diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..355cad8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +########################################################### +# The following permit to ignore files without extension. # +########################################################### +# Ignore all +* + +# Unignore all with extensions +!*.* + +# Unignore all dirs +!*/ + +# Unignore +!LICENSE + +######################################################### +# And now we indicate the files/dir we want to exclude. # +######################################################### +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Personal unwanted files and folders +gohBackup/* +package/* +assets/artWork/* +*.opt +*.log +*~ +*.debug +*.xz +*.7z +*.SUM +*.desktop +git-push.sh + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..be1626b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,25 @@ +# Search and Replace ©2018-21 H.F.M + +## Informations + +At the bottom you can find a compiled standalone ".deb" version with its checksum. The ".tar.gz" sources contain a "vendor" directory ensuring you can always compile it even if the official libraries have been changed. + +## Changelog + +All notable changes to this project will be documented in this file. + + + +#### [1.1] 2021-04-02 + +#### Added + +- + +#### Fixed + +- + +#### Changed + +- code refactoring diff --git a/LICENSE b/LICENSE index 9cbcf9b..5528cb9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 H.F.M +Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 52b21b7..a27b3c4 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,98 @@ # File Stamper + *This software allow you to clone timestamp between files.* +#### Last update 2021-04-02 + Take a look [here, H.F.M repositories](https://github.com/hfmrow/) for other useful linux softwares. -- If you just want to use it, simply download the compiled version under the "release" tab. You can see at [the Right way to install H.F.M's softwares](https://github.com/hfmrow/instHFMsofts) page to integrate this software in your debian environment. - +- If you just want to use it, simply download the compiled version '*.deb' under the "release" tab. + - If you want to play inside code, see below "How to compile" section. ## How it's made + - Programmed with go language: [golang](https://golang.org/doc/) - GUI provided by [Gotk3 (gtk3 v3.22)](https://github.com/gotk3/gotk3), GUI library for Go (minimum required v3.16). - I use home-made software: "Gotk3ObjHandler" to embed images/icons, UI-information and manage/generate gtk3 objects code from [glade ui designer](https://glade.gnome.org/). and "Gotk3ObjTranslate" to generate the language files and the assignment of a tooltip on the gtk3 objects (both are not published at the moment, in fact, they need documentations and, for the moment, I have not had the time to do them). ## Functionalities -- Copy timestamp from file(s) to other file(s). + +- Copy time-stamp from file(s) to other file(s). - Undo function - Copy "Access time" - Copy "Modification time" - Options to apply on directory -- Option to scan subdirectories +- Option to scan sub-directories - Drag and drop functionality - Each function have his tooltip for explanations. -## Some pictures and explanations +## Some pictures and explanations *This is the main screen.* -![Main](readME-Pic/mainScr.png "Main") +![Main](assets/readme/mainScr.png "Main") -*Files loaded. The selection order on multiple files is important to assign timestamp correctly (i.e: multi selection from bottom to top will apply timestamp to destination from bottom top top too).* -![files loaded](readME-Pic/fileLoaded.png "files loaded") +*Files loaded. The selection order on multiple files is important to assign time-stamp correctly (i.e: multi selection from bottom to top will apply time-stamp to destination from bottom top top too).* +![files loaded](assets/readme/fileLoaded.png "files loaded") *Undo command. Undo the last action only* -![Undo command](readME-Pic/undo.png "Undo command") +![Undo command](assets/readme/undo.png "Undo command") *Tooltip display* -![Tooltip display](readME-Pic/tooltipDisp.png "Tooltip display") +![Tooltip display](assets/readme/tooltipDisp.png "Tooltip display") ## How to compile + - Be sure you have golang installed in right way. [Go installation](https://golang.org/doc/install). -- Open terminal window and at command prompt, type: `go get github.com/hfmrow/fileStamper` -- See [Gotk3 Installation instructions](https://github.com/gotk3/gotk3/wiki#installation) for gui installation instruction. -- To change gtk3 interface you need to use a home made software, (not published actually). So don't change gtk3 interface (glade file) ... -- To change language file you need to use another home made software, (not published actually). So don't change language file ... -- To Produce a stand-alone executable, you must change inside "main.go" file: - func main() { - devMode = true - ... -into +- Open terminal window and at command prompt, type: `go get github.com/hfmrow/file-stamper` - func main() { - devMode = false - ... +- See [Gotk3 Installation instructions](https://github.com/gotk3/gotk3/wiki#installation) for gui installation instruction. -This operation indicate that externals datas (Image/Icons) must be embedded into the executable file. +- To change gtk3 interface you need to use a home made software, (not published actually). So don't change gtk3 interface (glade file) ... -## Misc/Os informations -- I'm working on: +- To change language file you need to use another home made software, (not published actually). So don't change language file ... -| DISTRIB | LinuxMint | -| -------- | --------- | -| VERSION | 19.1 | -| CODENAME | tessa | -| RELEASE | #21~18.04.1-Ubuntu SMP Thu Jun 27 04:04:37 UTC 2019 | -| UBUNTU_CODENAME | bionic | -| KERNEL | 5.0.0-20-generic | -| HDWPLATFORM | x86_64 | -| GTK | libgtk-3-0:amd64 3.22.30-1ubuntu3 | -| GLIB | Ubuntu GLIBC 2.27-3ubuntu1 | +- To Produce a stand-alone executable, you must change inside "main.go" file: + + func main() { + devMode = true + ... + + into + + func main() { + devMode = false + ... + +This operation indicate that externals data (Image/Icons) must be embedded into the executable file. + +### Os informations (build with) + +| Name | Version / Info / Name | +| ---------------------------------------------------------- | ---------------------------------------------- | +| GOLANG | V1.16.2 -> GO111MODULE="off", GOPROXY="direct" | +| DISTRIB | LinuxMint Xfce | +| VERSION | 20 | +| CODENAME | ulyana | +| RELEASE | #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 | +| UBUNTU_CODENAME | focal | +| KERNEL | 5.8.0-48-generic | +| HDWPLATFORM | x86_64 | +| GTK+ 3 | 3.24.20 | +| GLIB 2 | 2.64.3 | +| CAIRO | 1.16.0 | +| [GtkSourceView](https://github.com/hfmrow/gotk3_gtksource) | 4.6.0 | +| [LiteIDE](https://github.com/visualfc/liteide) | 37.4 qt5.x | +| Qt5 | 5.12.8 in /usr/lib/x86_64-linux-gnu | - The compilation have not been tested under Windows or Mac OS, but all file access functions, line-end manipulations or charset implementation are made with OS portability in mind. ## You got an issue ? -- Give informations (as above), about used platform and OS version. + +- Give information (as above), about used platform and OS version. - Provide a method to reproduce the problem. ## Website -- [H.F.M Linux softwares](https://hfmrow.yo.fr/) Free linux software on Github. Sharing knowledge. +- [H.F.M Linux softwares](https://hfmrow.go.yo.fr/) Free linux software on Github. Sharing knowledge. diff --git a/assets/images/Apply-32.png b/assets/images/Apply-32.png old mode 100644 new mode 100755 diff --git a/assets/images/FileStamper-300x29.png b/assets/images/FileStamper-300x29.png old mode 100644 new mode 100755 diff --git a/assets/images/FileStamper-500x48.png b/assets/images/FileStamper-500x48.png old mode 100644 new mode 100755 diff --git a/assets/images/Folder-time-48.png b/assets/images/Folder-time-48.png old mode 100644 new mode 100755 diff --git a/assets/images/Folder-time-cal-in-48.png b/assets/images/Folder-time-cal-in-48.png old mode 100644 new mode 100755 diff --git a/assets/images/Folder-time-cal-out-48.png b/assets/images/Folder-time-cal-out-48.png old mode 100644 new mode 100755 diff --git a/assets/images/Sign-Select-20.png b/assets/images/Sign-Select-20.png old mode 100644 new mode 100755 diff --git a/assets/images/Sign-cancel-20.png b/assets/images/Sign-cancel-20.png old mode 100644 new mode 100755 diff --git a/assets/lang/eng.lang b/assets/lang/eng.lang index 48ce23a..66535b6 100644 --- a/assets/lang/eng.lang +++ b/assets/lang/eng.lang @@ -1,18 +1,20 @@ { "ProgInfos": { - "Name": "fileStamper", - "Version": "v1.0", - "Creat": "H.F.M", + "Name": "file-stamper", + "Version": "v1.1", + "Creat": "hfmrow", "MainObjStructName": "mainObjects", - "GladeXmlFilename": "/media/syndicate/storage/Documents/dev/go/src/github.com/hfmrow/fileStamper/assets/glade/main.glade", - "GladeXmlFilenameRel": "../glade/main.glade" + "GladeXmlFilename": "assets/glade/main.glade", + "TranslateFilename": "translate.go", + "ProjectRootDir": "github.com/hfmrow/file-stamper", + "GohProjFile": "fileStamper.proj" }, "Language": { "LangNameLong": "English", "LangNameShrt": "eng", "Author": "H.F.M", "Date": "Sat, 09 Mar 2019 05:32:38", - "Updated": "Sun, 10 Mar 2019 03:35:39", + "Updated": "Fri, 02 Apr 2021 16:01:12", "Contributors": [ "" ] @@ -20,9 +22,10 @@ "Options": { "SkipLowerCase": true, "SkipEmptyLabel": false, + "SkipEmptyName": false, "DoBackup": true }, - "ObjectsCount": 11, + "ObjectsCount": 12, "Objects": [ { "Class": "GtkButton", @@ -31,8 +34,11 @@ "Tooltip": "Applying timestamp to destination files", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 0 }, { "Class": "GtkButton", @@ -41,8 +47,11 @@ "Tooltip": "Bye !", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 1 }, { "Class": "GtkButton", @@ -51,8 +60,11 @@ "Tooltip": "Getting timestamp from files that\ndropped in this control.\nClick on this control to reset entries", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 2 }, { "Class": "GtkButton", @@ -61,8 +73,11 @@ "Tooltip": "Drop Files here to apply timestamp\nof the previous dropping job.\nClick on this control to reset entries", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 3 }, { "Class": "GtkButton", @@ -71,8 +86,11 @@ "Tooltip": "Go back to previous timestamp state", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 4 }, { "Class": "GtkCheckButton", @@ -81,8 +99,11 @@ "Tooltip": "Change last access time.", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 5 }, { "Class": "GtkCheckButton", @@ -91,8 +112,11 @@ "Tooltip": "Change creation time.\nNot available at this time,\nHaven't find a way to write it.", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 6 }, { "Class": "GtkCheckButton", @@ -101,8 +125,11 @@ "Tooltip": "Apply modification to directory too.", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 7 }, { "Class": "GtkCheckButton", @@ -111,8 +138,11 @@ "Tooltip": "Change modification time.", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 8 }, { "Class": "GtkCheckButton", @@ -121,8 +151,11 @@ "Tooltip": "Scan files in subdirectories.", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 9 }, { "Class": "GtkImage", @@ -131,8 +164,24 @@ "Tooltip": "Click it to display Aboutbox.", "Text": "", "Uri": "", - "Markup": false, - "Comment": "" + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 10 + }, + { + "Class": "GtkStatusbar", + "Id": "Statusbar", + "Label": "", + "Tooltip": "", + "Text": "", + "Uri": "", + "Comment": "", + "LabelMarkup": false, + "LabelWrap": false, + "TooltipMarkup": false, + "Idx": 11 } ], "Sentences": { diff --git a/readME-Pic/fileLoaded.png b/assets/readme/fileLoaded.png similarity index 100% rename from readME-Pic/fileLoaded.png rename to assets/readme/fileLoaded.png diff --git a/readME-Pic/mainScr.png b/assets/readme/mainScr.png similarity index 100% rename from readME-Pic/mainScr.png rename to assets/readme/mainScr.png diff --git a/readME-Pic/tooltipDisp.png b/assets/readme/tooltipDisp.png similarity index 100% rename from readME-Pic/tooltipDisp.png rename to assets/readme/tooltipDisp.png diff --git a/readME-Pic/undo.png b/assets/readme/undo.png similarity index 100% rename from readME-Pic/undo.png rename to assets/readme/undo.png diff --git a/fileStamper.proj b/fileStamper.proj new file mode 100644 index 0000000..a4fbd66 --- /dev/null +++ b/fileStamper.proj @@ -0,0 +1,376 @@ +{ + "FileSign": [ + "Gotk3 Objects Handler", + "v1.7.5", + "©2018-21", + "hfmrow", + "github.com/hfmrow/gotk3-obj-handler", + "License (MIT Restricted)" + ], + "AppName": "file-stamper", + "AppCreator": "hfmrow", + "AppVers": "v1.1", + "AppDescr": "", + "License": "", + "LicenseShort": "", + "LicenseAbr": "MIT", + "YearCreate": "2019-21", + "Repository": "github.com/hfmrow/file-stamper", + "ManualAdd": "/*MANUAL*/", + "DefaultSignal": "notify", + "PackageName": "main", + "MainWindowName": "MainWindow", + "GtkApplicationName": "app", + "GtkApplicationId": "id.application.name", + "ObjStructName": "mainObjects", + "OptStructName": "mainOptions", + "Gotk3Path": "github.com/gotk3/gotk3", + "GtkSourcePath": "\"github.com/hfmrow/gotk3_gtksource/source\"", + "GladeXmlFile": "", + "GladeXmlFileRel": "assets/glade/main.glade", + "GladeXmlFileCheckSum": "987efa1a76b1f18054db01c8c1afedbd", + "DefaultProjExt": "*.proj", + "BackupExt": [ + "*.go", + "*.lang", + "*.glade", + "*.proj" + ], + "Assets": { + "Activated": true, + "FirstCharLower": true, + "ScanSubDir": true, + "BinData": true, + "Directory": "assets", + "ExtInName": [ + "*.lang" + ], + "ScanExt": [ + "*.png", + "*.lang" + ] + }, + "OutFiles": { + "Custom": "fileStamperHandler.go", + "License": "LICENSE", + "OutProjectFilename": "fileStamper.proj", + "OutProjectPath": "github.com/hfmrow/file-stamper", + "Main": "main.go", + "Signals": "gohSignals.go", + "StartGtk": "gohStartGtk.go", + "Options": "gohOptions.go", + "Objects": "gohObjects.go", + "MiscFunc": "gohFunc.go", + "Images": "gohImages.go", + "Assets": "gohAssets.go", + "BackupDir": "gohBackup" + }, + "MainGladeVarNameMinimal": "mainGlade", + "FlagsBuild": { + "SortObjNames": true, + "SkipEmptyName": true, + "SkipLowercaseNames": true, + "DoBackup": true, + "CleanCode": false, + "AutoSwitchToEmbedded": false, + "MinimalBuild": false, + "ApplicationBuild": false, + "CheckIsGotk3ObjAvailable": true, + "WarnMissingFuncDecl": true, + "WarnMissingObjDecl": true, + "AddLicToMainFile": true, + "NamingCSS": false, + "NamingCSSLowerCase": false, + "NamingCSSForce": false, + "NamingCSSClear": false, + "ChooseGotk3Dir": false, + "GtkSourceUsed": false, + "UseGolangEmbed": true, + "AssetsManualSelection": true, + "Main": false, + "Objects": false, + "Options": false, + "Signals": false, + "MiscFunc": false, + "StartGtk": false, + "Images": false, + "License": false + }, + "ObjectsCount": 14, + "ObjectsAdded": 0, + "ObjectsRemoved": 0, + "ActualObjects": [ + { + "ObjectType": "GtkButton", + "ObjectName": "ButtonApply", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkButton", + "ObjectName": "ButtonExit", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkButton", + "ObjectName": "ButtonInFiles", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkButton", + "ObjectName": "ButtonOutFiles", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkButton", + "ObjectName": "ButtonUndo", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkCheckButton", + "ObjectName": "CheckbuttonAtime", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkCheckButton", + "ObjectName": "CheckbuttonCtime", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkCheckButton", + "ObjectName": "CheckbuttonIncludeDir", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkCheckButton", + "ObjectName": "CheckbuttonMtime", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkCheckButton", + "ObjectName": "CheckbuttonSubdir", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkEventBox", + "ObjectName": "EvenboxTop", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkImage", + "ObjectName": "ImageMainTop", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkWindow", + "ObjectName": "MainWindow", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + }, + { + "ObjectType": "GtkStatusbar", + "ObjectName": "Statusbar", + "LibPrefix": "gtk", + "Suffix": "", + "Prefix": "", + "Value": "", + "Commented": "", + "ManualyAdded": false, + "Unkowen": false, + "NewObject": false + } + ], + "VarFilesCount": 11, + "VarFilesAdded": 0, + "VarFilesRemoved": 0, + "VarFilesList": [ + { + "RelRoot": "assets/glade", + "VarName": "mainGlade", + "FilenameRel": "assets/glade/main.glade", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "apply32", + "FilenameRel": "assets/images/Apply-32.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "counterclockwiseArrow20", + "FilenameRel": "assets/images/Counterclockwise-arrow-20.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "filestamper300x29", + "FilenameRel": "assets/images/FileStamper-300x29.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "filestamper500x48", + "FilenameRel": "assets/images/FileStamper-500x48.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "folderTime48", + "FilenameRel": "assets/images/Folder-time-48.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "folderTimeCalIn48", + "FilenameRel": "assets/images/Folder-time-cal-in-48.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "folderTimeCalOut48", + "FilenameRel": "assets/images/Folder-time-cal-out-48.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "logOut20", + "FilenameRel": "assets/images/Log-Out-20.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "signCancel20", + "FilenameRel": "assets/images/Sign-cancel-20.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + }, + { + "RelRoot": "assets/images", + "VarName": "signSelect20", + "FilenameRel": "assets/images/Sign-Select-20.png", + "Suffix": "", + "Prefix": "", + "MainGladeVarNameMinimal": "", + "LineNb": -1 + } + ] +} \ No newline at end of file diff --git a/fileStamperHandler.go b/fileStamperHandler.go index 9040690..57bb030 100644 --- a/fileStamperHandler.go +++ b/fileStamperHandler.go @@ -19,7 +19,7 @@ import ( "github.com/gotk3/gotk3/gdk" "github.com/gotk3/gotk3/gtk" - gi "github.com/hfmrow/fileStamper/gtk3Import" + gidg "github.com/hfmrow/gtk3Import/dialog" ) // ButtonExitClicked: @@ -31,7 +31,7 @@ func ButtonExitClicked() { func ButtonApplyClicked() { if len(mainOptions.PrevOutFilesTs) != 0 { if err := chgTimestamp(); err != nil { - gi.DlgMessage(mainObjects.MainWindow, "error", sts["errChgTimestamp"], err.Error(), "", sts["ok"]) + gidg.DialogMessage(mainObjects.MainWindow, "error", sts["errChgTimestamp"], err.Error(), "", sts["ok"]) } } else { updateSb(fmt.Sprintf("%s", sts["noToDo"])) @@ -60,7 +60,7 @@ func ButtonUndoClicked() { } } if err != nil { - gi.DlgMessage(mainObjects.MainWindow, "error", sts["errUndo"], err.Error(), "", sts["ok"]) + gidg.DialogMessage(mainObjects.MainWindow, "error", sts["errUndo"], err.Error(), "", sts["ok"]) } updateSb(fmt.Sprintf("%d "+sts["fileRestored"], chgCount)) } else { @@ -83,10 +83,10 @@ func ButtonInFilesClicked() { } // ButtonInFilesReceived: Store in files list -func ButtonInFilesReceived(bti *gtk.Button, context *gdk.DragContext, x, y int, data_ptr uintptr, info, time uint) { +func ButtonInFilesReceived(bti *gtk.Button, context *gdk.DragContext, x, y int, selData *gtk.SelectionData, info, time uint) { currentInFilesList = []string{} // Convert pointer to datas - data := gtk.GetData(data_ptr) + data := selData.GetData() list := strings.Split(string(data), GetTextEOL(data)) for _, file := range list { if len(file) != 0 { @@ -100,10 +100,10 @@ func ButtonInFilesReceived(bti *gtk.Button, context *gdk.DragContext, x, y int, } // ButtonOutFilesReceived: Store out files list -func ButtonOutFilesReceived(bto *gtk.Button, context *gdk.DragContext, x, y int, data_ptr uintptr, info, time uint) { +func ButtonOutFilesReceived(bto *gtk.Button, context *gdk.DragContext, x, y int, selData *gtk.SelectionData, info, time uint) { currentOutFilesList = []string{} // Convert pointer to datas - data := gtk.GetData(data_ptr) + data := selData.GetData() list := strings.Split(string(data), GetTextEOL(data)) for _, file := range list { if len(file) != 0 { diff --git a/gohAssets.go b/gohAssets.go index f90acb2..7a9a035 100644 --- a/gohAssets.go +++ b/gohAssets.go @@ -1,50 +1,48 @@ // gohAssets.go -// Source file auto-generated on Sun, 10 Mar 2019 02:46:35 using Gotk3ObjHandler v1.0 ©2019 H.F.M - /* - fileStamper v1.0 ©2019 H.F.M - - This program comes with absolutely no warranty. See the The MIT License (MIT) for details: - https://opensource.org/licenses/mit-license.php - - Embedded part of the source-code below is derived from the work of: - [github.com/jteeuwen/go-bindata], his work is subject to the CC0 1.0 Universal - (CC0 1.0) Public Domain Dedication. http://creativecommons.org/publicdomain/zero/1.0/ - which I thank the author (jteeuwen) for his great work. + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE */ package main -/********************************************/ -/* ASSETS declarations */ -/* - Not Embedded datas are local filenames */ -/* - Embedded datas are available as []byte */ -/********************************************/ -func assetsDeclarationsUseEmbedded(embedded bool) { - if !embedded { - apply32 = absoluteRealPath + "assets/images/Apply-32.png" - counterclockwiseArrow20 = absoluteRealPath + "assets/images/Counterclockwise-arrow-20.png" - filestamper300x29 = absoluteRealPath + "assets/images/FileStamper-300x29.png" - filestamper500x48 = absoluteRealPath + "assets/images/FileStamper-500x48.png" - folderTime48 = absoluteRealPath + "assets/images/Folder-time-48.png" - folderTimeCalIn48 = absoluteRealPath + "assets/images/Folder-time-cal-in-48.png" - folderTimeCalOut48 = absoluteRealPath + "assets/images/Folder-time-cal-out-48.png" - logOut20 = absoluteRealPath + "assets/images/Log-Out-20.png" - mainGlade = absoluteRealPath + "assets/glade/main.glade" - signCancel20 = absoluteRealPath + "assets/images/Sign-cancel-20.png" - signSelect20 = absoluteRealPath + "assets/images/Sign-Select-20.png" - } else { - apply32 = HexToBytes("apply32", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\xe0\x0b\x1f\xf4\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x20\x00\x00\x00\x20\x08\x06\x00\x00\x00\x73\x7a\x7a\xf4\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x0b\x82\x49\x44\x41\x54\x78\xda\xac\x57\x69\x8c\x5d\x65\x19\x7e\xcf\x76\xcf\xdd\xd7\xd9\x57\x3a\x33\x9d\x99\x32\x74\x1b\x28\x84\x92\x0a\x84\xb2\xa7\x16\xd4\x26\x18\x11\x34\xa2\x44\x09\x46\x49\x5c\xd0\xf0\x43\x12\x51\x7f\x20\x46\x81\x8a\x46\xd0\xa0\x10\x76\x68\x4b\x91\x42\x4b\xe9\xce\x32\x50\x5b\x66\xa0\x33\x4c\x3b\xfb\xdc\xb9\xcb\xb9\xf7\xec\xfb\xf9\x7c\xbf\xc3\x22\x81\xc2\x2f\xcf\xe4\xcb\x99\x7b\xcf\x3d\xdf\xbb\x3c\xcf\xfb\xbc\xef\xc7\x10\x42\xe0\x93\x17\xfd\xf8\xd5\x7b\x8e\xc3\x44\xd1\x00\x51\x60\x81\x61\x00\x7c\x1f\xc0\xb6\x7c\x31\x1a\xe1\xae\x48\xa7\x22\xe7\x66\x52\x42\x1b\xfd\x9d\xa2\x3a\xb3\x35\xc5\xde\xad\x68\xee\xfe\x64\x9c\x0d\x7c\xcf\x03\xdb\x76\xc0\x0d\x00\x2e\x8a\x1f\x06\x6b\x6a\x04\x9e\xda\xb1\x03\xdf\xf7\x3f\xde\x7f\x70\x70\x10\x46\x47\x47\x81\x65\xd9\xf0\x33\x0f\xa7\xb9\x2c\xcb\x07\x43\xf7\x81\x88\xe8\x10\xfe\x89\x11\x6e\xe3\xba\x95\x85\xdb\xfb\xbb\x93\xeb\x63\x51\x12\x15\x59\x02\x5e\x40\x20\x60\x58\x90\x75\xf8\xd1\xfb\x53\xda\xfe\xd1\x09\xe9\x1e\xcb\xf4\x5f\xa6\xef\xb3\x10\x80\xc0\x78\xa0\xa2\x43\x01\x09\xe0\x8b\xae\xcf\x38\x40\x23\x46\x9b\xe8\x35\x01\xcb\xf6\xa1\xa5\x31\xf6\x8b\xeb\x36\xb6\xff\xaa\x90\x74\x79\x62\xea\x70\x46\x36\x06\x4d\xa9\x28\x46\x6a\x83\x66\x7b\x30\xc7\xbb\xa9\xf6\xe1\xc4\x55\x67\xf6\xa5\x37\x3e\xf5\xc2\xe4\x6d\x65\x49\xbf\x4f\xe0\x7c\x88\x80\x03\xaa\x66\x00\x09\xc8\x67\x8c\x7e\x14\x7d\xe8\xc0\xc7\x10\xa0\x65\x6a\x3b\xc0\x17\x58\x96\x01\x81\x67\x20\x9b\x8e\xdc\x7a\xd3\xa6\xae\x5f\x27\x89\x0a\x2b\xf2\x29\x18\x6c\x6e\x00\xcf\x73\x40\x4c\x24\xc1\xd4\x34\x60\xf0\xdd\x61\x8e\x87\x77\x4e\x95\xe0\x98\x6b\x47\xb6\x5c\xb5\xec\xde\x87\x9f\x1d\x77\x3c\x43\xf9\x6b\x54\xc0\x0c\xe1\xd6\xb1\x68\x0c\x03\xb1\xe0\x23\x3b\x0c\xda\xa1\x90\x7c\xe4\x04\xf3\x87\xfb\x1f\x04\x45\x91\x60\xdd\xb9\xeb\x81\xe3\x00\x0e\xec\xdf\x0f\x87\xf4\x61\x48\xe4\x5a\x56\xaf\x5b\x55\x38\xb0\xb2\xd5\x4f\x0e\xe5\x45\xe8\xed\x68\x04\xdf\xf3\xc1\x73\xbd\x10\x96\xc0\x0f\xd0\xd9\x20\xbc\xdb\x86\x0a\xba\x03\x70\xb0\x46\xe0\xf0\x84\xa3\xcc\xfd\xe7\xd8\xfa\xb3\x13\xef\xce\xc8\x95\x4a\xba\x24\x97\xe3\x57\x5f\x7e\xf5\x50\x47\x47\xc7\xca\x5d\xbb\x76\xbd\x39\x32\x32\xf2\x02\xe5\xc1\xc7\x19\x58\x5c\x2a\x41\xad\x56\x86\xe5\x8a\x1a\x3a\xb0\xb8\x58\x84\x53\xa6\x0a\x67\x36\x77\xfd\x78\xa8\x83\x4b\x76\x44\x79\xe8\x6c\x88\x83\x69\x9a\x98\x15\x01\x0c\xc3\xf8\x90\x17\x62\xe8\x10\x8d\x2c\x12\x4f\x41\x21\x8f\x49\x67\x74\x28\xb7\x32\x69\xfb\xa4\xbb\x73\xfd\xea\x61\xb5\xc4\x4a\xf9\x07\xdf\x7f\x28\xb2\xe6\x82\x35\x13\x03\x1d\x03\x52\x5b\x5b\x5b\x66\x7c\x7c\x7c\xff\xd4\xd4\x94\xc6\x84\x58\x23\x1c\x3c\xcf\xe3\xc6\x3c\x70\x98\x12\xba\x04\x9e\x43\x28\x98\x65\xe7\x0c\x64\x36\x09\x81\x0b\x43\x9d\x39\x10\x22\x31\xe0\x18\x0e\xd3\xef\x85\x2f\x95\x8a\xa5\xf0\xb7\xf4\x72\x90\xf5\xa6\xa6\xc3\xdc\x62\x09\xea\xf5\x71\x48\x90\xd7\x60\xed\x85\x66\x57\xdb\xf2\xfe\xa1\x42\x3e\xdf\x9a\xed\xc8\x14\x0e\xce\x1c\x6c\xa2\xdc\x6e\x6d\x69\x2d\x34\x36\x36\x76\x86\x91\xa3\xcd\x70\x7d\x9a\x20\x14\xb7\x78\x8c\x1b\x6e\xce\x09\xf9\x24\xef\x81\xa3\x2b\xc0\x20\xe6\x0c\xf2\x82\xf1\x18\x48\x26\x93\x30\xb2\xf0\x26\xc4\xa3\x71\x70\x6d\x17\x2a\xb5\x0a\xd8\x09\x13\x8e\x5a\x6f\x40\x2e\x93\x86\x4c\x17\x40\x4d\x55\xe1\xd9\xa9\x47\x60\xd2\x3c\x09\x16\x31\x60\xb4\x38\xda\xa8\x2b\x3a\x97\x48\x27\xc4\x01\xbc\xa6\xa7\xa7\xdf\xa5\xc6\x3f\xb7\x0c\x45\x9e\x49\x09\x3c\x81\x84\x28\x00\x8f\x24\x2b\x21\x4c\x96\x65\x81\x8a\x30\x39\xae\x0d\x4f\x3d\xfe\x24\xbc\x5d\x3e\x0a\xd9\xcd\x79\xf8\xe3\x85\x7f\x86\xe9\xca\x34\x78\x9c\x03\x1e\x6f\x80\x6e\xb8\x50\xb3\x4d\x30\x12\x01\xf4\xc6\xce\x82\xab\x1b\x36\xc1\x99\xe9\xc1\x14\x3a\x9a\x45\x07\x94\x55\xab\x56\x2d\xdf\xb3\x67\x8f\x80\x24\x74\x29\x0c\xa7\x75\xc0\x75\xbd\x9a\xeb\x53\x16\x13\x88\x8a\x22\x24\x31\x03\x22\xbd\xc7\x13\x61\x89\x6e\xd8\x70\x11\xf0\x13\x49\x50\x0b\x06\x3c\x36\xfe\x08\x66\xc8\x46\x1e\x30\x50\x51\x0d\x48\xf3\x79\x58\x9d\x5f\x03\xdd\x89\x5e\xc8\xf1\x4d\x90\xe2\xe3\x90\xca\x72\x30\x3e\x3e\xd1\x82\x10\x4e\xf6\xf7\xf7\xb7\x24\x12\x89\x66\x4d\xd3\xe6\x38\x24\xdd\x69\x75\xc0\xb4\xbc\xd9\x8a\xea\xd9\xf5\x34\x11\x25\xa9\x86\x79\x12\x20\x2a\x88\x98\x4e\x36\x54\xb9\x2b\xaf\xb9\x06\x2e\xd3\xaf\x84\xed\x33\xcf\xc2\x09\xe7\x3d\xe8\x4c\x76\x42\x6f\x76\x39\xf4\x64\xfa\xa0\x49\x6c\xc1\x4d\xf1\xb7\x8e\x8d\xfb\xb8\xb0\x58\x57\x80\x15\x63\x58\x8e\x62\x4b\xa5\x52\xe1\x9b\x9a\x9a\x44\xac\x88\xde\x23\x47\x8e\xcc\x45\xa3\xd1\xd3\x70\x80\xca\xa6\x6f\xbd\x75\x72\x46\x1e\x3d\xa3\x31\x33\x6c\x11\x1e\xa3\xe0\xc1\x70\xfd\x50\xf9\xa2\x31\x1e\x22\xc8\x3f\x11\x75\x61\x2d\x96\xeb\x39\xa9\x73\xa1\x27\xd7\x03\x22\x4b\xc5\xc9\x05\xcb\xc5\xe5\xeb\x48\xd8\x00\x5c\xe2\x81\xe7\xb3\xb0\x50\xd2\xa0\x90\x4a\x64\x4a\xa5\x52\x43\x4b\x4b\x8b\x34\x34\x34\xd4\x77\xe8\xd0\xa1\x7d\x54\xf2\xf8\xff\xf5\x80\x20\x7c\xa9\x50\x28\x74\xdd\xbe\xb1\xf3\xeb\xb3\x3e\x34\x96\x55\x02\xa7\x62\x3e\xac\x88\x0a\xe0\xe3\xf3\x18\xc2\x40\x45\x2a\x40\x1c\x1c\xdf\x83\xae\x6c\x37\x24\x90\x94\x98\x37\x30\x50\x19\x1d\x34\xee\xfb\x1f\xec\xe3\x62\x20\x6e\xe8\xb4\x0f\x92\xe4\x23\x69\x45\x2a\x40\xcb\xd0\x89\x37\x7b\x7b\x7b\x93\xa9\x54\x2a\x87\x3a\x22\xf1\xb4\xb4\x5c\x7c\x59\x88\x08\x67\x35\x34\x77\x7c\xab\x6b\xc5\x39\x9b\x23\xb1\x78\xdb\x2a\xdf\xf1\xde\x5f\x32\x03\x3f\x12\x63\x17\x91\x58\x8d\x02\xd6\x2c\x55\x31\x2a\x3e\x08\x03\x2b\xf2\xe0\x04\x1e\x58\xb2\x04\x99\x6c\x1e\x53\xee\x84\x2a\xfa\x81\xf1\x0f\x96\xed\xf8\xf8\xbd\x0b\xa6\x11\xc0\xd8\x44\x15\x94\xa5\xf1\x7c\xa5\x52\x55\x7a\x7a\x7a\xa0\xb5\xb5\xb5\x7b\x66\x66\x46\x62\xdb\x3b\x3a\x56\x5c\xba\x69\xcb\xd6\xae\x15\xeb\xfe\x2d\x16\x3a\xbe\xef\x31\x42\x7e\x7e\x6e\x4e\x6b\x48\x70\xec\xca\xce\xb4\x5d\x29\xeb\x41\xd1\xe1\xa1\xe8\xf3\x20\xe3\x86\x0e\x2e\x5a\xaa\xa1\x64\xf3\x11\x6c\x46\x36\xd8\x18\x39\xfd\xce\x45\xe3\x0e\x2e\x1b\xd5\xd2\x34\x11\x0a\xfb\x83\xef\x2b\xaa\x04\x65\xcd\x81\xb7\x4f\xcc\xa9\x95\xd2\x52\x0c\x4b\x90\x41\x35\xec\xa4\x92\xcc\xfd\xf4\x8e\x3b\xff\xd9\xbd\xe2\xec\x6b\x6d\xc7\xf3\x75\x4d\xb3\x4e\x9e\x9a\x0c\xde\x39\xf6\x36\x34\x35\x64\xf8\xe6\x96\x16\x26\xce\x83\x5f\x2c\x6b\x4c\x0d\x19\xa8\x07\x0c\x58\x28\x48\xf4\x5e\x77\x02\xa8\x79\x1c\xcc\xd7\x6d\x88\x63\x77\xa4\x75\x6d\x21\xe9\x4c\x8c\x98\x3a\x49\x33\x65\x22\x04\x1a\xfe\x8e\x70\x0c\x48\x35\x99\x54\x83\x04\x4f\xd4\xa5\x52\x21\x97\x96\x12\xf1\x04\x7f\xe8\xf0\xe1\x31\x6e\xa0\x77\x59\x43\xf7\xe0\xea\xf3\x4c\x3b\x08\x96\x4a\x25\x98\x9c\x38\x01\xb3\x73\xf3\x90\x8c\x45\xa1\xbd\xbb\x47\x40\xc8\x49\x21\x15\xf1\x03\x0c\xad\x26\xdb\xa4\x8e\xa2\x5f\x94\x74\x66\xb6\x28\x33\xb3\xf3\x15\x52\x9c\x5b\x20\x51\xc6\x23\x99\x74\x8a\xd1\x4c\x0b\x0d\xe3\xec\x80\x59\x90\xb1\x53\xda\x3e\x43\xbb\x06\x18\x96\x45\x66\x2b\x8a\x9b\x6d\x6e\x17\x5c\xcf\x49\xda\xb5\x85\x85\xce\xee\x6e\xf2\xc6\xeb\xaf\xcd\x70\x4d\xf9\xcc\x48\x73\x5b\xfb\xf9\xf1\xa6\xde\xfe\x4a\x55\x72\xb1\x54\xa0\x26\x2b\x48\x28\x87\x60\x9a\x78\xcb\x25\x0c\x25\x56\x1c\xdb\x5b\x2a\xc6\xfa\x8c\xa5\xf9\x56\xad\x1c\x10\x43\xf1\xe3\xac\xef\x15\xb2\x69\x17\xc9\x46\xd2\xa9\x38\xea\x26\x03\x2a\x46\x2c\x21\x2c\x35\x4d\x27\x4b\x52\x2d\x98\x97\x14\x4f\xb2\x02\x27\x9d\xcb\xfb\xa9\xb8\x40\xe2\x99\x42\xb6\x3a\x3f\x69\xe6\x33\x49\xf5\xd4\xd4\x74\x8d\xc3\x09\x26\xa8\x62\x18\xab\x37\x5c\xb1\x45\xb6\x08\xc8\xb2\x42\x54\x55\x83\x2a\xd6\xff\x40\x5f\x0f\x4f\xf8\x28\xe7\x20\xa6\x16\x46\xa4\x69\x06\xe3\x61\x03\x12\x63\x09\x22\xc6\xd2\x01\x1f\x4d\x12\x1e\x6b\xbc\x6a\xba\x44\x33\x4d\xa1\xa2\xbb\x30\xb9\x58\xf1\x67\xab\x8a\x57\xb3\x89\x0b\x62\xd2\x4d\x66\xb3\x41\x26\x93\x42\x79\x17\x20\xc2\xb3\x14\x2a\xce\xf1\x49\xca\xa8\xcc\x97\xc5\x48\x24\xe0\x24\x49\x62\xc6\xc6\xc6\xa6\x97\xf7\xf5\x0c\xe6\x7b\xcf\x5b\x5b\x91\xaa\x8e\x8a\xbd\xbe\x54\xae\x92\xb6\xc6\x1c\x93\xcc\x36\xf3\x96\xe5\x84\xe4\x72\x5c\x02\x9a\x19\x50\xa1\x02\x07\xc9\x25\xdb\x01\x4c\xd6\x4c\x98\x56\x3d\x14\x1c\x99\xc8\x4e\xe0\x92\x68\xd2\x4d\xe7\x73\x41\x2e\x97\x21\xa9\xa4\x48\x33\x17\x8e\x76\x48\x03\xaa\xb0\x60\xea\x3a\x41\x7e\x26\x64\xa9\x12\x88\x1c\xd4\xb1\x01\x03\x16\x18\x44\xe7\xdf\x1f\xad\x9e\x7b\xe9\xb5\x57\x55\x4d\x5e\x50\x15\x85\x20\x69\x98\x08\xe3\x40\x57\x77\xaf\x20\x29\x06\x66\x44\x83\xba\x6c\x84\xc4\xaa\xa3\xe1\x29\xd9\x86\x79\xcd\x03\x1f\xc9\x97\xcf\xc6\x21\x5f\xc8\x07\x59\x34\x9a\x4b\xc7\x20\x81\xcc\x8d\xe1\xee\xa2\x80\x52\x8b\x24\xf2\x50\x33\x6c\xd3\x06\x5d\xd5\x19\x59\x96\xb1\x7b\xaa\x7c\x4d\xaa\xfb\xaf\x1d\x78\xe5\x45\xea\x00\x5d\x59\xa9\x56\xb3\x1a\xd2\x62\x73\x6e\xf0\xa2\x35\x95\x6a\xd5\x35\x0d\x13\x6a\xe5\x12\xe9\x6c\x6d\xe7\xa7\x17\x64\x46\x35\x1c\x4c\xb5\x0f\xf3\x2a\x76\x40\x0c\x9f\x8f\x46\x20\x47\x0d\x67\x62\x90\x49\x46\x20\x15\x8f\x40\x02\x55\x32\x16\xe5\x20\x16\xc1\x36\xcb\xb1\xe1\xc0\x42\xd5\xd1\xd0\x0d\xa6\xae\x68\xac\xae\x29\x42\xad\x38\x5b\x7d\x6b\xf7\xb6\x87\x5f\x7c\xec\x6f\xb7\x9d\x1c\x1f\xdb\x41\x95\x90\x36\x79\x13\x57\xe1\xf9\x47\xff\xf2\xd2\xf7\xd6\x5e\x75\xb1\xee\x27\xb2\xc5\xb2\xe5\x95\x4f\xcd\xc0\xf9\xc3\xb3\xfe\x8c\x95\xe5\x7c\x96\x21\x02\x1a\x49\x63\x84\x29\x9c\x09\x93\x89\x48\x88\x6b\x1c\x07\x96\x68\x18\x2d\x0b\x11\xee\xc3\xb1\x0e\xeb\xdb\xc1\x4c\x19\xa6\xcd\x20\x9f\x18\xc3\xd0\x85\xfa\xe2\x4c\xf5\xf8\xbe\x17\x9f\x39\xb8\xf3\xe9\x07\x90\xe8\x47\x57\x0d\xaf\x83\x6b\x37\x6f\x0a\x7b\x01\x1d\xd6\x74\x5c\xf5\xb2\x24\x2f\x8c\x3c\x77\xdf\xde\x7a\xe7\x0d\x5b\x4a\xf5\xc0\xf3\xc5\x0c\x2c\x55\x2a\x7e\xa6\xb3\x03\x19\x05\x90\xce\x44\x51\x7a\x69\x57\x14\x42\xe3\x31\xc4\x17\x47\x75\x5c\x4c\x38\xa0\x50\x39\xa7\xf2\x6b\xe2\x90\xa2\x69\x26\xab\x9b\x46\xa4\x5e\x9c\xad\x1d\xdf\xfd\xfc\x73\x07\xb6\x3f\xf9\x40\xb1\xb8\xf8\x46\x57\xff\x59\x70\xe3\xb7\x7f\x02\xfd\x3d\xdd\x90\x74\x4b\x1f\x37\x23\x3a\xb8\x57\x71\x25\x0f\xee\xde\xf6\xca\xa6\x5b\x2e\x3f\x5f\xe9\xea\x6b\xf1\x14\xc1\x2d\x4a\x8a\xff\xa5\x75\x71\xb2\x64\x11\x26\x9b\xa6\xad\x99\x1a\x8f\xa0\x71\x8c\x1c\x31\xa6\xc3\x2b\xbd\x3c\x4c\xb7\x45\x0d\x9b\x16\x8b\x7d\x21\x22\x17\x17\x94\xd1\x3d\x3b\x9f\x7e\xf5\xe9\x7f\x6d\x5d\x5a\x5c\x3c\xb8\xec\xac\x61\xb8\xec\xc6\x1f\x42\xdf\xd0\x5a\x1c\x66\x39\xf0\x95\xa5\x70\xc2\xfa\x64\x37\xb4\x71\x2d\x20\xd6\xc7\xa6\x8f\x3c\xbc\xe3\xec\xaf\xdc\x7d\xf3\xe4\xb4\xef\xca\xce\x02\x49\x0b\x48\xef\x58\x86\x4f\xc7\x39\xf2\x91\x71\x41\xa0\xe9\xa6\xda\x8f\xe3\x3b\x6e\x64\xda\x36\x6b\x38\xae\x28\x97\x17\xb5\x77\x5f\xdd\xb5\x7d\xcf\x23\x0f\x6d\x9d\x9d\x3e\xb5\xb7\xa3\x7f\x08\x6e\xb9\xfb\x2e\x68\x6e\xef\x06\x42\x65\x5a\x57\x21\xf0\x5c\x3a\x8e\x9f\x76\x22\xa2\x50\xcc\xbe\x7e\x68\xdf\xb6\xb5\x97\xbc\x71\x41\xef\xc0\x86\xa1\xca\xb4\x69\x5b\x5a\xcd\x6b\xe9\x69\x45\x42\xd3\x61\x94\x0d\x0f\x1e\xa8\x53\x58\x9a\x7e\x68\xd8\x74\x1d\x51\xab\x4b\xe6\x89\x03\xbb\xb7\x1f\xd9\xfe\xc4\xd6\xb1\xb7\x47\x5e\x1a\xba\xe0\xe2\xe0\xe6\x5b\x7e\x0e\x9d\x7d\x83\x08\x0f\xce\x93\x96\x0d\x3e\xca\xf4\xa7\x4f\x62\x9f\x76\x80\x3e\x55\x10\xc6\xb1\xbd\x4f\xfc\xe9\xef\xd7\xff\x6e\xe3\x6f\xc6\x82\x6e\xb6\xa6\x68\xc1\x19\x31\x86\xd4\xf1\xc4\xe4\x3a\x5e\xd8\x76\x0d\xcb\x66\xd0\x70\xd4\x50\x6b\xf6\xf4\xd1\xd7\x77\xed\x7d\xe4\xc1\xfb\x27\xc6\x8e\xef\x6c\x1f\x18\xf2\xbf\x71\xc7\x6f\x61\xd5\x86\x4b\xb1\x04\x39\x1c\xd9\xf5\xd0\xf8\xa7\x0d\x7f\xee\xc9\x88\x92\x98\x3a\xf1\xce\xe8\xbb\x3b\x16\x0f\x3f\x7e\xe9\xd0\xc6\xef\x5c\x59\x9d\x18\x31\x5c\x55\x0e\x14\x93\xb0\x96\x65\x30\x88\xb1\x68\x69\x75\x7f\xf1\xc4\xb1\x57\xf7\x3d\xfe\x8f\x7b\x27\x8e\x1f\xdd\xd6\xbd\x66\x9d\xf7\xcd\x3b\x7f\x0f\x83\xe7\x6d\x80\x78\x32\x05\xa6\x22\x87\xa7\x27\x12\x7c\xf1\xd1\x8c\x39\xdd\x97\x91\x48\x24\x7c\xd6\x54\xc8\xad\xbf\xeb\xf1\xbd\x8f\xbe\x33\x55\x89\x0d\x64\x41\x58\x70\xd8\x94\xa1\xd6\x83\xa5\xc9\xd1\xd7\x46\x76\x3d\x7b\xef\xd4\xf8\x7b\xcf\x64\xdb\xba\xec\x4b\xae\xbf\x09\x56\x5e\x7c\x59\x38\x37\xda\x38\xbc\xd2\x8e\x44\xc2\xc9\x0a\xef\xf4\x7c\x48\x53\x4f\x0f\x32\xa8\x84\x21\x0c\xf8\x48\xb0\x6a\x58\x05\x4b\xa7\x77\x00\x87\x05\x88\xc5\x62\x70\xf2\xe4\x49\xe6\xa6\x1f\xdc\x7a\xe7\x85\xdf\xfd\xe5\xcf\xac\xb9\x09\xf7\xd0\x81\x7d\xc7\xdf\x7a\xe5\xf9\xad\xa7\x4e\x8c\x3e\xa9\xc8\xb2\xde\x7c\x46\x1f\xac\xbb\x72\x33\x24\x73\x79\x70\xd0\x30\x9d\x96\x68\xa6\xc3\xe3\x25\x8d\x1c\x87\x01\x7a\x27\xc8\x15\xfa\x3f\xd5\x07\xea\x18\x3d\xaf\x72\x2e\x9e\xbe\x03\xf5\xf4\x0e\x7c\xf2\xc2\x61\x32\xff\xe5\xaf\x5d\x77\x43\xb9\x52\x91\x0f\xbd\xf2\xf2\xd3\x96\x6d\xcb\xf0\x7f\xbc\xfe\x2b\xc0\x00\x10\x22\x8d\x3f\x5f\x72\x62\x82\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\xae\xd3\xbe\xcb\xe0\x0b\x00\x00")) - counterclockwiseArrow20 = HexToBytes("counterclockwiseArrow20", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\xcd\x04\x32\xfb\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8d\x89\x1d\x0d\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x12\x00\x00\x0b\x12\x01\xd2\xdd\x7e\xfc\x00\x00\x04\x7f\x49\x44\x41\x54\x38\x8d\x85\xd4\x4b\x6c\x94\x55\x14\x07\xf0\xff\xb9\xf7\xfb\x66\xa6\xd3\x99\xe9\x33\xa5\xc5\x02\xe5\x61\xe4\x69\x84\x52\x48\x88\x28\xe5\xb1\x50\x21\x71\x01\x09\x06\x15\x71\xa3\x41\xc5\x10\x23\x1b\x37\xb2\x11\x12\x20\xba\xd0\x44\xe5\xb5\x30\xc6\x27\x46\xa3\x31\x60\x04\xaa\xa0\x15\x82\x94\x48\xa1\xa6\x09\xb4\x29\xd0\x0e\xa4\x9d\xce\x7b\xbe\xef\xbb\x8f\xe3\x62\xda\x09\x8f\x85\x67\x73\x17\x37\xf7\x97\x93\xf3\xb8\x84\xff\x0b\x22\x02\x33\xcb\x50\x24\xb2\x71\xdf\xd7\xa7\x6a\x9a\x5a\x66\x6a\x15\xf8\x44\x44\x00\x60\xb5\x0a\xa2\xf5\x4d\xad\xff\x9e\x39\x7e\xf4\xe4\xfe\x9d\xdb\x9d\xbb\xdf\x0a\x29\x25\x33\x33\x5b\x6b\xef\x77\xa5\x1b\x0a\xcb\xc6\x69\x0f\x9b\x44\x63\xa3\x55\x8a\x41\x44\x6c\xb5\x0d\xc7\xeb\xc5\x70\x7f\xcf\xb9\xee\x23\x7b\xdf\x01\x80\x0a\x48\x44\x64\x8d\x31\x20\x22\x22\x21\x98\xef\x45\x99\x2d\xfc\x52\x81\x45\x38\x0a\xab\x15\x33\xd8\x4a\x37\x2c\x07\xba\x8f\x1f\x3f\xb3\xff\x8d\x4d\x5e\x26\x95\x27\x22\x12\x13\x98\x60\x66\x7e\x74\xfd\x96\x97\x5a\x17\x2d\x5f\xc1\x6c\x2d\x91\x10\xf7\x67\x69\xac\x25\x63\x0d\xb4\x56\x56\x05\xbe\x81\xe3\x20\xd5\x77\xfe\xa4\x97\x49\xe5\x85\xe3\xb8\xcc\xcc\x82\x84\x94\xcc\x6c\x67\x2c\x5b\xbd\x6e\xed\xdb\x1f\x1c\xdd\xb0\xfb\xe0\x0f\xcd\xf3\xda\x97\x31\x5b\x4b\xe2\x5e\xd4\x1a\x03\x15\xf8\x60\xe9\x08\x19\xa9\x76\xf3\xa9\x51\xee\xd8\xb2\x63\x5f\x5b\xc7\xaa\xd5\x56\x6b\x45\x42\x4a\xc1\xd6\x18\x08\x49\xcb\xb7\xbe\xb5\x77\x70\xe8\x26\xb2\x22\xd6\xf0\xd0\xd2\x27\xd7\x4c\x66\x7e\x37\x18\xf8\x9e\x96\xd5\x09\x24\x7b\xcf\xfd\x7c\xed\xd4\xb1\x4f\x45\x38\x42\x77\xc6\x73\x68\x7f\x61\xe7\x7b\x20\x01\xb6\xc6\x38\x00\x30\xad\x7d\xe5\x5a\xb7\x79\xd6\x12\x2f\x57\xc0\xc8\x95\x0b\x3d\x3d\x5f\x7e\xb4\x0f\x00\xac\xb5\xa6\x52\x43\x63\xac\x53\x1d\x8f\x0f\xf7\xfc\xfe\x47\xf7\x81\x1d\x9b\x98\xad\xad\x99\x35\x7f\x65\xb8\xbe\x79\x7e\x62\xca\xcc\xe5\xad\x8b\x57\x74\xde\xbc\x78\xf6\xb4\x00\x80\xa6\x05\xcb\xd6\x95\x7c\x1f\x90\x02\x83\x5d\xc7\x3e\xb1\xca\xd7\x24\xa4\x03\x66\xae\x4c\x40\x38\x52\x35\xfc\x77\xd7\x8f\x7f\x1d\x78\x73\xbd\xf6\x4b\x81\xf1\xbd\x60\xe0\xd4\x77\x1f\xc3\x71\x50\xf4\x03\x34\xce\x5b\xba\xa6\xd2\xe5\x50\x43\xcb\x23\x7e\xa0\xa0\xbd\xa2\x1d\xeb\xbf\xd4\x5d\x69\x6b\xf9\x64\x00\x50\xf9\xcc\xe8\xa5\x43\xbb\x5f\xb4\x5a\xe9\x72\xdd\x8d\x1d\xeb\xef\xf9\x33\x28\x16\x60\x42\x61\x84\xea\x9b\xe7\x56\x40\x2b\xdd\xa8\xd6\x0a\xca\x2f\x7a\xaa\x90\xcb\x00\x00\xa3\x92\x5c\xd9\xb5\xd6\x32\x33\x40\x84\xc9\x91\xd2\xa5\x42\x5a\x07\x9e\x07\xe9\x44\x02\x8b\x18\x00\x08\x00\x28\x65\xd3\x39\xad\x35\xa4\x13\x8a\x86\xe2\xb5\x0d\x00\x40\xa0\xfb\xa7\xa6\x9c\x35\x33\x4f\x2c\x09\x42\xd5\xb1\x06\x92\x22\xa2\x54\x80\xc0\x2b\x66\x2a\x60\x3e\x39\x74\x45\x1b\x0d\x96\x12\x8d\xf3\x16\xaf\x2a\x17\x4d\xc8\x07\xc5\x89\xa0\xf2\x5d\xc3\xdc\x25\x9d\x2c\x24\xb4\x31\x28\x24\x87\x7a\x2b\x60\xea\xea\xf9\x13\x5a\x05\x28\xe4\x32\x98\xfe\xc4\x86\xed\xa1\x58\x4d\x82\x8d\x56\x24\xa5\xf3\x80\x25\xa5\xc3\x46\xab\x50\xa2\xae\xae\xf5\xf1\xa7\x5e\x2d\x64\x33\xd0\xca\xc7\x78\xdf\x85\x5f\x26\x41\x4a\xf7\x5f\x3a\x9b\xbe\xde\xfb\x9b\xb2\x0c\x53\x95\x98\xbd\xf8\xe5\x5d\x87\x40\x82\xd8\x18\x3d\xb1\x89\x0e\x09\xe1\x10\x11\xb1\x31\x1a\x42\x8a\xc7\xb6\xed\x3a\xac\x42\xf1\x36\xcd\x40\xfa\xda\xe5\x5f\xb3\xd7\x7b\xcf\x01\x20\x59\x5e\x31\xe6\xd2\xed\x1b\x57\x1b\xda\x3b\xb7\x16\xb2\x59\xc4\x5b\x67\x2d\x9c\xd1\xbe\x62\x4d\xe6\xd6\xc0\x3f\x5e\x6a\x74\x18\xcc\x5c\xee\x36\x71\xed\xec\x05\x1d\x1d\xaf\xbd\xfb\x8d\x6c\x99\xb3\x2e\x9d\x4a\x19\x12\x14\x0c\x7e\xf1\xfe\x66\x95\x1d\x4b\x82\x84\x20\xa0\xfc\xcb\x58\x63\x4c\x63\xc7\xda\xe7\xa7\x6f\x7c\xfd\xb3\xa0\x98\xe7\xea\x68\x15\x6a\x12\xd5\xb6\x38\x3c\x70\xb9\x70\xe7\x56\x1f\x40\x88\x36\x4d\x9d\x1f\x6d\x69\x5b\x94\xce\xe4\xa9\x50\x2c\xc1\xad\x8a\xd2\x8d\x6f\x3f\xdc\x9c\xba\xd8\xf5\xd5\xa4\x41\x44\x44\xcc\x4c\x20\x72\xc0\x1c\x84\xda\x16\x3e\xdd\xfc\xcc\xb6\x23\x22\x5e\x37\x45\x58\xc3\xb1\x78\x9c\xc2\x91\x30\x00\xc0\xf7\x7c\xe4\x72\x39\xb6\x42\x92\xcd\xa6\x46\x92\x3f\x1d\xde\xa6\x86\xfa\x4e\x80\x28\x04\x66\x4d\x44\x4c\x00\x10\x8d\x46\x91\x48\x24\x50\x15\xad\xa6\x10\x0c\x47\x1a\x5b\xaa\x5b\x57\x3d\xfb\x4a\xbe\x66\xea\x73\xb7\xf3\xfe\xcc\xc0\x70\x98\x00\xb8\x92\xbc\x29\xb1\xf0\x40\x2c\x7d\xeb\xf3\x9b\x5d\xdf\x1f\xf4\xc6\x92\xc5\x00\x92\x4a\x85\x3c\x67\x73\x39\x14\x8b\x45\xd0\x9e\x3d\x7b\xe6\xb4\xb4\xb4\x74\xba\xae\xdb\x26\xa5\xac\x93\x8e\xdb\x00\xa3\x18\x3a\xb0\x3e\x8b\x86\xb4\xe2\x69\x25\x83\x5a\x00\xa8\x92\x48\xd7\xba\x34\x14\x26\x9b\x82\x13\x12\x90\x2e\x19\xad\xc6\x8c\x31\xe3\x4a\xa9\xc1\x91\x91\x91\xd3\x4e\x32\x99\x2c\xba\xae\x3b\x1c\x8b\xc5\x38\x12\x89\x8c\x4b\xa9\x6e\x33\x90\x00\x09\x12\xc0\x68\x63\x88\x06\x04\x41\x01\x80\x65\xb8\x9a\xa1\x4a\x2c\x14\x02\xc5\x04\x95\x35\xc6\x14\x3c\xcf\x4b\xe7\xf3\xf9\x91\x64\x32\x59\xfc\x0f\x8c\xa1\x6b\x40\x8a\xc3\x1a\x87\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x4a\x76\x99\xfa\xcd\x04\x00\x00")) - filestamper300x29 = HexToBytes("filestamper300x29", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x00\x40\xff\xbf\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x01\x2c\x00\x00\x00\x1d\x08\x06\x00\x00\x00\x10\x2c\x51\xc9\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x52\xcc\x49\x44\x41\x54\x78\xda\xec\xbd\x77\x94\x65\xc9\x59\x27\x18\x11\xd7\xdf\x77\x9f\x37\x99\xf9\xd2\x56\x56\x55\x96\x57\x57\x77\xb5\x53\xab\xd5\x6a\x39\xa0\x25\x24\x61\x35\x0b\xcc\x0c\xa3\x5d\x10\x0c\x66\x61\x0f\xcb\xec\x9c\x61\x76\x66\xd9\xb3\x63\x76\x19\x40\x83\x3b\x9c\x23\x61\x16\xad\x40\x48\x08\x23\x87\x04\x74\x37\x52\xd3\xbe\xda\x94\x37\x59\x95\xde\xbd\x7c\xfe\x5d\xef\x22\xf6\x8b\xb8\x2f\xab\xba\x35\xa0\xe1\x9f\xd9\x39\x67\xcf\xbc\xee\x57\xcf\xdf\x1b\x37\xe2\xfb\x7e\xdf\xef\x73\x91\x98\x31\x86\x0e\x6e\xff\xe0\xa7\x7e\x18\x7d\xe6\x8f\x3f\x8d\xd4\x7c\x01\xfd\xdd\x37\x8c\x58\xea\x23\x4a\x11\x92\x72\x73\xf0\x52\xc9\x11\x82\x0d\x82\x91\x44\x19\x8a\xe1\x78\x1e\x46\x38\x90\x24\xf8\x17\xc3\xd7\xe1\xf0\x0c\x3e\xe0\xe7\x11\x8f\x70\x47\xe2\x35\x1c\x87\x06\xf0\x85\x3e\x8a\x86\x3d\xf4\xcb\xff\xf6\x63\xe8\xa7\xff\xc9\x8f\xa0\xff\x1a\xb7\xb5\xcb\x5b\xe8\x47\x3e\xf0\x3f\xa3\xfb\x1e\xbc\x07\x1d\x3d\x76\x14\xc5\x71\x8c\xfe\xdb\xed\xbf\xdd\xfe\xab\xdc\x40\x3d\x34\x45\x43\x3f\xf7\xd5\xff\x1d\xef\x76\xb7\xb0\x4c\xb1\x44\xe3\x44\xd5\x91\x6c\xfd\xaf\xff\xfc\x5f\x37\x1e\xba\xf7\x5b\xd4\x4f\x7c\xea\xcb\xa0\x3f\x14\xc9\x92\x8c\x74\x5d\x45\x45\x4b\x47\x96\xa9\x21\x2b\xa7\x23\x5d\xd5\x10\x21\x08\xcd\xcf\x35\x50\xb7\x3b\x42\x9d\xde\x10\xd9\xde\x10\xed\xee\xef\xa0\x9d\xbd\x4d\xb4\xd7\xde\x41\x83\x51\x0f\x85\x01\xe8\x30\x4b\x91\x66\x4d\xa0\xa1\x5f\x42\x41\xa0\x22\x49\x52\x90\xa2\xc9\x48\x51\x15\x71\x6c\x22\x11\x78\x54\xe0\x7d\x49\xdc\xf9\x81\xf9\xfb\x98\x9f\x00\x94\x9b\x70\x05\xe7\xfa\x0d\xba\x4d\x61\x3c\x34\x4d\x51\x14\x47\xc8\xb1\x5d\x64\xdb\x0e\x92\x91\x8f\x1e\x7b\x60\x16\xbd\xeb\x6d\xc7\xd1\xd1\xb9\x45\x34\x3d\xd1\x44\x96\x95\x87\xc3\x48\xf0\x3d\x8a\x4a\x45\x13\xd5\xab\x16\xba\xb5\xba\x83\x3e\xff\x95\xf3\x28\x86\xdf\x73\xc8\xc0\x70\x5c\x09\x00\x05\x70\x05\xc9\xf0\x5d\x7e\x92\x62\x3e\x87\x4a\xa5\x1c\x1c\x73\x7c\x5b\xdd\xdc\x40\x97\xaf\x5e\x42\x92\xa6\x7d\xd3\xd9\x4c\x63\x0f\x49\xc6\x8c\x3e\xb1\xf8\xc4\x89\xa5\x7b\xdf\x77\x6a\x6e\xaa\x32\x5d\xca\xab\x45\x2c\x61\x25\x8e\x69\xd0\x1b\x46\xbd\xed\x3d\x77\x65\xbf\x1b\x5c\x4c\x12\xba\x2a\xf1\xdf\x44\x29\x4a\xfc\x08\xc5\x7e\x8c\x62\x2f\x46\xa9\x07\xcf\x03\x19\x25\xf6\x65\x94\xe2\xdf\x45\x92\x6e\xa0\xaf\x3e\xf3\x34\x8a\x93\x58\x4c\x04\x16\x77\x22\xce\xc7\x00\x19\x0f\x20\x95\xf0\x89\x12\x97\x94\xdd\x68\x9a\x64\x10\x0a\xef\x73\x20\x14\x13\x09\xdf\xa6\x29\xcd\xc0\x52\x4c\x28\xbb\xf3\x48\x60\xd2\x29\x47\xda\x83\xab\xe1\x9f\xc1\xa4\x38\x1b\x2e\x32\xbe\xe9\x75\xff\xff\xff\xc6\xe7\x96\xdf\x53\x9a\x8a\x79\xc1\xe3\x79\xa6\xfc\x3f\x3e\x67\x34\xfb\x0e\xc6\xe3\xf9\xc7\x5c\x52\xf1\xdf\xeb\xd8\xfc\x37\x5c\x09\x91\xe3\x20\x24\x83\xc8\x49\x07\x62\x97\xf0\xc3\xc2\x8a\xc1\x6b\x2e\xac\x62\x3d\xc8\x78\x40\x4c\x28\x03\x1e\x1b\xc9\x4c\xfa\xd8\xdf\x61\x42\xff\xb3\x18\xf0\x4d\xbe\xfb\x9f\xf9\x35\xfe\xff\x76\x1d\x14\x59\x45\x57\x5a\x57\xd1\xc8\xe9\xf0\xa9\xe0\xc8\xa0\xc0\x75\x6b\xf9\x4a\xcd\x32\xb4\x79\xe5\x93\x9f\x79\x12\xd1\x04\xc0\x4a\x21\xf0\x5d\x19\xe5\x74\x05\x99\x00\x5a\xa6\xa1\x82\x0c\x2b\x48\x03\xb0\x01\x9c\x41\x81\x17\xa2\x89\x7a\x09\x85\x51\x0c\x00\x04\x80\x03\x8a\xaf\x2a\x2a\xd2\x34\x1d\x19\x1d\x13\x0d\x47\x5d\xe4\xf9\x0e\xe8\x73\x1f\x4d\x54\x52\x14\x24\x16\xb2\x47\x2a\x00\x99\x8a\x92\x08\x8e\x21\xf3\x3b\x07\xaa\x58\x9c\x87\x83\x17\x1e\xcb\x48\xa6\x9b\x99\x84\xa4\x94\xcb\x47\x0a\x46\x1e\xc0\x2a\x0a\x51\x12\x87\xc8\xd2\x19\x3a\xb5\xa8\xa3\xfb\x4f\x2f\xa2\x53\x4b\x0b\x68\x61\x66\x0e\x35\x1b\x53\x00\xaa\x96\xf8\x2d\x05\x5d\x2d\x03\x58\xd5\x00\xac\x76\xf7\xba\xe8\x85\xf3\x37\xe0\xf8\x20\x05\x58\x7a\x13\x60\x49\x02\x20\x09\x57\x51\xb8\x96\x22\x8c\xd9\xe5\x32\x92\x2d\xe7\xe7\x9f\xfa\x2a\xfa\xd0\xf7\x7d\x00\x69\xb5\x06\x7a\x23\xeb\x7a\x03\xad\x92\xd3\x34\x95\xf3\xd3\xef\x39\xf1\xf0\xb7\xfc\xf8\x7b\xdf\xf7\x8e\xb3\x47\xa6\x4a\x89\x1a\x84\x7e\x02\x93\x02\x43\x46\x2c\xa1\x8c\x10\x55\x85\xf3\x68\x64\xbb\x15\xb9\xcf\xbd\xba\xff\xd2\xda\x96\xfd\x27\x38\x4d\x87\x34\x4a\x50\x12\xc0\x1d\x00\x2b\x76\x33\xc0\x8a\x07\x17\x51\x94\xfc\x06\x08\x30\x50\xb3\x30\x41\x0c\xbe\xc3\x05\x17\x66\x0d\xee\x51\x76\x66\xcb\x82\xcf\x25\x01\x2c\x68\x38\x10\x8a\x73\xe7\x56\xa9\x64\x80\xc4\xbf\x0f\x0b\x81\x5c\x47\x08\x3c\x29\x16\x11\x58\xa5\xec\x58\x5c\x41\x38\xb0\x01\xe3\x43\xbd\x41\x76\x3c\x81\xda\x28\xfb\x6c\xd8\x45\x05\x6d\x06\xbd\xaf\xf9\x04\x9a\x3b\xbc\x80\x8e\x9f\x5c\x02\xf4\x8f\x33\x7d\xfc\x3b\x94\xef\x8d\x80\x87\xc5\xc4\x4a\xdf\xa0\x20\x77\x7f\xcc\x95\xfd\x6f\x99\xcf\x3b\x00\xf1\xc6\x1b\xcc\xef\xdf\xfa\xdd\xff\x92\x37\x7e\x3d\xb2\x22\x23\x67\xe4\x20\xcf\xf5\xd0\xd6\xe6\x36\x1e\x8d\x46\x20\x9b\x18\x96\x8d\x52\x1d\xe5\x50\xc1\x2a\xea\x4c\x49\xcd\xfa\x74\x45\xae\x4f\xd4\x61\x6e\x59\x82\x53\x32\xa2\x72\x1a\x13\xb0\xac\x7c\x0e\xf8\x7f\x9c\x3c\x13\xf1\x8c\xc1\x92\x66\xac\x9a\x5f\x63\x18\x05\xe8\xd2\xfa\x15\x84\xde\xf7\x04\x42\xfb\xfb\x08\xa4\x14\xd6\x83\x4f\x54\x03\x99\xb0\xb6\x1a\xdb\x43\xb4\x5c\x45\x0c\xd6\x83\x82\x65\x16\xe2\xe6\xab\x88\x6a\x31\x3f\x12\xdc\xf9\x5a\xc2\x72\x71\x19\x60\x18\x33\xae\x91\xfc\xf8\x04\x50\x8d\xf2\xb7\x38\x5d\xe7\x3f\xe3\x2f\xa4\x0c\x47\x31\xca\x40\x56\xbc\x47\xd0\x78\x70\xd9\xb2\xb0\x83\xcf\xf9\x67\xf4\x9b\x23\x1a\x43\xff\xe9\xda\xfe\x6d\x88\x88\xdf\xf8\x5d\xf6\xf7\x43\xcf\x6f\x7c\x09\xd7\xa4\x2b\x3a\x7a\x6a\xf9\x69\xf4\xe2\xed\x67\x88\xca\x90\x92\x46\x61\x0e\x25\x49\x2e\xf6\x3c\xf3\xd0\xf4\x23\xfa\xa3\x0f\x7f\x40\x4e\xc0\xb0\x9b\xba\x8c\x4c\x53\x45\x05\x13\xd8\x95\x65\x20\x40\x33\x78\x4f\x03\x40\x92\x05\x1b\xe2\x73\x5f\x07\x25\x8f\x92\x04\x98\x55\x5f\xc8\x96\xeb\x07\x68\x68\xf7\x50\xb7\xdf\x06\xe6\xd5\x42\xbd\x7e\x17\x80\x71\xc0\xc2\xc8\x43\x5a\x5e\xc6\x04\xe6\xdf\x71\x18\xdc\x15\x14\x84\x0a\xe8\x01\x67\x53\x2a\x4c\x11\x10\x02\x4c\x84\xf9\x10\xf2\xcf\xc6\x93\xcb\x4d\x8d\xc4\xdf\x4e\x80\xd9\x21\x54\x2f\xab\x68\x66\x32\x87\x0e\xcf\x37\xe8\xd1\xf9\x59\x78\x3e\x8b\x26\xeb\x93\xb4\x58\x28\x4a\x00\x96\x98\x83\x84\xa2\x48\xa8\x5c\xce\x09\x80\xbd\x79\x7b\x0b\xbd\xf8\xca\x0d\x18\x57\x24\xe6\x95\x13\x8d\x0c\x08\x33\xb0\x92\xc6\x60\xd5\x9c\xa8\x88\xeb\xda\xdf\x1f\xde\x65\x58\xa6\xa4\x03\xa2\x1a\x82\xda\xe1\x37\xaf\x1a\x88\x16\xd3\x41\x78\x0b\x8d\x63\x3f\xf8\xc8\x0f\x7c\xe4\x67\xde\xf3\xee\x7b\x4b\x86\x33\xe8\xc6\x68\x14\x05\x47\xcb\x06\xaa\xd4\x73\x48\x01\xc1\xf0\x13\x96\xee\x0d\xfc\x74\xb5\x3f\x42\xcd\x8a\xa1\x7e\xdf\x07\x66\xdf\xf5\xf4\x8b\x9d\xc3\x2f\xbd\xba\xf7\xdb\x00\x18\xab\x92\xca\x05\x47\xce\xdc\x42\x40\x53\x06\x68\x1e\x39\x04\x25\x34\x44\xf3\xa5\x19\x34\x5f\x98\x46\xae\x37\x42\xbd\x3d\x98\xcc\x60\x0f\x46\x41\xd0\xc2\xf4\x71\x60\x7d\x3a\xcc\x09\x46\x6b\x83\x4b\x28\x4c\x23\x71\x51\x5c\x10\xef\x3d\xfe\x08\x2c\x08\x45\xbb\x6b\xeb\x68\xa2\xd9\x44\x9b\xb7\x97\x11\x01\x0b\x75\xe2\xcc\xfd\x60\x61\x1c\x14\x00\x80\xe5\x01\xbc\x7a\xfb\x6d\x64\x2a\x16\xba\xd4\x3b\x8f\x0e\x4d\x9f\x44\xaa\x2a\x0b\xe1\x28\x00\xe0\x2d\x5f\x7e\x05\x25\x03\x18\x53\x50\x46\x39\xc3\x40\x7e\x00\x00\x13\x52\x94\x72\x97\x96\x65\x4c\x02\x8f\x17\x2a\x03\x22\x7a\x47\xb0\x39\x65\xb5\xfb\x43\xb4\xb1\xb6\x91\xb1\x3b\x96\xb1\x0e\x05\x2e\x14\x6e\x72\xca\x52\xd2\x98\xaa\x91\x7a\xa3\x2e\x04\x06\xf4\x2a\x48\x61\x82\x31\x5c\xfb\xde\xf6\x1e\x6a\xb5\xf6\xb1\x34\x06\x2d\x00\x36\xb6\x78\xf8\x10\x2e\x94\xf2\x3a\x7f\x0e\x87\x0a\xd2\x94\xa1\xff\x62\xf8\xc5\x90\x10\x88\xe1\x68\x84\xb6\x37\xb6\xb0\x6d\xdb\x64\x34\x1c\x4a\x92\x4c\x64\x38\x39\x51\xb0\xaa\x37\xeb\xb3\xd5\x99\xe9\xd9\x7a\xa1\x94\xab\x33\x2d\x9d\xa2\x24\x2e\x70\xc6\x4b\xb0\xe4\xc2\xac\x6c\x90\x14\x3f\xe7\xe8\x5a\xdb\x77\x03\x60\xca\x01\xca\x81\x05\xdf\x4e\x07\x28\x44\x3a\xba\x5a\x29\x62\xae\x44\x52\xc8\x50\xa7\xbd\x87\x5e\xd8\x78\x06\x4b\x8b\xdf\x81\x28\x58\x61\xb6\xb1\x85\x24\x60\x08\x2c\x2a\xe2\x32\x96\x59\x89\x6c\xe1\xb8\xa0\x20\x6a\xe4\x71\x8a\x47\x30\x17\x04\xa7\x51\x0e\x8c\x0b\xb0\x71\xac\xc1\xd2\xfb\x08\xa7\xa0\xa0\x80\x8c\x1c\x63\x52\x59\x06\x74\x04\x70\x57\x64\xcc\x62\xfe\x1a\x20\x2b\x85\x05\xc1\x20\x1b\x4c\xc3\x0c\xd6\x85\x61\x8a\x59\x04\x70\x87\xf9\xbc\x83\xe5\x4e\x13\x01\x74\xa0\x16\x38\x8b\x4f\x64\x08\xcb\x92\x88\xaf\x0b\xba\x83\xb8\x07\x8c\x5c\x40\xc9\xf8\xf5\x37\x22\x0b\x3b\x30\x4a\x07\x4c\x94\xa1\x3b\x36\xea\x4d\xdf\x7f\xc3\xfb\x6f\x30\x62\x19\x83\xcd\xde\xa2\x07\xef\x8f\xbf\xcf\x60\xbe\x94\xe9\xe3\xb8\x5c\x9d\xc1\x69\x6f\x43\x4b\x86\x2d\x8b\xfa\x4e\x4e\x0a\x7c\x7d\xd3\xdb\x91\x76\xfc\x9e\x52\xaf\x34\x50\x28\x73\xee\x95\x19\xf2\x04\x8e\xe7\x27\xe0\xde\x45\x11\x53\x41\x3e\x39\xcb\xe2\xf2\xba\xbb\xb9\x8f\x2a\xd5\x02\x1a\xc1\x73\x17\x98\x16\x85\xa5\xa5\xb9\x12\xac\x13\xe8\x53\xbe\x86\xf4\xda\x90\x15\xdc\x21\x72\x41\x4f\x5c\xdf\x66\x44\x4a\xd1\x44\x99\xa0\x1a\x4d\x98\x0f\x0c\x2d\xf4\x53\x98\x92\x10\x80\x0b\x1e\x61\x3a\xc7\x8c\x17\xa6\x97\x83\x09\x66\x2a\x07\x9f\x82\x81\x0a\xb9\x3c\x2b\x02\x63\x6a\xd6\x6a\xac\x5e\xa9\xa6\xb5\x52\xdd\xa8\x94\x2a\x6c\xb2\x5e\x35\x09\x63\xb5\x28\x8a\xd7\xc0\xdd\x4c\x2c\x4b\xc7\x9c\x59\x05\x41\xc4\x5e\x38\x7f\x15\x2d\xaf\xec\xc0\xf1\x19\xe8\xa3\x04\x9c\x02\x66\x82\x70\x86\x45\xef\xb0\x38\x3e\xb7\x15\x70\x03\xf9\xb1\xf7\xf7\x07\xc0\xca\x0a\x77\x19\xd6\xda\x97\x97\xd1\x3b\xbe\xff\x43\x68\x63\xa6\x83\x54\xaa\xbc\x11\xac\x72\x69\x12\xd6\x8b\xb3\xdf\xfd\xd6\x9f\xf8\x99\x7f\xfb\xf8\x43\x47\x25\xd4\xdf\xeb\xa4\x0f\xcc\x17\xd1\x62\xb3\x02\x24\x45\xe6\xbe\x19\x58\x67\x17\x99\x9c\xbd\xc0\xf1\x5c\xf0\x61\x2f\xaf\x75\xd0\x4b\xed\x00\x15\xa6\x9b\xda\xb3\x2f\x77\xbb\x4f\x3f\xbb\xf9\x2b\x40\xc1\xd6\x19\xf8\xae\xdc\x35\x4c\x61\xc6\xc3\xce\x45\x50\xf8\x8f\x01\xe8\x8c\xd0\xb7\x1f\xfb\x10\xfa\xae\x53\x1f\x40\xdd\xa0\x85\xf2\x9e\x81\xd2\x09\xa0\xa3\x54\x42\x85\x22\x46\xab\xbd\x00\xd9\x4f\xb5\xd1\xd9\x33\x8b\x68\x2d\x3f\x84\xcb\xd0\x61\x92\x3c\x94\xcf\xeb\x68\x13\x0c\xf2\xe0\xe5\x3e\x52\x73\xe0\x17\xcb\x04\x75\x06\x21\xca\xcf\x4e\xa0\xc9\x22\xf8\xbd\x7a\x04\x24\xcc\x44\xcf\xfc\xe5\x79\x74\x76\xfd\x1e\x74\xf9\xbd\x0a\xe8\x80\x85\xf4\xa4\x05\x93\x44\x71\x61\x72\x12\xd5\x0a\x3d\x7c\x65\x0d\x2c\xd6\xee\x2c\x3e\xf3\xb8\x87\x56\xdb\x7d\x52\x01\x01\x0e\x2c\x06\xb6\x05\x70\x48\x03\x01\x82\xc7\x38\x48\x89\x13\x44\x12\xd0\x49\x02\x8b\xc7\x23\x76\x08\xf9\xa6\x11\x85\xea\x84\x1f\xfb\x32\x0d\x69\xcc\xa5\x0f\xcb\x92\x51\x30\xca\x45\x55\x55\xf3\x48\xa6\x39\x62\x30\x93\x33\x30\xce\xb4\xe0\x1b\x6d\xdd\x8a\x9e\xc5\xb2\xef\xf5\x7b\x8e\x62\x8f\x5c\x39\x8e\x12\x05\x16\x3f\x55\x71\x1e\x57\x72\xf3\xa7\x70\x8e\x2e\x80\xa5\x01\x9b\x46\x6e\xe4\xeb\xfe\x25\x59\x66\x7f\x5f\xfc\xf9\x3b\xad\xfe\x98\x14\x0a\xe3\x88\xc7\x7c\x99\x03\x71\x0c\xae\xba\xeb\x04\xa4\xd7\x19\xc9\xf6\x30\x50\x3c\x2f\x54\x43\x2f\x35\x4c\xb5\x56\x69\x36\xa7\x1b\x46\x51\x6f\x0c\x9c\xde\xb9\x4e\xb7\x75\x6a\xbf\xbd\xbb\x04\x42\x55\xad\x94\xaa\x68\x71\xee\xf0\xc8\x30\xf3\x5f\x4b\xe3\xe8\x93\x97\x67\x2b\x5f\xbc\xba\xb2\x1e\x76\x49\x87\x14\x2a\x39\x96\xa4\x4a\xea\xfa\x00\x84\x95\x82\x24\x19\x70\x61\x01\x83\x8b\x53\xb1\x69\xe6\x90\xdc\xed\x03\xee\x00\xe8\xc0\x6b\x58\x5d\x98\x13\x1f\x6c\x33\x8f\x5b\x80\x25\x4b\xb9\x72\x30\xac\x28\x06\x07\x1f\xc0\x90\x18\x0b\xac\xe1\xa3\xe7\x36\x14\x84\x1a\xc4\x0c\x73\x17\x15\x64\x96\x9b\x0f\x11\x38\x48\x85\x1e\x61\x2e\xc7\xc0\x09\x99\x30\x65\x4c\x04\x48\xf9\x25\x62\x42\x05\x10\x65\x5e\x8c\x88\xaa\x52\xce\xc7\x32\xbe\x20\x0e\xc1\xff\xa1\x3c\x60\x82\xc4\x17\x59\xca\xb2\x93\x66\xe7\x80\xe7\x34\xfb\xbd\x88\x1e\x88\xaf\xf1\x39\x14\x73\x49\xb2\xf7\xb2\x73\x1d\xbc\xcf\x0e\x62\xb7\x38\x7b\xfd\x06\xe2\x36\x1e\xf3\x18\x2d\xc5\x21\x33\xf0\x1a\x7f\x9f\xbd\x01\xda\x68\x12\x93\xc8\x1f\x2a\x91\xdb\x33\x22\x77\x68\xa6\xa1\xa7\xc5\x81\x27\x95\x0b\x13\xe4\xd4\xb1\xfb\x61\xc0\x29\xe8\x9e\xc4\x54\x70\xdb\x14\x60\xc8\x8a\x4c\x98\xae\x69\x8c\xeb\xe3\xee\xee\x26\xea\x74\xdb\xf4\xd8\xd1\x53\xdc\xa5\x62\x66\x4e\x47\x83\x81\xcd\x62\xf0\x34\xe0\xb2\x18\x67\x96\x60\x37\x19\x4d\x63\x96\xa6\x31\x0a\xe3\x08\xec\x88\x07\x40\x12\xc0\xbb\x09\x53\x35\xc2\xc9\x2e\x7c\x96\x80\xe7\x13\xc1\x9a\xc6\x3c\x3e\xc5\xaf\x88\x72\x23\xa7\xc0\x31\x35\x45\x81\xf3\xe9\x8c\x1b\x79\x53\xd5\x29\x7f\x9d\xd3\x0d\xa3\x90\x2f\x1d\x37\xcd\xd2\xe9\xf9\x46\x31\x3e\x71\x68\x72\xc0\x55\xe8\xf2\xcd\x95\xbf\x59\x3a\x7a\xb8\x0d\x84\x98\xb4\x5a\x03\x74\x7b\x75\x9b\x8d\x80\xd1\x03\x30\x31\x7e\xfd\x09\x07\x2b\x38\x33\xe6\xab\x02\x67\xe1\x6e\x20\x9f\x3d\x0b\xd8\xe3\xdc\x4c\x03\x0d\xfa\x0e\x80\x66\x82\xfe\xec\x0b\x9f\x66\xf2\x37\xd1\x01\x4e\xda\x2d\x46\xa3\x49\xc9\x38\xf6\x96\x27\xbe\xfb\xa7\xde\x76\x66\x91\xb0\xee\x5e\x9b\x7e\xef\x43\x87\x11\xf8\x77\xc8\x07\x8a\x69\xc2\x80\x81\x7d\x81\xc5\xd4\xc1\x33\x8b\xc4\x12\x39\xf0\xfe\x7d\x47\x26\xd0\x74\xc5\x45\x9f\xbd\xbc\x19\x3e\x72\xff\x6c\xbd\xdd\x75\xff\xe1\xab\x97\xf6\x7f\x21\x25\x38\x02\xa1\x45\x29\x53\x80\x7a\xae\xa1\xc8\xeb\xc2\xaa\xa7\xc0\xb2\x52\xc4\x91\x9b\x4b\x16\x11\xd2\x05\x22\x0d\x77\xe1\x05\xc0\x45\xa4\x1e\x58\xcb\x44\x81\x73\x01\x0a\xc3\xb0\x29\x3c\xd2\x98\x08\x8a\x68\x5a\x32\x52\x2d\x02\x96\x05\x60\x1f\x14\x3c\x57\x62\xb8\x58\xc4\x38\xaf\x13\xe0\x09\x09\x7e\xf4\xbd\x87\x71\x1e\x6c\x75\xad\xce\xb0\x4a\xfa\x58\x55\xe0\x7d\x0d\x63\x4d\xeb\x13\x49\xa6\x68\xe9\x2c\x98\x7b\x75\x15\xa7\x21\xc6\xf3\xf7\x48\x40\x8d\x81\x2f\x65\xf3\x87\xc1\xd8\x10\x77\x14\x4b\xbd\x76\xa0\xaa\xc3\x48\xf3\xbc\x58\x85\xeb\xc5\x0a\x33\x74\x25\x57\x3a\x6e\x47\xf1\x5b\xea\xaa\x55\x06\xa6\xb4\xc3\x60\x1e\x42\x1a\x36\x6c\xbb\x5f\x6b\x0d\xed\x86\xeb\x38\x55\xdb\xf6\xa6\x72\xa6\x85\x27\xaa\x93\x49\x7d\xb2\xf8\x99\x72\x59\xca\x51\x94\x53\x75\x5d\x57\xea\x0d\xa5\xeb\xba\x5d\x07\xce\x97\xe6\x55\xab\xd0\x1d\xf6\x1e\xee\xb6\xed\xef\x9c\x6b\x2e\x50\xa4\x84\x7f\x36\x73\x88\xea\xf5\x89\xb4\x05\xba\x2c\xdd\x85\x24\x21\xe7\x99\xb8\xe3\xb1\x8f\x92\xe9\x06\x1b\x7f\xcc\x70\x46\x02\x59\x86\x50\x99\xcf\x83\x85\x4e\x73\x7a\x91\x79\x9d\x51\x98\xa2\xd1\x20\x92\x7a\xdd\x50\xc1\x24\xd1\xf9\x5d\x97\xf5\x52\x65\x7e\xae\xaa\x59\x66\xa5\x3b\xe8\x9c\xbd\x7e\x79\xf5\xf1\xf5\xcd\xd5\x69\x3f\x08\x90\x6e\x98\x1d\x2b\x97\xbf\xbd\xb1\xb7\xae\x6c\xef\x6f\x55\xdf\x72\xfc\xec\x3d\x8d\xe6\xf4\xd3\xc7\xe9\xce\xf4\xe2\x69\x69\x98\xa2\x45\x1c\x50\x85\x84\x21\x2b\x45\x80\xe8\x1e\x95\x86\x36\xc7\x44\x20\x9b\x09\x00\x42\x62\x87\x38\xd5\x72\x28\x25\x02\x4c\x88\x20\x38\xc4\x10\xae\xa7\x50\x59\x99\x11\xca\xa5\x1b\x40\x09\xf3\x8c\x0d\x88\x33\xbf\x00\x7e\x39\x88\xff\x86\x0a\x4d\xe7\x57\x4c\x70\x06\x48\xf0\xc8\xf1\x21\xe5\x97\x4a\xb8\xf7\x29\x94\x9f\x09\x08\xc3\x19\x16\x09\x67\x51\xc0\x18\x13\xe0\x37\x66\xac\x38\x9b\xbd\x8c\x10\xc3\x67\x12\xcb\x9e\x73\x38\x92\x32\xf7\x52\x80\x5e\xe6\xbc\x23\x01\x72\x63\x90\x19\x03\xbe\x00\x26\x72\x97\x8e\xa1\xb1\x4f\x9a\xd9\x82\xb1\x59\x38\xe0\x54\xfc\x6c\x6c\xfc\x0c\x09\x95\x14\x4c\xef\x2e\xab\x1a\x73\xad\x83\xf3\x8a\xd4\x94\x44\x89\xaa\x29\x52\x8c\xf2\x4a\x84\x99\x11\x2b\xb2\x96\x2a\xaa\x1c\x81\x4b\xe2\xda\x1d\x89\x33\x18\x06\x14\x92\x02\xf3\xe4\x87\xc3\x92\xcc\xf6\xf7\x77\xd8\xad\x95\x9b\x74\x6b\x7b\x83\xfa\xbe\xc7\x5c\xd7\xc6\x67\x4e\x9e\x05\x3d\x75\x19\xe8\x06\x77\xf9\x59\x9c\x70\xc1\x86\xc9\xcb\xe4\x85\xa3\x3c\x32\x14\x85\xea\x52\x1e\xe5\x74\x13\x70\x23\x05\x12\x9d\x02\x60\x11\x94\xcb\x69\x00\x4a\x0a\x1d\xbb\x98\x2c\x23\xfe\x30\x5d\x44\x82\x3b\x61\x12\x40\x7d\x1c\xf9\x30\xe5\x69\x59\x35\x72\x4b\xcd\xa9\x99\x23\xe0\x0a\x4e\xd6\x4a\x16\x4e\x52\x06\x64\x11\xaf\x17\x4c\xad\x4d\x14\xa9\x71\x75\x75\x7b\xd0\xed\x0c\xf0\x68\xe4\x8e\x09\x2a\xb7\x98\x89\x88\x1b\x70\xd6\x2c\x56\x04\xac\x05\x68\x3f\x00\x24\x43\x86\xae\xb2\xe6\x54\x19\xf5\x07\x0e\x78\xfe\x32\xfa\xd4\x1f\xfe\x26\xfb\xc3\x4f\x7f\x22\xfd\x06\xc0\xe2\x92\x1e\xc0\x31\x64\x2e\x2a\x3a\xbc\x6e\x00\x40\x1c\x3e\x72\xe6\x1f\x9d\x7b\xd7\xdb\x17\xd5\xbd\xed\xb5\xe4\x87\x1f\x5b\x42\x1a\x5c\x4c\x82\x55\x2e\x52\x70\xce\x44\xb0\xaa\x11\xb8\x16\xa0\x98\x62\x21\x72\x06\xd0\x3e\x40\xcd\x89\x8a\x85\xbe\xed\x50\x88\xbe\xb2\xd3\xf2\xdf\xfe\x70\x73\x69\x7b\xad\xfd\xe8\x43\xa4\xff\x14\xf1\x13\x1c\xc0\x58\xe3\x63\x13\x00\xf6\x1f\x05\x2b\x29\xa1\x59\xab\x89\x7d\x70\x17\x78\x40\x2e\xcd\xb2\x8a\x30\x1d\x0c\xc3\xfc\xa2\x4a\x5e\xc2\xc5\x47\x8a\x98\x4c\x7b\x68\x06\xfc\x02\x60\x97\xc8\xd4\xc0\xbb\x36\x28\x6a\x68\x88\xe8\x67\x4d\x2c\xa9\x40\x6e\x54\x19\x2b\x44\x03\x8f\x85\xd3\x7c\x2e\xe6\xa0\x04\x34\x11\x56\x1b\x2c\x39\x96\xe2\x14\xa7\x42\x9e\x08\x37\x9c\x20\x89\xf0\x1a\x94\xc9\xf7\xc1\xea\x7b\x39\x1e\x55\xc4\x9e\x8f\xf1\x58\xb0\x40\x26\x25\x1c\xf8\xb1\x3c\xea\x07\x6a\x77\x3f\xb1\x06\xfd\x28\x1f\xfa\xd8\x4c\x62\x26\x4d\x94\xea\x95\x10\x0d\x4f\xde\xba\xb9\xfc\x0f\x97\xe6\x8f\x17\x7b\xc3\xce\x60\x63\x67\x5d\xe9\x0d\xfa\x39\x9e\x3c\x20\x40\x2e\x00\x0d\xfd\x72\xb9\xb4\x19\xa6\x21\x6b\x4c\x36\xb6\x24\x59\xb7\xb7\xf7\xdc\x73\x81\x1b\x3c\x52\x2d\xd7\x61\x9a\x8d\x17\x06\x0e\xdd\x05\x4a\xee\xcf\x4d\x16\xad\xcd\xbd\xe5\xd3\xd4\x65\x0b\x49\x1d\x66\x5d\x55\xcb\xfd\xb0\x38\x99\xd8\x0a\x77\x83\xe4\x8c\x8c\x1f\xfc\x3f\xd6\x29\x3a\x5e\xf8\x03\x39\xcf\xc0\x88\x09\x3c\xc8\x9c\x13\x00\x28\x98\x82\x4c\x85\x84\xc3\x03\xb2\xc8\xad\x15\x76\x81\xdd\x0d\xbb\xb6\x36\xea\x8d\xcc\xd1\x00\x5b\x0a\x2d\x95\xa6\x9b\xd3\x79\x27\x18\x1c\xbe\x79\xf5\xca\x3b\x37\xb6\xd6\x0e\x7b\x61\xc0\x26\x67\x16\x5e\x9c\x9b\x3f\x7c\xa5\x98\x2f\x6e\x99\xb9\x7c\x3f\x49\x13\xb5\x3f\xe8\x35\x0c\xb0\xae\x81\x22\xfb\x03\xd7\x9a\xa4\x1e\x9a\x90\x75\x23\x29\xf8\xda\x51\x39\xf0\xee\x81\x99\x53\x62\x43\x5f\x1e\x36\x4b\xaf\x24\xaa\xcc\xed\xa7\x20\x2c\x29\x4f\xc0\xc0\x13\x7e\x1f\x0f\x14\xdc\x19\x0a\xd7\x07\xaf\xa9\x80\x13\xcc\x43\x12\x29\x13\x81\x7e\x3c\x76\x95\x79\x3a\x59\xb0\xaf\x71\xd8\x44\x5c\x3c\xcd\xd2\xcc\xf0\x44\xca\x30\x40\xf0\x16\x89\xab\x7a\x06\x52\x63\xc6\x72\x00\x4c\x74\xec\xe1\xa3\x71\xae\x60\xec\xdd\xf0\xd8\x0c\xbe\xe3\xc9\x65\x18\x37\x06\x36\x3c\x9e\x5c\x7c\x80\x59\x63\x4c\xa1\x77\x60\x86\xb2\x4c\x81\x69\x36\xde\xec\x85\xd0\xc0\x71\xd6\x4c\xc8\x31\xcd\xbe\x27\x1e\xb3\x0c\x12\xa3\xd9\x7b\x28\x8b\x6f\x72\x7c\x12\xef\x65\x19\xa3\xec\x3d\x60\x3f\x40\x76\x62\x20\x5a\x01\x4d\x03\x17\x5c\x64\x17\xa5\x51\x08\x1e\x6c\x40\x6e\x86\x21\xbd\xf7\xf4\x03\xe0\x11\x82\x97\x0b\x96\x77\x38\xdc\xa7\x6b\xeb\xb7\xe8\xc6\xce\x06\x38\x00\x21\xc8\x1d\xf7\x89\x29\xbe\xf8\xda\xb3\x88\xc4\x3e\x39\x75\xe2\x0c\x80\x56\x82\x2c\x5d\xa1\xc3\xd0\xe7\x04\x03\x44\x9b\x88\x78\x23\x7c\x97\x89\x78\x2a\x0f\x81\x00\x53\xc3\x58\x1e\x43\xfd\x38\x1e\x09\x9f\xea\xaa\xce\x2c\xd3\x40\x86\xc1\x33\x89\x20\xd8\xc0\xb6\x46\xa3\x01\xb1\x47\xa3\x4a\xa9\x54\x3e\x3e\x3f\x35\x7d\xe4\xc4\xe2\x7c\x65\xaa\x6c\x71\xc6\x97\xf6\x9d\x20\xdd\x1b\x38\xa4\xbf\x35\xac\x9c\x9a\x2d\x77\xc3\x30\xce\x9f\xbf\x76\x53\x05\x19\xa2\x77\x24\x35\xa3\xc0\xe2\x9f\xb1\x45\xe0\x6c\x95\x82\x7c\x01\x58\x29\x68\x7a\xaa\x8a\xba\x03\x97\xe9\xaa\x81\x3f\xfb\xb9\x4f\xa6\x7f\xf8\xb9\xdf\x8d\x70\xe1\x0d\x59\x42\x26\xe8\x70\x0e\x4d\xa7\xef\x42\xae\x76\x41\xf6\xa2\xa8\xc8\x58\xdc\x24\xf2\xd2\x91\x47\xde\xf1\xee\x6a\xcf\x69\xa7\x6f\x9d\x34\x91\xdd\x6d\x63\x56\x2a\xdf\x29\x53\xe0\x19\x02\xae\x04\xbb\xbb\x2d\x3c\x37\xab\x66\xc7\x12\xc1\x4c\x8c\x79\x7a\xd3\x24\x01\x5a\x54\x52\xb4\xa9\xc4\xf8\xe8\x62\xf9\x3d\xd3\x7b\x5b\xaf\x9f\x98\x82\x99\x97\x01\xb8\x95\x69\xac\xa8\x87\xb8\x41\x05\x42\x13\x03\x33\xf7\x60\xc2\x54\x1e\xee\x05\x96\xc3\x6d\x5f\x24\xe6\xac\x09\x50\x4e\x4e\xe7\x70\x9a\xf8\xa4\x26\xcc\x6e\xc4\x05\x92\x08\xeb\xca\xb5\x13\xde\x8b\x01\x68\x12\x37\x05\xcb\x8e\x44\x1c\x98\x53\x7b\x3e\x07\x40\x86\x30\x47\x27\x61\x90\xc5\x14\x21\x61\xb9\xc7\x1e\x45\x06\x4e\x3c\x18\xc5\xd1\x8a\x08\xa3\x9d\x3d\x83\x15\xe4\xdf\xf7\x03\xa6\x0e\x7a\xc8\x1a\xf6\x69\xc9\x1e\xd2\x72\x18\xa6\x06\xcf\xb7\x68\x56\x5e\xbf\x79\xfd\xb5\x07\xe3\x28\x2e\xbe\x74\xf1\x79\x34\x72\x6d\xa5\x5a\xad\xee\x2c\x1d\x5b\xda\x2d\x16\x4b\x9d\xa9\xc9\xa9\x3d\x59\x56\x62\x7e\x03\xe9\xe3\xf2\x19\xc0\xd0\x94\xd7\x2f\xbf\xfe\xc8\xfe\xf6\xde\xb9\x73\x67\x1e\x44\x33\x87\xe6\xba\x60\xdf\x7c\xdf\x76\x8a\x68\x5a\xe5\x99\x9d\xe6\x44\x71\x12\xc5\x34\x5d\x93\x35\x7d\x83\x11\xcb\x76\x3c\x45\x15\x4a\x3a\xb6\xe1\xe8\x4e\xf4\x43\x5c\x7a\x16\xff\x64\xe3\x85\x67\x68\x2c\x00\x9c\x2c\xe0\x4c\xa3\x71\x76\xd9\x07\x9e\x52\x94\x84\x60\xa1\x63\x75\xd0\x0f\x4d\xbb\x1f\x58\xf6\x28\xb0\x54\xa6\x17\x67\x0e\xcd\x6b\xfb\xed\x8d\x7b\xf6\xd6\x56\x9e\x68\x77\xf6\xd5\x7c\xb9\x7a\xe3\xfe\x93\xf7\x7c\xcd\x30\xf2\x3b\xdd\x5e\x9f\xdd\xde\xdc\x01\xaf\x37\xa1\xc5\x5a\x65\xa7\x58\x29\xad\xda\xa0\x53\xa3\x41\x9b\xc2\x98\xa7\xb9\x9b\x96\x37\x0b\x58\x53\x73\x4b\xdb\x5b\xb7\xbe\xf3\xe8\xcc\x91\x69\x18\xca\x1f\xa1\x7d\xda\x77\x72\xd2\x2a\x0c\x40\x16\xeb\xc1\x32\x40\x12\x8a\xcc\x63\x50\xf4\x0e\x38\xf1\x29\xc2\xf4\xee\x73\x0e\x02\xdc\xf4\x82\xc1\xa2\x8c\xdb\x7c\xa1\xe4\x07\xbf\x12\xc7\x61\x2c\x15\xa0\x01\xbf\x03\x57\x65\x1c\x62\x39\x70\xb0\xc0\x15\x04\x99\xca\xfc\x61\x9a\x01\x14\x16\xc9\x67\xbe\xce\x19\x6d\xca\x1c\x64\x3a\x66\xa5\x34\x63\xa0\x1c\xad\x24\x8e\x52\x14\xdd\x65\x59\x77\x02\xed\x7c\x46\xc7\x5c\x96\x66\x93\x2d\xa6\x96\x0a\xec\xa1\xec\x20\xea\x35\x4e\xb4\x08\xea\x90\x66\xf0\xc3\xd8\x81\x1b\xc6\x9f\xb2\xec\x5d\x3e\x27\x60\x50\x29\xa3\xe3\xd7\xfc\x31\xb3\xd6\x22\xcc\xc2\x52\x70\x21\x60\xbd\xe0\x9e\xa4\x91\x9f\xb0\x28\x34\x00\xc4\x24\x77\xd4\xc3\x93\xf5\x9a\x32\x3d\x39\x8d\x2e\x5c\x79\x3d\x5d\xdb\x5c\x89\xfd\x28\x88\x65\x59\x4d\x25\x59\x66\x60\x9c\x81\x91\x27\xc0\xd1\x52\x7c\xfe\xe2\x0b\x58\x52\xb0\x74\xe2\xd8\x19\x2e\x57\xa8\x5a\xb5\xd8\xc8\xf6\xc1\x0d\x4b\x98\x24\x93\x0c\xb0\x00\xbc\x24\xae\x4e\xfc\x91\x08\xb5\x10\xcc\x6b\xac\x1e\x2c\x02\x8a\x3f\x72\x7d\x34\xf2\x1c\x12\x78\x36\x4a\xe2\xa8\x5e\x2a\xd5\x8f\x9f\x3c\x79\xcf\xe1\xc5\x99\x66\xa9\x59\xca\x51\x43\x26\x49\x02\xdf\xeb\xdb\x01\xeb\x8e\x3c\xbc\xdb\x71\xd8\xc5\x95\x7d\x6b\x67\x67\xa7\xd8\xb0\xf0\x1e\x4d\x42\xee\xeb\xbb\x2c\x4d\x88\x50\x77\x7c\x60\x21\xa8\x88\x37\x72\x68\xe4\x31\x5b\x70\x31\xf1\xdc\x4c\x9d\xd9\x4e\x00\x2e\xaf\x8e\x3f\xff\xe7\x7f\x1c\xff\xf6\x27\x7f\xdd\x03\xf7\x29\x95\x34\x15\xdf\x01\xac\x08\x26\xf1\xbf\xaf\x7e\x0f\x7e\x79\xb2\x8f\x9f\xe9\xbd\x06\xe7\x97\x27\xd2\x38\x6e\xca\xd5\xb3\x53\x13\x0b\x15\xc9\x19\xec\xa5\xa7\x8e\xcd\x90\x91\x6d\x23\x2d\x8c\xc1\xa5\x52\x10\xf7\x89\xd3\x24\xc5\x80\xea\x68\xaf\xd5\xc2\x53\x8d\x09\x61\x11\x05\x3b\xe2\xe1\x02\xf8\x5c\x85\x01\xdc\x33\x6d\xe0\xcd\xcd\x11\x99\x9a\x2d\xce\xf8\x34\x77\xcf\xf4\x09\xed\x8a\x9f\x10\x8d\x53\x81\x31\x4f\x06\xa6\xa3\x81\xf6\x69\x7c\xfc\x44\x08\x61\x96\xe5\x86\x47\x46\x12\x8e\x4b\x36\xa7\xfc\x4a\xc6\xb8\xc7\x51\x98\xcc\xfc\x65\x73\x2b\xaa\x1b\x32\xc6\x8e\xc7\x1e\x90\x10\x5c\x59\x16\xf4\x1d\x8f\x19\x97\xd0\xf2\x4c\xe6\x84\x3f\x81\x33\xea\xce\xad\x38\x27\xd6\x59\xbc\x82\x5b\x69\x2e\x79\xb0\x02\x52\x3a\xf2\xf5\xb0\xe7\x96\x82\x81\x5d\x49\xdc\xb0\x08\x3e\xbd\x9e\x2f\xd4\x49\xe2\x8f\xcc\xd8\xf3\x8f\x2f\xce\x1e\x81\x5f\x47\x2f\x95\x2b\xe5\x57\x65\x49\x01\x92\x18\xa5\xe0\x0a\x4a\x1b\xcb\xab\x52\x10\x86\xdc\xf7\x97\xc6\x71\x42\x69\x6e\x7e\x91\xd4\x4a\xb5\xfd\x4e\x6b\x7f\xc7\x4f\xdc\x75\x58\xf8\xdb\xad\xb5\x2d\xc5\x50\x72\xcc\xee\x75\xf3\xb1\x1f\x2e\xe4\x9b\x05\x3e\xc6\x5b\x38\x08\xf6\x93\xdd\x08\x1c\x61\xa0\x79\x59\x90\x64\xac\x0f\x07\x9e\x06\x66\xf4\x0e\x42\x89\x29\x17\x67\xa1\xe2\x2e\xf2\x73\x59\x5c\x59\xe8\x19\xe1\x49\x36\x12\xc7\x09\x01\x32\xa7\x8d\xfa\x23\xcb\x19\xda\x25\xdf\xf5\x0b\x49\x94\xe6\x8f\x2e\x1e\x55\x37\x37\x6f\x1e\x63\xae\xff\xc1\x66\x63\x36\xa9\x4d\xce\x3e\x55\xac\x35\xce\x77\x7a\x83\xf0\xda\x8d\xdb\x5a\x18\x45\x48\x56\x94\x48\xcb\x19\x4a\x10\x85\x2a\x20\x55\x12\x45\xb1\x11\x8d\xdc\x62\x14\x44\x26\x0f\xc9\xaa\x3c\xb4\x57\x56\x8b\x9e\x63\x97\x58\x92\xe8\x00\x90\x35\x29\xf2\x0d\x5d\xc2\x6a\x46\xf9\x84\x02\x8b\xf5\x1c\x03\x13\x4f\x89\x33\x1e\xe1\xa7\x99\xdb\x9a\x66\x11\x23\x60\x61\x12\x15\x19\xa3\x94\x26\x92\x1c\x25\xb2\x90\x07\xb8\x14\x95\xa9\xea\x94\x5c\x98\x97\x65\x6a\x25\x29\x8d\x5b\x38\xda\xb0\x65\xda\x95\x13\x62\xc0\x19\x14\xf8\x95\xc4\xb1\x0c\xd4\x1c\xc4\x8b\xc5\x32\x93\xb8\x3a\xea\x70\x46\x99\x66\x21\x24\x1a\x11\xe6\x47\x48\x04\x73\xf8\xba\xb0\x04\xa6\x49\x49\x89\x0e\xa7\xd4\x13\x80\x10\x9f\xa4\x4e\xc4\x0d\x3d\x1a\x97\x0b\x66\x4e\x12\x1e\x13\x21\x92\x31\x3f\x9c\x61\x8a\xf0\x65\xd8\xb8\xb4\x30\x03\xa3\x0c\x9e\xd2\x0c\xb4\x0e\x32\x5f\xc2\xcd\xa2\x82\x65\xf1\xa3\xc1\xd8\x13\xd0\x0d\x96\xc1\x01\xe5\x8c\x05\xae\x5d\x60\x9b\x48\x0a\x48\x3c\xf9\x8c\x32\x43\xcb\xe5\x95\x1f\x81\x66\x7e\x1c\x5f\x56\x05\x26\x8d\x5c\x59\xbd\x1c\x5e\x5f\xbf\x46\x87\xa3\x41\x4c\x64\x35\x91\x4c\x33\x61\x8a\x9a\x26\x22\xa4\x96\x82\x81\x80\xef\x61\xc4\xe7\x84\x3c\xf3\xca\xb3\xa9\x1b\x85\xd2\xbd\x6f\x39\x87\x42\x18\x57\xa9\x56\x40\xae\x17\xf2\x7a\x43\xc6\x15\x24\x03\x29\x00\x2b\x99\xbb\x79\x24\xf3\xbb\x25\x3c\x46\x6b\x3e\xbe\x18\xbb\xce\x80\x38\xf6\xa0\xa0\x68\xe5\x33\x73\x87\xcf\x1e\xa9\x57\x0a\x85\x53\x87\xa7\x40\xb8\xd3\x98\x87\x80\xc0\xfd\xe7\xee\x26\x1a\xba\x11\xdb\xe9\xda\xe8\xe6\x66\x17\x9d\xbf\xd1\xc2\x9f\x59\x59\xa9\x7f\xe4\xd1\xea\x72\x41\xd7\x75\x15\xc7\x36\xf7\x82\x88\x30\x0e\x6c\x2c\xcb\x62\x02\x39\x4e\xb3\x5a\xc5\x60\xf5\x72\x19\xd9\x70\x0c\x3e\xcd\x9f\xfa\xc3\x4f\xc4\x9f\xfe\xf4\x27\x1c\x40\x53\x5f\xd6\xb4\x84\x07\xb7\xee\x32\x2c\xac\xa1\x5e\x74\x98\xad\x39\xbf\x2a\x05\x71\x6c\x49\x48\xaa\xc0\xb2\x96\xcb\xe5\x23\x66\x07\xc7\xf4\x3e\xf0\x81\x8b\x86\xca\x3a\xbd\x04\x5f\xbc\x72\x85\xf1\xe2\xca\x46\xbd\x86\x27\x1b\x93\x22\xc2\x7f\xe3\xf6\x0a\x7b\xf0\xde\xfb\x40\xcf\x42\x41\x60\x78\x70\x4e\xd5\x0c\xcc\x03\x41\xe0\xd2\xa2\x5a\x27\xa4\x9d\x52\x4e\x0b\xb7\xf4\x46\xdf\xdd\x7a\x85\x62\x05\xc3\xef\x39\xff\x04\xc0\xf3\x25\x9a\xd1\x1f\xee\xde\xc3\x0c\x61\x4c\xc7\x71\xca\x94\xa7\x54\xb9\x4f\xc3\x0d\x70\x16\xd2\xc0\xe2\x75\x46\xdd\xc7\x6b\x9a\x25\xb2\xc7\x74\x3e\x0b\xd6\x66\x61\x54\xae\xbb\xdc\xa5\x1a\x13\x7f\x21\x69\x34\x8b\x99\x0a\x50\x1d\xe7\xc9\x0f\x62\xd1\x77\xca\x40\xc4\x89\xa8\x1f\xc3\x14\xfb\x4a\x98\x26\x46\x9c\x52\x13\x5c\x19\x1d\xb8\x97\xd2\x98\x9a\x88\xf7\x07\xfb\xf3\x95\x62\x23\x0f\xac\xaa\x6f\x58\xf2\xcb\x5b\x5b\xeb\x6e\xaf\xd3\xe5\x66\x86\xe3\x46\x32\xf6\x10\x64\x18\x86\x02\xcf\x14\xe0\x64\x2a\x68\x48\x74\xf2\xe8\xb1\xd7\x4f\x1e\x3d\x7e\x81\x67\xe4\xd6\x6f\xdf\x52\x5c\xdb\x96\x9b\x87\x9b\x61\x7f\xd8\x99\xcc\xe7\x8a\x39\x59\x96\x1d\x58\x95\x15\x05\xc7\x6d\x16\x8a\xc1\x66\xf0\x23\xe0\x95\x47\xd7\x60\xf9\xc6\x35\x66\x32\xe1\x6e\x27\x90\x10\x7e\x9e\xcc\x1a\x0a\x29\x13\x0b\xc0\x55\x9c\x1b\x0d\x9c\xa5\xa0\x41\x65\x88\x9b\x06\x6a\x90\x38\x16\x8e\x9d\x32\x49\xfd\x32\xa1\x41\xae\x94\xcf\xab\xe0\xc1\x6b\xaf\xbc\x76\xe9\xd1\xc7\xee\x7b\x1c\xe7\xab\xa5\x97\xa9\x86\x9f\xf7\x3c\x5f\x2d\x15\x55\xad\x52\x3e\x9c\xd5\xce\x24\x4c\x4f\x40\x74\x25\x83\x04\xa0\xbe\x9a\x37\x4a\x0a\x8e\x82\x8a\x72\x4c\x73\x70\x6c\xd6\x28\x98\xa9\xa2\xc6\x35\x43\xd5\x8b\x92\xa2\x06\xba\x25\x75\x66\xca\x46\x1e\x9e\x9f\x02\xc3\x67\x81\x48\x62\x49\x57\x3c\xa5\x24\xef\xf1\xeb\x01\x43\x27\x51\x41\xb5\xc0\x07\x09\x48\x11\x66\x2c\xcf\xc6\xab\x90\x32\xce\xda\x29\x8f\x49\x25\x3e\x0b\x46\xc0\x06\x08\x96\xe5\xa4\x90\xe6\xa7\xfa\x3b\x3b\xe7\xb4\x54\x3a\x95\x2f\x56\xbb\x47\x72\xf2\xd7\x91\x2a\x0f\x71\x90\xd6\x40\x6f\x8a\xdc\x28\xc0\xb2\x85\xa1\x82\x5a\xb1\x24\x0d\x54\x8a\x2d\x29\x4a\x2b\x8c\x26\x79\xbe\xd6\x70\xba\x38\x94\xf1\xfe\x40\x4d\x37\x5c\x14\xdb\x3c\xd5\xac\xa6\x8a\x51\xf1\xd0\x09\x29\x4d\xeb\x9c\x50\x0f\x65\xba\xe9\xc8\xa4\xa5\xa4\x18\x40\x37\x55\x05\xb0\x82\x36\x25\xf0\xd9\x48\x65\x5d\x87\x24\x36\x8f\x61\x8a\xd0\x45\xc2\x0d\x36\x0f\x53\x27\x9c\x28\x02\x66\x62\x99\x5f\x27\xc7\x1f\xf8\x1d\x05\x03\x91\x00\xb2\x23\xf8\x98\x50\x01\x78\x94\x9a\x48\x51\x67\xd4\xe2\x0c\x46\x60\x3c\x92\xc4\xe9\xc7\x71\x77\x52\xb3\xea\x8a\xc2\x34\xc0\xb2\x14\x78\xd4\x68\x07\x3b\xfb\x36\x8b\x3d\x2c\xa2\x22\x29\x4a\xe3\x10\xf0\x2d\x48\xe2\xd0\x8b\xd3\x38\x82\x53\xc4\x12\xe7\x9c\x5c\x3d\xea\x53\x65\x5e\x68\x95\x10\x45\x49\xc0\x55\x49\x85\x5b\x9d\xc6\x69\x1a\x05\x28\x0d\x03\x80\xde\x48\x49\x61\x0c\x97\xae\x5f\x66\x31\xa5\xe4\xdc\xd9\x07\x31\x01\x6d\x2b\x15\x0b\x3c\x73\x8d\x79\xc6\x8e\xe3\x20\x4f\x0c\xf1\xe4\xab\x44\x44\x4e\x42\xd4\x72\x71\x25\x88\xfc\x50\x1a\x0d\x3a\x5a\xab\xb5\x99\x73\x1d\x6f\xee\xfd\xdf\xff\x2f\xce\xbe\x78\xfe\x55\xf6\xc2\x33\x5f\x8b\x0e\xfd\xd8\xff\xc0\xc0\x07\x15\xe4\x9d\x03\xb3\xe3\x45\x68\xaf\x6f\xb3\x6b\x9b\x03\xf4\xd2\xed\x36\xda\xe9\x79\x89\x54\x9e\xb2\xce\x6f\x77\x16\x1f\x99\x4d\xf7\xaa\x85\x66\x2a\x61\x91\xe0\xe0\xb3\x25\xac\x01\x9f\x3f\x0e\xcf\x95\x52\x9e\xe9\xba\xc6\x3a\x00\x76\x23\xdb\x41\xbf\xf7\xa9\x8f\xc7\x7f\xf9\xa5\xcf\x02\x3b\x52\x7d\x90\x21\x1f\x06\x94\x62\x99\xdc\x75\x09\x15\x64\xa0\x3f\xf6\x3e\x86\xb6\xbd\x5b\x44\x45\x8a\x01\xcb\x54\xa0\xbc\x2c\x44\x2d\x4b\x9d\x30\xa2\xe5\x22\x66\x36\xb8\x78\x45\xab\x00\x3e\xa6\x81\x56\xd7\x37\xd0\xb3\x2f\xbf\x82\x36\x76\xb6\xf1\xce\xf6\x0e\x7a\xea\xeb\x5f\x43\xb5\x72\x0d\x35\x6a\x35\xf4\xf2\xa5\xd7\x91\xae\x69\xf8\x91\x7b\x1e\x40\x39\xd3\x44\x86\x42\xb0\xd3\x1a\xf2\xd4\x6a\x7a\x7d\x79\xf7\x84\x73\xfd\x45\x0d\x26\x3c\x2c\xab\xea\x33\xb5\x89\x5a\x70\xe6\xf8\xc3\x54\xcf\x99\x38\xe4\x26\x4c\x52\xc0\x1b\x93\x40\x3e\x65\x1c\xf3\x9a\x58\x90\x67\x89\x07\x84\x50\xca\xaf\x14\x73\x1f\x9a\x65\xfc\x7e\x9c\x90\x21\xc2\x0a\xf1\x77\x44\xb9\xa8\x08\x3e\xf0\x85\x46\xd9\x73\x8e\x5a\x54\xac\x09\x16\xb0\xcd\x59\x5b\xe6\x4b\xc1\xeb\x34\x0b\x5d\xd3\x71\x20\x38\x0b\x5c\x64\xe0\x17\x27\xd2\xc8\x1d\xe8\x5d\x2f\x31\xfa\x40\x87\xbd\x28\x46\xbc\xfe\xd5\x50\x4d\x24\x99\x85\xa4\xbb\x7a\xeb\xd8\x91\xe6\x51\x98\x29\xfd\x9a\x1b\x26\x03\x8a\x4c\x3c\x39\x5f\x4c\xc6\xe5\x0f\x24\x89\x53\x79\x34\x18\x49\xae\xeb\xf2\x24\x2d\x5a\x58\x3c\x82\x54\x5d\x6a\x06\x61\xda\xd4\x0c\x6d\xcf\x09\xa3\x56\xdf\xf5\x64\xb3\x58\x26\xc5\x46\x55\x5e\xbb\xb2\xb6\x34\x5b\x9f\x47\xb0\x28\x9b\xaa\xa5\xf6\xb0\x81\x48\x90\x44\x95\x04\xc6\x01\xe4\xc1\x00\xf8\x2f\xe0\x54\x2a\x81\xaa\x58\x99\x50\x52\x1e\xf8\x74\x0c\x8b\x6c\xab\x39\xd4\x11\x21\x87\x03\xbf\x70\x1c\xeb\xcd\x42\xc6\x59\xf0\x85\x45\x31\x61\xa1\x9f\x4b\x7d\xb7\x94\x06\x41\x99\xc6\x51\x01\xa4\x99\x67\x94\x11\x4f\xfa\x0c\x47\x43\xe3\xd6\xc6\x32\x3a\xa6\x9d\x58\xa4\x1e\x0f\x99\x32\x92\x97\xb3\x6c\xb1\x2a\xab\x48\xce\x69\x0e\xc8\xc4\x1e\xf0\x83\xdc\xc0\xe9\xf5\x52\x7b\x68\x30\x2f\xb4\xca\x86\xa5\xea\x86\x9e\xd4\x8a\x16\xbb\xbd\x7a\xe3\x50\xad\x54\x97\x55\x5d\xdb\x48\x70\xdc\x61\x7d\x6f\xc9\xf5\x7a\x55\x58\xa3\x3a\x00\x76\x2e\xc2\xfe\x6d\xbf\x17\xbd\xe4\x27\xbe\x9d\x86\x54\x33\x64\xab\xa0\x4b\x46\x05\x94\xba\x16\x7a\xfe\x21\x58\x17\x43\xd4\x22\xe9\xa6\x28\x72\x04\x26\xb1\xea\x3b\xfd\x95\xde\xa8\x17\x69\xe0\x1e\x68\xd5\xc9\xca\xf2\x8d\xcb\xc7\x4f\x4c\x1e\x3b\x2c\x59\x28\xef\x7b\xee\xb5\xfe\x6a\xfb\xed\x1b\xeb\x2b\x4d\x77\x34\x6a\x1e\x5f\x3c\x89\xa6\x9b\x73\x2e\x93\xe9\x73\x88\xc6\xc3\x61\xbf\x7f\x68\x6f\x7b\xb3\x39\x1a\xf4\xa7\x27\xab\x53\xf8\xe8\xe1\x13\x8e\xa6\xc9\xd7\x90\x17\xbc\xe4\x8e\x76\xd7\x03\x1a\x07\x35\x6b\xaa\xde\x6d\xed\x9f\x56\x43\xfa\xde\x43\x0b\x4b\x7d\x39\x8d\xbe\x58\x0a\xe8\xa1\x24\x88\xab\x49\x10\xd5\x41\xf6\x24\x5d\x37\x00\x8a\x48\xcb\x0f\x92\xd5\xae\x1c\xde\x1c\x21\xa7\x05\x7e\x92\x02\x70\x04\x74\x0e\xc6\x8b\x73\x66\x49\xb1\x8a\x05\x49\x2d\x11\x42\x0d\xb0\xb1\x18\x14\x31\x09\x10\x05\xbf\xa4\xbb\xe7\xc4\x76\x20\x5c\x51\x2c\xd1\x39\xb3\x31\x53\x96\xa4\xfb\x0c\x59\x9b\x4d\x15\xe9\x5a\x44\xd9\x6e\x1a\x78\x8b\x80\x21\xf3\x56\xbe\xc0\xf3\x13\xeb\x7d\x1a\xdf\x5c\xd7\x82\x0b\x9e\x9c\x8c\x40\x25\x24\xee\x6a\x45\x51\x20\xc5\x71\x88\xc2\x90\xb3\x8f\x34\x11\x64\x8c\x80\x12\x4b\x40\xa4\x64\xb0\x89\x22\x08\x85\x09\x2f\xfc\x05\x94\x44\x51\xe0\xa5\xa1\xef\xc0\x15\x7a\x00\x2a\x01\x4e\xf5\x10\xaf\xdd\xbe\x81\x9b\xb5\x49\x72\xea\xf8\x29\x16\x79\x21\x2b\xe4\x0d\x56\x32\x74\xcc\x8f\x09\xfe\x18\xe5\xa9\x0e\x9e\x55\x14\x01\x75\x81\x27\x29\xa8\x41\x80\x87\xdd\xbd\x7c\xbb\xb5\x3d\xd1\x6e\x6f\x17\xbe\xfc\xa5\xdf\x1f\x78\xda\xf1\xfc\xe6\xab\x17\xe8\x85\x5b\xbb\xc8\xca\x97\x58\xe0\x7b\x08\xc0\x0c\xed\x0d\x03\x76\xb3\xe3\xa0\x1d\x17\xc8\x50\xb1\xc8\xee\x5d\x6c\xa0\x6a\xce\x48\xbd\xce\xce\xcc\xca\xee\xa5\xb9\x43\x73\xf3\x9b\x8d\xc9\x66\x04\xc6\x8a\x27\x85\x01\xc7\x53\xa6\x2a\x32\x2e\x16\xf2\x22\x0b\xb8\xdb\xea\x23\x55\x35\xd8\xdf\x3c\xf7\x25\xfa\x97\x7f\xfa\x59\x07\xe7\x54\x1f\xd0\xd5\x07\x11\x0c\xb9\x6b\xcf\x51\xf4\xcd\x41\x77\x5e\xc7\xc2\x53\x70\xb0\x06\xf0\xc4\xe0\xe3\x0f\x62\x00\x1b\xb0\xe1\x12\x4d\xd0\xda\xd6\x16\xca\x15\xaa\x20\x4c\x0a\x5a\x9c\x9d\x17\x15\xac\xdd\x7e\x9f\xfd\x83\x8f\xfe\x10\x5a\xbb\x74\x11\x7d\xe4\x9f\xff\x00\x7a\xec\x7b\xde\x85\x7e\xe7\x67\x7f\x1b\x26\x36\x60\xff\xf2\xe2\xbf\x42\x3a\x88\xf9\x89\xca\x2c\x42\x53\x39\xd4\xef\xb6\x93\x47\xbf\xe7\xe8\xcc\xff\xf2\xe8\xef\x2c\x2e\xef\xac\x24\xa7\x7e\xfa\xcc\x5b\xe2\x3f\x09\x5f\xff\xee\x63\x3f\xfa\x47\xa7\x4f\x3f\x86\xcb\xf9\x02\xc9\x03\x37\x4f\xd2\x90\xb8\x52\x82\x4b\xa6\x0a\xe0\xa0\xe0\x04\xac\x56\x31\x57\x22\x2c\x07\x63\x8c\x63\x5e\xe0\x46\x80\x6b\x70\x11\x20\x22\xd7\x9c\xf1\x27\x22\x00\x8a\x64\x01\xc7\x2c\x7f\x8b\xb2\x4c\xd2\x01\xc0\xf1\xc0\x86\x70\x1c\x09\x47\x2d\x00\xb2\xac\x7f\x48\xb8\x2a\x59\xdc\x41\x3c\x72\xda\x3f\x1a\x3a\x72\x77\xbb\x9b\x6f\x6f\x77\x54\x77\x30\xca\xc7\x51\xa4\x81\xbb\x97\x54\xe6\x9a\x69\xbb\xd3\x9b\xd4\x25\x6d\xb2\x5c\xaa\xf8\x3e\x62\x4f\x83\xa2\xc5\xd5\xda\xa4\x05\xce\xdb\x14\x1c\x4c\xe1\xa9\x65\x70\x0f\xd3\x5c\xce\xdd\xbb\x7a\xf5\xaa\x27\x63\x20\x57\x44\x21\x37\x97\xaf\x3f\x76\x64\xfa\xe8\x0c\x4c\xeb\x73\x14\xc9\x6b\xae\x9f\x68\x05\xcb\xc2\xbd\xd1\xd0\xa4\x31\x9d\xb7\x72\x79\xee\xba\x2d\x8f\xfc\xa0\x33\xea\x8e\x24\x1a\x31\xab\x60\x14\x2b\x8a\x42\xaa\x51\x64\x4f\x77\xda\x7b\x8b\x8e\x3d\x9a\x37\x75\x53\x9d\x6d\x2e\x24\xaa\xa6\xad\xd9\x7e\xfc\x0a\x71\xf0\x79\xe0\x16\x1d\xb0\x73\x52\x96\xb8\x1a\xd7\x14\x61\x34\x0e\x46\x53\x04\x63\x27\x76\xdf\x96\x06\x3d\x5b\xf5\x1c\x5f\x85\xeb\x91\xc0\x25\xc3\x71\xdc\x43\xd5\x7a\xc3\xbd\xf7\xec\xb9\xe7\x5e\x79\xe5\xa5\x47\xae\x2d\x5f\x99\x04\x33\x31\xc9\x0e\xea\xcd\xe0\x30\x26\x18\xa8\x63\x87\x4f\xa2\xa3\x87\x8f\x8f\x88\x4c\x5e\x54\xa8\x7c\xd9\x1b\x8d\x92\xb2\x55\x53\x2b\xf5\x0a\x4f\x32\xe4\x7d\x7f\x94\x84\x4e\xb0\x68\x96\x61\x9d\x07\x6d\x65\xaf\xb3\xfb\x5d\xc3\xc1\xa0\xd4\x6a\xb7\x4c\x19\x16\x6c\x69\xf1\x18\x9a\x39\x3c\xd7\x73\xba\xdd\x5a\x7f\xd8\xb3\x6a\x85\xa9\x12\x53\xa3\xea\xda\xce\xfa\xa9\xf6\xde\xfe\x89\x4e\xa7\x6d\x79\x9e\xc7\xdd\x40\x74\xf6\xe4\x39\xc4\xc1\x27\x55\x13\x85\xd0\xb8\x3b\xec\xb4\x58\x25\x5f\xc3\x71\xce\x29\x0c\xfb\xdd\x09\x32\xa7\x20\xdb\x19\x2a\x37\x6e\x5d\xf9\xde\x9b\xb7\xae\x9b\xe0\xf9\xb9\xe0\x6a\xf4\x2f\x5e\x7f\xbd\x5c\xb0\x78\xb1\x0e\x7a\xf7\xcd\x95\xab\x6c\xf9\xf6\x0d\x15\x7c\xbf\xd4\xb0\xac\x4e\x7b\xd0\x31\xc0\xd0\x5a\x87\xe7\x97\xee\x37\x94\x64\x4d\x8d\x1d\xf0\x72\x3a\x11\xe0\x8c\xee\xd8\x9d\x52\x32\x8c\xe5\xa3\xf3\xc7\xea\xe0\x8f\x3c\xd1\xda\xdb\xce\xad\x6f\xac\xe6\x47\xc3\x81\x10\xaf\x89\xfa\x14\xba\xef\x9e\x87\xd2\x7a\xc1\xb8\x9e\x23\x91\xd2\x63\x3e\xb1\x53\x3b\x94\x53\xd5\x2c\x1b\x8d\x8a\x2a\x69\x15\x00\x88\xb9\xf6\xce\xfa\x22\x00\xc1\x4c\xa9\x50\x26\xd3\x93\xb3\x01\xd8\xb0\x6b\x15\xbd\xfc\xca\x7a\x7b\xb4\xe3\x78\x4e\xaa\x4a\x3a\xa9\x99\x4a\xfd\xf6\xf5\x4b\x0f\x9c\x9e\x3d\x7d\xdc\xca\x15\xd4\xab\xcb\x97\x1e\x5c\xbe\x76\xf5\xde\x14\xdc\x75\x3e\x47\xa7\x4f\xdc\xe7\xeb\xaa\xfa\xd7\xba\x94\x46\xed\x52\x7c\x3e\x46\x22\x69\x47\xc0\x6e\xd1\x28\x92\x19\x20\x1a\xe0\x64\x3a\x4e\xbe\x48\x94\xe7\xb3\x79\x6e\x95\x09\xbb\xcc\x38\xd7\x63\x51\x98\xd2\x10\xa7\x0c\xf8\x15\xf3\x01\xdb\xc2\x38\x64\x5e\xea\xc8\x33\xb5\xbc\x7c\x6e\x69\x1e\xdc\xbe\x00\x00\x2e\x65\xd8\x8d\x99\xac\x2b\xac\x94\x33\x41\x4b\x64\x9a\x82\x51\x16\x49\x53\x60\x9e\xbc\x4c\x82\x73\xc6\x48\x06\x77\x3a\x76\x49\x18\x38\x26\xbc\x61\xde\x78\xf9\xf3\x7e\xee\xdc\x51\x6d\xe8\xab\xf8\xe9\xa7\x9e\x45\x93\x27\x1f\x64\x9d\xfd\x1e\x1a\x46\x14\xb9\xaa\xca\x4c\x00\x9f\xfb\x16\x2d\x34\x55\xd4\x90\x0a\xc7\xea\x0f\x1c\x69\xbd\x37\x34\x7b\x1b\xed\xfa\x13\x8f\x48\xb8\x5c\x28\x24\x00\x90\x84\x57\x02\xe8\x06\x6f\x23\xc2\x14\xbe\x83\xfa\x43\x17\xf1\xba\x2e\x09\x70\xe9\x3b\x3e\xf0\xed\xe4\x2b\x5f\xfe\x0c\x03\x0f\x24\xc2\x06\x89\x10\x0f\x70\x67\x2e\xd1\x9b\x01\x0b\x1f\x18\x65\x4e\xb8\xe0\xce\xdd\x8f\x24\x1d\x50\x43\x92\x90\x9f\x62\xb4\x74\xe8\x10\xea\x3a\x01\xa7\xf3\x28\x4c\x63\x14\xc3\xe3\x44\xb5\x8a\x7e\xf1\x5f\xfd\x3c\xfa\xa1\x9f\xfe\x1f\xd1\x5e\xe1\x06\x7a\xf9\xeb\x2f\xa0\x9f\x8f\xfe\x2f\x5e\xc4\x81\xfe\x4a\xfe\x0b\xa4\xbd\x3d\x45\x37\xd5\x22\x32\x80\xb7\x0d\x7d\x07\x6f\x5f\x38\x94\x1a\x97\xb0\xbf\x1f\xec\x23\x79\x81\xcd\xc7\x6b\xe9\xce\xe7\x9e\xff\x75\x96\x1c\xf1\xd8\x13\xcd\xc7\xa9\xb2\x26\x21\x7b\x04\xbf\xb1\xbb\xe8\x2d\x15\x82\x02\xb8\xef\xb4\x06\xe8\xfe\xc9\xfb\x50\x30\x17\x23\x7f\xcd\x46\xd8\x32\xb1\xaa\xc1\xc5\x01\x30\xb8\xed\x10\xfb\x91\xcb\x03\x5c\x48\x91\x64\x4c\x89\x28\xbc\x05\xef\x9d\x21\x17\x50\x1b\x83\xff\x2d\xf1\xac\x08\x21\xa2\xa5\x61\x3d\xde\xc0\x3b\xfd\x6d\x70\xa7\x00\xad\x75\x0d\x0d\x07\x7d\x6e\x98\x84\x6f\x68\x15\x8b\x22\x97\xa4\xc6\xc0\xf2\x46\x92\x1e\x7b\x31\x50\xf0\xd4\x04\x49\xc8\xf3\x58\x54\xb5\x50\x0f\x6b\xd5\x82\x7d\x75\xe5\xd5\xb7\x4e\x55\x26\xd4\x30\x0a\x7b\xbd\x41\xe7\xdd\xbb\xad\xad\xe9\x6e\xaf\x5d\x0c\xc2\xa0\xc0\xb3\x1c\x00\x28\xe8\xd8\xe2\x71\xda\x68\xce\xfd\x47\x38\xcf\x8a\x0e\x7c\xbd\xdd\xd9\x5e\x64\x71\x3a\x4d\x24\x12\xf8\x91\xff\xf2\xee\xee\x0e\xe0\xd4\x48\x3f\xb2\x70\x34\xdc\xdd\xdd\x7a\x5b\xb9\x50\xd1\x60\x1c\x83\x20\x8d\x2f\x2c\xaf\xdd\xee\x84\x76\xa8\x1e\x9a\x3d\x52\xf4\x03\xa7\x31\xec\x7b\xef\x1a\xf5\xba\x6f\x59\x5e\xbb\x89\xfc\x38\x8c\xb0\x48\x27\xc7\xfa\xa9\x23\x6f\xa9\xb3\x34\x72\x1d\xe6\x5d\x8c\x75\x77\x00\xbe\xa2\x7a\xa7\xb3\x49\x12\xb5\xac\x98\x64\xa1\x08\x1c\x27\x11\x8d\x88\xcb\xf3\x83\xe0\x08\x84\x3c\x32\x41\xe1\x3b\x69\xc4\x42\x74\x7b\xed\x1a\x59\x5a\x3a\x7e\xf5\x3d\xef\x7d\xef\x5e\xb7\xd7\x9d\xa0\xdc\xd8\x1e\xc4\x03\xe1\x5c\x8e\x63\xeb\xd7\xd7\xaf\x1e\x2f\x14\x8a\x95\xa9\x89\xe9\x87\x80\x52\xed\x48\xaa\x66\x17\xeb\x55\x76\xf5\xe6\xd5\xd3\x17\x5e\x7b\xed\xec\xec\xd4\x2c\x5a\x5a\x3c\x8e\x2e\x5e\x7f\x15\x6d\xed\x6d\xcd\xf2\x9e\x32\xdd\x34\xed\x42\xa9\xb8\x5d\xad\xd5\xdb\x5a\x3d\xdf\x0e\x08\xdd\x6a\x0f\x83\x5c\x25\x3f\x5b\xa1\x8a\x54\x81\xdf\xbd\xbd\xb5\xbd\xd3\x74\xc0\x42\x17\x6a\xd5\x9d\xf9\xd3\xc7\x37\x79\x3c\x63\xe4\xd9\xe7\x82\x28\x50\x98\xa5\xed\x75\x07\xb1\xe2\x86\xe0\x46\xcd\x4c\xc5\xdb\xed\x56\x53\x66\x4a\x71\x6b\x77\x0d\x6d\x6c\xaf\x97\x53\xc2\x86\xa7\xdf\xfa\xd6\xa7\xea\x93\xcd\x75\x90\x85\xe8\xf9\xbf\xf8\xca\xf7\x5f\xbf\x7d\x25\x0f\x6b\xa1\xf8\x49\xe4\x1d\xb9\xf7\xdc\xcb\x95\xc6\xe4\x56\xb9\xd6\x68\xad\x2d\x5f\x3b\x6a\x8f\xec\x27\xa2\x24\x06\x5f\x4b\xa3\x5d\xdb\xd0\x7b\x03\xcb\x6c\x4e\x17\xd2\x30\x91\x54\x96\xb8\xe8\xc2\xb5\x57\xd0\xad\xb5\xe5\x49\x31\x9e\x7a\x7d\x6d\xe1\xec\x7d\x1b\x8a\xa6\xf9\xbb\x9b\x6b\xcd\xcb\x37\x2e\x9e\x79\xeb\x7d\x6f\x3f\x45\x70\x69\xc7\x76\x92\x4e\x7f\xa0\x46\x8b\x13\x33\xe5\x30\xb4\x67\x43\xc7\x7b\xdb\xfe\xd6\xc6\x3c\x80\x2f\xb0\xf0\x24\x52\x55\x15\x94\x55\xad\xcc\x4c\xcd\x37\x43\x45\xea\x20\x5c\x76\x07\x43\x97\xe5\x35\x45\x66\xb2\x26\x0f\x86\xa3\xe2\xa8\x32\x44\xfb\xbd\xd6\x23\xb7\xaf\x5f\x47\x7a\xb1\x78\xb3\x39\x7f\xe8\xda\xea\xf2\xf5\x33\xbd\xe7\x7b\x8b\xf7\x9d\x7d\xf8\x2c\x29\x19\x2f\x24\xa9\x46\x02\x92\x84\x9c\xfd\x73\x91\x66\xc2\xbe\x02\x79\x00\x07\x95\x1e\x44\xf2\x79\x4d\x11\x80\x13\x0f\x59\x73\xbf\x53\x02\x37\x55\x49\x42\xcc\x80\x22\xa6\x91\x2f\x45\x91\x97\x50\x7f\x48\x13\x67\xa8\xbe\xf5\xfe\x07\x58\xb3\x94\xe7\x9d\x0c\x4c\x56\x25\xca\xd9\x94\x0c\xe6\xdc\x60\x11\xcb\x19\x26\xd3\x2b\x26\x03\x79\xe5\xe4\x9d\xbb\x86\x94\x87\x21\x64\x12\xa0\xbd\xfd\xa2\xdb\xea\x68\x9e\xeb\xcb\xa5\xc4\x1f\xc4\xce\xd5\x3f\x0f\x72\xc6\x84\x7e\xeb\xc2\x6b\x6c\xcb\x99\x64\x52\xc1\x40\xe5\xb9\x32\x3a\xbb\x50\x46\x8b\x8d\x1c\x2a\x19\x32\x4a\x00\x5e\x56\x57\xb7\xe4\x5b\x2f\x3f\x3d\x3c\x9c\xf4\x5f\xfb\xf0\x3f\xfe\xd0\x8b\xc7\x8e\x9d\x70\x61\xc8\xa4\x54\xc8\x8b\xe8\xb1\x07\xe6\x7e\x30\xf2\x04\x8e\xf0\xcc\x20\x60\xab\x60\x5a\x33\x53\xb3\xf8\x87\x7f\xe8\xc7\xf4\x7f\xf9\xb3\xff\x53\x9f\x46\x09\x15\xa5\x02\x3c\xba\x01\x80\x26\x7f\xd3\xb6\x0d\x40\x81\x68\xb4\x91\x14\xb1\xa2\x75\xc1\xf4\x83\xbf\x2b\x08\x4c\x32\x6e\x67\xe0\xad\x12\x21\x08\xe6\x89\xa5\xa3\xe8\x27\x3f\xfa\x4f\xd1\xbf\xfe\xe2\xbf\x40\xc3\x4e\x0f\x7d\xe2\xcf\x7e\x09\xa1\x12\x7c\x7e\xaf\x8c\x8c\x6b\x1a\xba\x91\x03\xe1\x05\xb8\xe5\x25\x2e\x6b\xc3\x97\xd0\x93\x37\xbe\x86\x62\x0f\x4e\x90\x47\xe0\x67\xa1\x64\x81\x1e\x47\xef\x9e\x7f\x07\x72\xf1\x00\xc5\xbc\xb5\xa2\x8c\xf1\xa1\xea\x0c\x8a\x0a\xc0\x76\x12\x1b\xcd\x4c\xeb\xa8\x9d\xf0\x96\x0e\x38\x80\xce\x2b\xe4\x47\xc0\x27\x19\x92\x81\x50\x60\x15\x90\x95\x84\x02\x67\xa3\x24\x14\x21\x5c\x0e\xd3\x04\xcb\x68\xdf\xd9\xc4\x2d\xb7\xc5\x02\xd7\x43\x92\x2a\xa3\x01\x58\x4c\xcd\xd2\x60\xfc\x22\xc8\x85\xe5\x38\xc2\xa9\x4a\xc1\x6d\x35\x08\xcf\x76\x22\x0d\x26\x4e\xd3\x49\x3a\x62\x4a\x8c\xe3\x7c\x8a\xd3\x32\x25\xac\x44\x19\x35\x35\xdd\x50\x0f\x9f\x5c\x64\xb7\x76\xae\xbd\xd3\xf7\x9c\x77\xda\x9a\x81\xbe\xf4\xe4\x9f\x56\x6c\xd7\x7e\x58\x56\xb5\x6e\xa9\x58\x5e\x2b\x56\x6a\x6d\xa0\xf5\x6b\xf0\x7d\x25\x91\x49\xec\x86\x5e\x2f\x8a\x43\x6b\x7a\x61\x26\xda\xd8\xb9\xf1\xc0\x7c\x7d\x9e\x47\x96\xb6\xec\xd0\x6f\xed\x75\x5a\x66\xce\xb2\x24\x02\x68\x66\xef\x0c\x4e\xcc\xcc\x03\xa3\x20\xf4\xfa\x20\x70\xbc\xc8\x4f\x27\x17\x17\x8e\x18\x7e\x62\xcf\xf6\xd6\x77\x3e\x78\xcf\xd2\xbd\x13\xd5\x72\x75\xb9\x3a\xd3\xbc\x0a\x56\xce\xdb\xd9\xdb\x2a\xdf\x5e\x5b\x7e\x6f\x4e\xcf\x49\xe5\x66\xc3\x67\x26\xcc\x53\x2e\x55\x11\x25\x8a\x88\xde\x65\x41\x2c\x7c\xa7\xce\x11\x96\x3b\x06\xca\x97\xf0\x9c\xb3\x02\x8c\x55\x06\xb7\x21\x15\x75\x4b\x12\x8f\xe9\x8f\xc0\xb2\x5e\xbc\x7e\x3d\x57\x2a\x97\xdd\x52\xb9\x76\x53\xd4\xdd\x8c\x0b\xb6\x74\xcd\x64\x4b\x95\x72\xb2\x7c\xf5\x72\xe4\x38\xa3\xc7\xbd\x62\x19\xa7\x05\x45\x8a\xc0\xf1\xeb\xfa\x9e\x74\xe8\xc4\xc9\x5b\x09\x08\xb9\xdb\x19\x9c\x34\xf4\x9c\x5e\x9d\x9c\x5c\xaf\x1c\x9a\x59\x6e\x4c\x4c\x0e\x60\xce\x9c\x08\x30\xdf\x34\x73\x31\x0f\x41\xde\x5a\x5d\xc5\x96\x5e\xb2\x54\xcb\xc8\xad\x5c\xbc\xf4\xce\xc8\x09\x1a\x95\xc9\xc9\xdd\xfb\x4e\x9c\x78\xb5\x5c\x6f\xb4\x0c\x33\xe7\xee\x6e\xac\x2d\x4a\xbd\x00\x48\xa9\xdc\x09\x30\xe8\xf4\xc8\x91\xc0\x9b\xc4\x7a\xde\x42\xb7\xaf\x5f\x38\x32\x51\x9d\x04\x12\x64\xd3\xda\xc2\xc2\xeb\xb3\x47\x8f\x5d\xf2\xc2\xc4\x8b\xa9\x86\xda\xbb\xdb\x0b\xf5\x62\x2d\xa7\x69\x3a\xad\xcc\xcd\x5f\x9e\x39\x76\xe2\xd5\x98\x22\xbb\xd3\xeb\x63\x1d\x6c\x34\x8d\xd3\x7a\xb5\x50\x41\x01\x4b\x3b\x01\x21\x9d\x91\xe7\xcb\x46\xae\x00\x42\x20\x49\x9e\x3d\xac\x1f\x99\x9c\x43\x7d\x67\xe0\x95\x66\xe7\xae\x9d\x3a\x74\xf8\xa6\x51\x28\xed\x8d\x5c\x2f\xca\x69\xb9\xa4\xde\x9c\xcb\xaf\xbf\xf6\xf2\xb4\xef\x3b\x15\xb0\x46\xe5\x9c\x66\x99\xa5\xa9\x9a\xde\xd9\x5f\x3d\x46\x06\xce\xb7\x9c\x5a\x3c\x65\x5a\x85\xf2\x6b\x8d\xa3\xc7\x56\x53\x82\xbd\xd5\x5b\xd7\x17\xaf\xdc\xbc\xf0\x08\xcc\x63\x2a\x4f\x4d\xd8\xc0\xa4\xa5\xc0\xa3\x4a\xdd\x2a\x60\x70\xbd\xf3\x0a\x22\x65\xcf\x77\x51\x7b\xd4\x1b\x9c\x7c\xf0\x91\x2f\x59\xb5\xfa\x75\xc0\x1a\xa7\x52\x9b\xb8\xb5\x76\xfd\xea\x3b\x07\x91\xbb\x29\xcb\x5a\x3b\x90\xa9\x93\x15\x58\x20\x2c\x73\x65\x04\x57\x8d\x26\x9c\x2f\x67\x05\x07\x3c\x45\xcf\xb2\x76\x08\x51\x30\x81\xc7\xc1\xf9\x18\x73\x37\x5f\x84\x72\xe5\x20\x4d\x08\x0b\x82\x64\xb6\x31\x29\xbd\xed\xfe\x87\x81\x51\x27\xac\x5e\x2e\xb1\x71\xd1\x29\x83\xcb\xe7\x15\xeb\x94\x7b\x05\x9a\xa6\xb2\x62\x3e\xcf\xd9\xd5\x38\x1c\x8a\x79\x61\x28\xeb\x0d\xfa\xa3\x56\x67\x7f\x60\xbb\x6e\x89\x52\x4b\x8e\x06\xe7\x7d\x42\x1e\x55\x35\xb3\x88\xe6\x16\xab\xa8\x32\x5f\x43\x47\xe7\x0b\xc0\xaa\x0c\x90\x17\x15\x0f\x5c\x8f\x5c\x7d\xe9\xd9\x68\xfd\x95\xa7\x57\x8f\x54\xf5\x97\xbf\xf3\xdb\xdf\xb7\x7c\xe6\xe4\x5b\x78\xca\x9f\xe7\xfb\x45\xd9\xd2\x60\x30\x12\x7d\x8e\xe0\x12\x0a\x21\x05\x06\xc9\xf3\x9a\x22\xf6\x0d\x46\x13\x7d\xf0\x7d\x1f\x32\x3e\xfd\x87\x9f\x32\x2e\x9f\x3f\xef\x0b\xf4\x8c\x41\x60\xe5\x37\x00\x16\x13\xcd\x80\x77\x8a\xb1\x12\x71\x97\x60\x7e\x7a\x97\x82\x70\xd7\xc9\x8d\x96\x4c\xb4\x37\x70\xd1\xb0\xd7\x46\xf5\x46\x03\x29\x0a\x2f\xff\xcf\xca\x83\x8a\xc0\xc2\xbf\xf5\xf1\x77\xa0\x9f\xfb\x33\x70\x29\xf9\x46\x0f\xd3\x70\x07\xa7\x32\x01\x5f\xd6\x5e\x81\x43\x99\xf0\x5a\x13\x6d\x7e\x59\x6d\x8d\x35\xee\xfd\x19\xc0\xf8\x28\x91\xff\xd9\x3f\xf9\x2e\xf5\x3d\xc7\x6a\x78\xdd\x1f\x49\xca\x04\x27\x8b\x14\x33\x69\xc8\x83\x83\x98\xa7\x3c\x45\xf0\x4a\xd4\xd7\xf0\x55\xc1\xa2\x70\x90\x65\xf9\x69\xae\x92\x98\x07\x94\xc7\xd9\x66\xe0\x0d\xa9\x28\x40\xa4\x34\xc2\xa7\x59\x15\xbe\x5c\x17\x25\x0d\x31\x00\x35\x5c\x30\xbe\x5b\x9c\x27\x7e\x77\xd0\xc9\x2b\xf4\x9b\xbf\x8e\x82\x84\xf4\xbb\xbe\xb1\xbf\x6b\x97\x06\x1d\xbf\xe1\xb9\x51\x3d\x0a\x63\xcb\x32\x0d\xd9\xb0\x98\xbc\x73\x71\xed\x5d\x47\x66\x97\x4c\x4d\x55\x83\xe6\xec\xd4\x0b\xcd\xa9\x73\xab\xa0\x24\x1d\x45\x51\x87\x3c\x51\x64\xdb\xa3\x2c\x8e\x10\x07\xf2\xcd\x1b\xaf\xe7\xf2\x46\x11\x26\xda\x37\x81\xab\x9f\xca\xe7\x60\x72\xe4\xf4\x96\x3f\xea\x83\x73\x1b\x98\x93\x93\x93\xe0\x09\x8e\xaa\xa6\x6a\x1e\xca\x99\x16\x8d\xe4\x64\xcd\x75\xba\xb9\xf9\xb9\x49\xad\x37\xda\x3a\xbe\x79\x7b\xfd\x9d\x33\x8d\x69\x6b\xaf\xbd\x8b\x82\x34\x2c\x75\xfa\xed\x47\x7a\xdd\x4e\xa9\x0d\x0c\xa2\x51\x6b\xd8\xc4\x92\x5f\x4d\x15\x74\xcd\x25\xf1\x10\x78\x97\x0a\xd3\x20\x67\x0b\x88\xf1\x38\x73\x9f\xe5\x11\x78\x81\x0b\xcc\x42\xa0\xe0\x38\xd0\xb1\x0f\xde\x87\x97\xb0\x88\x17\x1e\xeb\x7c\xbe\x92\x94\x92\x18\x38\xa8\xd3\xed\x4b\x1b\xed\xae\x2c\x12\x17\xf0\xfb\x42\xae\x84\x8e\x1c\x59\x0c\xb6\x77\x77\xe6\xdd\xee\xf0\xfe\x72\xae\x8c\x40\x89\xae\x78\x61\xea\x0d\xdc\x50\x1b\xb8\x7b\x78\x61\x66\xc1\x5e\x7a\xcb\xd9\x2b\x9b\xaf\x5f\x3e\x51\x29\x57\x59\xa9\x3c\x73\xb9\x17\xb8\x5b\x3b\x9d\xae\x0a\xc2\x83\x1b\x8d\x06\x55\x13\x5a\x82\xd1\xe8\xb5\x62\x7d\x00\xf3\xc4\x76\x56\x6e\x9f\x9b\xcc\x37\x1a\x53\xd3\x0b\xd7\xf5\x89\xea\x73\xb0\x1c\x70\x7a\x89\xad\xaf\xde\x5e\xf0\x77\xf6\xdf\x71\xb4\x79\x04\xc7\x9a\xb4\xda\x71\x3c\xaf\x3b\x74\xf5\xb9\xc9\xb9\x68\x38\x1c\x96\x0c\xa4\x34\xc1\xd5\x42\xa1\xa5\xfd\x0d\xf8\xdb\x17\x6e\xac\xad\xa9\x91\x9f\xc8\x4b\x47\x17\x53\xb7\xd3\x39\x79\xa8\xb9\x40\x70\xb1\x70\x31\x2c\x58\x4f\xae\x6f\xef\xa8\xbb\x7b\x7b\x6a\xa3\xd2\x48\x82\xc8\xcb\x51\xd7\x3d\x9a\x9f\x69\xa2\x48\x21\xd7\xbb\xb6\x1d\xda\xae\xa7\x4f\xd6\xf2\x69\x1c\x05\x39\x95\xa1\x66\xa3\x3a\x81\xca\xb3\x73\x97\x47\xaa\xfc\x97\x5b\x5b\x5b\xc6\x60\x6d\x47\xd6\x55\x53\x59\x98\x9b\xa7\xf6\x70\x6f\x5a\x97\x94\x82\xeb\x39\x28\xd1\xc8\x36\x28\x25\xbd\x7d\xf5\xd5\xb7\x7a\xad\xd6\xa3\x73\x53\x73\xca\x56\x6b\x93\x82\x11\x9a\xec\xf6\xdb\x0b\xbd\x4e\xab\xd0\x1f\xf5\xa5\xb9\xd9\xc5\xfd\x24\x9f\x7b\xc6\x0f\xc2\x9d\x6e\x0b\xe6\x14\x2c\x71\xb1\x50\xf4\x9d\x41\xab\xd9\xac\x4d\xe9\xd5\xda\x84\x63\xcd\x2f\xfc\xde\xc0\x71\xdb\x17\x2f\x5c\xa6\x09\xa6\xfe\xc2\xfc\xec\xf5\xa5\xfb\x1f\xbc\x05\x86\x32\xe8\xea\xe1\x32\x8e\xd2\x58\xbf\x53\x9e\x9f\xf9\xfa\x44\x92\x61\xaa\x24\x7a\x27\x38\x0b\xe4\x90\x88\x4f\x45\x3c\x40\xbc\x0f\xd4\x8a\xb9\x8e\x4b\x64\x20\x5d\x89\x2b\xb3\x00\xc0\xe8\x83\xef\x7d\x02\x37\x2a\xb5\x14\xbc\x00\xa6\x48\x1c\xa8\x78\x35\x3b\x10\x3e\x60\x2d\xaa\x0c\x7e\x1f\xbc\xc7\x5b\x7a\x5c\xcf\x65\x85\x7a\x8d\x15\xac\xbc\x48\x8b\xe6\xac\x5c\x0a\x8c\xd3\xdb\x69\xef\x0f\xba\xc3\xc1\x08\x86\xa4\xd1\x5c\x48\x34\x6d\x14\x94\x66\x1f\x36\xcf\x2c\xa8\x74\x6a\xa9\x01\xac\x0a\x74\x0c\xce\x77\xf3\xf2\x6b\xc9\xf5\x17\x9f\xda\x8d\x5a\x2b\x37\xcf\x1c\x39\xb4\xf6\xf0\xbd\x0f\xf4\xe6\x66\xe6\xb0\xae\x69\xbc\x9f\x90\x8d\x46\x36\xda\x6b\xed\x03\x66\x14\x45\xbc\x81\x67\x16\xb3\x6a\xe0\x94\xd7\x12\x31\x41\x88\xc0\xaf\x05\x17\x01\xff\xf8\x8f\xfe\x64\xe9\xc7\x3f\xfa\x11\x87\x77\x7e\x88\xbd\x0e\xf6\x47\x77\x2b\xdd\xd5\x26\x01\x71\x80\x9f\x72\xfa\x01\x9e\x18\xaf\x20\x05\x40\x4a\xe3\x78\x39\x5c\x39\x7f\x3e\xb9\xef\xdc\x13\xf2\xe5\xee\x0e\x7b\x64\xaa\x8e\x30\xb0\x0b\x8e\x84\xa2\x74\x61\x5c\xf9\x12\xd3\x08\xfd\xd2\xcf\x7c\x0c\x55\xa6\x8b\x59\x93\x29\x0f\xff\x92\xac\x48\x0f\xbe\x8b\x45\x7a\x4b\xd4\xb0\x13\x61\xf2\xc1\x36\x60\x0a\x3c\xf7\xcb\x9f\xf8\x02\xa9\x1e\xf3\x64\xb9\xbc\x82\xe7\x72\x14\x56\xc2\x17\x39\x78\x8a\x42\xc2\xbb\x01\xc0\x71\x11\xc5\xcf\xa2\x8d\x95\x97\x38\x88\x8a\x67\x26\x02\x51\x07\x67\xe0\x35\x70\x59\x44\x3e\xab\xc1\x19\x97\x39\x48\xdc\x0f\x14\xf1\x29\x78\x02\xe4\x09\x18\x73\x7a\xa7\xec\x21\x15\xb5\x33\xa2\x42\x5a\xf4\xa7\xf1\x63\xf2\x9e\x9b\x18\x25\x0a\x61\xa1\x45\x50\x5c\x97\x48\x52\x57\x64\x5a\x10\x70\xcb\x02\x49\x51\x68\x34\x3b\xd3\xdc\x2d\x58\xc0\x6b\x1a\xe5\x95\x59\xb5\xfa\x5c\x7b\x7f\x5f\xee\xb4\xf6\x24\xb0\x98\x15\xbe\xbd\xc6\xb8\xf2\x59\xe2\x6e\x15\xef\xf4\x9a\x9d\x39\x14\xf7\xec\xee\xf1\xb2\x55\xb5\x80\x86\x7b\xb2\x16\xee\x24\x7e\xb7\x54\x32\x89\x32\x37\x5d\x8e\xd6\xb6\xb7\x8e\x97\xf2\x55\x59\x56\x49\x97\xca\x80\xd8\xa9\x5b\x2e\xe6\x2b\xd2\xcb\x2f\x5d\x7d\x68\xba\x3a\x6b\x01\x3b\xa1\xaf\x5c\x79\x31\xe1\x5b\xf8\x18\x39\xa3\x5f\x6b\x14\xaf\x9d\xba\xe7\xd8\x4e\xad\xde\xd8\x51\x55\x2d\x48\x12\x5a\xac\x62\xf9\x30\x33\xd3\xdb\xc2\xc4\xf2\xfa\x4a\x46\x0e\xba\x49\xf8\x35\xf2\xaa\x63\x1e\x07\xe4\x1b\x71\x68\x5a\x5e\x82\xc5\x95\xa3\x5c\xa1\x82\xab\xa5\xb2\x0c\x0c\x39\x19\xf4\x87\x78\xe4\x0e\xf9\xd6\x20\x30\x85\x2a\xc9\x1b\x05\x10\xa8\x52\x52\xae\x96\x70\xbf\xd3\x3a\xb6\x75\xf3\xd6\x23\xa0\xb0\x86\x32\x6d\x5e\xa2\xa6\x7c\x71\xf3\xd6\x2d\x39\x89\x43\x91\xaa\x87\x7b\xb2\xb5\xb6\xb6\x08\xe2\x68\x68\xa6\x39\xea\xc4\xe1\xde\xea\xad\x55\x0d\x5e\xa4\x93\x93\x8d\x58\x41\x6c\x92\x74\xdd\xf7\x24\x12\xde\xd6\x72\xfa\x93\x9d\xf6\x6e\x03\x7c\xf5\x23\xd3\x27\x16\x06\x6d\x39\x7e\x2a\x0c\x39\x66\xf8\x95\xb5\x9b\x57\xee\x69\x6f\xac\x9d\x7a\xec\xdc\xe3\x3c\x5d\x95\x80\xe3\xba\xb2\xb3\xb3\x47\x43\x2f\x4e\x0c\xdd\x8c\x3a\x3b\xb7\xe7\x9a\x95\x09\x45\xb3\xac\x7d\x4f\x97\x2f\x5f\xb9\x7a\x55\xea\xf7\x06\xe8\xd4\xb1\x53\xc1\xa8\xb7\x37\x5b\x94\xf4\xf9\x7c\xa9\xe2\x8f\x4c\xf5\xd5\xb5\x8d\x75\x69\x7b\x6b\x9b\x98\x8a\x89\x66\x26\x26\xe3\xfe\xee\xca\x99\xba\x55\x2e\x32\x45\xee\x85\x04\xdf\xec\xec\xb5\x64\x5e\x2b\x53\xb1\x0a\xb4\xbf\xbf\x3d\x59\x2d\x54\x65\xd3\xb4\xe2\x81\x82\x96\x3b\xbb\xbb\x3a\x73\x63\x79\x69\x76\x21\x2a\x95\xf3\x52\x6b\x7b\xed\xbe\x9d\x9b\xd7\xde\x5e\x34\x0a\xb2\x4d\xc3\x1b\x96\xae\xdd\x08\xec\x51\x61\xed\xea\xa5\x87\x1f\x38\xfd\xa0\x02\xac\x3e\x79\xe9\xc2\x0b\x54\x06\x6d\x57\xc1\x70\xd5\x67\xe7\xaf\x9c\x9e\x7c\x64\xbd\x54\x6d\x6c\x82\x9b\x4a\x93\x30\x32\x9a\xb5\x4a\x3a\xe8\x0e\x50\xc1\x54\xa4\x51\x6b\xb4\x38\xdf\x98\x47\x46\xbe\x70\xc1\x0d\xfc\xd6\xc6\xad\xdb\xbc\x96\x27\x30\x73\x1a\x76\xbc\xe1\x3e\x29\x49\xed\x7c\xa3\xe0\x36\x34\x50\x06\xd1\x29\xc8\xa8\x20\xbc\xf0\x04\x3c\x1a\xae\xd0\x14\xb0\x46\x04\xc6\x09\x6f\x16\xe0\x6e\x9b\x68\x34\xe2\x1d\x98\x84\x25\x11\x8f\x59\x45\x78\x9f\xb4\x49\xe4\x0c\x71\x1f\x0c\xd2\xc9\xc3\xc7\xc9\xdb\xef\x7f\x1b\xe3\x1d\x0b\xa6\x95\x17\xed\x35\x84\x48\x1c\xac\x04\x70\xf1\xe2\x8f\x42\xa1\xc0\x6e\xdc\xb8\x8e\xff\xb7\x7f\xf3\xf3\xf4\xf0\xe2\x22\x7b\xfc\xb1\xc7\xd1\x83\xe7\xce\xe1\x66\x73\x8a\x1e\x3d\xb4\x18\xb5\x07\xbd\x51\xbb\xdf\xed\x7b\x81\x9f\x4b\xd3\x54\x49\x93\x55\xaf\x3e\x03\x0e\x4b\x2e\x47\xd4\xc4\x27\xcb\x17\x6f\xd1\xb5\x2b\xcf\xb7\xed\x9d\x1b\x37\x67\x9b\x13\xab\xe7\xde\xff\xfe\xc1\xe9\xa5\x93\x2e\xcc\x7f\x64\xa8\x3a\xdd\xdc\xd8\x44\x5f\x7f\xee\x6f\xd0\xe7\xbf\xf8\x05\x76\xf5\xda\x55\xf4\xf1\xdf\xf8\x38\xbe\xf7\x9e\x7b\x51\x7f\x30\x40\x3c\x32\x75\xd0\x1b\xc0\x99\x07\x57\x63\x30\x50\xec\x9d\xef\x78\xb7\xf9\xd0\xa3\x8f\xe5\x9f\xff\xfa\x5f\x47\x82\x9f\x00\x28\xdf\x01\x2c\x7d\x3e\xbb\xa3\xdb\x00\x17\x1a\xe2\x0e\xdb\x08\x7e\x1a\x12\x32\xd2\x97\x5f\xfb\x13\x67\xf3\xe6\xc3\xa5\xd2\x52\x05\x75\xc1\x47\x5e\x2c\xab\xc8\xe1\x5b\xc5\xa4\x31\x32\x72\xa6\xe8\x0e\xd7\x34\x0d\x7f\xf8\xdc\x77\xa0\xe9\xf9\xa9\xbb\x21\xb1\xf8\x4e\xd7\x7c\x56\x45\xc4\xd9\x10\x30\x58\x89\x57\x93\xf3\x00\xba\x8a\xc8\xca\x5f\x6d\x49\xab\x43\x4d\x31\x3b\xa7\xb1\x17\xb8\x30\x75\x29\x91\x24\xd1\x5a\x01\x03\x4c\x88\xa0\x47\x64\xdc\x7f\x8c\xd8\x38\x62\x2e\x3a\x0b\x88\x48\x55\x73\xe2\x46\x79\x81\xe8\x18\xa8\xb2\xbe\x07\x5e\x99\x96\xf1\xda\xac\x65\x43\xdc\x79\xc1\x21\x4f\x44\x22\x36\xae\x15\x03\x27\x4c\xd4\x71\x89\xcc\x20\x15\xe0\x07\x4c\x46\x75\x12\xbb\x10\x26\xac\x04\x78\x5a\x00\x08\xcb\x63\x60\xf6\x9a\x91\x67\x29\x95\xcd\x28\x4c\x9b\xd6\x44\x0e\xc9\xba\xb2\xdd\x19\x75\xf5\xf6\x80\xd3\x44\xc2\x34\x60\x4f\xc0\xb0\x14\xb8\x3e\x19\xc0\x4a\xe6\xf2\xc3\x3b\xef\xad\x72\x8d\x2c\xaf\x6d\x1c\x3f\x34\xb9\x84\xb0\x82\x37\xc2\x38\x0d\xc1\xd3\x00\xbd\xab\x00\x04\xe8\xd8\xb1\xfd\x85\xd9\xf9\x2a\xef\x44\xea\x02\xdb\x49\xc0\x32\x9a\x0a\x51\x62\x50\xf6\x1d\x99\x2a\x8d\xa5\xc5\xe3\xf6\xfc\x91\xc9\x2f\xc1\xe7\x36\x57\x00\x38\xb6\x16\x04\x71\xc1\x77\x82\x53\x71\x44\x4f\xeb\xa6\x31\xd0\x64\xf5\x0b\xe0\xec\xed\xf2\x9d\x93\x84\xad\xca\xea\xad\x45\xc6\x30\x89\xa9\x14\x86\xb1\x12\xfa\xb1\x4a\xc2\x98\xb7\xcc\x4b\x40\x16\xe5\x9a\x55\xc8\x6d\x6f\x6e\xdc\x5f\x2f\xd7\xe3\xc9\xf9\xd9\x9d\x98\x4d\xf5\x28\x5f\x31\x98\xb7\x34\x4e\x0b\xa1\xef\x57\x6e\x5d\x7c\xf5\xc8\xf6\xfa\xfa\x22\x00\x23\x9a\x3a\x79\xfa\x15\xab\x5e\x3e\xbf\x72\x7b\x99\x0d\x3a\x1d\xe1\x2e\x00\x58\x32\xde\x20\xe5\xdb\xb6\x16\xb9\x3c\x5c\x20\x25\x60\x65\xd2\xa3\x87\x16\x3c\x1a\x27\x25\xa7\xdb\x3a\xe5\x39\xd1\x43\x81\x69\x3a\x72\xb5\xf0\x42\x30\xf0\x92\x7e\xbb\x55\xb2\x77\x5b\x64\x6e\xf6\x10\x4e\x70\x7a\xac\xbb\xbf\x5b\xbd\x71\xfd\xe2\xc9\x4e\xa7\xa3\x96\xcb\x95\x08\xd4\x5e\x62\x12\xde\x03\xe5\x6a\x0d\xf6\xdb\x72\x41\x35\x98\xc2\xeb\xab\x5c\xef\x48\x6d\xf2\x30\x8a\x64\xe9\xc6\xa0\xd7\x0d\xec\x5e\x4f\x2f\xeb\xf9\xb4\x68\xaa\xe8\xf6\xe5\x0b\xf7\x9c\x68\x1e\x41\x40\x13\x56\x5d\xdf\x6d\x0f\xf6\x5a\xba\x06\x17\x7f\x78\x76\x26\x8c\xbd\x5e\xdd\xde\xde\x79\x60\x76\xf1\x04\xb0\x23\xf9\x15\x70\xc9\x6c\xa7\xdf\x07\xc7\x9f\xb0\x62\xce\x88\x3b\x1b\x40\x00\x26\x17\x60\x3d\x8d\x7d\x84\xfc\xcd\xb9\xc9\x49\xcc\x2a\x51\xc5\xb5\x07\x93\x57\x5e\x7c\xf5\x2c\xb8\x9a\x53\x7c\x5b\xa2\x46\x73\xe6\xa2\xd5\xa8\x3f\xdd\xda\xdc\xc6\xd5\x4a\x25\x28\x55\x6b\xdb\xba\xaa\x1d\x39\x76\xec\xcc\xda\xec\x89\x93\x9f\x07\xd6\xe3\x03\xfb\x49\x19\xdf\x59\x21\x08\xeb\x71\x7f\xf0\x0e\x09\x49\xe7\xf2\xc5\xc2\xf9\xc9\x6a\xf9\x49\x29\xa6\x60\x93\x90\xa5\x13\xe5\x90\x95\x2f\x26\x30\xd6\x6b\xee\x68\x18\xa9\x32\x09\x15\x45\x0b\x01\xee\x1d\x60\x35\x61\xc9\xca\xa7\x79\x23\xc7\xb3\x67\x1c\x9c\x62\xbe\x73\x12\x67\x3f\xfc\x51\x01\xd7\x4d\xe2\xb1\x1c\x90\x58\x45\x16\xfd\x44\xa2\x6a\x05\x40\x87\xf7\x9e\x8a\x4a\xee\x08\xdc\xac\xde\x60\x20\xc5\x61\x82\x03\x2f\x00\xc3\x42\x95\xf7\x3c\xfa\x6e\x49\x06\x26\xa6\xca\x94\xf7\x1d\x72\x90\x12\x32\x2b\x8d\x8b\x46\xc1\x5b\xe0\xaa\x89\x3f\xf9\x07\xbf\x1f\xaf\x6d\x6d\xd0\xd5\x9d\x2d\xf6\xd4\x73\xcf\xe0\x89\x5a\x83\x1d\x3f\xba\x84\x17\x17\x0e\x31\xdd\xd4\x5d\xd0\xb3\xae\xa5\x9b\x16\xac\x8d\xee\x06\x23\x6c\x6f\x3e\x63\xa7\x87\x27\x4a\xcf\x3d\xff\xf9\x7e\x77\xfb\xfa\xad\x89\x5a\x71\xed\xd1\x87\x1e\xee\xcc\x37\x67\x1d\x06\x72\xfe\xfa\xab\xaf\x27\x9f\x5b\xb9\x95\x5e\xba\x7a\x99\xbd\x7e\xe9\x22\xdd\xd8\xde\x44\x2c\x8e\x39\x85\x42\xbf\xf0\x2b\xbf\x48\x3e\xf5\x89\x4f\x12\x60\x5e\x28\x14\xc9\x3e\x11\x82\x1a\x07\x60\x53\x51\xe3\xc6\xaf\xe5\x47\x7e\xe4\x27\x4a\x2f\x3d\xff\xec\x28\xe5\xfb\xd7\xf0\x0d\x56\xee\xb8\x84\xdc\x09\x4c\xb3\x32\x18\xf8\x89\x0b\xcf\x7a\xdc\x69\x23\x92\x66\x06\x83\xe7\xdc\xaf\x7e\xfa\xff\xd1\x0f\xfd\xec\x3f\x35\x5f\xe7\x95\x2e\xbd\x10\xe7\x01\xd3\xc0\xa4\x20\x45\x56\x84\x3b\xed\xfb\x3e\xf6\x22\x5f\xd4\xa7\x38\xae\xcb\xeb\x68\x30\x47\x74\x51\xca\x4f\x79\x0b\x4c\x16\x14\x8f\x92\x00\x91\x7e\x0d\xeb\x65\x8a\xf3\x0d\x19\xf8\xac\x6c\x2a\xc5\xc9\x72\x20\xe7\x49\xaa\xeb\x12\xdf\xa2\x06\x8b\x66\xc2\x3b\xfd\x62\x44\xb4\xab\x66\x1b\xc4\x10\x96\x65\xbe\x44\x46\x90\xb1\x31\x78\x09\x30\xca\xde\xcf\xda\xcf\x0e\x7a\xce\x44\x9a\x7f\x0c\x72\x68\xdc\x63\x26\xa2\x33\x62\xa3\x11\x3c\x76\x25\xb3\x6a\xa5\xac\x79\x36\x8d\x03\x5e\x2e\x5c\xa4\x0a\xcb\x83\x24\xe4\x90\x12\xe9\x88\x26\x44\xcb\x03\x7e\x29\x6a\x6e\x38\x1c\x35\x28\xa2\xc0\xab\xe5\x16\x53\x54\xbf\x3c\x35\x15\xf1\xe8\x76\x1a\x27\x4a\x18\x84\x3a\xf3\x23\x89\xfb\xdb\x20\xb8\xb8\x58\x9e\xa0\x7d\xc7\xa9\x02\x05\x9e\x99\xae\x2d\x20\x49\x93\x56\x3a\x3d\x0f\x05\x31\x22\xe5\x5a\x35\xb5\xdd\xa8\xd8\x6a\xb5\xca\xcd\x4a\x1f\xe5\x2b\x46\xdf\xf7\x40\xdf\x41\xf4\xf8\xe6\x66\xf9\x7c\xd1\x7b\xfd\x95\x0b\x7c\xfe\xc0\x93\x28\x3c\x91\xd2\x24\x02\xb4\xc2\xed\x6e\xdb\xdc\xdf\xdf\xb7\x78\xaa\x7b\x6e\x76\x66\x70\xea\xd4\x89\xcb\xaa\x4e\xda\xaa\x9c\xf2\x00\x9e\xc4\x41\x4a\xc9\xda\x4f\x78\xa6\x9a\xd0\x20\x51\x12\xdb\xcf\x05\x76\x98\x03\xd7\x56\x13\x1b\x2f\x4a\x3c\x74\x0d\x17\xe1\xbb\xe4\xaf\x5f\xbf\xf4\x70\x73\x72\x9a\x16\x8a\xc5\x21\xb8\xf9\x09\x2f\x04\xde\xef\xb4\xac\xfd\xfd\x96\x1e\xc7\x11\x9a\x6c\x4e\xed\x9d\x38\x7d\xfa\x42\xb9\x56\x59\xd9\xd9\xdf\x0e\x92\xd0\x51\xf3\xba\xaa\x02\x30\x13\x0d\xb8\x2f\x8b\x02\x75\x6a\x72\xa2\xfd\xc2\xd7\xbf\x46\xe5\x57\x95\x4a\xb1\x58\xfe\xb0\x1f\xf9\x3c\x91\x50\xb4\x47\x23\xbd\xd9\x9c\xb6\x8f\x2d\x9c\xfd\x6a\xcf\x1e\x3a\xce\xc8\xd1\x16\xe7\x17\x77\x9e\x5d\x5d\x6d\x7d\xf1\x2f\xfe\x78\x42\x26\xf2\xbb\x79\xcd\x55\xb1\x56\x5d\x7b\xec\xde\x73\xaf\xdd\xbe\x7e\xf5\xc1\x4e\xaf\x3d\xdd\x2c\x5a\x7b\x28\x8c\x28\x2f\xf1\x5f\x9c\x9d\x06\xa2\xb0\x77\x68\xd8\xef\x56\x03\x60\x75\x52\x5e\xdf\x0a\x46\x23\x49\xe3\xd9\xbb\x4a\x39\xc1\x49\x58\xd8\x5a\x5f\x99\x55\x60\xce\xee\x99\xa8\x6f\x26\x8e\x0f\xb8\x4d\xc5\x0e\x02\xb5\xa2\x85\x9f\xfb\xfa\x57\x1e\xf3\xfb\x03\x03\x00\x72\xad\xac\xd7\xaf\xf4\xd7\x57\x25\x05\xac\x5b\x29\x5f\x49\x09\x8b\x35\xdf\x1e\x4d\x86\x95\x00\xdd\x5e\xb9\xde\xf0\x62\xff\x1f\xc3\x35\x4b\xad\xd6\x4e\x79\xbf\xb5\xa3\x72\xa9\x00\xbf\x75\xfd\xe4\xe9\xb3\xcf\x5b\x85\xf2\xda\xc6\xc6\x26\xe9\xec\x77\xe4\x1a\x00\xab\x61\x98\x36\x30\x2b\xe4\x87\xc1\x61\x59\xd7\x7e\x20\x4d\x13\xc0\x6f\x98\xbb\xd6\x4e\xa1\xd7\x6b\x5b\x5c\x84\x0f\x1d\x3e\xb6\x76\xa4\x72\xe6\x15\x60\xb0\xac\x58\x28\x85\xed\xce\xce\x61\xc7\x1e\x59\x14\xb1\x16\xa8\xe4\x66\x8c\xd2\x3d\xb3\x58\x48\x00\x44\x62\x3d\xaf\x3b\x85\x6a\x79\x98\x2f\x15\x7c\xdd\x34\x13\x4d\x91\xd2\xb1\x8b\x04\xae\x1b\x07\x28\xc2\x7b\xfa\x78\x27\x11\xcf\xe2\x89\x3e\x3e\x51\x8d\x4c\xb2\xae\x26\x51\x60\x98\x72\xc0\x4a\xc9\x30\x0c\x51\xd7\xb1\xe5\xae\x3d\x52\x8e\x1d\x39\x29\x3f\x74\xff\x5b\x49\xb7\xd7\x63\x92\x70\x01\x65\x24\x98\xda\xd8\x2d\xe4\x00\x51\xc8\xe7\xd1\x17\xbe\xfc\xc5\xe4\xf9\xf3\x2f\x04\x85\x72\x19\xb4\x02\x0c\x5d\x0a\xd7\x32\xec\xe2\x8d\x67\x9e\xc6\xf4\xe9\xbf\x44\xe3\x6e\xa5\xee\xc2\xd1\xc3\x66\x6d\xaa\xa1\xc1\x58\x4c\xbb\xb7\xd9\x7d\xf5\x6b\xbf\x7f\xb3\x90\x33\xb7\x1f\xb9\xff\xbe\xf6\xd2\xe2\x51\xf7\xf4\xd1\x63\xc1\xc7\x7f\xfb\xb7\xa2\x5f\xff\xcd\xdf\x88\xc3\x34\x11\x41\x36\x40\xc3\x54\x56\x35\xa6\xe5\x4d\x4e\x44\x24\x90\x31\xf2\x95\x27\xbf\xca\xfe\xe0\xb3\x7f\x80\x3e\xf2\x8f\x3e\x42\xc0\x58\x89\x2d\xa6\x32\xe6\x30\x6e\xd4\x00\x20\x75\x1c\x97\x7d\xeb\x7b\xbe\xcd\xfc\x96\xf7\x7f\xa0\xf8\xe7\x7f\xfa\xc7\xc1\x9b\x00\xeb\xcd\xbb\xf2\x30\xe0\x40\xb8\x0d\x47\xaf\xc1\xf1\x0b\xbc\xeb\x78\xf3\xda\xef\x0e\xfe\xe0\xb7\x2a\xd2\x0f\x7e\xf4\xfb\x8d\x2b\x1a\xa3\x75\x58\xf4\xe3\x96\x2e\xb2\x50\x2a\xdf\x91\x10\xd0\x8e\x53\x4d\x0e\x58\x81\x1f\x64\x6d\xa3\xf8\xa0\xc4\x11\x23\x29\x6b\x5f\x17\x65\x05\x48\x4a\xb3\x96\x8a\x54\xd0\x28\xc9\xeb\xed\x2b\xb6\xa1\x12\x5e\x0a\x22\xaa\xdf\xb3\x6d\x70\x32\x97\x0f\x7e\x20\x9a\xe1\x10\xcb\x3a\xa3\xef\xb0\xa1\x71\x6b\xb7\x68\xcf\xcf\x00\x8e\x8e\x7b\x4f\x0f\x0a\x40\xb3\x9d\xfd\x58\xf6\x9a\x23\xd9\xb8\xdf\x80\x8c\x5b\x87\x31\x26\xe3\xd8\xf4\xc1\xbf\x0c\x87\x41\x42\xa2\x10\x78\x55\x84\x30\xdf\x16\x0b\xf4\x97\x93\x25\x16\x27\xbc\xcb\x4b\x4e\x81\x12\xfb\x3d\xbb\xd7\x31\x27\x2b\x1d\xa4\x1b\x2d\x33\x67\x24\xc0\x48\xe4\xc0\xf3\x8d\xd4\xe7\x65\x02\xb1\x96\xc4\x48\x86\xdf\xf1\x8d\x58\x12\x8c\x95\x24\x4e\x12\xbb\x33\xea\x04\x75\xdc\xdc\xdc\x6f\x0d\x80\x65\xca\x69\x90\x30\x5a\x56\x2d\x0f\x2b\x4a\x6f\x65\xeb\x56\x69\x72\x61\x7a\x63\x38\x0a\x51\x10\xe2\x74\x6b\xbb\x8d\x16\x0f\x1d\xbf\xe2\xc3\x58\x6e\xae\x2e\x2f\x38\x57\xec\x49\x59\x96\xc4\x16\x35\x56\xde\xea\x96\x2a\xe5\x9d\x99\xe6\xf4\xce\xfc\xfc\xec\xb2\x6a\x91\x5d\x9c\xf3\x57\x78\x51\x3e\x0f\xf2\x65\xfd\x39\x22\xfc\x80\x79\xf7\x85\xef\x26\xcc\x1d\xc6\xb2\x3d\x0c\xf5\x28\x48\xcc\x0c\xcc\x79\xde\x7b\x2b\x3e\xb6\x74\xfc\x65\xc3\xb0\x3a\xb7\x57\x6e\x1f\x59\xd9\xb8\x3d\x0b\x92\xcf\xab\xca\x79\xdc\xa2\x57\x9f\x9c\x58\x39\xb4\xb8\xb8\x5a\xaf\xd7\xb6\x63\x16\x76\x5b\xdd\x8d\x61\x10\x78\x8a\x42\x70\x89\x21\xc1\xcc\x45\xbc\xa1\xdb\x69\xa1\x13\x27\x4e\x6e\xde\xfb\xc0\x03\x4f\x5d\xbc\xf0\xfa\x19\xef\xa6\x3b\xc1\x25\x28\x67\xe5\x07\x8b\xc7\x96\x2e\x1f\x5e\x5a\xba\xea\xfb\xa1\xbd\xb7\xb5\xad\xf2\x39\xaf\x57\xab\xce\x7b\xbe\xf5\xfd\x5f\xd8\xdc\x5c\x5b\x04\x1d\x97\xcb\x95\xda\x7e\xb5\x56\xdf\x86\xb5\x97\x6f\x5e\xb9\x84\x6e\x6d\xdd\x8a\x9a\xc7\x16\x36\xd3\x61\x28\x76\x4f\xb1\x72\x1a\x10\x79\x49\xde\xef\xee\xa7\xad\x51\x67\x7d\x66\xa2\xd2\x8e\x83\x80\x98\x9a\xc6\x3c\xcf\x66\xd3\xd3\x13\xc3\x87\x1e\x7d\xd7\x5f\xc0\x45\x69\x54\x55\x96\x5d\xdb\x21\x0a\xdf\x2d\x13\x8b\xae\x68\x74\xf2\xf4\xbd\x97\xa2\x30\x5c\x29\x4e\x4f\x2d\x77\xfb\xfd\xd0\xf7\x7c\x55\x51\x54\x60\x49\x55\xc0\x98\xa8\x5a\x30\xcc\x42\x77\xd0\x41\xeb\xfb\x5b\x7d\x7b\x30\x68\xf2\x48\x51\xbe\x54\x6c\x1d\x3f\x7b\x6e\x79\x02\xc0\xaa\x5c\xa9\x6f\xf5\xfa\xc3\xf4\xe6\x8d\x65\xd5\xf1\x3c\x82\x41\xc9\xfb\xc3\x01\xbe\xef\x81\x47\xbe\xfe\xfa\xab\x2f\xc6\xaf\xde\x78\xed\x30\x8c\x67\x82\x17\x5e\xf2\xd8\xa5\x55\x28\x6d\x95\x27\x9a\xd7\xe7\xe6\x17\x6f\xd6\xe1\x71\x7b\xb7\x85\xf7\x76\x5a\xd2\xd2\xd1\x72\xe4\x05\x54\xda\xdc\xdd\x88\xe7\xe6\x16\x77\x2a\xd6\x4c\xc7\x9a\x2c\xae\xe5\xd2\x3c\x93\x00\x9c\x8c\xbc\x1e\x15\xaa\xc5\xd0\x2a\x9a\xb1\x66\xa8\xa9\x2c\xe1\xac\x65\x46\xd4\x44\x09\x77\x82\x8e\xab\x9a\xb3\xfc\x60\x66\xa0\xe9\x38\x9c\x91\x69\x2d\xc8\xba\x17\xf2\x3d\xaf\x86\x92\xed\x39\x32\xc8\x9d\xb4\xd3\xda\x41\x7f\xf5\xf5\xa7\xd3\xb7\x9e\x7b\x10\xab\xaa\xcc\xb8\x11\xe2\xe2\x4f\x84\xe8\x23\x6c\x18\x3a\x6b\xb5\xf7\xd9\xef\x7f\xf6\xd3\x9e\xa2\xa9\x81\x61\x99\x29\x0f\x9c\xc0\xa4\x13\x09\x50\x52\xd1\x55\x09\x98\x0e\x30\xb6\x90\xba\x23\xdb\x36\x14\xad\x75\x64\x7e\x91\x07\xc6\x0d\x70\x07\xbd\x99\xc9\x66\xef\xf8\xe2\x92\x7d\x68\x66\x36\xa8\x57\xaa\x49\xad\x52\xa5\xfd\x5e\x3f\xf1\xdc\x51\x68\x96\xc1\xa0\xc8\x24\xe6\x45\x9f\xbc\xf1\x98\x8a\x0d\x09\x91\x06\x40\xa9\x24\x91\x84\xfe\xc3\xaf\x7f\x0c\xbf\xf7\xdd\xef\x21\xd5\x72\x95\x83\x53\xe6\x84\x91\x0c\xb8\x8a\x85\x02\xd8\xac\x14\x7d\xea\x33\x7f\xe0\x2f\xdf\xbc\x11\xdf\xe9\x3b\x3f\xd8\x5e\xa6\xb5\xb7\x87\x1e\xff\x81\x0f\xa2\xeb\xeb\x2b\x08\x5c\x00\xfe\xa1\x05\xf7\x59\xb8\x2f\xf1\x47\xc6\x62\x8b\xe2\xa2\x76\xf8\x9e\x1f\x2c\x7d\xf0\x7b\xbe\xcf\x3c\x73\x6a\x0a\x99\x52\xc4\x0a\x24\xc5\x16\x48\xd6\xce\xd6\x3a\x3a\xd9\xc8\xe3\x13\x8b\x0b\xb0\xa0\xc3\xac\x21\x49\xec\x9d\x24\xea\x60\x45\x2c\x85\x2f\x40\x92\xc4\x84\xd9\x16\x92\xc1\xce\x14\x2a\x9a\xf6\x7f\xfc\xbb\x5f\x78\xe5\xc6\xb5\xd5\xdf\x9b\x99\x9f\x27\xe0\x7f\x4b\x3c\xf2\xc6\x0b\x6f\xb3\x1d\xaf\xb2\xbe\x4c\x8c\xc5\x46\x46\x7c\x8f\x29\x72\x00\x3c\x04\x8f\x9f\x67\x95\x55\xd9\xff\x22\xb5\x21\x42\x59\x18\x8b\x6f\x8f\xc9\x95\xc8\x4d\xc0\x3b\x52\x46\xa8\x44\xb5\x2d\x47\xbf\x71\x0b\xa1\xd8\x2e\x80\xc7\xbb\xe0\x65\x64\xfb\xc6\xa8\x3d\x2c\x8d\x3a\xc3\x89\xd0\xf5\x2b\x60\x0d\x78\xca\x80\xef\xd4\x18\x1c\x3a\xb4\x80\x73\x86\x51\xe4\xca\x00\xce\xd5\xcd\x58\x43\x1b\xf0\x43\x29\xf2\xc0\x8d\xec\xdb\x05\xa7\x37\xaa\x05\x8e\x57\x06\x45\xd4\xf9\xb4\xaa\xba\x16\x2d\x2e\x2c\x30\xd3\xd0\x73\x5c\xbc\xba\xbd\x7e\xb0\xb1\xbe\xa9\xb2\x2c\x63\x90\xcc\xcd\xce\xb1\x4a\xa5\xc4\x77\x48\x93\x5d\xcf\x0f\x6e\xdf\x5e\x95\xb9\x40\xf1\xb8\x60\xbd\x56\xa3\xcd\xa9\xc9\x14\xdc\x00\xde\xda\x72\x67\xbf\x1f\x38\x37\x6f\x26\xf6\x89\x4c\x86\x4c\xa5\x6d\x25\x2f\xb5\x25\x99\x50\x72\xa7\xce\x5d\x6c\xd5\x21\x20\x39\x0e\x63\xc9\xee\xd9\xb9\x41\x7b\x54\xb6\xfb\x6e\x25\x0c\x22\x8b\x66\xf5\x81\xa2\x91\x24\x9f\xb3\x50\xa3\x31\x41\x0d\xf0\x11\x61\xae\xb4\x3b\x5b\x3e\xc0\x4f\x61\xbc\x61\x14\x87\xb6\x13\xc0\x62\x6a\xa8\xc7\x67\xc9\x77\xc2\xbc\x33\xf0\x2b\xa1\x1f\x16\x00\x3b\x55\x11\xa9\x84\xc1\x5a\x96\xc5\xe6\xe7\xe7\x63\x15\x7c\x0b\x5e\xd9\x3f\xde\x25\x21\x4e\x29\xf5\xc1\x7a\x02\xeb\xd8\x57\x0f\x5a\x5a\xb0\xd8\x77\xb1\x92\x56\xeb\xd5\x98\x07\x90\x81\x85\x49\x43\x00\x80\xc6\xc4\x04\x2b\x95\x4a\x06\xbf\x8c\x30\x0a\xfc\x95\xdb\x2b\x24\x08\x42\x54\x2c\x15\xa3\x85\xf9\x05\xbe\xbe\x16\x88\x41\x00\xc7\x0a\xb6\xb7\xb7\x55\x61\xa7\x64\x1c\x94\x4a\xc5\x70\x6a\xaa\xc9\x4d\x39\xdb\x6f\xb7\xb5\x6e\xbb\xab\xf3\xdd\x83\x79\xbf\x03\xb8\x63\x41\x73\x7a\x3a\x94\x01\x10\xfa\xfd\x81\xbc\xb7\xdb\x52\xd3\x08\x56\x8d\x61\xf9\xf8\xd1\xe3\x61\x6b\xff\xf6\xfd\x45\xa4\x3d\x5e\xaa\x36\x5a\x40\xc9\x3e\x9b\xb5\x56\x73\x03\xc9\x22\x20\x2b\xf6\x70\x34\x4a\x3a\xdd\x8e\xec\xda\xae\xcc\x44\xa9\x07\x4f\x43\x65\xe8\xd0\x6c\x36\xe3\x7a\xbd\x9a\x2a\xb2\xac\x8d\xeb\xdf\x70\x56\xd2\x07\x04\x3a\x4e\x02\xb0\x6b\xc9\xee\xee\xae\x06\xd7\xc7\x85\x30\xad\x94\xcb\xde\xd1\xa3\x47\xc1\xd4\xa7\x05\xb8\x6e\x5b\xab\xab\xaf\xa0\x22\x5a\x85\xc5\x06\x77\x4d\xa2\x8a\x26\x53\x0e\x54\xe0\xea\xf1\x18\x93\x68\xea\x10\x1b\x5b\x50\xd1\x85\x4f\xc7\x0d\x57\xe3\xe4\x2d\x13\x2e\x39\x41\x77\xfb\xad\xb9\x85\xe2\xfd\x81\xad\xde\xbe\xb4\xbc\xb5\xaa\xde\xde\x5c\xb5\x3a\xbd\x9e\xe1\x00\xd3\x02\xa4\x94\x4e\x1e\x39\x49\x3e\xfc\x9d\x1f\xc6\xf7\x9e\x39\xc3\x5b\x6d\xf8\xd6\x31\x5c\xb9\x58\xb9\x5c\xc2\xbf\xf4\x2b\xbf\xec\x7d\xee\x4f\xff\x68\x58\xa9\x55\x43\x2d\xa7\x27\x3c\x51\x0f\x17\x41\xfc\x28\x94\x82\x20\x90\xfd\x30\x52\xa2\x20\xd4\xec\xa1\xad\xbc\xf7\x1d\xef\xca\x7d\xdf\x87\xff\xbb\x1c\xe8\xb8\x5c\x2a\x14\xc2\xb9\xa9\x19\xbf\x51\xa9\xc5\xa6\x61\x50\x6e\x54\x4d\x33\x87\x7f\xea\x9f\xfd\x8c\xff\x89\xdf\xfb\xed\x51\xae\x54\x08\x01\xf4\x62\xca\xeb\xbe\x79\xf0\x0d\x23\x30\x88\x4c\xa3\x49\x6a\xd0\x24\xd1\x92\xde\x80\xfc\xf0\x47\x7e\x44\xfa\x95\x7f\xff\x31\xa9\xd3\xeb\x20\x11\x2e\x02\xe0\x57\x54\x1d\x3f\xff\xe2\x8b\xf4\x63\xbf\xf6\xcb\xee\xd7\x9e\xfc\xea\x00\xa5\xcc\x41\x1c\xf8\x28\x4b\xe4\x6f\xb2\xbd\x12\x8f\x63\xed\x1e\xb0\x30\x60\x0a\x4d\x42\x47\xd6\xad\x57\x7e\x2d\xf9\xb5\x6b\x7f\x6e\x1e\xbf\xe7\xdb\x0b\xf7\xbd\xf5\x9d\xea\xcc\xc2\x14\x2e\x56\x4a\xa8\xd7\x95\xd1\xe1\x1a\x27\x3a\x94\x87\x31\xee\x80\x21\xcb\x5c\xeb\xac\xb1\x15\x58\x15\xd0\x11\xbe\x2b\x06\x96\x92\xac\x5f\x3e\x49\x23\x76\x6d\xfb\x6a\xda\xc7\x03\xd1\xa0\x4e\xb3\xee\xfd\x74\x4c\x81\x04\x63\x1a\x43\x10\xdf\xec\x4e\x14\x82\x0a\x3c\xe2\x50\x48\x24\x3c\xde\x5c\x8f\x64\x0d\x9c\xd2\x18\xc0\xc6\x10\x96\xa1\x5b\x56\x90\xc4\xc4\x3f\x77\x37\x27\x64\x19\xf3\x13\x91\x2f\x36\xde\x3a\x84\x4b\x79\x48\xb5\xd4\x8e\xd3\xc4\x8b\x15\x0a\x53\xcd\xe5\x00\x8e\x95\x7a\x92\x6d\x87\x89\xdb\x2d\xd6\x2b\x8e\x92\xd3\x1c\xac\x11\x9b\xd3\x6a\x0e\xae\xb1\x17\x1a\x5e\xcf\x4d\xfc\x91\xa7\x24\x41\xc4\x03\xee\xbc\xe2\x1d\xe8\xb9\xef\x5e\xbf\x71\xd5\x35\x72\x26\xe5\x20\x06\x2e\x91\xc9\x17\x4b\x4c\x8e\x44\xc2\xdb\x2b\x37\x83\xbd\xfd\x5c\x02\xe7\x55\x5c\xd7\xd5\xe3\x28\xd2\xf1\x98\x45\xee\x6c\x6d\xe2\xd6\xee\x0e\x33\x4d\xd3\x03\x1a\x4f\xc7\x56\x91\x03\x89\x0f\x8a\x3a\x54\x2d\xbd\x93\x2b\x5b\x8e\x0a\xeb\x7e\x77\x97\x19\xb1\x0b\x80\x68\x82\xe3\x9c\x13\x5c\x53\x12\x38\x30\x6a\x0f\x84\x2f\x4c\x24\x70\x2a\x41\x5f\x52\x5d\xb4\x46\xc3\x05\x77\xfb\x43\xd4\xed\x0f\x90\xae\x1b\x91\xae\x6b\xbe\x88\x85\x48\x24\x81\x15\x88\xb0\xc4\x3c\xd5\xc0\x83\x42\xd9\x1c\x99\x05\x2d\xe4\xee\x28\x27\xb1\x71\xc0\x24\xbe\xe5\x0e\xaf\xc7\xe4\x9b\xa0\x70\x9b\xe9\xb9\x3d\x74\xe3\xfa\x80\x8f\xd5\xd5\x34\x15\xf8\x10\x8e\x19\x8f\x6d\xf9\x3e\x07\x4d\x4d\xe2\x7b\x1a\x8e\x8b\x94\xf9\x54\x0f\xfa\xdb\xc0\xcc\x36\x45\x13\xb2\x08\x1a\xab\x72\xd8\xde\x73\x42\xcf\xc9\x0d\x39\xd8\xd8\x23\x57\x8b\xc3\x88\xef\x5d\x9b\x26\x41\xd7\xdf\xdf\x0b\xbc\x5c\xde\xdc\xf5\xbd\x50\x19\xf6\x6d\x53\x27\xa9\x30\x63\x8a\x2a\xc5\x32\xeb\xb9\xfd\xee\xd0\xe7\xb1\x1a\x58\x33\xc9\x94\x53\xd1\xcc\x27\xf1\xd8\x10\x0b\xbd\x41\xbb\xef\xf2\x2a\x9c\xd0\x8f\x73\x3a\x4d\x8d\x98\xa6\x44\x93\x35\x54\xd0\x62\xbc\x65\xdb\xb3\x95\xd9\x19\x04\xac\x06\xe8\x63\x7f\xb4\xb5\xb5\x81\x00\x3c\x78\x00\x2a\x13\xd5\xec\xb3\x4d\x94\xc0\xf0\x61\xb6\x22\x0d\xae\x11\x2b\xbc\x2d\x8b\x1a\x00\xc0\x4a\x16\x49\x60\x68\x7f\xe3\x9a\x34\xd8\x53\x89\x69\x1a\x91\xc4\xb3\x76\x18\x25\x00\x34\x31\xf7\x0c\xf9\xbe\x52\x61\x08\x43\x83\x89\x34\x88\x70\xdb\x62\x1a\x75\x9d\x5e\x27\x5d\x9b\x9a\x2e\x8d\xaa\x13\xc6\x20\x57\x53\xfb\x24\xdb\x53\x25\xc9\xfa\xc9\x44\xab\x2b\xcf\xfa\x00\xb5\x1f\xff\xd5\x03\x78\x4f\xb4\x5f\x90\x0c\x9c\xb2\x9d\x5d\xb3\x94\x61\xd6\xc9\x9d\x8a\x6e\x34\x3c\xa6\x57\x31\xd8\x19\x57\xea\x01\x4d\xde\x87\x5f\x0e\xc1\xcd\x71\x41\xf4\x43\x0d\x93\x28\x3d\x7f\xf1\x6f\xc8\xe5\x6b\xe7\xf1\xfb\xde\xf5\x6d\xf8\xfb\xbf\xf7\xfb\xc8\xec\xcc\x34\x02\x30\x41\x2f\xbd\xf4\x72\xfc\xf9\x2f\x7c\x6e\x64\x99\x8a\x5b\xb0\xe4\xd0\x2a\xe8\x29\xef\xaf\xf4\x23\xa0\x78\x36\xc8\x4f\x04\x2e\x02\xa3\x5a\x04\x7a\x1d\xa5\x09\xd6\x14\x2d\x78\xf8\xec\xfd\x71\x00\x4c\x4e\x95\x55\xbe\x27\x16\xe5\xc0\x37\x76\xa4\x84\x7e\xc5\xa1\x68\x0b\xf1\xc1\x47\x06\x1f\x9e\xd7\xba\x22\xd1\x32\x24\x12\x61\x7c\xa0\x52\xb6\x4f\x2f\xb1\x2c\xe5\x93\x9f\xf9\x7d\xfc\xc1\x6f\xfb\x76\xf2\x9e\xc7\xdf\x8d\xf9\xce\x2f\xe0\x77\xa3\xdf\xf8\xf8\x6f\xc6\xbf\xf7\xa9\xff\xdb\xf7\x7a\x03\x07\x4e\x12\x62\x59\x04\xab\x04\x97\xbc\x03\x58\x1c\xd9\xc8\x9b\xb7\xfa\xe5\x3e\xb2\x0d\xf7\xad\x71\x3f\x6d\x8c\x53\x3c\x2d\x25\x49\x39\xea\x5c\x08\x5f\xff\xf3\xd7\x47\xaf\x3f\xf9\x71\xad\x50\x3e\xa4\xe4\x2a\xb3\xbc\x61\x06\x3f\xf6\xf3\x3f\xaa\xe0\xa3\x73\x59\x19\x66\xb6\x61\xed\xf8\x91\xbd\x61\x47\x5e\x22\x36\xc5\xe3\xc5\x9e\x46\x44\xb0\xac\xa8\xf2\xd0\x76\x64\xb9\xdb\xe7\x81\x36\x29\xe1\x3b\x43\x8e\x77\x72\xa4\xe3\x6e\xf9\x83\x94\x2e\x5f\xa1\x83\x8d\x85\xee\xec\xff\x74\xd0\x46\x9f\x45\xe5\xdf\xb0\x53\x6d\xe6\x1f\x1e\x6c\x6b\x84\x0f\xf6\x70\x7f\xf3\xfe\xc0\x6f\xc2\x68\x6e\xb5\xc1\xc6\xa9\x66\x6c\x02\x0c\xa8\xa0\xb3\xa0\x19\x58\xca\xc1\x0f\x61\xd2\xd9\xb0\xe3\xed\xef\x06\xdd\x9b\xed\x58\x4d\x7c\x2c\x1f\x6c\xac\xc4\xeb\xb9\x64\x5d\x09\x65\x4f\x06\x4c\x00\xfb\xe8\xc3\x7b\xa6\x90\x26\xe0\x92\xa0\xde\x03\x1e\xcc\x26\xbc\xaf\x8d\x49\x25\x18\xb5\x95\xed\xfe\x86\x5c\x98\x7d\xa7\x33\x62\x11\x6f\xe4\x84\x49\xb2\x40\x64\xe1\x5c\x9c\xb9\x60\x29\xcb\xb3\x22\xda\x1f\x89\x31\x73\xd0\x8c\xe1\x5d\x9f\xa8\xc4\x96\x4c\x69\x28\xc5\xd2\x88\x04\x52\x00\x18\x9d\xf2\x86\x5a\x91\x11\x64\x59\xd3\x70\xb6\x75\xcb\x78\x53\xa8\x90\x69\xa9\x8f\x06\xd8\xc7\xe0\x8b\xb2\x32\x4b\x99\x01\xab\xa9\x8a\xbd\x58\xc6\x9e\xf0\x70\xe8\xf2\x4a\x10\x38\x07\x8a\x40\xd1\x3d\x49\x93\x5c\x55\x57\x6c\xcd\x52\xdd\x21\xa0\xae\x3c\xe4\x1b\x96\x21\x12\x3b\xf1\x30\x74\x42\x37\xf2\x13\x0f\xc0\xdc\x82\x93\x68\x68\xdc\x66\xc0\x9b\x42\x5c\xf0\x3d\x01\xac\x7c\x60\x0b\xe0\x5e\x48\x01\x2f\x67\x06\x8e\x6d\x80\x01\x33\x41\xc9\x55\x51\xa1\x7b\x67\x3f\x3b\x10\x43\x90\x3f\x91\xd4\xa4\x34\xa0\x34\xf1\x1d\x67\x98\x26\x71\xaa\x83\x4d\x1b\x17\xc2\xb0\x18\x8e\x61\x53\x16\x8c\x82\x30\x0e\xe1\x38\xba\xcc\xb3\xb6\x94\x19\x1c\x90\x35\x85\x7a\xa6\x8e\x1d\x55\xe7\xbb\xf9\x32\x1e\x52\x43\xe3\xce\x6a\xac\xe8\x24\xd0\x0d\x0c\x60\x4f\x23\x70\xf3\xf5\x14\x2e\x0d\x80\x88\xf0\xfd\x13\xaa\xc5\x4a\x1a\x25\x83\xbc\xe7\x3a\x33\xd9\x68\xe2\xdd\x38\xe8\xc5\x69\xd4\x0d\x60\x25\x03\xd3\x54\x1c\xd3\x52\x3d\x20\xb7\x60\x43\x12\xd5\x1d\x45\x39\xcf\x65\x56\x12\x31\x3d\xa5\x62\xe7\x09\x11\xb1\x00\x95\xa0\xa1\x17\x01\x7a\xe2\x98\xc0\x75\x03\xc3\xf0\x81\x11\x87\x30\x26\x6e\x3c\xf5\x24\x64\xbc\xe8\x18\xd8\x2b\xf3\x01\xb5\xfb\x12\x0e\x5b\xaa\x1c\xb4\xcb\x79\xc3\x93\x61\x61\x78\x0f\x2e\x1a\xff\x6d\x16\x21\x49\x6c\xbc\x67\x19\x91\xc4\x6e\x15\xa9\x9c\x30\x95\x69\x40\xaf\xf5\xac\xd9\x9d\x37\x09\x1f\x34\xba\x47\x89\xe0\xb7\x94\xef\x02\xc5\x7b\x17\x81\x00\x38\x60\x90\xd6\xf7\x02\xd2\xda\xe3\x99\xdf\x24\x19\x0c\xc3\xd8\xf1\x43\x2d\x0c\x03\x25\x8e\x99\xd2\x1b\x0e\xa4\x5f\xfd\x9d\xdf\xc2\x5f\xf8\x8b\xbf\x42\x3f\xf9\xd1\x1f\x23\x1f\x78\xe2\xfd\xf8\x17\x7f\xf5\xd7\x07\xab\x1b\x2d\x1b\xe6\xc4\x0f\x03\x2f\xca\x95\x95\x14\x03\x49\x1e\xf8\x2e\x1e\x44\x43\x12\xc0\xb4\xc3\xd4\x93\x14\x68\x63\x14\x46\x52\xc0\xbb\x3d\x4a\x65\xc6\xab\xed\x53\xb1\x31\xfa\x9d\xdd\x2c\x44\x76\x8c\x07\x73\x62\x5e\xfd\x19\x02\x97\xf5\xfc\x28\x21\x30\xe9\x8a\x96\xe1\x6a\x16\xb0\x89\x78\xed\x2b\x80\x8d\x2c\x81\xbb\x19\x0c\x6d\xfc\xef\xfe\xe3\x7f\x48\xce\x9d\xbd\x4f\xf9\xb3\x2f\x7f\x91\xfe\xc2\x2f\xff\x42\xb8\x72\xf3\x46\x88\x54\x25\x20\x79\x93\xff\xb5\x9b\x48\x6c\x6f\x91\x88\x0e\xf2\xbb\x31\xac\xee\xb0\x0f\x82\xdb\x7f\xe3\x3e\xe3\x6c\x1c\x86\x77\x04\xd3\x02\x57\x04\x68\x99\x0f\x17\x53\x07\x64\x2e\x49\x3a\x03\x21\x1c\xca\xee\xe0\x65\x75\xd4\x7d\x41\x01\xc5\x56\xed\xc1\x87\xaa\x20\xb9\xd2\xdd\xed\x4f\xd8\x7f\xb2\x1f\x26\x07\xc6\x5b\x6b\xb7\xd1\x30\xe8\xe2\x4a\xb7\x40\x2e\x5c\xbc\xe0\xf3\x76\x0c\xb0\x4a\x82\x85\x65\xfb\x22\x8d\xf7\xf3\xca\xda\xc5\xc5\x56\x31\x77\xd1\x68\x8c\x40\xec\x1b\xfe\x02\x02\xbe\xbb\x21\xf7\x9d\x3f\x40\xf1\xe6\x0a\xfe\xbb\xe3\x60\x6f\x50\x9b\x37\x6d\xd0\x29\xfe\xfc\x47\x0a\xb3\x19\xc0\x00\x86\xb2\xd8\x5b\x91\xff\x69\x1f\x58\x1f\x96\x8e\x42\x16\xba\x41\x1a\x80\x52\x01\xa8\x26\x59\x46\x83\x2f\x92\x86\xb5\x14\x16\xc5\x97\x10\x1e\xf1\xbc\x0d\xbc\x1b\xf0\x51\xc3\xec\x3a\x44\xe5\xd9\x3d\xd0\x13\xbe\x7b\x4e\x2a\xea\x75\x63\x71\x19\x12\xf2\x88\x86\x1c\x60\x5a\x91\x00\x29\xb0\x49\x70\x4c\xf0\x07\x41\x51\x41\xc8\xc7\x5b\x5b\xf3\x91\x02\x54\x00\x98\x48\x28\x14\x7f\x86\x44\xa3\x2e\xc0\x84\x9f\x4a\x00\x19\x54\x6c\xd5\x38\xde\xf3\x69\xbc\x8d\x09\x3b\xd8\x6e\x66\x7c\x59\x40\x33\xc4\xfe\x76\x7c\x2b\xaa\x08\x05\x70\x4c\x13\x71\x29\xa7\x48\xb9\xb3\x53\x0a\x1c\x1f\x96\x9d\xd7\x34\x04\x4c\x61\x2e\x55\x53\x37\xd1\x39\x93\x03\x59\x65\x61\x82\x43\x9e\x8d\xe0\x3b\x15\xc0\x0b\x98\x8f\x94\xa5\x2e\xac\x55\x1e\x96\xcb\x18\x6f\xba\xce\x19\x5d\xca\x5d\x36\x50\x5e\x37\x82\xcf\x01\x1d\x78\x39\x3d\x70\x35\xaa\x03\xa3\x36\xc0\xa5\x52\xc7\xdb\xba\x88\x98\x2a\x1c\x0b\xae\x93\x37\x6d\x73\x07\x8d\xf8\x24\xa0\x0e\xe1\x85\x25\x09\x7c\x3f\xa6\x39\x38\x36\xaf\xda\x8f\x89\xc7\x6c\xd9\x65\x43\x70\x81\xe1\xb0\xc0\xa2\x82\x34\x07\x8a\xae\x89\x1e\x6f\x18\x2f\x56\x62\x87\xbb\xd7\xf0\x9e\x02\xec\xd8\x84\xf3\x19\x82\x6d\x12\x71\xad\x91\x70\x0f\x23\x56\x62\x42\xe0\xf9\x4e\x29\x29\xc9\xeb\xb9\xb0\xbf\xd2\x3f\xbb\xb2\xbe\xa2\x55\x4a\xf5\xd1\x8c\x7c\xe4\xd5\xab\x97\x3b\xd7\x7b\x83\xb8\x4f\x64\xea\x21\x12\xba\x7c\xd3\x59\x30\xe0\x31\xcc\x9a\x0a\xbc\x33\x07\x6b\xc2\x81\x92\x1b\x14\x2d\x8b\xaf\x0a\xa9\xe2\x15\x37\x31\xff\x2b\x51\x7c\x2b\x35\xd0\x55\x97\x5f\x71\x96\xa5\x4e\x2d\xf8\x3e\x0f\xab\xf0\x1c\x48\x48\x48\xd2\x6b\xed\x86\x9d\x5b\x37\x06\xa3\x21\xde\x8d\x16\x26\xe7\x59\xc3\xac\xc3\xb0\x12\xa1\xf3\x52\xf6\x07\x18\xee\xec\x20\x24\x7b\x26\xcb\xb7\x6b\x68\x5b\xdb\x60\xb7\xfc\x57\x51\xe2\x85\x08\x17\x44\xa6\x04\x78\x5f\x84\xc8\x44\x13\xd1\x51\x95\x21\xf7\x3c\x92\xf5\x02\x4a\x4b\x05\xe4\x39\x3b\x78\x6d\x70\x15\xd9\xf1\x88\x38\xb1\x2d\x03\x02\x87\x00\x2a\xe0\x8e\xa7\xe0\x8a\x52\x8d\x25\xa9\x0c\x72\x27\x5d\x59\xb9\xce\x7e\xe2\xe7\x7e\x26\xf9\xb5\x4f\xfc\x66\x72\xfd\xfa\x75\x17\xe6\x24\x70\x43\x3f\xc2\xdd\xbd\x98\xec\x6b\x4c\xca\x19\x98\x0a\xe7\x81\x57\x56\x88\xd8\xcc\x78\xfb\x09\xca\x93\x0c\x4c\x94\x45\xe1\xbb\x65\x7e\x07\xfa\x35\x26\x2a\x0c\x74\x59\xd4\x4d\xb1\x30\xa6\xa2\x34\x5f\x87\x29\x50\xe5\xf1\xd6\x21\x20\x85\xa2\x7a\x12\xf3\x6d\x22\x88\x9c\xcf\xc9\x2f\x5d\x7a\x0d\xbf\xeb\x3b\x9f\x88\x96\x6f\x2d\xc7\x29\x58\x26\xa9\x60\x85\xa2\x7f\x50\xdc\x49\xc2\xc1\x0a\xeb\x0a\xc2\x86\x7a\x97\x61\xdd\xda\x5a\x47\xdb\x9b\xeb\x48\x2d\x57\xde\x14\x7e\xe7\x7b\x55\xc0\x90\xf8\x46\x55\x6d\xb8\x07\x60\x3a\x7a\x98\xd7\xa8\x63\xa4\x03\x99\xcf\x21\xdd\xa8\x60\x9a\x56\x70\x4a\x0b\xe3\x3d\x14\x19\x6f\xdd\xe1\x21\x06\x70\x3f\x44\x68\x88\x37\x89\xf2\x8f\x78\xcb\x82\x60\xd4\x86\x43\x1e\x3c\x7b\x56\xfe\x37\xff\xfe\xff\xbc\xfa\xe4\xb3\x5f\x7b\xb2\x3c\xd9\x60\xae\xe7\xe2\x83\x4d\x6b\xff\x5f\xe6\xae\xe5\x37\xae\xab\x8c\x7f\xe7\xdc\x73\xe7\xce\x38\x1e\x8f\x53\xbf\x9a\x10\xbb\x21\xa1\x88\xaa\x48\x50\x05\x76\xb0\x01\x04\x1b\x76\xc0\x0e\xc1\xdf\x81\x04\x7f\x06\x42\x2c\x58\x01\x8b\x50\x2a\x81\x84\x54\xa4\x4a\x48\x65\x87\x50\xa5\x40\x52\x54\x55\x22\xa5\x24\x71\xa6\x1e\x3b\x19\xdb\x33\x9e\xb9\xaf\x73\xf8\x5e\xf7\x31\x8e\x9d\x84\xb0\x61\xa2\x38\xf1\xcc\xdc\xf7\xf9\x7e\xdf\xfb\xf7\x71\xd5\x82\x44\x99\x2a\x2a\x75\xc9\xf3\x85\x06\x95\xc4\x35\x3c\xdb\x56\xd2\x6e\x14\x53\x03\x95\xb2\xd6\x9a\x8a\x53\x4a\xeb\x1f\x4c\xf5\x3e\x7b\x61\xb2\x43\xf2\x32\x7d\x54\xa2\xeb\x9a\xcd\xf1\x96\x8f\xf1\x9d\x13\xc3\x71\x77\x3f\xb7\x1d\x13\x7a\x71\x92\x18\xd7\x73\x75\x29\x39\xfa\x50\x0e\xff\x44\x64\x18\xe7\x36\x45\x68\x99\x50\xec\xde\x72\x2b\x81\x41\x4d\x81\x40\x4f\xf6\x3c\x81\x51\x8e\xbe\x78\x49\x0e\x31\x39\xda\x26\x43\xd5\x39\x47\x2c\xf1\x4c\xa9\x44\x51\x90\x3c\xe4\x8d\xf5\xc3\xfb\xa7\xa2\x0c\x76\x49\x11\xac\xd0\x34\xc6\x6d\x1c\xee\xc5\x11\x5c\x52\x81\x1a\x1e\x81\x83\x7c\x3c\x13\x88\x6b\x6b\x0c\x97\x3b\x87\x9a\x97\x8e\xa5\xc1\x11\x3c\x85\x19\xee\xbd\x44\x60\x9c\x13\xf5\x08\x83\x22\xd3\x10\x71\xe1\x34\x1d\x03\x8d\x7f\x5c\x20\xf8\x17\x15\x2c\x9e\x9b\x2f\x0a\x4b\xe4\xb8\x46\x4c\x65\x5a\x78\xf8\xbe\x47\xb8\x03\xea\x72\x4c\xc3\x24\x50\x1c\x8b\xd9\x50\x49\x13\x99\x02\xb7\xc1\xed\xd1\x5a\xea\xc0\xbc\x8c\x25\xe8\x8d\xe7\xea\xf0\x5b\x31\x91\x35\x08\xb8\x0a\xb5\x27\x5e\x6b\x1c\x18\xb0\x88\x27\x11\x08\x28\x53\xa2\x44\x02\xa2\xa3\xc1\xb5\x15\x28\x92\x82\x6e\x16\x7a\x55\x53\x94\x96\x13\x4f\x69\x38\x32\x66\x68\xbb\x82\x46\xca\x71\xf0\x20\x43\xad\x9f\x12\x5b\x02\x10\x67\x62\x1e\xc5\x36\x44\x0e\xd8\x12\x41\xb7\x1c\x8f\x99\xf8\xa4\x9f\x20\xc6\x44\xe0\x12\x62\x76\xa7\x4e\x96\x47\xe3\x83\xf4\xfa\xab\x57\xdf\x1b\x7c\xe5\x5b\x07\xfd\xe5\x95\xc3\xa3\xc9\xf1\xad\xdd\xd1\xee\xed\x34\xcf\x4e\x72\x93\xa3\xb3\x33\xcf\x8e\xfd\x24\x47\x25\xe5\x37\xa3\x75\xb7\x62\x57\xba\x89\xed\x74\x1d\xb8\x1e\xde\x8d\x44\xd9\x78\x69\xf1\x90\x6c\x90\xd6\x20\x5e\x8d\x14\x81\x7c\x8e\x0a\x0c\x17\x3b\x95\x28\xdb\x5e\xd5\x8f\x8b\xdb\x50\xdf\xfc\x34\x4b\x67\x27\xd9\x38\x4b\xaf\xbc\xbe\xed\x2f\x6d\xf6\x61\x35\x49\x98\x79\xf7\xf4\xcb\xbb\x0c\x56\xee\x6d\xc1\x6b\xff\xf8\x2a\x7c\xbc\xfe\x4b\x78\x73\xf7\xa7\x90\x0f\x33\x80\xab\xdb\x00\xc3\x21\x50\x9a\x19\xbe\xf9\x35\x80\xbf\x7d\x1d\x60\xef\x67\x00\x6b\x97\x01\x3e\x77\x1d\xef\x2b\x8a\xe9\xe1\x3d\xc9\x40\x19\x4e\xa8\x53\xba\xaa\xa0\xf2\x2c\xa2\x42\xa3\x89\x12\xf8\xa1\x8b\x97\x97\x3c\xaa\xa2\xfc\xce\x07\xb7\x33\xfc\x1e\x29\xaa\x9c\xbd\x08\x3f\x47\x1b\x04\x2d\xbf\x19\xea\xaa\xad\x81\x54\x0d\xa9\x0a\x64\xd1\xc1\x35\x85\x60\xc4\x81\xba\x96\x74\x2d\x58\x0d\x84\x6b\xb3\xd9\x4c\xa8\x16\x89\xb3\x04\x55\x5e\xf9\x68\x0a\x76\xb0\x1c\xec\x52\xec\x41\x38\xf5\x19\xb4\x78\x8d\xba\x28\xa6\x65\xf1\xc1\xdd\x0f\xa9\x72\xb4\x88\x96\x7b\x54\x0c\x45\x8e\x71\xc6\xeb\x9e\x1e\x73\x12\x07\x7c\x04\x61\xa1\xf9\x99\xe7\x8e\x45\xd1\x82\xbb\xe4\x67\x99\xf0\x57\x26\x31\x15\x3d\x4c\x15\xf5\x8e\x48\xcb\x70\xbf\xa1\xe1\xba\xf6\x1d\xfc\x0a\x3d\xc8\x7e\xb7\x93\x70\x2b\xc8\xfa\xc6\x7a\x68\x02\xfa\x42\xef\xa2\x3a\x9f\xd8\x16\xec\xe6\xda\x56\xf4\xa3\x9f\xfc\xf8\xc3\x5f\xdc\xfc\xd5\x6f\x56\xd7\xd7\x1f\xce\x67\x33\x59\xb8\x12\xa7\xb1\x42\x0e\xc9\x71\xf3\xca\x33\xa6\x00\xa1\x32\xf5\x28\x14\x59\x4e\x02\x0a\x55\xad\xa9\xa3\x53\x55\x23\xb4\x94\x75\x98\x9a\xb5\xad\xed\x8d\x50\xf0\x5f\xc9\x1e\x40\xc3\x5d\xba\x67\x5b\xb5\x46\x53\x74\x2a\x2a\x6d\x40\x4b\x8b\x6e\x1c\x45\x5b\x5d\xe4\x3b\x4e\xbc\x46\x6d\xd0\x33\xfa\x02\x2d\xa1\xb0\x28\x9c\x25\xda\x51\xf4\x44\x53\x66\x8f\xb0\xe4\x3c\x48\x3c\x0f\x35\x16\xd1\x4d\xcc\xa8\x0f\x59\xb8\x35\x59\x3b\x97\x3a\x86\xc0\x73\x1a\x95\xb4\x35\x89\xaf\x32\x46\xf0\x65\x51\xd9\x3f\xd5\x81\x46\x54\x0a\x4c\x4c\x67\x64\x46\xe1\xcf\x82\x93\xb0\x41\x40\xd3\xd6\xe6\x18\x11\xb2\x09\xc5\x97\x5a\x80\x5c\xc9\xa6\xe9\x97\x04\xc8\x82\x43\xf9\xe6\xca\xd2\xea\x61\x7b\x43\xad\x4c\xb8\x38\x10\x22\xc8\xed\xf4\x32\xc5\xc9\xd8\x8a\x7d\x53\x39\x7e\x79\x1a\x17\x27\x82\x11\x38\x81\x60\x03\x41\x85\x9b\xcb\x99\x65\xcc\x73\xfa\xba\x88\x10\x60\x05\xac\x98\x01\x05\xaf\x9b\x78\x70\x33\xe0\x7e\x73\xa6\x58\x09\x32\xbd\x8d\xc8\xac\xb9\x1e\x8e\x24\xa5\x44\xab\x2a\x2f\x89\x09\x92\xf6\x92\x03\x8b\x18\x39\x1d\x85\x29\x10\x46\xd0\xa6\x2d\x73\xaf\xe3\xc6\x38\x30\xe0\xf9\x37\x44\x7f\xdc\x0c\x37\x25\x4a\x22\x40\x17\x1e\xdd\x78\x47\xd9\x54\x1f\xe3\x49\xbc\x64\x5f\xea\xc6\x28\x01\xf8\x7f\x10\x0b\xc6\x78\x87\x1f\x8f\x3e\xd9\x9b\xe0\x0e\xee\xf5\x07\xfd\xbf\x1c\xec\x1f\x1e\xef\xee\x3d\xd8\xc3\xbd\x1c\x65\x51\xee\x0f\xfd\x61\x39\xf4\x23\x7f\x5c\x1c\xfb\xac\xcc\x60\x12\x4d\xfd\x2b\x6e\xbb\x1c\xd8\x95\x79\x62\x3a\x13\xe5\xe6\xb4\xaa\x0d\x68\xf5\x91\x4b\x58\xa2\xce\x2a\xc8\x3d\x8f\xc9\xa0\xc2\xa7\x86\x4a\x1a\x65\x05\x41\x5d\x7a\x73\x49\x80\x73\x7c\x1e\xc5\x95\x4b\x9f\xf2\x37\xae\xbd\xc1\xe3\xd3\x88\x16\xfc\xcc\x00\xb2\x32\x2f\x47\x4e\x3c\x12\xaa\xe7\xa3\x1e\xb6\x6e\x84\xff\x76\x96\xa0\xcc\x26\x12\x5a\x76\xea\x0d\xb9\xae\xfc\x9e\x5c\x04\xe8\xa0\x0e\x2c\xc6\xec\xa2\xd3\xed\xd5\xc6\x07\xb1\xd4\x69\x2c\x07\x77\x99\xd2\x58\x0e\x2e\x5f\xa2\xa6\xc4\x82\xda\xab\x21\xa3\xc9\x2b\x5b\x88\x79\x23\x0a\xf8\x01\xbc\xbc\xda\x8e\x95\x04\x1d\xf5\x14\xe6\xa8\xc7\xbb\xdd\x2e\x38\x17\x33\x79\x67\x7b\x98\x80\x26\xb5\x20\x4d\x53\xaf\x11\x0a\x40\x67\x1d\x08\xb4\xc2\xf2\x25\x5c\xb0\x73\x31\x80\x84\xd6\x29\xe5\x68\x11\x13\xb2\x00\xb1\x9e\x90\x0e\x2a\xc4\x40\x12\xd9\x30\x71\xe4\xb9\x06\x20\x96\x99\x88\xb4\xa6\xcf\xef\x25\x24\x9d\xdd\x8d\x8d\x86\xa7\x99\xdd\x96\x62\x0a\xcc\xa1\x2c\xa6\x8a\x15\x7a\x07\x18\x20\x70\x50\x6a\xab\xfc\xf5\x5b\x6f\xce\x6e\xbd\x7f\x3b\x2a\xf2\x5c\x0b\xca\x43\xf5\x00\x2a\x37\xae\x8c\x5d\x5c\xfc\xfd\xce\x9d\xe1\x5b\x6f\xff\xee\x8f\x9d\x95\xfe\x83\x59\x36\xe3\xcc\x97\x5a\x3f\x1a\x28\x17\x13\x88\x68\x65\xf4\x17\xc9\x01\x4a\xd6\x4f\xab\x13\xd8\xac\x04\x09\xbe\xdb\x0a\x6f\x18\xca\x74\xc8\x23\xc3\x55\x64\x24\x7f\xb6\x10\xae\x0f\xa6\x1a\x04\x29\xb5\x10\x1a\x86\x31\x75\xe7\xb0\x61\x9e\x52\xb2\x89\xad\xee\x89\x8b\x60\x73\x31\xf6\x4c\x6b\xf8\x59\x8b\x63\x4b\x58\x73\x41\xca\xe9\x55\xca\xeb\x29\x2a\xea\xd4\xe6\xed\x41\x52\x5a\x2e\x55\x35\x6e\xe6\x56\xe9\x7c\xa5\xc0\x42\x50\x98\x8d\xbf\xd6\xa2\x51\x7c\xac\x4d\x4a\x23\xb6\x66\x13\xb9\x93\xbb\x15\xf4\xf3\x50\xf5\x30\x4b\x60\xb4\x99\x25\x58\x93\x70\x1a\x21\xcf\x54\x0d\x2a\x54\x87\xf5\xe8\x17\x19\x98\x10\x5a\x8e\x66\x90\x6b\xa5\x85\xce\x25\x2c\x55\xd0\x90\x9d\xf9\xa0\x44\xc7\x20\x7c\xa1\xec\x87\x72\xe8\x41\x92\x59\xbe\x61\xb8\x63\x86\xd1\x50\xca\x1e\x4b\x22\xbc\x23\xa9\xf1\x1c\x8e\x13\xbb\x90\x10\x9d\x78\xee\x7c\x81\xc6\x58\x51\x56\xb4\xc2\x4c\x3e\xaa\x7b\x51\x5e\x52\xde\xa1\x97\x73\xa3\xf3\xf7\xe4\x66\x6d\xc6\x9b\xe6\xe5\xee\x65\x72\xd7\xd3\xd8\xb8\x19\x4d\xfa\xd1\x9b\x44\x6b\x76\xbc\xff\xc9\xc1\xee\xf0\xe1\x70\xf7\xc8\x1f\x1d\xfe\xbb\xb8\xcf\x74\x7e\xc3\x62\x14\xe6\x01\x85\xb5\x4c\xe1\xda\xd6\x6b\xb0\xb6\xb4\x86\x90\x58\xf8\x8e\x49\x42\xdf\xf6\x8b\x8d\x68\x3d\x45\x2b\xcb\x84\x66\x20\x63\x10\xa2\x4a\x1f\x76\x5e\xd9\x0e\xfd\x95\x3e\x83\x4d\x96\x65\xfe\xee\x3f\x3f\x2a\xf5\x58\x7c\x87\x28\xb6\x78\x65\xe7\x4a\x58\xdf\x58\x43\xe4\x28\x64\x72\xd4\x79\x33\x22\x51\x2c\xa7\xe6\x31\xbc\xef\x6e\xc1\xbe\xb9\xc7\x04\x2a\x4d\xe0\x22\x9c\x3f\x7a\xc4\x73\xc9\x30\xe4\xc9\x8d\x10\x4d\x72\x88\x3a\xef\x05\x32\x71\xeb\xf0\x8e\xf0\xf4\xb1\x16\x64\x45\xc5\x56\x50\x51\x52\x73\xb1\xdf\xba\x0e\xe1\xf8\x1b\x01\x4e\x7e\x8e\xfe\x29\x1a\xce\x6e\x10\xa2\xe2\xb1\x92\xec\xc9\x81\x8d\x73\x61\x7f\xfc\x38\xfc\xe9\xdd\x77\x43\xbf\xbf\x0c\x35\x2b\x69\x33\xee\xc4\x13\x58\x8d\x46\xa3\xbc\x1e\x39\xc4\x39\xa6\x14\xf7\x49\xbd\x82\x1b\xc1\x95\x9f\x48\x2c\x5a\x88\x98\x4b\xa3\xa9\x30\x94\xf6\x3a\x33\xc7\xdd\xb0\xb4\x5e\x49\x1d\xd2\x84\x2b\xdf\x2c\x49\xf7\xd4\x11\x92\xc6\xb4\x51\x16\x16\x02\xdd\xa6\xce\x24\x4e\xf1\x98\x63\xc0\x55\x71\xf3\x9d\xdf\x3f\x86\xb7\x7f\x0b\xf5\x9c\xa4\xa0\x6e\xb9\x4c\x88\xc5\x8b\x08\x63\x3c\xf8\x7d\x34\x03\xef\xc7\xeb\x83\x11\x81\x60\xa1\x04\xbe\xea\x7f\xda\x56\x06\x8f\x06\xe3\x99\xaa\x9e\x8b\xd1\x3b\xaf\xe2\xf9\x2a\x6a\xb5\x5b\xa7\xd6\x18\xd7\x6a\x59\x30\xad\xfa\x2f\x75\xdd\x1a\x6b\x28\x54\xb8\xd4\x0c\x34\x31\x0d\x53\x69\x33\xe0\xa4\xf1\xcd\x8d\x69\xf8\xc0\x0d\x34\xe4\xea\xa6\x9e\xf2\x59\x8f\x7f\xa8\xe8\xd6\x8d\x69\x2d\x28\x73\x2a\xfd\x6a\xcc\x39\x03\x3b\x4f\x1b\xd9\xa6\xfd\x23\xc0\x13\x71\x37\xdd\xd3\xe9\x71\xa6\xe1\xd4\xfc\xc4\xd0\xa4\x20\x74\xe1\x29\x9e\x56\xa0\x26\x0a\xdd\x2c\xa4\x27\xa0\x09\x85\x05\xed\xf2\xa9\x31\xab\x59\x0f\x92\x62\x57\xc5\xc4\x7c\x7c\x3a\xb3\xb6\xe2\xdf\xac\x49\xce\x7d\xd0\x21\x69\x8c\x48\x35\x95\xb0\x17\x1a\x1b\x65\xa0\x64\xdf\x1b\xe1\x8b\x69\x3a\x59\x0f\x84\x2a\x1c\x57\x9d\xbb\xe7\x1e\x2a\x39\x9f\x52\xab\x91\xea\x61\x1c\xa4\x85\xc9\xfd\x2e\x89\xc4\xba\x07\xcb\xd1\x85\x14\xdd\x75\xb4\x8a\xa2\x47\x56\x8c\xa2\xae\x82\xc8\x63\x5c\xf9\x63\x13\xe2\x14\xf1\xd0\x1f\xc6\x47\x7e\xfb\xe2\x8e\xf9\xee\x67\xbe\x13\xa8\x7b\x83\xce\xe9\xb3\x1b\xaf\xc2\xc5\xde\x2a\x07\x96\xa5\x50\xc4\xab\x02\x6e\x67\x6e\x4c\xb5\xc8\x79\xa0\x68\x35\xbe\x2b\xe9\x26\xf0\xc6\x97\xbe\x18\x4e\xdf\x7f\xa6\x13\xaf\xa6\x9f\x3f\xe5\xe5\xd0\x14\x7e\x68\xef\xc2\x1f\x7a\x37\x61\xea\x26\xd0\xf1\xdd\xca\x16\x16\xe1\xe5\x18\x12\x89\x4c\xa7\x75\x04\x09\x78\xf3\xe9\x39\xb4\xc2\x86\x83\xe0\xf3\x77\x20\xda\xd9\x04\x9b\x44\xa5\xb0\x3a\xa8\xb4\x80\x97\x32\x46\xee\xf9\x49\x42\xa0\xe9\x0d\xaf\x7f\x21\xc0\x5f\x57\xa4\x8d\xb8\xec\x34\xd0\x20\x0a\x8c\xaa\xeb\x0b\xd7\xe9\x94\x1f\xef\xde\x2b\xbe\xfd\x83\xef\x95\x91\x06\x1d\x58\x35\x72\xe2\x84\x29\x24\x52\xd4\x2d\x27\x45\x96\xcd\xd8\x3a\x2a\x29\x19\xb4\x15\xb8\xd8\x80\xbc\xbb\xf2\x12\x50\xf6\xca\x45\xbb\x5e\xfb\x70\x2a\x2b\x45\x3a\x6f\xa8\x51\x8e\x2a\x92\x29\xfb\xee\xac\x76\xc9\x84\x53\xf7\xe6\x45\x07\xe6\xca\x7b\xb9\x56\xc4\xff\x0b\xff\xee\x77\x96\x97\xec\x39\xdb\xd0\x73\xa5\x8a\xb5\x31\xfe\x1f\x6d\x4e\x38\xac\x5a\xad\x4d\x0b\x0e\x1b\x00\x08\x15\x17\x30\x7f\xc6\x2d\xcf\xdc\x84\xa3\x5f\xe7\x10\x8d\x85\x7a\x34\x1c\x47\x58\x04\x15\x4d\x23\xad\x46\xf3\x84\x66\x01\x78\xaa\x72\x89\x9a\xa4\xfb\xd4\x84\xd4\xa0\xf4\xc9\x6d\x3b\x0a\xea\xe3\x9e\x75\x2f\x9e\xf5\xfb\xf9\xf3\x84\xcd\xd3\x36\x34\xcf\x35\xcd\xeb\x9c\xa1\x9d\xe1\x49\x9c\x5c\x78\xe7\x49\x35\xdd\x52\x31\xd0\x8c\xd2\x0b\xad\xcf\x43\x95\x77\xad\xec\x4a\x9d\xda\x10\xea\x14\x48\x8d\x2d\x26\x84\x85\x81\x7c\x50\x03\x8f\x97\x9e\xa8\x86\x97\xbe\x1e\x99\x22\x6a\x4a\xe0\x4f\xc7\x73\x1b\x15\x98\x06\xa4\x39\x9a\x5e\xcd\x9b\x31\x12\xc2\x58\xbc\x16\x0a\x2c\xe1\xd2\xda\x2b\x46\x70\x2d\xba\x9a\x75\x6d\xef\x58\x38\xdd\xc9\x74\x62\xda\x24\xd4\x91\x61\x82\xcf\xf7\x08\x4d\xb1\xf4\xcb\x9f\xbe\xe1\x7f\xf8\xf9\xef\xf3\x55\xc5\x51\x5c\x8f\x47\xcb\x8a\x0c\x8e\xd3\xc9\x8b\x8c\x7b\xd4\x59\x12\xfe\x7f\x1a\x1a\x49\x9d\xb7\x3d\xb8\x00\xa3\xf4\x11\x4c\x93\x02\xa2\x0d\xb4\xde\x62\xf4\xac\x57\x13\x00\x12\xb3\x31\x82\x40\xef\xcf\x00\xf8\x3e\x2c\xa1\x18\x9e\xec\x49\xc0\x86\x72\x44\xd9\x5d\x80\x55\xbc\x96\x59\x17\x1f\x1a\x91\xfb\x31\xa3\x60\x63\x70\x68\x62\xcd\x18\x17\x7c\x8c\x20\x65\xe7\x10\x8d\x3e\x42\x38\x3f\xc0\xfd\xad\xb0\xdf\x6f\xfd\xb4\x91\xce\xc0\xd6\x19\x3a\xea\x26\x35\x8e\xab\xbe\x2d\x55\xc2\x07\x65\xcb\x97\xf4\x34\x7a\x5f\x05\x1e\x3c\x2f\x66\x24\xeb\x1c\x3f\x73\x51\x88\x06\x74\xdc\x25\x44\x1a\xb2\x57\x1e\x70\x0c\x9d\x1a\xdd\x4d\xf0\xf5\xf3\xaa\xe7\xd0\xd1\xf9\x39\xfb\xd4\xa5\xed\xfe\xab\xe7\x70\x36\x60\x1d\x68\x7c\xcb\xd5\xcb\xfd\xec\x57\x29\x7e\x2b\x37\x56\x17\x4f\x15\xdf\x36\x58\x98\x53\x6a\x4a\xc1\xc5\x2f\xca\xa4\x69\x4d\xe4\x35\x55\xe9\x43\x38\x7d\x84\x27\x87\x62\x9a\x33\xc4\xb6\x6d\x35\xc1\x73\x80\xf6\x0b\x0d\x5c\x5e\x58\xdd\xcf\xfb\xfd\xe7\xfb\xee\xf3\x3e\xbf\xf3\x3e\x0b\xe7\xbe\x1f\xce\x50\x43\xe6\x59\xdb\x9a\x05\x40\x31\x8d\xb1\xa8\xc2\xb3\xe0\x21\x6b\xf6\xc9\x3e\xeb\xbc\xcf\xbd\x1e\x9a\x23\xb0\x33\xd8\x86\x2b\xab\x97\x61\xc5\xa3\xb4\x3c\x0a\xb3\x08\x2c\x65\xf2\x26\x50\xc5\x93\x50\xf8\x68\x46\xd6\x85\xde\x05\xbf\x7d\x75\x5b\xfc\x25\xaf\x69\xfa\xff\xa3\x17\x2d\xf7\x69\x7e\x82\xb8\x13\xa0\x73\x61\x00\xa1\xcc\xc0\x0c\x12\xf4\x94\xd0\x24\x1a\x0f\x11\x60\xee\x23\x16\x0c\xd8\x15\x84\xd9\x48\x75\x05\x5e\x62\x86\xf6\x03\x91\x21\xac\xae\xe2\x85\x65\xea\x98\x9a\x27\xef\x19\x65\x2f\x60\x9f\xa3\x59\x70\x70\x84\xfb\x43\x10\x59\xea\xeb\xbc\xa5\x19\xd4\xee\xa0\x21\x79\x35\x33\x43\x89\x15\x26\xfd\xb5\xca\xec\x5b\x3f\xc9\x92\x63\x4f\x65\xa0\x8a\x54\xca\xe6\x4a\xb0\x9c\x86\x5c\xac\x79\x01\x2c\x4f\x43\x6e\x87\xea\x6d\xd9\x17\x5e\xcb\xff\x11\x60\x00\x17\xfd\x42\x18\xab\xa4\xd2\xf7\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\xd5\xdc\x0d\xab\x2a\x53\x00\x00")) - filestamper500x48 = HexToBytes("filestamper500x48", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x07\x40\xf8\xbf\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x01\xf4\x00\x00\x00\x30\x08\x06\x00\x00\x00\xe7\xd8\x88\x9c\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\xb2\x38\x49\x44\x41\x54\x78\xda\xec\xbd\x09\x90\x65\xd7\x79\x1e\xf6\x9f\x73\xd7\xb7\xbf\xd7\xfb\x32\x3d\x3d\x33\x3d\xfb\x0c\x80\x01\x30\x00\x48\x10\x20\x01\x50\xe0\x4e\x85\x12\x43\x49\x51\xb4\xc7\x96\x14\x55\xd9\xb2\x53\x56\x59\xb1\x2b\x92\x12\x5b\xb2\xe2\x52\x24\x57\x12\x25\xb2\x25\xd9\x51\xd9\x96\x1d\xc9\x5a\x28\x53\xe2\x26\x71\x01\x09\x92\xd8\x88\x7d\x06\x98\x7d\x7a\xba\x7b\xa6\xb7\xb7\x2f\x77\x3d\x27\xff\xff\x9f\x7b\xbb\x1b\x0b\x69\x4a\x56\x5c\xb6\x0a\x0f\x78\xf3\x5e\xbf\xe5\xbe\x7b\xcf\x3d\xe7\xff\xbe\xef\xdf\xae\xd0\x5a\xc3\xeb\x6f\xde\xc9\x79\xf8\xab\x74\x0b\xcf\xad\xfe\x95\x3a\x9e\xef\x39\xfb\x63\x3b\xcf\x1f\x7e\xf4\x21\x78\xeb\xf6\xd6\xed\xad\xdb\x5b\xb7\x3f\xef\xed\x6f\x7e\xfc\xef\x08\x7a\xd4\x51\x22\x41\x69\x81\x77\x4b\xa7\xca\x06\xad\x6d\x50\xe0\x15\x8a\x63\xb5\xdf\xff\xe7\xff\xbc\x74\xf2\xd8\xbd\xd6\xbf\xf8\xed\x3f\x81\x67\x5f\xbc\x04\xae\x63\x83\xe7\x39\xa0\x94\x02\x69\x49\xf0\x5d\x07\x7c\x1f\xef\xae\x8b\x77\x0b\x3c\xfc\xdb\xf3\x6c\xb0\x2d\x07\x1c\xdb\xa2\xad\x83\x83\xdf\x39\x7a\x78\x1f\xdc\x5c\xdf\x86\x8d\xcd\x16\x7e\x57\x43\x18\x8f\x60\x30\xec\x43\xbb\xdb\x86\x76\xa7\x85\x8f\x2d\xe8\xf6\xda\xd0\x1f\xf6\x60\x38\x1a\x40\x18\x05\x90\x26\x31\xa4\x2a\x05\xc2\xa8\x52\x7d\x02\xc2\xa4\x06\x9d\xae\x03\x51\x22\x70\x9b\x0e\x58\x96\x05\x42\x4a\xdc\x0f\x8b\xef\x16\x3d\xe7\xbb\x79\x9d\xfe\x16\xd9\x6b\x02\xf0\x7d\xdc\x5f\x10\x02\xff\x17\xe6\x35\x7a\x9e\x3d\xe2\x1b\xf4\x16\xfd\xcb\xfb\xcc\xa8\xa8\xcd\x33\x3a\x56\x73\x4f\x71\x9f\x52\x48\xe2\x18\x12\xdc\xb7\x28\x8e\xa0\xd7\xe9\x81\x56\x31\x4c\x8f\x79\xf0\x81\x47\x4e\xc0\xfc\x4c\x0d\x66\xa7\x26\x60\xb2\x31\x09\x63\xb5\x3a\x54\x4a\x55\x1c\x0f\x0f\x6c\xdb\xc6\x8d\x09\xde\x6e\x9c\x68\xf0\x3d\x0b\xa6\x26\x6b\x38\x5e\x16\x6f\xfb\x89\x67\x2e\xc0\xe3\x4f\xbd\x82\xcf\x69\x9f\x14\x8f\x11\x00\xee\xbb\xd0\xb8\x5f\xf4\xc8\xbb\x8e\x8f\x74\x5c\xc2\xbc\x87\x9f\xd3\xf8\xf9\xf1\xf1\x2a\xcc\x4e\x37\xe0\xe2\xa5\x55\xb0\xff\x92\xe7\x88\xd8\xf3\x28\xe9\x71\xe6\x8e\x9f\x2a\x97\x26\x8e\x1d\x28\x16\x6b\xc7\x8a\x45\x77\x02\x27\xc0\xb8\xeb\xca\x32\x0d\x5f\x92\xaa\x61\x18\xa5\xad\x51\xa8\xb6\x46\x41\x72\x21\x4e\xd4\x25\xad\x60\x9b\xb7\x40\x44\x03\x0f\x4a\xa7\x1a\x07\x11\x0f\x30\x49\x20\x0d\xf1\x1e\xa5\xbb\xf7\xec\x6f\x95\xfd\xad\xd2\x32\x24\xed\xdf\x00\xa8\x3e\xfb\xd6\x6a\x7d\xeb\xf6\xd6\xed\xad\xdb\x5b\xb7\x6f\xc5\x66\x4b\x46\x34\x42\x5f\x1b\xff\x70\xf0\xd1\xb1\xa0\x58\xdb\x3c\xf7\x6a\xf5\xe3\x9f\x7c\x06\xfe\xce\xcf\xfc\x1a\x04\x61\x08\xe5\x92\xcf\x00\x47\x20\x4b\x00\xe9\xd8\x0e\x83\xbb\x8f\x80\xbd\x03\xe6\x2e\xbd\x6e\x33\x98\xdb\x0c\xb4\x68\xc6\xd1\x86\x37\x5b\x1d\xd8\x37\x3b\x01\x83\x41\x08\x49\x1a\x81\x8d\xbf\x60\xf3\xe7\x3c\xfc\x8e\x8f\xa4\xa0\x00\xc5\x52\x11\x3a\x9d\x36\xf4\xfa\x5d\x04\xf5\x3e\x04\xc1\x08\xe2\x14\x3f\x8f\xb6\x3f\xe8\x35\xa1\x50\x19\x42\x63\x71\x0c\x89\x80\x07\xed\xb6\xc2\x47\xc9\xdb\xb1\x2c\x9b\x81\x39\xc5\x1f\x63\x40\xb7\x08\x5d\x2c\x06\x76\x99\x83\x37\x82\xb9\x4c\x65\x06\xdc\x7b\x00\x5d\xc8\x1d\xc4\x12\x19\x7c\x19\x91\xab\xf9\x91\x81\x3c\x4d\xf9\x31\xc5\x47\xda\x97\x84\x80\xbc\xd7\x07\x5b\x6a\xb8\xfd\xe8\x24\x1c\x5b\xaa\xc3\xd2\xe2\x04\x34\x10\xc0\x27\x1b\x13\x30\x3e\x36\x0e\xf5\x4a\x15\x4a\x7e\x09\x5c\x24\x3a\x82\x06\x81\xc9\x01\xe0\xd8\x29\x28\x15\x3d\x98\x9e\x2c\x33\x21\xa1\xed\x3d\xf9\xf5\x8b\xf0\xcc\x0b\x97\x70\x2c\x08\xf0\x05\x12\x05\x1a\xc3\x6c\x1f\x14\x1d\x9f\xd9\x41\x9b\xf8\x08\x11\x15\x02\xf8\x0c\xd4\x1d\x1c\xff\xfd\x73\x13\xb0\xb1\xd5\xc2\xfd\x55\x6f\x04\xf4\xbf\x80\x3a\xcf\x41\x5c\x66\x77\x9e\x18\x53\xa7\xff\xc6\xd4\xd4\xc2\x3d\x0f\x4e\xcf\x4e\x9c\x9e\x9d\x2c\x55\x67\x27\x0a\x30\xdd\xf0\xa0\x5a\x72\x40\xe2\x9e\xd1\xee\x26\x89\xaa\x0c\x83\x74\xba\xd5\x09\x61\x7d\x3b\x78\xe0\xe6\xe6\x28\xc0\xc7\x73\xed\x5e\xf8\x58\x9a\xc0\x79\xde\x69\xfc\xa0\xa0\x13\x84\xec\x46\xe0\xf7\x24\x81\x7c\x76\x07\x65\x31\xe8\x13\xf8\xd3\x39\xe0\x93\x8a\x27\x57\xff\x15\xf7\x38\x7c\x47\xf1\x43\x6f\x99\xa1\xb7\x6e\x6f\xdd\xde\xba\xfd\xc7\xaa\x73\x41\x92\x10\xc1\x4e\x22\x18\x20\x2a\x82\x83\x86\xd6\x43\x03\xea\xa6\xf1\x00\xde\xf9\x91\xff\x5e\x9d\x3e\x7a\x8f\x4c\xd2\x18\x81\xdb\x65\x1b\x9b\x2a\x52\x97\xa8\xc0\x6d\x87\x41\xdc\x77\x0c\x90\xbb\x0c\xe6\xf4\x68\xa1\x8a\x77\x18\xcc\x73\x40\x17\xae\x80\x7e\x7f\x04\x63\xf5\x2a\x1c\xd8\x3f\x09\xd7\x96\x37\xf0\xfb\x08\x50\x08\xfa\xa4\xb4\x1d\xfc\x5e\xa1\xe0\x43\xb1\x5f\x82\x52\xa1\x04\x9d\x5e\x05\xfa\x83\x36\x02\x36\xa9\x75\x04\xf5\x38\x64\x35\x9c\x04\xf8\x68\x75\xa0\x5a\xf1\xa0\x58\xb4\x11\x58\x3d\x24\x00\x36\x2a\x7b\xdc\x75\xe1\x40\xcc\x2a\x16\x41\x1e\x31\x40\xb2\x7a\x17\xac\x68\x5f\xaf\xc6\xf3\x3b\x83\x57\xa6\xce\xf3\x9b\xce\x80\x9c\x31\x05\xc1\x37\x51\xa4\xc8\x13\x08\xc3\x08\x95\xb1\x66\x00\x2e\x7a\x1a\x3e\xf8\xd0\x22\x1e\xaf\x82\xc5\x7d\xe3\x30\x51\xaf\xc3\xc4\x18\x02\x79\x7d\x9c\x41\xbd\x52\x2a\x33\x49\x71\x71\x8c\x34\xfd\x16\xfe\x97\x22\xd8\xd2\x6d\xac\x5e\x86\x5a\xb5\x88\xfb\x04\x10\x46\x11\x82\xf9\x05\x78\xf9\x95\x65\xdc\x5f\xda\x67\xfc\xbd\x24\x05\xcf\x11\xec\x30\xa1\xcf\x30\xf6\x65\xca\x9c\xc8\x89\x65\xd1\x31\x91\x37\x02\x18\xc0\x17\x17\xc6\xf1\xb3\x29\x8f\x6f\xc1\xf3\xff\xa3\x14\xfa\x5e\x20\xb7\xb3\xbb\x5b\x18\xbb\xbd\xba\x70\xc7\x8f\xbf\xeb\xd0\xe1\x43\xf7\x9c\x58\xaa\xbb\xa7\x0f\x54\x61\x69\xba\x80\x94\x4f\x43\x7b\x10\xc0\x46\x67\x04\xad\x5e\xc8\xa0\x4b\xee\x9b\xb1\xaa\x07\x8b\x73\x15\xdc\xc1\x06\xb4\xba\xb1\x7f\x75\xa5\x7f\xd7\x85\x6b\xbd\xbb\xae\xdc\xe8\xbd\xd8\x6c\x87\xbf\x8b\xc7\xb5\xce\x27\x06\xef\x1a\x0f\x86\x68\x4a\x3e\xe0\x66\xd0\xad\x1d\xf7\x88\x22\x76\x86\xac\x2f\x7d\x6b\xbd\xbe\x75\xfb\xcf\xf4\xf6\xf9\xcf\x7e\x41\xbc\xce\x93\xb5\xf7\x51\xef\x79\xe4\xe7\x0f\x3f\xfa\x90\x7e\x6b\xd4\xde\xba\xfd\xff\x28\xd0\x8d\xd4\x63\x49\x0b\x84\x40\x0e\x02\x99\x0b\x96\x96\xcf\x3e\xfb\xf1\xe4\xf8\xd2\xed\xae\xef\x15\x20\x88\x42\x06\x46\x1f\x15\xa1\x8b\x20\x4e\xc0\x4d\xee\x76\xb2\xe1\x04\xca\xf9\x6b\xa4\xce\x5d\xdb\x66\xc0\x26\x17\x77\x0e\xa6\x64\xb3\x9b\xad\x2e\x2c\xee\x9f\x46\x20\x8b\x61\x7d\xa3\xcd\xc0\x4f\x6e\x71\x52\xd8\xa4\x64\x3d\xaf\x88\xea\xb5\x08\x95\x72\x05\x41\xba\x0c\x83\x51\x8f\xd5\xfa\x68\x34\x84\x20\x1c\x41\x88\xc0\x1e\x23\xb0\xc7\x43\x05\xc5\x2a\xc2\x8e\x1f\x43\xa1\x88\x44\x61\x4c\xe0\x67\x1c\x18\x0e\x09\xd8\x4b\xd0\x1b\xc4\x08\xc2\xa8\x7e\x11\x90\x2d\x69\x3c\x01\x84\x21\xec\xba\x96\xb0\xa3\xd2\x5f\xbf\xf4\xd8\x29\x9c\x29\x71\xda\x47\xd2\xcb\xe4\x71\x28\xfa\x02\xf6\xcd\xfb\xb8\x8d\x10\x4e\x1f\x9d\xc7\xfd\x16\x30\xd1\xa8\xc2\x78\xa3\x81\x8f\x04\xe2\x0d\x68\x54\x0d\x90\x17\x0a\x05\x7c\xdf\x63\xf5\x4d\x2e\x76\x5a\xc5\x29\x6e\x98\xc2\x10\x04\xe4\xa4\xce\xe9\xd6\x6c\xf7\xe0\xe9\xe7\x5e\x85\xe5\xd5\x6d\x26\x47\x12\x41\x19\xb1\x9c\xc7\x4c\x08\xcd\xae\xf4\x9d\x30\x40\xe6\x72\xb7\x64\x06\xe6\x88\x83\x2a\x55\x30\x3b\x3d\x06\x8d\x7a\x05\xae\x5d\xbf\xc5\xe3\x4e\x9f\xfd\x8b\x02\x7a\x6e\x94\x48\x8d\xbb\x24\x82\xf1\x5e\x18\x5b\xfa\xfe\xa5\x23\x77\x7c\xe8\x7d\xb7\x9f\x9e\x1f\x7f\xdb\xa9\x31\xb8\x6b\x7f\x09\x5a\x9d\x3e\x3c\xf1\xc2\x65\xb8\xb9\xdd\x07\x8d\x7b\x3c\x59\xf2\x60\xb2\xea\xf3\x0e\x76\x86\x11\x5c\x43\x80\x8f\xf0\xc0\x9d\x92\x0f\x87\x16\x27\xe1\xec\xe9\x06\x1c\x3f\x58\x83\x17\x2f\xb6\x6f\xfb\xfa\xb9\xed\x43\xd7\x56\xfa\xbf\x13\x85\xe9\xd7\xc8\x65\x22\x52\x8d\x2a\x1d\x67\x1f\x8f\xfc\x0e\xa6\xef\x9a\x40\x76\xb7\x38\x6f\x00\xf4\xa3\xd5\x03\x7c\x52\xc3\x00\x7f\x0b\x59\x1e\xdd\xae\x5f\x38\xcf\xb1\x90\xfc\x36\x31\x33\x07\xf3\x87\x96\xa0\xdb\x6a\x42\x81\x18\x16\x9e\x98\x73\xcf\x3c\x09\xe1\x70\xf8\x26\x4b\x40\xc0\x5d\xef\x7c\x18\x4a\xe5\x32\x6c\xde\xba\x09\x9d\xe6\x36\x4f\xd8\x72\xb5\x06\x53\xb3\x73\xf0\xf8\xa7\xff\x84\x3f\x77\xc7\xfd\x0f\x40\x05\x19\x1b\xbb\x69\xf0\xde\x5c\xbf\x05\x65\xfc\xbb\x54\xc1\x09\xdb\x6e\x41\x1c\x91\xeb\x09\x99\xad\xef\xc3\xb3\x5f\xfa\x22\x7f\xe7\xec\x43\xef\xe6\xd7\x69\x3f\x68\x9b\x0b\x07\x0f\x41\xb7\xdb\x81\x41\xa7\x03\x97\x5e\x7a\xc1\xec\xc0\xdd\x6f\x99\xa1\xff\x42\x41\x7c\x27\x14\xb5\xc7\xa3\xc5\x53\xca\xd7\x55\x71\xb0\x78\xc2\x9d\x59\x9c\x9a\xb5\x4b\x62\x42\x17\xc3\x89\xd4\x0f\xab\x7b\xb7\x63\x45\x5e\x4b\xa4\xd6\x9a\x4c\xed\xcb\x51\xb9\xbb\xfd\x97\xb1\x6f\x3f\xfe\x8b\xdf\x4b\x41\x38\x80\xad\x2d\xf3\xc2\xff\xfc\xbf\x00\x5c\xbb\x86\x96\xc1\xce\xfc\x90\x23\xdc\xcb\xff\x16\xe4\xcd\x22\xdc\xf7\xb6\xaf\xc2\xe8\xf2\x25\x5e\x67\xf0\xde\x47\x41\x94\x4a\x10\x5c\xba\x24\xd2\x56\xdb\xbc\x86\xff\xc7\x2b\x63\xa0\x43\x0b\xd2\x49\x9c\xbf\x68\x68\x93\x5b\x75\xb4\x0c\x5d\xa1\xdc\x3e\xa4\xcd\x3a\x1a\xc7\x01\x14\xdc\x32\xc4\x9d\x91\x40\xa9\x05\x1a\x55\x9a\x0e\xcd\x9a\x54\xbe\x07\x6c\xc7\x06\x0a\xb4\x67\x0b\x6d\xe3\xeb\x11\xc5\x6b\x13\x00\x27\xca\x28\x4e\x19\x54\x84\x4f\x2a\x09\xda\x13\xb4\x6c\x09\xee\x67\x9a\x20\xcf\x0f\xf1\x8e\x78\x94\x66\xc3\x1c\x85\xec\x41\xd5\x05\x14\x9c\xa8\xae\x40\x88\xd7\x1c\xb7\x46\xa3\x0d\x49\xc4\xdf\xdd\xab\xd0\xbe\xf1\x4d\xbf\xe9\xd3\x37\x7c\x4a\xbf\xfe\x73\xdf\xf8\x7b\x6f\xcc\x5f\xfa\xe6\xdf\xd5\x6f\xb6\xad\xd7\x6f\x43\xbf\xee\x67\xde\xe4\x73\x5a\x25\xa2\xf2\xb6\x1f\x80\xb4\xb7\x2d\x75\xd4\x13\x69\x77\xc3\x55\xe1\xc0\xd3\x51\xe0\xe9\x24\xf2\x74\x1c\xbb\x3a\x51\xb6\x76\x53\xf9\x3b\x9f\xfe\x6d\xeb\x7b\x3e\xf2\x23\x28\xc7\x62\x50\x28\xa6\x52\xbc\x2b\x57\x02\xe2\x25\x2b\x56\x54\xf4\x78\x4f\xf1\x67\x24\x02\x52\x4a\x12\x1f\x22\x7c\xcd\xd6\x96\xb6\xc8\x35\x2f\x32\x55\x8c\x9f\x68\xa1\xfd\x1d\x5e\x57\x30\x39\x59\x85\xa4\x25\x51\x85\x87\x3c\xf4\x74\xce\x63\x81\x30\xe2\x6a\x20\xcd\xe6\x59\x2e\x54\x5c\x14\x81\x61\x1d\x9c\xf2\x80\xdd\xef\x08\xea\x3a\x8a\x11\xd4\xd1\x7e\x13\xb9\x88\x93\x18\x7c\x04\x47\xa7\x80\xd8\xe1\x27\xe0\x95\x15\x94\x63\xb2\xb3\x5d\xf0\x4b\x29\x44\x91\x84\x52\xa9\x86\xc0\xac\xf0\x77\x02\x88\x12\xd4\xb3\x1a\xe7\x5a\x64\xe2\xd8\xec\x6a\xe7\x38\x35\x9d\x05\x02\x4a\xc5\x77\xcf\xc3\xe5\x50\xb7\x61\x6a\x0c\xf7\x51\x85\x3a\x4e\x03\xd8\x37\x53\x85\x2a\xe2\x56\xb9\x38\x05\xb5\x4a\x99\x55\x78\xa3\xda\x80\x3a\x82\x38\xb9\xd6\xcb\x88\x17\x25\xbf\xa4\x5d\xd7\x66\xef\x00\xcd\x35\x8e\x81\xa3\x82\x26\x9e\x54\xaf\xf9\x1c\xae\x20\xb0\x56\xf8\x6b\xcb\x2b\x1b\x9c\x8f\xd0\x6c\xf5\x99\x08\xd1\x6b\x71\x4c\x2e\x75\x7c\x2e\xb4\x99\x8f\x52\x67\x40\x9b\x45\x44\xf0\x6e\x5b\x46\xa5\xd3\x9f\xb5\x4a\x09\xe6\x66\xc7\x60\x63\xb3\xcd\xd8\x42\x79\x0a\x04\x8a\xf6\x5f\x10\xcc\xad\x4c\x91\x13\x90\x17\x69\x95\x4d\x1c\xf9\xeb\x77\xdc\xf6\xb6\x6f\x7f\xf8\xed\x67\x67\xed\x0f\xdc\x39\x01\x4e\x1a\xc2\x1f\x3f\xfe\x0a\xb4\xda\x43\xb8\xef\xd0\x04\x7c\xec\xcc\x3c\x02\x79\x81\x59\x1c\x22\x29\xef\x84\xed\xf9\xb8\xee\x62\x68\xf5\x43\x78\x69\xb9\x09\x5f\xbb\xb4\x0a\xe7\xce\xaf\xc0\xf1\xe3\xf3\x70\x3f\x6e\x63\x72\xcc\x2f\x7d\xe5\xb9\xcd\x1f\x3e\x7f\xb1\x3d\x3d\xe8\x07\x1f\x27\xf7\x83\xe4\x55\x2a\x77\x27\xf8\x9e\x89\x8a\xc6\x0e\x01\xdf\xfe\xcf\xca\x98\x8b\xbd\x3c\x58\xec\x3e\x17\xd9\x7f\x6f\x46\x98\xcd\xf9\x13\x7c\x6c\x66\x31\xc0\xb7\x68\x74\xfe\xd2\x41\x08\xbe\x89\x9a\x7c\x8d\x92\xa4\xc7\x6f\x55\x4d\xbe\x4e\xa5\xbe\xc1\x26\xfe\x55\x50\xa5\x6f\x02\xe2\x79\x38\x2a\x7f\xe4\xe7\x05\x5d\xb5\x8f\x1d\x38\x31\x5d\x9f\xab\x2c\x49\x44\x75\x6d\xf7\x44\xf2\x0d\xb6\x99\xba\x61\x03\x1f\xe8\x7e\xd2\x0a\xbd\x4f\xa5\x5e\x78\xeb\x9b\xed\xc3\x6f\x0c\x9e\x12\x7f\xad\x74\x8f\xfe\xa5\xc2\x48\x24\xb5\x2a\xc8\xea\x24\x4c\x24\x1b\xa8\x64\xaa\x68\xf0\xba\x30\xec\xdf\x84\xea\x43\x8f\x0a\x17\x55\x11\xfc\xe1\x9f\xa0\xfd\x71\xf1\x64\x16\x41\x95\xf6\x21\x08\x4b\xb0\xd1\x18\x09\x91\x0a\xa5\x36\x70\xcd\x3a\xd0\x89\x5d\x10\xe3\x0b\x22\x89\x03\xd0\x2b\x48\x62\x9d\x81\xd0\x7d\x92\x05\x25\x9c\xaa\x26\x4e\xa8\xea\x48\xd5\x91\x27\x3b\xd5\x31\x50\xe4\x72\x6d\x78\x08\xcc\x68\xe0\xec\x0a\x72\x84\x02\x1a\xad\xb2\xd0\xd2\x03\x61\x85\x08\xda\x68\x60\x69\x51\xdb\x2e\x4f\x23\xcb\x77\x85\x48\x10\xcc\xd1\xb0\x6a\x24\xba\x5a\xa2\x14\x72\xcc\x76\x41\xc4\x1c\xed\xd4\x80\x86\x91\x3e\xee\x22\xa0\xe3\xee\x21\x6e\xb0\x97\x4e\x08\x0a\xb5\x59\x42\x91\x3d\xa5\x75\x83\x32\x8a\x27\x11\xf9\x26\x4d\x10\x32\xdb\x0e\x59\x5b\x73\x52\xc8\x65\x09\x2a\x03\xf4\x1c\xf0\xd5\x1e\x9b\xa2\x4d\x82\x14\xab\x0f\x9d\x4f\x75\x02\x04\xb5\x17\x95\xdf\x08\xc7\xaf\x7f\xf2\x0d\x70\x5b\xc3\x37\x00\xe5\xd7\x7d\x48\x7f\xa3\x6d\xbd\x29\x98\xbf\x19\x81\x78\xdd\x77\x8d\xfc\x03\xe9\xb9\x22\xed\x7b\xb6\x24\x24\x1a\x76\x3d\x15\x0c\x7c\x91\x44\x2e\x4e\x0e\x57\xa5\x09\xb2\xb2\x54\xe2\xc9\x96\x37\xda\x5b\xf6\x18\xaa\xd1\x14\xc7\x2a\x26\x02\x86\xe3\xe9\x58\xe4\x31\x45\x10\x47\x22\x97\xe0\x76\x1d\x1c\x37\x57\x11\xac\x23\xa8\x4b\x7c\x0b\x87\x48\x2a\x02\xa3\x14\x45\x0b\x79\xf3\x91\x04\xa0\x20\x6b\x6d\x77\x00\xa5\x1d\xd8\x95\x22\xf4\x7b\x01\xbe\x16\xd3\x29\xd1\xa4\x62\xe9\xdb\x8a\xe6\x02\x39\x0b\x10\x18\x6d\xa7\x88\x04\xb0\xa4\x2d\x4a\x2c\x8b\x46\x30\x42\x30\x2f\x44\x04\xce\x91\x0e\x82\x01\x2b\x69\x0b\x09\x46\xa1\xec\x70\x5c\x3f\x49\x95\xa6\xf0\x40\x11\x31\x25\x46\x85\xad\x74\xa4\xbd\xb2\x86\x4a\x5d\x67\xa7\x37\x66\xfc\x16\x22\xb3\xab\xda\x80\x25\x89\x45\x5b\xe2\x54\xc2\x63\xa1\xd8\x3f\x0d\x87\x6b\x2b\xf0\xfd\x9a\x2e\xfa\x53\x08\xe4\x25\xa8\x15\x2b\x50\xc4\x75\x52\x43\x11\x57\x29\x55\xa0\x42\x7f\xa3\xe8\xf3\x0a\x3e\x01\x72\xd9\xb6\xf5\xc1\x57\x2f\xbe\x12\x1d\x3f\x7a\xea\x9c\xc6\x7d\x21\x17\x79\xa9\x58\x80\x4a\xd9\xe1\xed\xd1\x31\xf6\xfb\x01\x5c\xbc\xb2\x0c\x97\xae\xde\xc2\x63\x48\xf1\xfb\xae\x89\xcb\xa7\xc6\xbd\x4e\xb3\xca\xd2\x72\xe7\x1c\x9a\x1c\x3e\xf2\x6e\x48\x9e\x75\x46\xf5\x93\xd7\xc0\x86\x85\xf9\x09\x5c\xc7\x21\x74\x3a\x43\xf6\x74\x70\xac\x1e\x78\xee\xbf\x76\x52\xfc\xb4\xff\x93\xf0\x2b\x87\xfe\xdd\x7f\x08\xcc\x69\x49\x15\x98\x2e\x23\x59\x18\x3b\xf0\x7d\xb7\x9d\x7d\xe4\xfb\x1e\x7c\xcf\x83\xf3\xe2\x83\xb7\xd5\xe1\xcb\xcf\x5f\x87\x17\x2f\xad\xc3\x47\xef\x39\x00\xf7\x1d\x9d\x66\x77\x07\xb1\x95\x34\x55\xcc\x8c\xba\xdd\x1e\x84\x61\x00\x13\x13\x13\x7c\x40\xb4\xb3\x36\xee\x38\x3d\xbf\xb8\xda\x86\x3f\xf8\xfa\x32\x6c\x23\xd7\x7b\xf8\xfe\x63\xd0\xea\x69\x78\xec\xc9\x5b\xf0\xf5\x17\xb7\xbe\xd4\xed\x05\xff\x8a\x56\xa9\xe6\x24\x39\xbc\xc7\xb8\xcd\x38\xc5\xc7\x3c\x29\xae\x08\xc1\xcd\x7f\x0b\x41\xfa\xa9\xd7\xec\xf4\x2f\x7f\xdb\x2f\xe2\x5e\x2b\x4e\xf7\x18\x20\x83\xd3\xdb\x29\x2c\x56\xf7\xc3\xfa\xf8\x16\xc8\xa8\x84\x26\x0c\x07\xb4\x10\x83\x57\x94\xc8\x9a\x2a\xf0\xec\xb5\xa7\x60\xfc\x6b\x2e\x3c\x7a\xdb\xc3\xf0\xca\xc9\xe7\x51\x59\x54\xa1\x8d\x47\x5c\x17\xb8\x01\x7f\x08\x65\x2f\x41\xd3\x81\x0c\xb2\x6a\xc3\x4a\x27\x82\x57\xbf\x3c\x82\x3b\x6b\x03\xe8\xfa\x55\x58\xe9\x0d\x61\xae\x51\x45\x26\xd9\x84\xf3\xeb\x36\x1c\x3e\x7a\x08\xea\x53\xab\x20\xfb\x53\x50\xf7\xfa\xe0\xd4\x23\x28\x88\x0a\x38\x68\xb4\xfe\xdf\x3f\xfd\x0c\x9c\x7d\xf2\x76\x78\xfb\xfb\xee\x83\xdf\x9a\x7b\x06\xea\xea\x18\x4c\xe9\x10\x54\xbf\x83\x23\x1b\x41\xd5\x0b\x61\xd0\x9f\x80\xa9\xc3\x55\xa8\x97\xb7\x20\x6c\x26\x70\x2b\x08\xe0\x97\x7f\x03\xc4\xdf\xf6\x3f\x0c\xef\xfd\x5b\x3d\x78\xb2\xfc\x24\x7c\xf5\x73\x43\x71\x5c\x4e\xe2\x64\xbf\x05\xcb\x55\x21\x8a\x85\x1a\x40\x37\x10\x36\xda\x69\xed\x22\x6b\xc3\x35\x53\xc4\x93\xae\xd0\x38\x0f\x03\x8d\x36\x33\xa4\x98\x19\xa8\x20\xc4\x53\x83\x6b\x18\xc7\x46\x4b\x62\xd7\xb8\x7e\x43\xcd\x74\x03\x09\x97\xc0\xf3\x25\xe2\x38\x96\x4a\x29\x9a\x27\x68\xd8\xd1\xfc\xa6\x8e\x9c\x2c\xce\x97\xab\xd5\xf2\xb4\xe5\x58\x25\x72\x98\xe9\x42\x3c\xae\xfc\xb0\xf2\x86\xc9\x92\x5a\xdb\x22\x91\xcf\x04\x6a\x74\x8b\x45\x53\x14\x89\xe1\x70\x28\xd3\x34\x11\x51\x14\xcb\x24\xdb\xb6\x94\x12\x37\x2c\x71\x41\x59\xba\xa6\x11\x74\x26\xc7\x8f\x28\x3f\x5e\x52\x4e\x54\xc7\x6d\x04\x42\x59\x1b\x3a\x16\x4f\x85\x72\x30\xf8\x4f\x8a\xca\xfa\xcf\xf7\x31\x5a\x1c\x51\x1c\x09\x34\x26\x22\x49\x62\x11\x46\xa1\x0c\x46\x23\x19\x46\x91\x9d\x26\xa9\x85\x4a\xd3\x46\xc3\x63\x27\x4a\xd9\x5e\x5a\xf6\xf6\xcf\xee\x9f\xa9\x4f\x55\xf7\xc9\xb2\xf2\xf2\x4d\xf5\x7a\xad\x13\xa3\x60\xb0\x38\x1c\xf6\x4f\xe2\xf6\x4e\x78\x48\x7a\x4b\x05\x34\x22\x65\xca\x96\x2d\x9c\xc3\x5f\x79\x3a\x88\x93\xc7\x68\xe5\xc6\x3a\xf9\xe4\xef\xbf\xeb\xfe\xf5\xde\xef\x3d\x03\x97\xb6\x9e\x85\x60\x11\x97\xfe\xa0\x29\x4e\x1c\x3e\x8c\x8c\xbd\x00\xc1\xda\x1a\x44\xa3\x39\x48\x26\x1d\x91\xa2\x21\xb2\xd0\x10\x15\x83\x75\x1c\xfb\x2a\x1a\xc0\x50\xa8\x32\x4e\x90\x72\x05\x4a\x64\x28\x36\x6e\x8a\x14\x95\xb5\xaa\x17\x50\x01\xa3\x75\x43\x40\xf7\x52\x72\x43\xa2\x49\x4e\x7b\x38\x77\x12\x54\x3b\x52\x78\x28\x61\xc8\x78\xd2\xc1\xa6\x89\x46\xfe\x8c\xe0\x5c\xc0\xcf\x2b\x34\xaa\xa8\x8a\xc9\x92\x4b\x32\x94\x28\x85\xd2\x08\x01\xd9\x35\xf9\x2e\x02\x57\x8c\xf0\x6c\xf2\x69\xe2\x3a\x45\xe0\x15\x69\x86\x40\x94\xc7\x9b\xb2\x89\xa0\x7f\xd0\x06\x0b\xe6\x06\x02\x15\xba\x4e\x32\x90\x62\xab\x66\xc2\x6e\x88\x31\xb4\x29\xda\x8e\x16\xe6\xcd\x0c\xc8\x84\xd2\x0c\xf9\x04\x0f\x20\x90\x08\x08\x32\x37\x29\xbd\x47\xba\x47\xe7\xc2\x47\xc8\x4c\x3c\x69\x04\x03\x2b\xc6\xdf\x46\xec\x22\x8b\xaa\x6d\x45\x14\x86\xf7\x91\x8f\x91\x0c\x29\xa5\x1d\x93\x1a\xcd\xbc\x82\x19\xea\xd3\x36\xf0\xad\x8c\xad\x65\x13\xc0\x16\x92\x31\x56\x6a\xfa\x3d\x91\xb3\x06\x23\x62\xd9\x81\x21\x58\x8d\x09\xc2\x94\x1d\x96\x0f\xb4\x9f\x60\x34\xec\xae\xbc\x16\xaf\x09\xec\xea\x37\x44\x65\xf8\x18\x68\x57\xb3\xf7\x64\xf6\x9e\x7a\x13\xf2\xa0\x77\x29\xc1\x6b\xde\x55\x49\x24\x93\x68\x60\x25\xd1\xd0\x52\xd1\xc0\x4d\x82\xbe\x9b\x44\x23\x1f\x55\xba\x8d\x2a\x1d\x05\x76\x82\x87\xa2\xa4\x6b\x17\xe5\x03\xf7\xbe\x4f\x04\x08\xa6\x8e\x25\xd9\x8d\x2d\x91\xa4\x39\x78\xea\x6c\xdb\xc4\xac\x2d\xcb\x64\x5f\x13\xe8\xe0\x73\x4d\x40\x94\xc7\xd2\xb7\x9a\x9b\xe4\xca\xd6\x13\xf5\x49\x08\x91\x0c\x12\xec\x34\x1a\x65\x4a\x10\xd3\xdb\xdb\x5d\x73\xe4\x66\xd8\x89\x64\x31\x5f\x52\x84\x17\x78\x70\x4a\x45\x94\x94\xa6\x53\x15\x73\x86\x79\x94\xe0\xac\x4f\x02\xf6\xae\x46\x28\xbb\x63\x15\xf0\xe1\xf9\x45\xdc\x07\x9a\x32\x14\xf7\xc6\x89\x49\x89\xd4\xe4\xe9\x54\xb8\x11\xca\x4e\x37\x07\x4c\x2c\x83\x7e\x0a\xa1\x9c\xdd\xd7\xc4\x09\x71\xff\x69\x1e\xe0\x3e\xdb\x96\xc3\x2a\xdb\x43\x52\x51\xf0\x7c\xed\x39\xb6\x40\x42\x01\x85\xa2\x4f\xaf\x89\x22\x87\x1b\x70\x05\x78\xc5\xc3\xfd\x51\x72\xb2\x56\xf4\x5a\x4b\xb3\x8d\x1b\x0b\xf3\x33\xfb\xaa\x95\x8a\xd7\x6c\x75\xba\xcf\x9f\xbb\xf0\x95\x63\x47\x0f\x8f\x2a\x65\x04\x7b\x17\xcf\x12\x25\x11\xe0\xcf\xdf\xdc\x68\xea\x2b\x57\xd7\xa0\xdb\xeb\x83\x71\x6b\x98\xd3\x4a\x98\x48\xfb\x1f\x93\xa7\x88\xcf\x25\x8e\x1d\xe9\xd5\x94\x84\x9d\xc1\x4b\x1e\xdb\x2c\x32\x42\x2a\xfd\xe0\xe2\x34\x83\xfa\xf2\x8d\x4d\x3e\xac\x62\xa1\x08\x17\x2f\x9d\xc3\xd7\xbc\x3f\x97\x42\xdf\x0b\xe6\xa4\xca\x6b\x14\xe3\x2f\x8c\x3d\x70\xe8\xd8\xdd\x1f\x7d\xe0\xdd\xef\x98\x13\x1f\x3a\x5d\x83\x7f\xfd\xb9\x97\x11\x40\x12\xf8\x99\x8f\xde\x85\xa4\x7a\x08\xcd\xe6\x36\x8c\x8d\x8f\x73\xa6\x23\xb3\x5b\xdc\x69\x4a\x86\x10\xc2\xcf\x9c\x1d\xc6\x05\x92\xe0\x63\x77\x30\x84\x1a\x32\xef\x9f\xfa\xe0\x6d\xf0\xfb\x4f\x5c\x85\x4f\x7e\xee\x25\x78\xf4\x5d\x27\xe1\x9d\xf7\xce\x40\x1c\xa7\x0f\x7e\xfd\x85\xcd\xf6\x28\x88\x3f\x01\x79\xb2\x00\x7b\x7c\xb2\x84\x39\x62\x83\x3c\x78\x9b\xff\xc5\xa8\xb8\x18\xc7\x89\xe6\x23\x82\x1e\xb1\x57\x04\x5a\xe4\xb7\x78\x1c\x44\x5a\x71\x40\x80\x1c\x0e\x88\x0b\x4c\x94\x69\x2e\x06\x41\x2a\xc6\x6a\xe3\xf0\x0f\xfe\x56\x20\x5c\xfb\x53\xe2\x3c\x9e\x91\xc6\x48\x8b\x8f\x3c\xe2\x0a\xb7\xd4\x17\xa8\x7e\xe0\x24\x0e\x86\xed\x47\x1c\xa1\xa0\xf9\x61\xdb\xa8\xb3\x90\x20\x8e\x06\xa1\x18\xf5\x71\x91\xa2\xbd\x1d\x0c\x22\x89\x06\x0b\x17\x2b\x20\xb8\x0e\x05\xdd\x08\x53\x65\xea\x5b\xe1\xd6\xf4\x42\x2c\xac\xc3\xa9\x95\x54\xe8\xe4\xc8\x44\xf6\x51\x1c\xb5\x71\x7c\x2d\xe5\xe8\xba\x72\xd3\xa2\x99\x0b\xe1\xeb\x20\xed\xcd\x04\x77\x52\xc2\x7f\xf6\xcf\x4c\xa9\xcf\xd5\xa7\x82\x66\x18\x24\x08\x70\x4a\x06\x43\x65\x05\x23\x6d\xa1\xfd\xb7\xd2\x94\xf0\x1c\x6d\xa9\x0d\xca\xa1\x45\x35\xa8\x1c\x1c\xd9\xfd\xe3\xaf\xdd\x46\x32\x8e\xbb\xb2\x74\xf4\x68\xfa\xa9\x6a\x23\x0d\xb2\xdf\xd2\xdf\x1c\x81\xc5\xb7\x80\xd3\x9a\xf1\xe0\xcd\xde\x14\xe2\xb5\x47\xb5\xd7\x63\xcb\xd6\x3c\x5b\x96\x5a\x1a\x1d\x47\xaf\x8d\x86\x09\x9e\x2f\x2d\xa2\x51\x22\x82\x51\x2c\xbb\xed\xc8\x19\xf4\xb4\x35\x1c\x08\x7b\x34\x04\x27\x0c\x85\x93\x8e\x7c\xb7\xe2\x4e\x4d\xd4\xc7\xa7\xe6\x24\x8a\x0f\x06\x2d\xbc\x5d\xbd\x7e\xf5\xd1\x41\xaf\xff\x6d\x48\x08\x8a\xdb\xad\x4d\x08\x90\xf0\xa6\x1c\x03\x94\xbc\x50\xe7\x67\x16\xe8\x7e\xb2\x5a\xae\x9d\xf4\x6c\xbb\x12\xe9\xf4\xd3\x78\x66\xf7\x3d\x72\xf5\x6b\x9d\xfe\x91\xbe\x7e\x07\x82\x78\x88\x13\x26\x74\x13\x9d\x20\x8e\x8e\x06\x55\x18\x8c\x95\x40\x49\x1b\x08\x03\x5b\x44\xd8\xd0\x10\x8e\x0a\x15\x90\x14\xeb\x14\xa8\x94\x6d\xca\xb2\x45\x10\x1e\x22\x38\x16\x2a\x82\xe8\xb9\x54\x01\x2e\x4d\x5a\x93\x0e\x49\x16\x32\xfa\x64\x99\xd1\x58\x7a\x82\x92\x81\x88\xd4\xf9\x1a\x7f\x80\x08\xa1\x85\x73\x36\x0d\x85\x3b\xf2\xc0\x43\x90\x0a\xc9\xf8\x84\xbc\x1c\xf1\x6d\xcf\x8c\x58\xcc\x19\x41\x64\x4c\x85\xe6\x12\x24\x34\x53\x38\xc1\x11\x8c\x11\x78\x71\xfb\x10\x19\x7f\x15\xe3\x9e\x60\xd4\x23\xef\x1d\x4e\x46\x41\xc4\x40\x71\x76\x10\x0d\x2f\x7e\x9f\x3f\x64\x11\x5e\xa3\xc1\x8b\xf1\x6f\x54\x53\x8a\xc8\x81\x62\x12\x80\x0f\xc2\xc0\xa2\xa4\x45\x63\x4e\x90\x92\x59\x30\x92\xd5\xb7\x30\x48\xc9\x19\x45\x42\xc7\xe6\x2f\x6d\x25\x34\xd3\x39\xa4\xa7\xc0\xa0\xaf\xcb\xe4\x01\x9f\x33\x79\xa0\xdf\xcd\x5c\x65\x68\x69\xd9\x0d\xca\x7a\xd2\xec\x38\xc7\x65\x59\xf1\x29\x63\x76\xd9\xcb\x96\xa7\x43\x09\xd8\x8d\x86\xd2\x77\x64\x36\xeb\x04\x03\x7b\x76\xc8\xbb\x59\xd6\xda\xb8\xe8\xc4\xde\x78\x4c\xbe\x79\xc6\x3d\x73\x8c\xb0\xe3\x90\xcd\x26\x6d\x36\x61\x73\xf0\xde\x9d\xaf\xb9\x7f\x8f\xfc\x1e\x60\x86\x30\xfb\x18\x12\x2b\x99\xe2\x64\x49\x13\xdf\x4a\x62\xdf\x89\x83\xa2\x9b\x86\x43\x17\xc1\xd3\x00\x7a\x12\xdb\x04\x88\xc8\x94\xc4\xd6\xa0\x69\x4f\x35\x26\x18\x1c\x49\x15\xd3\x9a\xe5\xec\x6d\x7c\xa2\x38\x8b\x9c\xb6\x2c\xcd\x7a\xb0\xa8\xac\xcc\xd3\xbd\xe1\x00\x2e\x5f\xbd\xa0\x2f\x5d\xbe\x80\x30\x9d\xea\xfb\xdf\xfe\x2e\x31\x33\x35\x07\xc1\x70\xa0\x37\x3b\x7d\xa8\xd6\xca\xe0\x57\x8a\xba\xd3\x1d\x64\xae\x11\x72\x9e\x64\x12\xd3\xa8\x3c\x82\x1b\x2d\x09\x90\x95\x8d\xf3\x96\x94\x7f\x8c\xe0\x5e\xd0\x9a\x4b\xc8\x12\x48\x14\xce\x77\x7c\xc4\xbf\xb5\x83\x24\xce\xf7\x1d\xcd\x09\x63\xc0\xa5\x5f\xb4\xbf\x9a\x40\x33\x49\x52\xde\x77\x1a\x43\x9c\x57\x5a\xf2\x31\xd0\x6c\x22\x90\x24\x62\xe2\x20\x59\xa1\x7c\x00\x5b\xbb\xb6\x83\x60\xee\x70\xb2\x3c\x31\xda\x18\x49\x0d\x1a\x6b\xab\x5c\x28\x9f\x4c\xad\xe2\x1d\xb1\x55\xaa\x2f\x1d\x6c\xc0\xdc\x78\xe5\xe0\x64\xbd\xb8\x88\xc0\xbf\x8d\x24\x3d\xac\x37\x6a\x6e\xbb\xd7\x9a\x40\x06\xb4\x86\xa4\x5b\x0f\x23\x05\x3d\x14\x78\x2b\xab\xdb\x7a\xab\xd9\x31\xc7\xc8\x4b\x81\x45\xac\xa6\xf5\x4d\x27\x95\x2b\x06\x69\x9c\x65\x9e\x0c\x66\x92\xf9\xf8\xfc\x4a\x9e\x11\x9c\x8c\x28\x71\x0d\xcf\xcf\x4d\xb0\xf2\x5f\xbe\xb1\xce\x5e\xee\xa9\xc9\x49\x78\xe6\xd9\xa7\xe0\x1f\xfd\xe3\xff\x51\xd1\x87\xed\xbf\x20\x98\x93\xdb\x6f\x5c\xda\xb5\xe9\x85\xe3\x3f\xf0\xb6\xbb\xee\x9b\x97\x1f\xbc\xbd\x0e\xbf\xf9\xd9\x97\x00\xc5\x00\xfc\xe4\x77\x9c\x31\x6b\x19\xd5\xef\xad\xad\x65\xa8\x56\x6b\xbc\x83\x29\x53\x2f\xdc\x88\x6b\x04\x09\xed\x50\x1e\x4b\x22\x26\xb2\xbd\xdd\x84\xa9\xa9\x49\x40\x9b\x08\xdf\x79\xcf\x7e\xf0\xed\x1b\xf0\xe9\xcf\xbf\x0c\xef\xff\xb6\xdb\xe0\x6d\x77\x4e\x41\xbb\x1b\x7e\xe8\xdc\x85\xed\x73\x78\xc8\x57\x38\xc1\x9f\xd8\xb0\xca\xe2\xe9\x54\xe6\x87\xcf\xe3\xde\x1a\x40\xe5\x3f\x9d\x3b\x9d\x08\x56\x18\xa2\xc6\x88\x34\x24\x94\xb9\x88\x0a\x38\xa6\xd0\x5f\x40\x65\x15\x1a\xdf\x93\xa8\x88\xf0\x5c\x85\xec\x89\x44\x92\x43\xff\xb3\x03\x55\x7c\xc7\xfb\x1e\x14\xfe\x7b\x1d\xd1\x2a\x5f\x84\x8f\x14\xab\x08\xc2\x37\xc1\x77\x52\x14\x17\x68\x4d\x0a\x3c\x4e\xc2\xb7\x06\xb8\x3a\x7a\x82\xcb\x2f\x4e\x0a\x61\xbb\x43\x61\x59\x64\xc2\x68\x32\x70\xa6\x87\xb0\x2d\x8d\x86\x3f\x15\x7c\xea\x15\x91\x63\x62\x76\x64\x38\xd9\x05\x26\x86\xbd\xc4\x8a\xd1\xfc\xda\x88\xce\x41\x90\xe0\x62\x4d\x9c\x38\x4c\xed\x34\x56\x34\x7c\x26\x01\x14\xb7\xe0\x8c\xc6\x17\x54\x51\x1d\x25\x33\x6b\xe5\xf6\xc2\x4d\xc7\xf0\xfd\x71\xa3\x40\x76\xac\x83\xd8\xde\xea\xde\x16\x85\xf1\x18\x4d\xce\x7e\x6f\x78\x78\x38\x0c\x96\x88\x9d\x97\x8a\x65\x40\xd0\x01\x4a\xa4\xf1\x0a\xd6\x67\xbc\x52\xfa\x25\x57\x5b\xc7\xdb\xd7\x6a\xb5\x48\xa9\x06\x2e\x2b\x17\x87\xa9\xe7\xcb\xd6\x75\xcb\x6b\x0f\xe2\x44\x91\xc9\xd4\xc8\x42\x55\x41\x16\x64\x5a\x4c\xce\xf8\x96\xb2\x9f\x7c\xfa\xb9\x0f\x9f\x3c\x78\xe7\x59\xa4\xc3\x2d\xcb\x4d\x3f\x2b\xdd\xf8\xe5\x41\x47\xde\xb7\x78\x30\x79\x11\xf6\xba\x3c\xdf\x34\xc0\xc1\x74\xfc\x1b\x61\x3b\xe7\x9c\x98\xd7\x0c\x0b\x66\x6b\xb7\x47\x09\x19\x03\x4a\x92\x30\x83\x19\xcd\xb2\x8f\x5f\xa4\xe7\x5a\xe4\x62\xc7\x30\xed\x24\x54\x5c\x5a\x69\x23\xf3\xea\x47\xb1\x8c\xf1\x31\x1a\x44\x4e\x1a\x26\x4e\x12\xc6\x4e\x1a\xa7\x8e\x8e\xd0\xd6\xc4\xa5\xd2\xd8\xcc\xfe\x39\xb7\xee\xb8\x34\x59\x47\x61\x50\x58\xb9\xb1\xfa\xc8\xd6\xf6\xf6\x23\xad\x6e\x13\x46\x41\x00\x43\x44\xfe\x38\x79\xa3\xd3\x7d\xb3\xb9\x05\x97\xae\x5f\x84\xa3\x07\x8f\xc1\xe2\xc2\xa1\x83\x5e\xa5\xe0\xa1\x3d\x5d\x98\x2a\x76\x6f\x4c\x96\xd0\x5c\x3a\x16\x1a\x36\xb2\x56\xae\x0a\x6c\xb2\xc7\xa1\x88\x50\xf8\x93\x3b\x0f\xb1\x0f\x95\x0d\x90\xba\x81\x00\x55\xb6\xd2\x14\x6b\xb4\x91\x00\xc4\xac\x3e\xc9\x72\x26\x64\x58\x58\x06\x50\x99\x0d\xce\x2e\x1e\x21\x3a\x70\x0b\x31\x0c\xd9\x5c\x62\x72\x6d\xd9\xc6\x49\x92\xc2\x3c\x38\x68\xcc\x51\xad\xa2\x7d\xb2\x69\x1d\xa2\x09\x24\x6a\x68\xbc\xd5\x06\x99\xd8\xc3\x29\x33\x09\x49\x19\xd5\x08\xb0\xa9\x09\xbd\x0a\x33\x92\x16\x7b\x09\xa5\x01\x2c\x21\x63\x43\x64\x8d\x5b\x1b\x71\x9c\x2b\x58\x18\xd4\x09\x70\x89\xb9\x43\x0e\xbb\x2c\xa6\x81\x55\xbc\xd0\x49\x7e\xea\x68\x09\x24\x8c\x7c\x64\x73\x28\xfe\x6e\x7c\x4e\x82\x38\x3f\xff\x2e\x65\x05\x1b\xf0\x48\x0c\x3c\x0a\xe3\x89\x35\xde\xe8\xec\xb4\x32\x54\xeb\x5d\xe5\x2c\x84\x39\xd9\xc2\x54\xe8\x48\x33\x0e\x7b\x84\xb6\xcc\x3f\x91\x4d\x39\xc9\x5e\x05\xb1\x17\x74\xcd\x30\x08\x0d\x7b\xc2\x68\x9a\x89\x81\xa9\xd2\xc9\xa5\xb9\x52\x3b\xfc\xe6\xf5\xa4\x99\x48\x80\xde\x91\xed\x72\xb7\x6a\xda\x64\x51\xef\x20\xbb\x56\x7b\x1d\xee\x3a\xfb\x9d\xec\x58\xd8\xb5\x80\x27\x08\x49\xbd\xe4\xa4\x03\x24\x96\x68\x7d\x84\xed\x38\x49\xea\x3a\x32\x01\x5b\x21\xb7\xc6\x3b\xd2\x54\x24\xfe\xf8\x99\x8d\xb5\x4b\x62\xa6\x31\xc6\x23\xce\xd9\x5b\x34\x0c\x16\x79\x45\x69\x87\x2d\xcd\xc3\x82\x48\xea\xb8\xae\x0e\x47\x03\x78\xf5\x95\x97\xe1\xfa\x8d\xab\x69\xaf\xdf\xd5\x26\x61\x3c\x11\x4f\x7c\xe5\x8b\x04\xea\xb2\x52\xaa\xe8\x61\xbf\x0f\x31\xb2\xfa\x2a\x2a\x59\x57\xa6\x7a\xd0\xa7\x5c\x0d\x3a\xdd\xda\x18\x72\xf6\xcb\xd0\x7a\x63\x7e\xc3\x07\x84\x7b\x48\x3b\xc4\x20\xcc\x8a\x1e\x15\xb9\x4b\x4c\xce\x76\x79\x92\xd0\xba\xd1\x68\x87\x6d\xcf\xd5\xac\xaa\x5d\x8b\x26\x9f\xce\x16\xbd\xa6\xb8\x36\xea\x75\x13\x69\xe1\x53\x8e\x9f\x95\xb6\x66\xdb\xca\x49\x67\xb6\xb2\x2c\xfc\x09\xb4\xa1\x69\x92\xca\x51\x3c\x72\x70\x76\xd6\x4a\xae\x7f\x6c\x72\x66\xff\xe2\x78\x7d\xbc\x31\x3d\x56\xd1\xb3\x63\x15\x28\x20\xc9\xed\x07\x31\xac\xb7\x86\x95\xd9\xf1\x62\xd3\xc2\xb9\x8f\xdb\x91\xf5\x7a\x6d\xb2\xd5\x1b\x6c\x0e\x86\x51\xba\xb5\xdd\x86\x5e\xa7\x8f\x6b\x91\x48\x90\x45\xce\x0e\xfc\xc9\x94\x06\x43\xf3\x74\x66\xfb\x6c\x80\x2c\xc1\xa5\x61\x73\x28\x00\x67\xa7\xa2\xe3\x4b\x34\xc5\xdf\x99\xf7\x6a\xf2\x5b\x68\xd8\x37\x33\x0e\x8d\x7a\x49\xdf\x58\xd9\x44\x6c\x09\x60\x72\xbc\x01\x57\xae\x5d\x80\x7f\xf2\xab\x3f\x9f\x6e\x77\x5b\x7c\x9c\xf6\xb7\x88\x5b\x22\xfb\x6c\x21\x53\xe6\x64\xe0\x27\x6b\x33\xff\xcd\x1d\x07\xef\x3c\x5c\xfc\xd8\x7d\x93\xf0\xfb\x5f\xbb\x8c\xca\x3c\x86\x9f\xfc\xc8\xdd\x7c\x3e\x68\xf0\xc8\xc0\xcf\xce\xcc\x70\x46\x1e\x9f\x09\xc8\xc0\x17\xff\x8b\xc2\x88\xcb\x15\xcc\x5c\xd3\xbc\x08\xa7\x26\xa7\x38\x5b\x8f\x40\x82\x3c\xbf\xef\xbd\x7d\x9e\x07\xed\xf3\x5f\x79\x15\xde\xf3\xce\x53\x70\xe6\xf4\x84\xb8\xb5\xd1\xfb\xe8\xe6\xd6\xf0\x7f\xe3\x90\x83\x21\x85\x46\x31\xe1\x6f\xa5\xe1\x3a\x44\x9b\x17\xc1\xaa\x94\xff\xc2\x20\x4d\x64\x2c\x40\xeb\x17\xf5\x91\xc1\x05\x36\xb9\x15\x29\x77\x46\x44\x99\xd8\x60\x05\x21\xcd\x12\x47\xc1\x03\x73\xa8\x63\xa7\x1f\xf6\x45\xa3\x6c\x51\xb2\x88\x38\x66\x97\x44\xb1\x44\x4c\x69\x0a\x1e\x96\xb1\x70\x4a\x5b\xb8\x4e\x7c\x5c\x2e\x5d\x30\x7d\x10\xc8\x84\x10\x28\xe3\x64\x72\x0b\x42\x59\x29\x1a\xa3\x10\x3c\xa4\xb5\x29\xa7\x93\x10\x73\x52\xec\x76\x50\x1c\x4d\x8a\x59\x21\xa4\x34\xed\x70\x9c\xd2\x51\x2a\xe8\xe4\x2b\x93\x7a\xc1\x36\x83\x88\x9e\x30\x6b\x96\x01\x5d\x65\x53\x98\x9c\x92\xc1\x30\xb6\x52\xdc\xff\x7e\x2f\x76\x7a\xbd\xc0\x0d\x86\x89\x13\x84\xa9\x1b\xe1\x9d\xb2\x44\xcc\xdc\x02\x51\x96\xd3\xd5\xd2\x24\x1c\x05\x9c\x47\xcf\xbe\xf8\xfc\x7b\xf7\x4f\x1f\x7a\x67\xb9\x88\x07\x67\xa9\xcf\x44\xc8\x50\x48\x31\x0e\x47\x83\xb1\x66\xab\x7d\x36\x8a\x22\x04\x9f\x21\xdf\xa9\x9c\x84\x6a\x54\xe9\x7d\xca\x10\xa5\x8c\xd7\x5a\xb9\x0a\x07\x17\x96\xe0\xc0\xc1\x85\x0d\xe9\x96\xdc\x66\x53\x9e\x50\x22\xcd\x3a\x38\xb0\xbd\x9f\xc0\x29\x34\xd1\x6e\x25\xab\x83\x51\x27\x22\xf7\x17\x9e\xf6\xa4\xee\x97\x2b\x5e\x45\x55\xaf\x5c\x5e\x3e\xb0\x7e\x6b\xf3\xec\xe9\x25\x8b\xdc\x6c\x0d\x9c\x3e\xef\x74\x2c\xeb\x5a\xaf\x27\x0f\xac\xae\x5a\x6b\xdf\x50\x8c\xe7\xc0\x9c\xb9\x17\xc5\x6b\xab\x51\x0c\x42\x99\x52\x4f\xc6\x12\x93\x4c\xaa\xd9\x68\x70\x08\xcf\xd8\x51\x63\x53\xc8\xa9\xa9\x59\xd2\xe5\xa6\x52\x9b\x08\x95\x66\xdb\x6f\xfe\x15\xb4\x58\x51\x40\x68\x1d\x84\x89\x1c\xf5\x23\x7b\x34\x92\xd6\x68\x18\x3a\xc3\xa1\xed\xe2\xb0\x78\x38\x3c\x4e\x32\xb2\xfc\x8a\x3b\x31\x36\x3e\x37\x55\x47\x79\xab\x71\x7d\xc3\xa5\xcb\xaf\xbe\xab\xdf\xe9\xbe\x77\x14\x8e\x60\xbb\xb5\x0d\xdd\x7e\x97\xc7\xaf\x50\x28\x34\x0f\x1d\x3a\xf2\xc4\xf8\xd8\xe4\xea\xc1\x03\x87\x2f\x65\x91\x5b\x7d\xfe\xd5\x17\x6f\x1f\x0e\x06\x63\x31\x9e\x55\x24\x67\xab\xa8\xce\x0b\x48\x20\x83\x5e\xb3\x3a\xc6\x02\x92\x5c\x2c\xae\x8d\xea\xc4\xd7\x7e\xd7\x6d\xd4\x46\xa3\x33\x68\x14\x6a\xc6\x2b\x6c\xb7\x87\xd5\xe2\xb3\xad\x9a\x6c\xd5\xd8\x7b\x4d\x9e\x68\x0a\xdc\x59\xac\x0e\xd0\xb0\x20\xce\x12\x4c\x72\xd2\x0e\x03\x99\x71\x7c\x19\x4c\x4a\xf9\x1d\xa2\xa0\xe6\xef\x0c\x2b\x72\xd1\xc9\xe4\xd2\x38\xc0\xcd\x37\x73\x8d\x68\xe6\xa4\x12\xf9\xa9\x50\xec\x6a\x46\xf5\x4b\x03\xcd\x82\xc4\x38\x5b\x0d\xc2\x29\x26\xa4\x82\x63\xaf\x5e\x1e\xc0\x36\xdb\x30\xae\x3d\xc2\x21\xb1\xb3\xe1\x0c\x9c\x14\x98\x6d\x82\x91\xaf\xc6\x95\xbe\xcb\xd8\x4c\xe2\x6c\x86\xb9\x59\xd2\xb1\xd1\x80\x99\x96\xdf\xd5\xb2\xc6\x7b\x98\x69\x78\x73\x7a\xc1\xb0\xb7\x6c\xb2\x99\x93\xbf\x73\xdc\xc6\x55\xaa\x5e\x1f\x6f\x7f\x7d\xd8\x5a\xe7\xde\xd5\x5d\x0f\x65\xee\x8a\x37\x9c\x86\xf1\x25\x03\x5d\x76\xc9\xe7\xbe\x7d\x91\x87\xed\x75\x56\xf2\xa4\xf8\xf7\xb3\x03\xa2\xf3\xa4\x33\xde\x2a\xb8\x5e\x5a\x6b\x95\x95\x55\xb3\x0b\xc3\x28\x71\xfe\x29\xa5\x76\x17\x05\x23\xbd\x71\x0d\x20\xc8\xe2\x9f\x09\xb9\xb4\x95\x8a\x23\x91\xa4\x51\xaa\xa3\x20\x49\x90\x0c\xaa\x14\x6d\x11\x12\x40\xc5\x7e\xef\x44\x84\x69\x4f\x5e\xbe\xf4\xb2\x3c\x7c\xe0\x30\x67\x9a\xf3\x12\xc8\xeb\xa1\x49\xe9\xe2\x02\xd6\xb1\xd6\x97\xae\xbc\x02\x57\xae\x5f\x4e\xba\xbd\xae\x22\x55\xce\xa4\x8b\xdc\x8e\xf8\xa3\xad\x61\x5f\x7f\xf9\x8b\x9f\xd2\x0f\xbe\xfd\x61\x59\x28\xf8\x3a\xe8\xa1\xcd\x08\x06\xba\x52\x29\x20\x89\x53\xba\xcf\x09\xc8\x3c\x53\xe8\x40\x38\x72\x6c\xd2\xed\x28\xce\x9d\xb9\xa1\x29\xcd\x8c\x02\x86\x9a\xe3\xde\x9c\x74\x66\x88\xa1\xe0\x12\xba\x8c\xfe\x89\x68\x14\x93\xfb\x4b\x78\x9e\x2b\x10\xdc\xb5\xe7\xba\x64\x7b\xb5\xd9\x82\x61\x0b\x99\x87\x8e\x9c\xef\x0a\x09\xb0\x54\x89\xb2\xf1\xe0\xad\x20\xee\x3b\x83\x7e\xaf\xb2\x30\x3d\x73\x7c\x66\xff\xe1\xa3\xbe\x5f\xf4\xe7\x1a\x65\x58\x9a\x69\x68\xdf\xb1\xc5\x28\x4e\x60\x80\xb8\x14\x20\xb1\x69\x8f\x22\x4f\xb6\x92\xea\x54\xbd\xbc\x11\xe3\x58\x4d\x4d\x4e\x17\x9f\x7a\xee\x65\x14\xfb\x3e\xe1\x36\x3b\x8e\x90\x2f\xeb\x98\x3d\x54\xda\x84\x14\x28\x1f\x13\xcf\x26\x12\x4e\x82\x77\x1c\x6b\x72\xf3\xe0\x8a\x34\x31\x94\xac\x89\x0c\x79\x88\x90\x78\x83\xc5\xa7\x71\x66\x72\x1c\xc6\x1a\x75\x7d\x63\x6d\x53\x74\x50\xf5\x8f\xd5\xeb\x7a\xbb\xd9\x82\x5f\xf8\xa5\x9f\x4b\x56\xd6\x57\x94\xb0\x4d\xc0\xfd\x5b\x55\xe8\x56\x96\x00\x47\x48\x39\x46\x80\x6e\x39\x0b\x73\xd3\x4b\x0f\xcd\xbe\xf7\x6d\xd3\xd0\xee\x0f\xe0\xe5\x0b\xb7\xe0\xd7\x7e\xe4\xed\xbc\x43\x29\xc7\xde\x78\xe2\x80\x6b\xc4\x88\xa9\xc3\xcb\x26\x20\x25\x57\xdc\xda\x58\x87\x7d\x73\xfb\xf8\x73\x2a\x7b\x8f\x5c\xf1\x14\x47\xcf\xd7\x08\x8a\x1e\xf8\xaf\xee\x5a\x80\xab\x9f\xbd\x08\x2f\x5d\x5e\x83\xdb\x8e\xcc\xc0\xc5\x4b\xcd\xc3\xad\xd6\xe8\xee\x1f\x9f\xb8\xf5\x74\xd5\x41\xc0\xed\x0e\x44\x6f\x44\xb5\x8e\xf8\x79\x1d\x83\x7f\xe4\x9f\x10\x28\x0b\x72\x08\x5b\xe4\xba\x20\x8f\x76\x6c\x7e\x57\xb2\x9b\x1b\x07\x10\xd5\xb3\xf2\x24\x75\xec\x11\x32\x12\x80\xe2\x43\x58\x0e\xc5\x8d\x85\x28\x55\x7b\xf0\xc0\xe9\xc3\xc2\x5b\x02\xd1\xa9\x5f\x41\xc0\x2e\x0a\xb9\x90\x8a\x43\x9e\x10\x8e\x13\xb1\x92\xf0\x3d\x47\x58\x2e\x1e\x9f\x15\x73\xa8\x8e\xca\x18\x94\x74\xb8\x32\x82\x8e\x41\x1a\xaf\x98\x20\xd6\xa6\xc8\x2f\x91\x10\x07\x4c\xd8\x40\xa6\xf8\x9c\x18\x2f\x7d\x24\x8d\x12\x8e\x4b\x6b\x24\x11\x23\x3a\xb1\x4a\x66\x40\x4d\x73\xd4\x62\xc5\x62\x9c\x6d\x32\x5b\xe0\xc6\xa1\xa7\x8d\x6c\x20\x35\xc4\x36\x70\x27\x75\x8e\x30\xdf\x44\x20\xf0\x2b\xa8\xba\x10\x6c\x62\x2b\xb1\x86\x2a\xb6\x03\x19\x3b\x23\xed\x16\x46\x2a\xf4\x46\x49\x54\x40\x15\xe9\xa1\xaa\xc4\x39\x8f\x3f\xa4\xa4\x1c\x9b\x98\x9c\xc3\x15\xe2\x3e\xf7\xe2\x73\x77\xdf\x5c\xbb\xf9\xce\xc5\xe9\x25\x2e\x15\xe9\x0f\x7a\xef\xd9\x6a\x6d\xc2\xad\xcd\x35\x18\xa0\x7a\xe4\xba\xd0\x24\x7e\xcd\xe4\x40\x10\x0f\x8e\x9f\x38\xf9\x04\xef\x14\x0a\xb4\x46\xad\xd1\x3e\xbc\x74\xe4\x55\x76\x13\xa4\xb6\x93\xda\x89\x7d\xe5\xea\xe5\x63\x35\xaf\xfe\xce\x46\x65\xac\x26\x3d\xeb\x4b\x08\x6c\x4f\xd6\x27\x17\x0e\x0d\x6f\x89\x6e\x10\x0c\x23\x4b\xdb\x49\xa3\x54\x6d\x80\x63\xb9\xcd\x4e\x67\xbe\x58\x28\xe1\x5c\xa0\x09\xad\xc1\x29\x38\x97\x84\xeb\xbb\x5e\x15\x0f\xa1\x56\x2e\xbe\xc6\x0e\x1b\x5b\x9f\xf9\x11\x73\x83\x6d\x10\x29\xb3\xb1\x64\xcf\x74\x8e\x41\xc0\x76\x90\xed\xb5\xce\xed\x2a\xdb\x46\xcd\x2e\x08\x6d\xf4\x3b\xdd\x8c\x9f\xd7\xf8\x10\x4d\x70\x87\xe1\x9f\xdd\x1f\xd2\xe4\x70\x90\xdb\xcf\x01\x11\x06\x81\x8c\x92\xc0\x1a\x5a\x43\x37\x80\xc0\x09\xc4\x08\x1f\x43\x2f\x86\xc8\x4f\x85\xf2\xa6\x26\x27\x27\xea\xb3\x15\x6a\xd8\x01\xab\x2b\xd7\x0e\x6e\xac\xde\xf8\x10\xae\x89\x06\xb9\xd6\x69\x4c\x13\x3c\xce\xfd\x8b\x4b\xcf\x2c\x1d\x3e\xfe\xf4\xd4\xf4\xfc\x5a\x8e\x44\xca\xac\x39\xde\xf1\xe3\x27\xef\xba\xb8\x37\xb7\x89\x0e\xb7\x2d\xe3\x20\x1d\xd9\xd3\x7c\xfe\x2d\x72\x60\xbb\xb8\x3b\x45\xe9\x47\xe1\xdb\x94\x03\x05\xce\x4c\x31\x0e\xda\x42\x71\x34\x9a\xd1\xf5\xf1\xc7\xa2\x72\xa1\xaf\x18\x37\x0d\x14\x66\x21\x5e\xd8\x01\x63\x13\xc2\x64\xf0\x35\x3f\xc4\x9f\x24\xe3\x24\xb8\xc9\x86\xc9\x29\x32\x24\x9c\xcd\x27\x5a\x59\x2e\x1d\x35\xb1\x72\x5a\xcb\x8a\xdd\x3e\xc4\x84\x76\xd7\xb6\x01\x24\xa2\x4f\x0a\x44\x0e\x2c\x3a\xd7\x9a\x7a\x67\x1f\x38\xd7\x66\x6f\x83\x8f\x0c\xa8\x0d\x06\x65\xd9\xc3\x22\xd7\x5c\x39\x70\xeb\x3c\x14\x6d\xe6\xc2\x6e\xde\xdb\x1e\x50\xd7\xb9\x5b\x5b\xa8\xdd\xb8\x8a\xc8\xc1\x3d\x07\x65\xe3\x59\x30\x60\xaa\xf7\x86\x65\xcc\x36\x32\x31\x6d\x34\xbf\x56\xaf\x8d\x4e\x67\x4a\x58\xbf\x26\x53\x54\x67\xbe\x06\x16\x0b\x4a\xe7\x75\xce\x19\xc2\xf3\x6b\x7b\x55\xb4\xe2\xc9\x6a\x82\xe1\x0a\x76\x48\x43\xf6\x33\xca\x80\xba\xce\xd9\x29\x3e\x4b\xb2\xa9\x69\xea\xa3\xf8\x65\xa5\x75\x3e\x78\x90\xcb\x51\xc8\x28\x95\x19\x62\xa3\x4f\x11\xc5\xf9\x1c\xab\x04\x11\x25\x0d\xad\x34\x8d\x2d\x14\x17\x88\xdf\x21\xea\x2b\x84\xa0\x34\xb1\x29\xce\x4e\xc9\x09\x28\x1b\xd3\xd5\x1b\xaf\x58\xb3\x93\x93\x68\xef\x6c\x4d\x76\x9a\xbb\xb3\x59\x1e\xab\x88\xd5\xb5\x65\xb8\x74\xe5\x62\xda\xe9\xb5\x88\x02\x90\x32\xa6\xb3\x6f\x62\x09\x86\xd4\xf1\x63\xab\xbd\xa9\xbe\xf2\xb5\x3f\x53\x8f\xbc\xeb\x51\x49\x0a\x7a\x34\x1a\x71\x96\x7c\xb5\x52\xd4\xd4\x21\xad\xdf\x0f\x74\x96\x73\x65\xf2\x25\xc1\xf8\x79\x08\xe0\x45\x96\x67\x41\x40\xe8\x30\x87\xe3\x4e\x70\x99\xb3\x86\x96\xa5\xa3\x33\xdf\x88\x89\x4d\xe0\x9e\x53\x22\x1e\x8c\x22\x26\xae\x45\xcf\x05\x34\x23\x64\xbf\x77\x4a\xd7\x52\x15\xcb\x24\x8a\x6d\x12\x37\x83\x70\x60\x37\x37\xd6\x27\x4e\x9e\xbc\xfd\x94\x57\xaa\xcf\x4f\x34\x1a\xfe\x3e\x54\xe3\xb3\x8d\x92\x2e\xba\x36\x39\x26\xc4\x10\xc1\x3c\x40\xde\x83\x02\x1c\xd7\x6e\x0c\xbd\x20\x11\x57\xd7\x3a\x93\x27\xf7\x0d\xdb\xd5\x42\x29\x40\xe2\xe0\x2e\xdf\xb8\x51\x5c\xd8\x7f\x20\xa6\x5f\x88\x99\x5d\xaa\x8c\x95\x66\x79\x22\x64\x5d\x84\x31\x3a\x3a\x4f\xc4\xa0\x75\x21\x6d\xc8\x86\x4c\xa7\xec\x69\x25\xa8\x50\x62\x72\xaa\x81\x62\x77\x0c\xc1\x7c\x4b\x74\xbb\x03\x3d\xde\xa8\x90\x6d\x14\xff\xf0\x97\xfe\x7e\x7c\xf9\xfa\x85\x58\x70\xe2\xe7\xb7\x06\xe8\x79\x28\x67\x6f\xdc\x9c\x33\x6d\x0b\x95\xf7\x2c\x4e\xdf\x3e\x25\xcf\x1e\x2c\xc1\xff\xfe\x89\x67\xe1\x47\x1f\x38\x04\xc3\x4e\x13\x6c\xb4\xc9\x74\xa2\x55\xce\x2a\xd3\x6c\x02\x03\x4f\x46\x66\x5b\x94\xd9\xbe\xb1\xb9\x05\x73\x33\x73\x3c\x81\xcd\x5c\xcc\x96\x31\xa9\xcf\xec\xbb\x74\x02\x6f\x6e\x6e\xc3\x47\xef\x9c\x16\xff\xf7\x13\x37\xe1\xe0\xfc\x38\x9c\x38\x36\x06\x57\xae\x6e\xbf\x7f\x6d\x60\xbf\x5c\x2c\x24\xa9\x46\x9a\x56\xac\xe2\x89\xf7\x68\x24\x1c\x13\x5e\x77\xa9\x2d\xa1\xc5\x71\x37\xf2\x02\x52\x47\x1f\x69\x93\x07\x83\x96\x6b\x11\xc4\x11\x14\x33\x56\x47\x1c\xf6\x28\x0d\x2c\xa6\xe5\xcf\xf3\x85\xe2\x2a\x14\xbb\x73\x6c\x42\x6f\x04\x7f\x35\x12\x76\x6a\x73\x7c\x99\x42\x44\x9a\xd4\x34\x61\xb1\xcc\x2c\x00\x2e\x84\x38\x96\x22\x0a\x4d\x68\xcd\x38\x65\x79\x7e\xb3\xf1\x32\xee\x28\x9a\x35\x74\xf2\x4c\xc4\x8d\x54\x86\x62\xdf\xa6\x91\x02\xa9\x16\xb9\xae\xcc\x00\x9c\xf5\x4c\x96\x76\x9b\xa7\xbc\xcb\xcc\x75\x29\x79\x96\x9a\xb9\x28\x05\xe4\xe1\xb6\xbd\xaf\x33\x9b\x60\x31\x8c\x8c\x5b\x5a\x51\x24\xec\xd1\x40\x39\xfd\x6e\x54\x18\x0d\x44\x61\xd8\x87\x12\x2a\x47\x3f\x8e\xc1\xc3\x5d\xb4\x89\x66\x17\xac\x92\x6b\x97\xfc\x2a\xd5\x03\x5e\xbd\x7a\xe5\x1d\x8d\x72\x1d\xd6\x36\x56\x60\x79\xed\x1a\x74\x7a\x5d\x08\xc3\x70\xc7\x40\x4d\x4e\x4d\x2d\xcf\xcc\xcc\x2e\xd3\x8f\x9d\xbd\xeb\xde\xa7\x5e\x9b\x82\xaf\xf7\xc4\xf5\xc0\x45\x66\x1e\x6a\x47\xf9\xd7\xae\x5d\xdb\xff\xd4\x93\x4f\x7c\xf8\xd4\xd1\xdb\xc0\xb3\x7d\x94\xac\xce\x83\x36\x2e\x49\xbb\xe4\x3c\xed\x38\xc5\x4a\xa7\x33\x8c\x6d\x4b\x24\x96\xeb\x96\x68\x0b\xbd\xde\x60\x7a\xdf\xcc\xc2\x2e\xd1\x2b\x79\x2f\xe1\x7a\x13\x6e\xb5\xb2\x1e\x25\xbe\x30\x2d\x14\xf7\x00\xfa\xeb\x9c\x49\xb9\xc9\x37\x80\x24\x32\x95\x95\xe1\x79\x1e\x66\xcc\x02\xa0\xc6\xc0\x1a\x63\xc1\x5f\x65\x03\x61\x84\x45\x06\x86\x59\xa6\x86\x39\x0d\x06\x47\x8c\x1f\x2c\x09\x23\x2b\x09\x43\x89\x46\xc3\x19\xc5\xa9\x13\xc6\xca\xc3\xc5\xee\x05\x61\xea\xa1\x39\x74\x91\x94\x17\xa6\x6b\xb3\xf5\xc6\x5c\x85\x37\xf4\xd2\x0b\x4f\xbf\x2d\xec\x76\x1f\xa1\xf5\x40\x89\x42\xe4\xdd\x40\x22\x75\xf5\xc4\xa9\x3b\x3f\x37\x31\x35\x7b\x93\x5e\x0f\xc2\xc8\xe9\xf5\xfa\xba\xd9\x6e\xc6\xa3\x10\x2d\x8c\xe7\xf6\xca\xf5\x6a\x50\xab\x54\x2c\xc7\xb1\x11\xa1\x2d\x15\xe9\x64\xd8\x8f\x82\x41\x3c\x8c\xab\xb8\xb0\x2d\xf6\x76\xa3\xf1\x92\x9e\x9d\x96\xa4\x98\x41\x02\x55\xd9\xdc\xb8\x39\x6b\xf5\x06\x3f\x7c\x60\x61\x09\x62\x4b\x7c\x72\x60\x89\xe7\xfc\xf5\xe6\xdd\xa1\x5d\xfb\xaa\x32\xac\xc6\x00\xba\xd2\x3b\x2a\x36\x07\x10\xf6\xb7\x33\xa0\x67\x7f\x93\xbb\xd3\xb8\x42\x4d\x02\x98\xa2\x79\x9b\x9a\xb0\x8c\x62\x27\xa6\x51\xaf\xfc\x3d\x65\xca\x4a\xd9\xeb\xc6\xc8\x25\x18\xba\xf9\x43\x46\xcf\xaa\x0c\xcc\x8d\xa8\x84\xcc\x3e\x98\xcf\xab\x9d\x2e\x5d\x06\x87\x72\x6e\x65\x36\xb1\xdb\xce\x2b\xcd\xb2\xcf\xe9\xc5\x5d\xb7\x8c\xc8\xcf\xb1\xc8\xdd\xec\x7a\x37\xd8\x9c\xa5\xec\x88\x1d\x0d\x98\x39\x18\x76\x9c\x3b\x19\xc1\xd9\x8d\x42\x6b\xb5\x93\x01\x9f\x81\x64\x5e\x54\x94\x31\xc6\x3d\x0e\xa0\x6c\x27\x72\x12\x69\xc6\x77\xa7\x85\xa8\xd6\x3b\xe0\xae\x18\x71\x77\xba\x91\xb1\x0f\xc3\x28\x33\x3e\x17\x42\xe7\x22\x3a\x0f\x2d\x98\x76\x1b\x14\x53\x10\xc6\x6d\x67\xc4\x91\x62\xe7\x07\x6d\x4f\x49\xb4\x22\x29\xb5\x10\x4d\xb5\xa1\x0c\xac\xa0\xcc\xf7\x75\xe6\x7f\xd7\x99\xab\x3d\x73\x93\x1a\xaf\x36\xdd\x62\xa9\x29\x2e\x43\x75\x7c\x09\xf2\xea\x34\xd1\x8a\x94\x3a\x65\x1b\x27\x91\x87\x88\x67\x69\x32\x64\x38\xce\x51\x30\x4c\x2e\x5d\x7a\xd1\xba\xe3\xf4\x5d\x92\x3c\xa2\x94\xfc\xb2\xb9\x79\x43\x5f\xba\x76\x31\xd9\xdc\xde\xe0\x4c\x09\xa2\xf0\xc6\x98\x66\x87\x8e\xd3\x92\xfb\x99\x82\x49\x74\xa2\x31\xd9\x68\xae\x8b\xcf\x7f\xf9\xcf\xc4\xa3\x0f\xbf\x57\x16\x4b\x3e\x95\xa2\xe9\xc1\x70\x04\xf5\x7a\x49\x53\xe7\xb7\x1e\x2a\x77\x92\xb1\xd2\x32\x03\x28\x45\x16\x4b\xe6\x7e\x24\xa8\xdc\xf3\xd6\xa7\x99\x94\xe1\x78\x3e\xcd\x46\x61\x4e\x3b\x5b\xd4\x2c\xb1\x81\x92\xdd\x58\x4e\xa5\x0a\x86\x41\x48\x77\xe1\xb8\xc6\x3d\x4e\x04\x23\x8a\x03\x2b\x1c\x8d\x9c\xe6\xd6\xe6\xe4\xfc\xbe\x03\x87\xcf\xde\xff\x6d\x87\xab\xd5\x9a\x3d\x53\xf5\xf4\x7c\xbd\x8c\xf6\xca\x62\xd7\xdd\x80\xba\x92\xe2\xe0\x8e\x10\xc8\x47\x41\x24\x3a\x83\x08\x5a\xbd\x40\x6f\x77\x87\xb0\xda\x0c\xec\x68\xd8\x1e\xbb\xe3\xe0\x54\xa7\x50\x2a\x8b\x4e\x67\xbb\x36\xaf\xf6\x77\xf7\x54\x4d\x10\x37\xe1\x54\x51\x33\xe1\x38\xe1\x52\x4b\xf6\xa6\xaa\x3c\x4c\x82\xe0\x9d\x18\x47\x92\x30\x1e\x27\xca\xf4\x9f\x9b\x19\x83\xe9\x89\x8a\x5e\x5b\xdf\x86\x56\xbb\x0b\x8d\x7a\x1d\x8f\xd7\x83\x9f\xfd\xf9\x9f\x8a\x5f\x3a\xff\x5c\x40\xee\x0a\xaa\x1f\x64\x50\x97\x4c\x09\xde\x3c\x65\xe8\xde\xcd\xdf\x15\xe5\x03\xff\x42\x3c\x2b\xbe\x6c\xf7\x46\x03\x1f\x0f\xa6\x8c\x3f\x52\xc7\x3d\xaa\x0b\x51\x6d\x94\xc7\xef\x6a\x3c\x72\xfb\x98\x78\x61\x75\x1b\xe2\xfe\x08\x1e\x3c\x31\x03\x2f\x9d\x7f\x05\x2e\x5c\xba\x26\x6e\x3b\x7d\x8a\xb3\x1b\x53\xd8\x55\xe5\x0a\x11\xcf\x64\x78\x0a\x18\x0c\x86\xd0\xdc\x6e\x09\x62\x79\x31\xd5\x82\x67\x84\xd2\x4c\x72\xb3\xaa\xe8\xf9\x95\xeb\x57\x85\xe7\x38\x70\x64\xff\x02\x9c\x99\x2a\xc0\x2b\x17\xd7\xc4\xa1\xf9\x69\x98\x9f\x2a\x1c\x7a\xf5\xa6\x77\xfa\xa1\x03\xbd\xcb\x44\xe1\xc8\xcc\xd9\x56\x4a\x46\x8d\x06\x4b\x10\x78\x3b\xe4\x82\xa0\x19\xbf\x03\x7f\xbc\x28\x4d\x55\xa4\x2d\x20\x54\x43\xe1\xa4\x08\xac\xe4\xea\xe0\x2c\x6e\x41\xb6\xc8\x18\x0b\x9a\x80\x09\x2a\x6f\x45\x40\x4a\x6e\x27\x22\xa9\x46\xf2\xa9\x2c\xa4\x4a\x53\x57\xb3\xd7\x3f\x67\xa1\xb0\x0b\xe8\x46\x50\xf0\xbc\x32\xee\x42\x95\x65\xb5\xd0\xa9\x52\x3b\x7d\x8a\x44\xf6\xf9\x1c\xd1\x59\x33\xa9\x3d\x6d\x8c\x4c\x0e\x4b\x66\x48\x76\x0c\x50\x16\xd2\x95\x62\x47\xa9\xe4\x88\x93\x6f\x92\xdd\x35\x1a\x81\x46\x59\x51\x98\xd8\xd1\x20\xf4\xa3\x7e\x58\x08\x06\x41\x29\x0e\xa2\x62\x1c\x26\x85\x24\x41\xc0\x21\x8f\x10\x6e\xb0\x3e\x3d\x55\xc4\x11\xd1\xaf\x9e\x7f\xf5\x88\x23\xad\xfa\xbe\xd9\xfd\xd0\x42\x72\x46\x49\x7b\xe5\x72\x79\xe3\xe8\xd1\x63\x17\xe7\x67\xe7\x97\x67\x26\x67\x36\xcc\xaf\x64\x96\x91\xba\x37\x90\x46\x43\x16\x39\x1c\x0e\xd3\x11\x65\x85\xd1\x30\xa6\x71\x12\x84\xe1\x68\xb2\x31\x57\x2a\x54\x0b\x62\xe5\xc6\xf2\x7e\x52\xa2\x2f\xbe\xf2\x3c\xac\xa3\xd2\x5f\x5a\x3c\x0a\xb3\xf3\x73\x1b\x32\x10\xd0\x5e\x6f\x5a\xa3\xde\x50\x8e\x55\x27\x3c\x2d\x12\xe8\xb7\x47\x5e\xb7\xd5\x3c\x32\x7e\xf8\x4c\xd6\x25\x50\x2e\xa7\x91\x0a\x71\x6e\xb7\xd3\x41\xd0\x19\x0c\x82\xdd\x8c\xb5\xd7\x67\xab\x49\x91\x2b\x75\x03\xd0\x7a\xc7\x60\xeb\x1d\x13\x6d\xac\xba\xd1\x9f\x46\xe1\x65\x3e\xd1\x4c\x05\x49\x99\xfd\x9d\x53\xe7\xdc\x56\x9b\xac\x0d\x6d\xb2\xbb\xd1\xd6\xc5\x32\x08\x03\x19\x0e\x23\x67\x34\x1c\x7a\xa3\x41\xe0\x87\xa3\x00\xc5\x71\xe4\xc7\x51\xec\xa1\x4d\xf4\xa7\xab\xd3\xe5\xd2\x98\x87\x86\x30\x82\xa7\xbf\xf6\x85\xef\x98\xa8\x8e\x1d\x17\x5e\x01\xd6\xd6\x57\xa8\x99\x46\x70\xf2\xc4\xed\x9f\xdc\xb7\xb8\x74\x9e\xf6\xae\xdd\xec\x58\xe4\xb5\xda\xda\xda\x06\xae\x15\xa3\x8c\x61\xc7\xb6\xd0\xbc\xda\xaa\x2b\xf4\x28\x09\xbb\x96\xe7\x44\x34\xe3\xd2\x28\x72\x10\xed\x8b\xf8\x3b\x4e\x9a\xa4\x0e\x47\x53\x2d\x89\xf4\xcc\x8e\x1a\x8d\x52\x43\xa0\x36\xbf\x76\xf1\xdc\x99\x85\xf1\x59\x93\x7d\x9d\xa8\xf7\xa3\x0a\x7b\x05\xcd\x48\xbd\x7b\x33\xb4\xc8\x99\xaa\x33\xf6\xc8\x29\x28\x06\xc0\x0d\x38\xe8\x5d\x07\x31\x67\x07\x1b\x15\x61\xcc\x10\x65\x7f\x67\xc1\x66\x95\xb9\x3d\xcc\x52\x55\x99\xdd\x52\x5c\x7e\x64\xbc\xbc\x29\x29\x74\xe2\x06\xf8\x63\x6a\x67\xa3\xfc\x2b\x22\x5b\x6e\x6a\x8f\x36\xe7\x93\x26\x0d\xe0\x65\x8c\x2b\x07\x63\x6d\xd8\x15\xec\x39\x91\x19\xf7\xcf\xd9\x9c\x30\xa5\x65\x3b\xeb\x20\x5f\x29\x59\x13\x2a\x99\x3b\xe9\xb3\xf4\x09\x2d\xb2\x28\x4b\xa6\xd0\x73\x85\x9f\x01\x2b\xe7\x9f\x40\xee\x97\x17\x59\x2c\x26\x77\x6f\xc3\x4e\x36\xba\xde\x89\x07\x30\x41\x78\x8d\x09\xcd\x13\x35\x76\x1c\x00\x9a\xf5\xaa\xde\xf9\x5e\x0a\x79\xe2\x06\xe4\x71\x1e\x06\x63\xa1\x4d\xf6\x1a\x9f\x8f\x94\x70\xd4\xfc\x08\xbb\x3d\xc9\x2c\xc5\xec\x28\x30\x83\xa7\x73\x4a\x60\xa6\x2b\x88\x4c\xce\x53\x12\x59\x9a\x81\xf9\x0e\xb1\xca\xd4\x20\xbd\xad\x76\x3b\xa5\xa5\xa9\x79\x3b\x09\x25\x97\x0e\xa4\x09\x9e\xba\x18\xf9\x03\x3f\x22\xe8\x28\x94\xe3\x89\x89\xcd\xe0\xae\xad\x6e\x5c\x57\x4b\xa3\x23\x16\xaa\x7b\x7d\xfe\xd5\x97\xd3\xf5\xad\x9b\xf8\x49\xce\x40\x54\x82\x13\x79\xa4\xda\x49\x4b\x30\x99\x0a\xd4\xce\x93\x9c\xe4\x96\x89\x55\x19\xb5\xbe\xb2\x7e\x43\xfc\xd1\x67\xfe\x48\x7e\xf0\xd1\x0f\x0a\xaf\xe8\xa3\xda\x1d\x81\x46\x08\xac\xd7\xca\xdc\xce\xb5\xd3\x1b\x1a\x97\xb5\x9d\x45\xea\xc8\x2c\xda\x7b\x9b\xad\x08\xb6\xb0\x32\xeb\xcf\x2e\xb3\xb1\x94\x24\xf3\x77\x20\x12\x78\x3e\x99\x38\xba\x92\x09\x95\xce\x45\x91\x1c\x04\xb1\x08\x82\xc0\x0a\x46\x7d\x37\x0a\xc2\x99\xf1\xc6\xec\xe9\x07\xde\xfd\xd1\xf9\x46\xc5\x87\xf1\xa2\x0b\x55\xdf\xd2\x04\xe4\x21\x65\xd2\xe3\x9d\x12\x19\x89\x2a\x85\x89\x42\xc2\x8d\x36\x0a\xd7\x73\x1b\x49\x47\x13\xef\xdb\x9d\x01\xdc\xda\xee\xc2\x53\x37\x37\x27\xa3\xde\xd6\xc6\xc1\x7d\xb3\x37\x0e\xce\xcd\xf9\xf1\xb0\x6f\x95\x8a\x25\xfc\x49\x05\xc6\xcf\x87\x16\xdb\x32\x6b\x49\xc1\x4e\xe2\x12\x3b\x5b\xd1\x08\x53\xe1\x16\xd8\x92\xfb\xa0\x72\x36\xbf\xe3\x38\x7a\x61\x6e\x12\x1a\xb5\xa2\x5e\xbb\xd9\xe2\x7e\x2e\x13\x8d\x31\xf2\xaa\xc0\xdf\xfd\xb9\x9f\x0c\xcf\xbf\xfc\x4c\xc0\x35\x81\x82\xc7\x5d\x9b\xf2\xcc\x37\x01\x74\x4b\x38\xe2\xff\x6c\xfc\x0d\x78\xf5\xb6\x6b\xf0\x3b\x97\x9f\x97\xc3\x30\x74\x5c\xe9\x14\x23\x9d\xd6\x70\x6a\xe0\x5d\x57\xa5\xb5\x34\xe6\x2f\x4c\xd9\xc7\x16\x4a\xf0\x2f\xbf\xf8\x32\xbc\xff\xc8\x38\x67\x9d\x1e\x59\x3a\x02\x14\x6f\xe5\x56\x77\x29\x15\xa6\xa4\xbb\x80\x9e\xa6\x42\x67\x75\xd5\x43\x94\x8a\x5b\xcd\x26\xbb\x88\x88\x08\xe6\xae\xbe\x3c\xb0\x99\x9f\xb4\xc5\x7d\xfb\x84\xe7\x7b\x10\xe1\x3c\x7b\xfb\xa1\x86\xf8\x8d\x67\x6f\xc2\x89\xa5\x19\x98\x9b\x2b\xc1\xf9\x75\xe7\x8e\xfa\x9c\xb7\xa6\xa5\x29\xed\xcd\xec\x0c\x9f\x5a\x33\xa5\x4d\xb0\x90\x5c\x17\x4c\xf1\x29\xd1\x41\xb1\x15\x01\x88\x4c\xe5\xc8\x90\x19\x2b\x4f\x3f\x63\x56\x94\xca\x12\x79\x8c\xfb\xce\xd4\xcb\xec\xe6\x48\xc1\x4e\xb1\x89\x21\x06\x79\xda\x90\x81\xe0\xcc\xcf\x0e\x90\x3f\xcd\x74\x41\xae\x03\x74\xd6\x66\x3f\x4f\xb8\x31\xd3\x14\x54\xae\x0e\x32\x6d\x61\xa4\x43\xc6\xed\xb5\x89\x2b\x6a\x9d\x27\x01\x89\x1d\x04\x32\x19\xbb\x26\x26\xcd\x2a\x25\x97\x08\x66\x3b\x29\xae\xab\x14\x0d\x3e\xce\x60\x37\x0d\xa3\x42\x1a\x86\xc5\x34\x0a\x4b\xf8\x5a\x51\xc7\xa9\xaf\x53\x45\x1d\xa1\x2c\x4b\xdb\x56\xb9\xe0\xdb\x94\x7a\xbc\xb2\xb2\x7c\xfb\xd2\xfe\xa3\x50\xaf\x34\xb8\x34\x65\xff\xc2\xfc\x27\x67\xa6\xa6\x2f\xee\xa8\x61\x1c\x9f\x7e\xaf\x2f\x7a\xbd\x2e\x83\xc0\xa0\x3f\x40\x72\x96\x95\x61\x18\x9f\x81\x05\x66\x41\xdb\xd2\xb2\x7c\x47\x77\x80\x16\xeb\x81\x85\x43\x17\x57\x56\x57\x8e\x84\x41\x50\x23\x80\xf6\x8b\xfe\x4b\xb6\x6d\x2f\x8f\xfa\x43\xe8\x36\xdb\x16\xb9\x1d\xab\x85\xb2\xd4\x71\xa2\xce\x9f\x7f\xe1\xb6\xb1\xfa\x38\x67\x76\x6b\x53\xaa\x74\x91\x62\x23\x96\x14\xdb\xd0\xef\xa9\x5d\x25\xae\xf5\x1e\xdf\x80\x16\xbb\x4a\x3d\x77\x49\xea\x4c\x88\xee\x1a\xe0\xfc\x4b\xda\x00\xb3\x71\xdf\x9a\x44\x9c\x3c\xa5\x48\x65\x19\xc7\xac\xc1\x95\xf1\x80\x31\x7f\x93\xe6\x9c\xe2\xc2\x96\x68\xc1\x04\x1a\x06\x27\x18\x84\x4e\x30\x0a\xfd\xd1\x68\x54\x88\x98\x28\xc5\x3e\x12\x54\x1f\x89\xaa\xeb\xcb\x42\xb1\x31\xd5\xa0\x72\x35\xf5\xcc\xd3\x5f\x7a\xcf\x5c\x63\xea\xf8\xc4\xd8\x14\x13\xa5\x83\x8b\x47\xaf\x4f\xcc\x2d\x7c\xc6\xf5\x0b\x9d\x30\x88\xdd\xcd\xcd\x2d\xb5\x76\x73\x2d\x77\x4b\x71\x28\x05\x07\x93\x5c\x43\xb8\xc6\xa5\x8b\x63\xe0\xf3\xb4\x4b\x34\x9e\xb7\x54\xa6\x41\xec\xab\x20\xf1\x71\x5c\xa8\x00\x97\xfd\x87\x9a\xe2\x58\x8a\x93\x30\xca\xb8\x01\xfc\x0e\x9a\x3a\xfa\x4a\x12\x1b\x50\x71\x24\x95\x07\x53\x89\x42\xd1\xe1\x82\x5c\xc8\xd4\x5c\xe6\x04\xce\x92\xff\x28\x9c\xa7\x72\x85\x9d\x51\x6c\x25\xf2\x28\x86\xc1\xb7\xec\x79\x9e\xba\x64\xc4\x9f\xce\xb2\x3f\x94\xca\x62\x18\xdc\xc1\x51\x1a\x37\x7b\xc6\x73\x69\x48\x85\xa3\xf1\x3f\xd8\x2f\x6a\x0b\x15\xcf\xda\x27\xac\xb4\x2c\x38\xbc\x26\xbb\x4d\x1d\xdd\xb8\x2a\xfb\xcb\xd9\xba\x31\xe7\x8d\x12\xa5\x08\x6a\x28\x2e\x95\x31\x35\x3a\x27\x92\xbd\x5e\x54\xe2\x66\xed\x04\x22\x94\x94\xe6\x7c\xcb\xdd\xd5\xaa\xb2\x75\x4d\xe5\x91\x8c\xd7\x46\x1c\x19\x3a\x67\x02\x61\x99\xde\x66\x6b\x6b\xe0\x47\xe9\x9d\xa4\x73\x2e\xb5\xcd\x9d\x3d\x56\xa6\xa2\x0d\xfd\x11\x39\x4e\x66\x0e\xef\xac\xd1\x95\xd6\x3b\x5e\xe6\xac\xd6\x9d\xf9\x8c\xdc\x13\x45\xc8\xdc\xe7\xda\x10\x7d\x9d\x03\x4f\xee\x5b\xe7\x6a\x00\x69\xde\x36\xee\xf1\x1c\xbc\x4d\x3c\xc4\xfc\x44\xa6\xf4\xb3\x44\x63\x30\x71\x72\xad\xb2\x47\xae\xaf\x57\xd9\x3a\xc8\xb2\x01\x99\x98\x71\x32\x84\xde\x71\x5a\xe5\xb3\x9b\xfd\x30\x42\x66\xb0\x6d\x51\x4c\x97\xa4\x3f\x70\xfb\x73\x4a\x80\x12\x29\x0f\xfc\x30\x8d\xf4\xe3\xcf\x3c\x86\xca\x36\xd2\x61\x1c\x51\x71\x12\x12\x49\x47\xf1\x95\x42\x2c\x0b\x01\x8c\x33\x74\x29\x43\x82\x13\xca\x29\x95\x9e\x6a\x0d\xf1\x98\x6c\xb2\x37\x9c\x8e\x91\x9a\xc1\x41\xa5\xae\xff\xdd\x1f\xff\x9e\xfc\xc0\x7b\x3e\x2c\xca\x95\x0a\x82\xfa\x00\x74\x6f\x88\x4a\xbd\x0c\x63\x9e\x8b\xa0\x3e\x10\x29\x65\x7a\x52\x18\x13\x4c\xdb\x53\x93\x97\x68\xd4\x37\xb9\x4d\xc9\x12\xdb\x62\xd7\x4d\x68\x7a\x95\x64\x29\x83\x26\xb7\x80\x05\x10\xae\x4d\x3c\xa2\x08\xc9\xf5\xc0\x19\x85\x23\x7b\xf9\xea\xca\xc2\xe4\xec\xe2\xa1\xf7\x7f\xe8\x07\x17\xfb\x21\x2a\x63\x35\x84\xd9\x6a\x8d\x87\x25\x24\xa1\x49\x35\xee\x99\x89\xd7\xdc\xc5\x0d\xc1\x1c\xb1\x6a\x18\x26\x9a\x1a\xa2\x35\x07\x21\xac\x6d\x75\x61\x6d\xa3\x07\x37\xb7\x7b\x70\xfe\x56\x20\x2e\x5f\x78\x79\xe2\x87\x1e\x59\xba\x7e\x60\x61\xbf\xf5\xec\x8b\xe7\x0a\xf5\xa5\xc3\x5d\x4e\xba\xb2\x80\xe3\xe5\x26\x68\x63\xef\x16\x62\x32\x79\xb4\x58\xe6\xda\x46\xa8\x6b\x6a\xce\x53\xad\x14\xf4\xbe\xd9\x49\xba\xc0\x8d\x5e\x59\xdb\xa6\x5a\x73\x3d\x33\x35\x06\x1b\x5b\x5b\xf0\x73\xbf\xf0\xd3\xe1\xca\xf2\xc5\x00\x77\x2c\xc6\x23\x4d\x28\x1b\x9a\x0f\xd4\xe2\xd6\xb6\x6f\x04\xf4\x44\x34\x60\xc2\xfb\x30\x3c\xd6\xfe\x25\xe8\xa7\x6d\x89\x3f\xe0\xe2\x1e\x15\xf1\xa8\xca\xb8\x3b\x15\xdc\x97\x82\x05\x47\xaa\xf6\x62\x09\xc8\x31\xb2\x72\xab\x07\x0f\x3e\x70\x40\x0c\x47\x21\xac\xde\xda\x80\xc1\x70\x24\xaa\x95\x32\x4c\x8e\x8d\x43\xc1\xf7\x11\x8c\x63\xaa\x65\x36\x0b\x1d\xd7\x06\xd5\xd1\xb5\xdb\x1d\xb8\xb9\xb9\x4e\x89\x70\x82\xe2\xa4\x86\x9d\x66\x25\x1f\x96\x71\x17\xd3\x59\x71\x2c\x27\xcf\x84\x17\xb3\xf5\x22\x94\x71\x61\xf7\xf0\x77\x26\x27\x2b\xf0\xa2\xf0\x96\x7a\x71\x8d\x6b\xf4\x32\x00\x36\x9c\x4d\xb0\xc7\xd0\x20\x36\xe7\x64\x1a\xa2\x20\xb9\x56\xc1\x80\xa7\xc9\x14\xe5\x0f\x8a\xdc\xc1\x6d\xbc\x85\x26\x31\x27\x77\x2b\x1a\x82\x21\xb3\xc5\xb7\x53\x58\x2a\xb4\xde\x4d\xfc\x01\x9d\x27\x62\x1a\x25\x2d\xb2\xd4\x67\x21\xb2\xe4\xe8\x1d\x2f\x9f\xf9\x4d\x99\x3d\xcf\x53\xb6\xa4\xcc\xfe\x36\x2e\x04\xb2\x89\xbb\xbd\x64\x20\xf7\x20\x89\x9d\x24\xa1\x0c\xd9\x69\xaa\x8a\x2c\x43\x48\xec\x90\xd0\x5c\x3f\xa0\x3a\xc7\x99\x21\xb5\xc5\xce\x38\x07\x15\x92\x13\x2b\xe5\x25\xa9\xf6\x90\xe0\x78\x78\x34\xae\xe6\x24\x47\x21\x6b\xf5\x71\xcb\xab\x3b\x71\xab\xd5\xaa\x85\x41\xb8\x30\x3b\x3d\xcf\x96\x6c\x72\x62\xf2\xa5\x6a\xbd\x78\x11\x55\xba\x68\x36\x9b\xba\xdd\x6a\x13\x80\xe7\x69\x38\xb0\x13\x1e\x00\x99\xef\x97\xe0\xa4\x4d\xce\xcc\x21\xfb\x99\xc8\xed\xd6\x7a\xdc\x18\xaf\xe9\xb9\xa9\x99\x8d\xef\xfa\xf0\x77\xfd\x3f\x7b\xdd\x40\x54\x47\x7a\xf5\xd2\x45\x99\x22\x11\xb4\x80\xb2\xe3\x7d\x3e\x01\x5b\xdb\x9b\x87\x4f\x2d\xdd\x96\x7f\x2e\xb0\x6c\xf1\x2a\xb9\x03\x5d\xa9\x57\x90\x88\x25\xb9\xea\xde\xd5\xe8\x3b\x0a\xdb\x9c\xaa\x1c\xee\xb3\x96\x89\xb9\x46\x57\x19\xbf\x12\x59\x15\x92\xc9\xd7\xce\xd6\x95\x69\xf3\xcc\xdf\x35\x8d\x1d\xb2\x24\x65\xc9\xed\x84\x77\x52\xac\x28\xb7\x97\x38\x31\x82\xb4\xad\xd2\xc4\x45\x03\xe1\x25\x49\x50\xd4\x49\xc4\x77\x7c\xcd\xc7\x7d\xf5\xa8\x8d\x0a\xb2\x69\xdf\xf6\x20\xbe\x74\xe9\xfc\xb1\x5e\x6b\xfb\xf6\xf9\x93\x67\xb9\x5e\xd7\x2f\x96\x2e\xea\xa2\xf7\x49\xda\xe7\xde\xa0\xef\xdc\x58\x5d\x0d\x13\x24\x32\x7e\xc9\x83\xdc\x01\x43\x14\x8e\xc2\x56\xb6\x6b\x0b\xa7\xe0\x5a\x08\xfc\x2e\x3e\xa7\x19\x0c\x49\x94\x38\x96\xb2\x0a\x71\x6a\x15\x12\xfc\x2d\xdc\x77\x0e\x1c\xe2\x3a\x48\x90\xd5\xc7\xe5\x92\x5b\x95\x3e\xc5\x3c\x93\x46\xb5\x52\x37\x7d\x1e\x2c\xb9\xe1\x15\xc8\x95\x25\xe2\xc2\x6c\x91\xea\xc9\x3c\x36\x02\x59\x06\x82\xd8\x49\x10\xcb\xc3\x7d\x3b\x09\xac\x0c\xc1\x3b\xa1\xe2\x3d\xe5\x52\x9c\x60\x44\x00\xca\x13\x5e\x88\x34\x73\x32\x13\x71\x57\x31\x92\x8e\x14\xe7\x5e\x9c\xe0\x38\xa5\x48\x80\x52\xc3\x7f\xd1\xe8\xa3\xc9\xd1\xe5\xa0\x30\x6b\xa9\x68\xf1\x75\x7e\xc1\xf2\x38\x14\xe7\xf6\x15\x1a\x0d\xe5\xb9\xdb\xde\x50\x8e\x59\xb1\x46\xa5\x90\x94\x14\xc4\xfe\x6e\xa6\xa3\x35\x4a\x24\x74\x5a\x85\xe4\x72\x22\x29\x78\x65\x8b\xd2\xc8\x6e\xb8\x91\xac\xe3\x41\xd7\x91\xad\x17\xf7\xf6\x5c\x41\xb4\xe9\x05\xb6\xde\xdc\x2e\xa5\x2b\x5c\xe2\x64\xea\x67\x8d\xe8\xb5\x8c\xab\xb6\x36\x72\x6b\xf5\x00\x8e\xa2\x7e\xe3\x90\x4f\xaa\xad\x7e\xdf\x4a\x6f\x2d\x17\xc2\x6b\x19\x7e\x32\xa9\x31\x95\xf3\x8a\x9e\xb0\x7f\x22\x55\x99\xf0\xe5\xbc\x01\x26\x02\x3a\x65\x00\x57\x3a\x4b\xd0\x33\x19\x08\xa9\xce\x3c\xea\xe6\xaa\x5d\xda\xc4\x48\x8d\xb2\xe6\xbe\x1a\x29\x4b\x10\x63\x22\xa9\x22\x8b\xe6\x60\x92\xc9\xcc\x34\xf3\x58\x1b\xb6\x95\xe2\x04\x94\x26\x20\x44\x3e\x4f\xb0\x53\x1b\x50\x2c\xeb\x50\x44\x24\xc6\xb8\x95\x26\xeb\x7d\x22\x3a\x64\x25\x38\x2d\x87\x83\x32\x59\xba\x18\x3e\x18\x0a\xc8\xa9\x84\xc6\xbd\xab\x8c\x6f\x85\xde\x4f\x22\x81\xe3\x84\xb6\xd1\x45\xa5\x18\x52\xd2\x0f\x79\x60\xa8\x32\x46\x66\xa5\x78\x3a\xc4\x5d\x92\xae\xab\x0b\x9e\x4b\x93\x8b\x7e\x2b\x21\x65\x2c\x2d\x1b\x51\xd0\xa2\x38\x67\xee\xf0\xe2\x20\xb0\x56\x89\xad\xb9\xb4\x8c\x6a\x71\xe9\x78\x70\xe4\x53\xc5\x2e\x9a\x51\x18\xe8\x3f\xfe\xcc\xbf\x87\x77\x3f\xf4\x5e\x39\x3f\x33\x07\xbd\x7e\x1f\x81\x7c\xa4\x71\xf2\x72\x16\x77\x7f\x10\x88\x20\x8c\xb2\xe4\x67\x63\x2c\xad\x4c\xb1\x23\x7e\x09\x9b\xe7\x55\x96\x0f\x63\xf2\xa4\xf2\x68\xa4\xa6\x14\x7c\x0a\x71\xc6\xf1\x40\xc6\x61\x20\xfb\x83\xae\x37\x1a\xf6\x5d\x14\x25\xd3\x3f\xf4\xd7\xff\xfe\x23\xda\x2d\xe8\xb5\xb5\x65\x78\xfc\xc9\xaf\xea\xc5\x46\x11\x96\xe6\x3f\xc0\x7d\xe3\xb9\xf3\x93\x30\xe9\x32\xac\x98\x11\xcc\xa3\x48\x51\x12\x9c\x1e\x20\xfe\x6c\xb6\x47\xb0\xba\xd9\x85\xad\xd6\x10\xae\x37\x87\xfa\xe5\x6b\x4d\x48\x07\x31\x0c\xe4\xe4\xe4\x63\xcf\x3c\x3f\xf9\x83\x0b\xfb\x36\x92\x78\x54\xf4\x3d\xab\x93\xf9\x65\x4d\x26\x3d\x64\xc5\x07\xda\x40\x8d\x51\x89\x86\x84\x52\x95\x0c\xbd\x35\x39\x56\x55\x53\xe3\x75\x9e\x5b\x6b\x37\xb7\xf4\x28\x48\xe0\xd0\xe2\x3c\x7c\xfd\x85\x17\xf4\x2f\xfc\xe3\xbf\x17\xb4\x9b\xeb\xa8\xcc\x25\x81\x62\x44\xd7\x37\xe3\x4e\x0b\x82\xd7\x22\x63\xc8\x1b\x00\x3d\xd4\x25\xfd\xf1\xad\x82\x58\x4d\x90\x1d\x59\xd4\x77\x49\xbb\x11\x1a\x2e\x8a\xa1\xe3\xc1\xa1\x31\x10\x9e\x4a\x1b\xf6\xfe\xe9\xb2\xbe\x8a\x07\xa4\xe3\x48\xcc\xd5\x5d\x9e\x30\xd3\x93\xa8\x40\xba\x1d\x7d\xed\x1a\x0e\xd2\x13\x4f\xf2\xc0\x1e\x5e\x3c\xa8\x97\x0e\x1e\x20\xd7\x2d\x25\x69\x69\x07\x0d\xd5\xcd\xcd\x4d\xd8\xd8\xd8\x16\x54\xab\xd8\x45\x95\x46\x0a\xd3\xf3\x5c\x54\x61\xb6\x69\xc0\x80\x3b\x47\x89\x57\x8a\x59\x30\x83\xbc\xa6\x0b\x02\x1c\x1a\x2b\x88\x26\xaa\xc2\x7a\xad\x08\x6e\xc1\xaf\xd8\xde\x86\xae\x97\x94\xca\xdc\xab\x06\x24\x45\x46\x8d\xb3\xfa\x55\xe3\x5f\xdd\x09\x9e\x19\x2b\xce\x79\x39\x72\x27\x08\xcb\x16\x54\x99\xaa\x9a\x0c\x93\x77\x82\xa7\x4c\xf9\x08\xac\x94\x29\x3a\xce\xaa\x4a\xf2\xc4\x34\x62\xe2\x62\xa7\x3a\xc5\xd0\x5b\xe3\x9e\xcf\x15\xbe\x36\x5e\x79\xbd\x83\x1f\x99\xff\xc1\x64\xa9\x1a\x3f\xfa\x4e\x46\xaf\xd8\x53\x55\xb0\xe7\xf5\x9c\x80\x2a\xb1\x53\x05\x93\x37\x04\xcc\x1d\xcc\xd9\x86\xb2\xfd\x4b\xa9\x28\x18\xd2\x90\x32\xa2\x53\x11\xa5\xd4\xcc\x24\xb5\xd1\xd8\x38\xe4\xd9\x51\xa6\xde\x85\x18\x2e\x4c\x4d\x4d\x51\x6c\x4a\x5f\xb8\x7a\xe9\xf4\xfe\xf9\x03\x80\xc8\xc1\x31\xce\x62\xc9\xbd\x48\x85\x98\x1b\xab\x6b\x69\xab\xd5\x4c\xf1\xd7\x94\x5f\xb0\x8c\x0a\xd0\xd9\x7a\xc9\xb2\xe4\x29\xe5\x54\x67\xf6\x21\x6f\x5c\x68\xa3\x48\x5c\x98\xdf\xef\x3a\x7c\xd5\xa3\xdd\x68\xe3\x70\x30\x50\xdd\x6e\x57\x6c\xe3\x1c\x08\x02\x4e\x70\x87\x7a\x79\xcc\xb2\x4b\x32\x6e\x75\x5a\x35\x04\xfa\xe9\x5a\xb5\x91\xab\xf3\x65\xfc\xa1\x10\xbf\xbf\x8d\x53\x80\xd6\x13\xd3\x59\x93\x7b\x60\xe4\x37\xd5\x90\x9a\x34\x03\x8b\x9d\x35\xc2\xb8\xdf\x76\x43\xa3\x06\x48\xc4\xde\xda\xf2\x3c\xf7\x40\xe7\xa3\x9c\xb9\x17\xf4\x9e\xb2\x5d\x3e\x3e\x99\x29\xa9\x8c\xa2\xe1\xf8\x21\xd3\x4f\xd1\x6c\x85\x8e\x90\x81\xa7\x74\x50\x50\x10\x22\xe0\x20\xa0\x8b\xa4\x00\x56\xe2\xe2\x9c\x75\xa8\x2a\x7a\xac\x51\xb4\x3d\xb4\xaf\x6b\x6b\xd7\x8e\xd1\x3e\x39\x38\xae\x74\x75\xaa\xd4\x57\x5f\xc3\x35\xcc\x03\xe9\xd5\x4b\x30\x51\x3f\x6a\xef\xd4\x2b\xed\xc9\x05\x48\xc2\x54\x85\x49\x34\x48\x64\xa4\x11\xb2\x47\x02\xb5\x3a\x02\xbf\x15\xa8\xc4\xb7\xf0\xb7\x70\x85\xe0\x1d\xb7\x26\xf8\xa2\x1a\x84\xcf\x6a\xac\x50\x82\x42\x45\xdb\x41\x30\xf2\xc2\xc1\x60\xa1\x5a\xa9\x99\x2b\x4e\xf9\xf6\x65\x07\x35\xbb\x55\xb0\x86\x6e\x64\xcf\xe9\x40\xd5\xd1\x80\x94\x93\x34\x2a\x73\xa1\xb6\x94\xa9\xe5\xda\x5d\x7f\xd6\xbf\x20\x5d\x11\x2a\x26\xb6\x78\x44\x08\xc4\x34\x48\x2a\xb3\xfb\xd4\x16\x4c\xf4\xe5\x78\x3a\x4c\x66\x91\x88\x15\xb9\xa4\x69\x27\xa6\xbc\x37\x8f\x81\xaf\x7e\x35\x8c\xfc\x74\x25\x54\x61\xac\x12\x6e\x12\xca\x61\x01\x6a\xcf\x5a\x00\x7b\x91\x88\xc8\x33\x5f\x79\xfc\x5d\xc7\x66\x8f\x52\x6d\x3d\x5a\x19\x79\x2e\xad\xda\x8f\x95\xc0\x3e\xac\xa3\xe4\x94\xb6\x52\x2e\xa6\x32\x53\xdc\xdd\xcb\x28\xc8\xd8\xd4\x2a\xa9\x33\xab\x13\xab\x87\xba\xb0\xa2\x64\xe4\x80\x97\x25\x93\x71\xba\xcf\x4e\x76\x3b\xa1\xe6\x78\x11\xc4\xd8\xd8\xc8\x3e\xd8\xf1\xad\x8b\x23\x2b\x19\x81\x49\x4b\xe1\x22\xba\x42\xe8\x95\x2b\x90\x9c\x54\x1e\x9d\x65\x37\x77\xff\x37\x4a\x20\x1b\x63\xa9\x3b\x35\x92\xd6\xba\x17\xcb\x2a\x2a\xa8\x12\x88\x04\xc9\x82\x09\x71\x88\x4c\x8c\x13\x61\x88\x6c\xd9\x6c\x97\xd3\xb5\x9e\xab\x7a\xec\x52\xd5\x79\x63\x1a\xc1\x71\xed\x94\x92\xce\x38\xf9\x4c\xe5\x59\xd8\x94\x3c\xce\x86\x49\x99\x1c\x4d\x12\xcd\x8a\xd5\x35\x79\xcf\xa9\x2a\x88\xca\xed\x12\x4e\xbf\x16\xe4\x5a\x4c\xb3\xb0\x06\xb1\x3a\xce\x5f\xc0\x25\x37\x0d\xb5\xda\xa2\x5f\x3a\xee\x38\x40\x57\xaf\xa4\x84\xdf\xde\x46\x3c\x5c\xb9\x12\xf6\x6e\x1c\xb4\xc6\x27\xa7\x7d\x77\x09\xc5\x73\x39\x67\xa4\x78\x3a\x3b\xbd\x58\xdd\x5a\x15\xdd\x9b\x2b\x30\xe8\x8a\x2c\xb0\x64\x0a\xc5\x52\xc9\x61\x92\x24\xe1\x8b\x7d\x28\x24\xda\x11\x35\x81\xa1\xa6\x2e\x31\xe5\x6f\x27\x82\x0b\xa7\x4d\xbb\x1e\xc8\xea\x11\x52\x81\xab\x01\x59\x5a\x2a\x2d\x9c\xf6\xb6\xa5\x4c\x1e\x8a\xa5\x8c\x43\x8f\x18\x08\x85\x2c\x13\x41\x57\xcb\xa4\x04\x3b\xc4\x0b\xf2\xda\x90\x4b\x9f\xeb\xb8\xc8\xfd\x4f\x1e\xfb\xcf\x7d\xf1\xb3\x70\xdf\x3d\x0f\x88\xc3\x07\x97\xe8\x42\x28\x9c\xc9\x5d\x29\x15\xf5\x58\xad\xc2\xb9\x26\xc3\x61\xa8\x33\xb1\x40\x4b\x21\x23\x95\xa4\x7c\xf1\x2e\x65\x9e\x25\xcc\xd1\x15\x72\x16\xb0\xd3\x8a\x7a\x23\x24\x14\x16\x1b\xb8\xbd\x5e\xcb\xed\x75\xdb\x85\xfe\xa0\x53\xe8\x76\xdb\xde\x8b\x2f\x3c\x11\xcc\x1d\xb9\xcf\x7b\xe1\x95\x4b\x70\xe1\xab\x4f\x40\xfb\xe0\x1c\x7c\xf0\x7d\x8f\xea\x30\xc6\xdd\xe7\xb2\x21\xc3\x68\x15\x7b\x91\x71\x85\x53\xeb\x6e\x24\x1a\xdb\xdd\x11\xb4\x7b\x21\xdc\xe8\x04\xfa\xb9\x95\x2e\xf4\x3b\x43\x6e\x81\x5c\x9d\xb6\xa1\x5c\x2c\xca\x8d\xcd\xe4\xc8\xc5\xeb\x57\x7b\x45\xbf\x60\x97\xfd\x82\xca\xa2\x3d\x1c\xfb\xd7\x3b\xee\x1b\x53\x4d\x43\xd9\xff\x59\x66\x89\x96\x9e\x84\x89\x46\x0d\xcf\x68\x01\xda\x9d\x50\x6f\x6e\xb5\xf0\x7c\x69\x18\x1f\xab\xe9\x4f\x7c\xf6\x4f\xe0\x9f\xfd\xfa\x2f\x07\xc3\x7e\x27\x60\x10\x47\xfe\x86\xca\x9c\x5a\xec\x25\x7c\x1e\x4c\x32\x01\xbc\x29\xa0\xd3\xf2\xfd\x37\xc9\x83\x66\x9d\xa6\x4c\x56\x9c\xac\x5c\x8d\x58\xb2\x47\x4e\x03\xa5\x6a\x56\xb5\xe2\xe9\x4b\xcd\x21\x4c\x95\x5c\x4d\x5d\xc8\x02\x2a\x96\xc7\xf3\x53\xc7\xc5\x79\xf6\xce\x33\x70\xfc\xc8\x51\x78\xe1\xdc\xcb\xf0\xe9\xc7\xbe\x00\xcd\x3f\xea\xf0\xa6\xcf\xde\x76\x3b\xdc\x7b\xc7\x5d\xf0\x2b\xff\xf4\xd7\xe1\xda\xf2\x75\xf1\x3d\xdf\xfe\x9d\x40\x60\x1f\x04\x21\x7c\xf5\x99\xaf\x73\xbb\x3e\x0b\x2d\x34\x5d\xb5\xe7\xec\xed\x67\xc0\x71\x5c\xae\x4a\x90\xb6\x69\xe0\x5f\xf3\x7d\x71\xa5\x9f\xc2\xc2\x54\x01\x5f\x2b\xb9\xff\xe0\xd7\x3f\x7f\xd4\x69\x3e\xd7\x97\x96\xcb\x0b\xe5\x47\xbe\xfb\x43\xd7\x8f\x9f\x3a\x94\x46\x1a\x55\x5f\xe2\xf0\xaa\xb5\xa8\x1d\x24\xf5\x8c\x50\x14\x09\xb1\x19\xc8\x33\x21\x0f\x90\x55\x6c\x33\x1e\x73\x9b\x23\x69\xa6\x85\xd8\x03\x90\x86\xee\x19\x15\x9c\x65\x9d\x19\x67\xb8\xce\x7a\x3f\x89\xac\xba\x29\x0f\x89\xe7\x9e\x7a\xb6\x84\x46\xc9\x32\xd7\xcb\x6a\x5d\x55\x1e\x98\xd5\x1c\xb3\xcf\xe3\x7a\x2a\xf3\x0e\xb0\x4f\x41\x8b\xdd\xb6\xa1\xca\x94\xe6\xec\x71\xa7\xe7\x59\x5e\xb9\x4f\x2f\x17\x9a\x79\x74\x51\x24\x61\x62\x8d\xd4\xc8\x1d\x26\xb6\xec\x87\x5a\x0d\xa3\x94\x93\x39\x42\x24\xdb\x09\xad\x5b\x6d\xb1\xe8\x2a\x38\x25\xdb\xab\x56\x22\xe2\x24\xeb\xeb\x9b\xa7\xee\xbf\xf3\x01\xde\x00\x25\x6a\x3a\x25\xff\x7a\x18\x45\xba\x1f\xc4\xa1\x5b\x2c\x53\x2a\xa0\xda\xdb\xd1\x02\x27\xa3\x65\x2a\x5a\x90\x28\x50\x81\x65\x96\x5c\x95\xf5\x33\x12\x47\x96\x8e\xd9\x85\x9a\x97\xbc\x3e\x73\xcd\xf1\xc1\xda\xba\x76\x43\xb3\x13\xdd\xf5\x88\x56\xea\xa9\xb9\x39\x89\x8c\x5f\x5e\x5f\xbb\x71\x6c\x6a\x7c\x86\x81\x8f\xa6\x3e\x82\xcc\x65\xe9\xd8\xb6\xeb\x5b\x03\xed\xeb\x22\x7b\x1d\xd8\x8d\x46\x24\x82\x5b\x29\x01\xa7\x66\xc5\x4e\x03\x62\xbb\x8e\xa4\xa5\x9e\x42\x5c\xdc\x8b\x8d\xb6\xb0\xfb\x8e\x23\xdb\x5e\x49\xdc\x74\x7c\xdd\x37\xb1\xb5\x9d\x18\xa2\xd8\xdb\x16\x27\xab\x37\xce\xeb\x96\x38\x2c\x05\xb9\xa7\x47\x53\x2d\x36\x15\x68\xe1\xa0\xea\xc4\x45\x76\x5a\x44\x5a\x5d\xc4\xfd\x28\xa2\x15\x2c\xe2\x9e\x50\x23\x53\x1b\xc9\x38\x65\x6f\xc8\x62\xc5\x56\xd4\xe0\xa9\xd3\x6e\x4f\x51\x8f\xe6\xad\xd6\x06\x4c\xe3\xb1\x21\x63\x3e\x6b\x15\xc5\x63\xaf\xcd\x03\x78\x7d\xab\x4f\x84\x16\xa4\xce\x2e\x5d\xe2\x0a\xbc\x06\xee\xcb\x78\x90\xf6\x57\xd1\x18\x82\x8c\x90\x5c\x47\xa1\x0f\x49\xec\x23\xe2\xba\x82\xae\x5f\x9d\x89\xe4\xb2\xeb\xdb\x14\x13\x7d\xe5\xdc\x8b\xa7\xa7\x27\x66\xc0\x77\x0b\x86\xdb\xda\xfa\x1a\x8e\x9d\x95\xf4\xd2\xf9\xa4\x17\xcd\xbf\x49\x57\x1e\x99\x04\xd1\x78\xd4\x1f\xdd\xae\x6b\xe9\x8b\x68\x48\x10\x48\x48\xff\xd2\x5a\xa7\x2d\x4b\xcb\x53\xc5\x19\x4b\xc9\xba\xb2\x13\xf7\x4d\x0b\xff\xf3\x20\xd3\xee\x4b\xe5\x74\xa0\x0f\x6f\x75\x36\x57\xd2\x94\x81\x9f\x56\x92\x2a\x7b\x35\x4f\x96\x4a\xde\xfa\xfa\xcd\xc9\x9b\xd7\xaf\x9f\x3c\xbd\x70\x8a\xa9\x69\x12\x25\x4b\x71\xa0\xbe\xa4\x21\xe2\x9d\xee\x35\x9b\xf3\xdd\x76\x6b\xb2\xb7\xdd\x3c\xe4\xdb\xde\xe4\xe4\x38\xc2\x57\xb9\x0e\xd2\xb1\x36\x11\xbe\x9f\x48\x5c\xb9\x4a\xd7\xce\xc8\xfa\x59\x78\xbd\xf5\xcd\x13\x51\x14\x78\x83\x66\xeb\x0c\x5d\xb1\xab\x5e\x1d\x03\x26\x34\x9e\x7b\x39\xb6\xe1\x7c\x20\xd4\x8d\xc2\x08\x4e\x6e\x0f\xb7\xaf\x24\x69\x82\xd0\x4a\x05\xf4\xa0\x2a\xf6\xe4\xfe\x04\xb5\xc4\xb5\x8b\xe7\x4f\x36\x84\xf7\x10\x25\x11\xa6\x96\xb8\xd4\x95\xe9\x17\xd0\x1a\x4c\x94\x00\x26\x76\x43\x35\xbb\xe1\x1b\xb5\xd3\x78\x2d\xa9\xba\x81\xae\x4e\xf6\x61\xb1\x22\x60\x6d\xc5\x19\xbe\xc2\x99\xeb\xdc\x21\x8a\x72\x71\x52\x29\xb3\x8c\x3e\x61\x92\xde\x00\xc7\x51\x8f\x89\xca\x58\x0d\xfc\xba\x6b\xe9\x86\xb4\xd2\xc2\xde\x2e\xad\xa8\xd0\xfb\x23\x95\x36\x37\x93\xde\x7a\x3b\x09\x87\x3a\x4d\xad\xcc\x81\x62\xaa\x04\x10\x30\x3d\xe5\x58\xc7\x6b\xf5\x33\xd2\x31\x35\x7e\xbc\xb6\x3c\xa8\x1e\xf0\x2a\x27\x17\xdd\xb1\x43\xc2\x8d\x7d\x63\x8e\xe4\x6e\x35\x8a\x0d\x8d\xa2\x27\x1b\x53\x30\x7e\xfc\x20\x8c\xbd\x72\xc9\x1d\x5c\x36\xe6\x86\xdd\xfc\x64\x0b\xa9\x59\x0b\x92\x87\x04\xc9\x63\x28\x29\x4f\x2e\x4a\x22\x8e\xe9\x2a\xfa\x67\x27\x8d\x8f\x90\x41\xd2\x8e\x68\x4e\x58\xe2\xeb\x8e\x93\x5f\xd9\x5c\xff\x9c\x12\x92\x13\x22\x00\x74\xd8\x29\x01\x79\xaa\x50\xb1\xca\x34\x89\x52\x8a\x61\xe3\xdc\xc5\xe7\xb1\x26\x90\xa7\x44\x30\x54\xff\xac\xd6\xbf\xfe\xd4\xe3\xa2\xe8\xf8\xe2\xc0\xfe\x05\x8a\x5d\xeb\x68\x14\xb0\x57\xbd\x54\x2a\x40\x09\x17\xc4\x28\x08\x35\x85\x90\x08\x24\x6d\xce\x7a\xd7\xd9\x25\x04\x28\x51\xce\xc4\xd5\x65\xd6\xa6\x88\x48\x15\xee\xb1\x26\x2c\x88\xc2\x9e\xd5\xef\x35\x8b\xdd\x6e\xab\x82\x2a\xbd\x12\x84\x41\xf1\x13\xbf\xf7\x4f\x7b\x3f\xf8\xd3\xef\x70\xb7\x46\xd4\xa3\xc1\x81\x95\xe7\xcf\xe9\x6b\x2b\xeb\xe0\x97\xc7\x80\x49\x88\x32\x16\x9b\x0e\xbb\x3f\x8c\xa0\x33\x08\x34\x79\x87\x9b\x41\x0c\xcb\xbd\x08\xae\xde\x1c\x68\xcb\x71\x61\xe6\x50\x19\x6a\x05\x1b\x0a\xb6\x85\xfb\x88\xc7\x3f\x73\xb6\xfa\xe2\xc5\x2f\xce\x1c\x9c\xa8\x0c\xd3\x68\x24\xeb\x13\x93\xb1\xca\x6a\x1b\xcd\x44\x90\x9c\x0e\x41\x16\x25\x49\x4d\x62\x63\xd1\x77\xa1\xde\xa8\x52\xe9\x9f\xd8\xde\xee\xe8\xad\x26\xe7\xd3\x69\x22\xba\x8f\x7f\xed\xab\xf0\xab\xff\xc7\x2f\x04\x38\xb7\x43\xca\x73\xc6\x97\x43\x4a\x9e\x37\x7d\x6c\x39\xb2\x6c\xb2\xc9\xa5\x11\x2e\xdf\x2c\xcb\x3d\xef\x39\xed\xec\xb9\x00\x0b\x3d\xb7\x12\x28\x5a\xc8\x4b\xf8\x92\x6d\xd3\x55\x17\xc2\xd1\x10\x2e\xae\xdc\x02\xdf\xf7\x50\x3d\xd7\x60\x14\x1a\xd4\xba\xfb\xf6\x3b\xe1\xbe\x33\x77\xc3\xda\xfa\x2d\xf8\xb3\xc7\x1f\xd3\xbf\xf5\x7b\xbf\x0b\x7f\xfb\x67\xff\x27\x48\xa8\x54\x01\x87\xfc\x03\xdf\xf7\x5d\xf0\x0f\x7f\xf6\x67\x60\x34\x18\xc1\xc5\xab\x57\x38\x01\x81\x7b\xf3\xba\x1e\xdc\xda\xda\x82\x62\xc1\xe7\xec\x77\x72\x9d\x34\x90\x47\x9f\xbb\xd5\x87\x57\xdb\x09\x0c\xf7\xcd\x8a\xed\x6b\x17\xd5\x3b\xee\xbe\xf3\x7b\xee\x39\xf8\x4e\x19\xe0\x47\x46\xc1\x48\xfc\xbd\xff\xf5\x97\x7f\x13\x39\xcb\x3a\x5d\xba\xee\xbe\xbb\x1f\x6a\x3e\xfa\xce\x8f\x45\xd2\xb5\x84\xa0\xb2\x32\x7c\x70\x2d\x87\x21\x9e\x5a\x3f\xfb\x0e\x65\x10\x48\x11\x31\xab\xc3\x57\xa5\xc9\x66\xa7\xf7\xc9\xed\x9d\x28\x62\xc6\xf8\x97\x67\x1b\x1b\xaf\xb2\x88\xb5\xcc\x1b\xd4\x69\xf6\x24\x98\x8c\x1b\x65\x3a\x52\xe5\xee\xf3\x5c\x75\x67\x72\x51\x64\x5e\x02\x0d\xbb\x99\x6c\x3a\x5b\x9c\x32\xab\x89\x22\x06\x2c\xb4\x71\x8b\xa9\x2c\x3e\x27\xb4\xc9\x6e\xcf\xdd\x57\x0c\xfa\x59\x91\x39\x67\xf7\x42\x1e\xc4\x54\x3b\x8a\x1e\x17\x8f\x0c\xc3\x91\x35\x1c\x49\x35\xe8\xa7\xb2\xdb\x1b\xc5\xc3\xbe\x4c\x83\x91\x95\xc6\x21\x62\x70\x4a\x09\x51\xa6\x69\xd5\x54\x7d\x06\x7f\xd5\x09\x2f\xbc\xfa\xd2\x89\x4a\xb1\xec\x97\x4b\x55\x23\x7f\x5d\xf7\x95\x38\x75\xe2\xce\x76\xa0\x26\xeb\x4b\xa2\x58\xf1\x3c\xa7\x60\x65\x44\x48\xbf\xa6\xa7\x7b\x30\x08\x61\x7d\x7d\x43\xb5\xda\xdb\x79\x59\x0f\x8c\x95\x27\x2c\x54\x9f\xf1\x76\xbb\x59\xdb\x58\x59\x79\xff\xe1\xfd\x47\xa7\xf8\x72\x86\x9e\xfc\x43\xa7\x50\xb8\x51\xa8\x54\x65\xb7\xd3\x93\xa6\x19\x94\x2d\x8b\xb5\x32\x27\x74\xdc\xba\xb5\x76\xdb\x9d\x27\xee\xce\xb7\x1e\x22\x67\xbb\xc2\x5e\x60\x47\x77\x47\x49\xea\xa3\xd1\xa7\x78\xbb\xa4\xa6\x0f\x74\xf1\x63\xd4\x7a\x53\x78\xee\xc6\xf0\x15\x0f\xf2\x4b\xf2\xec\xa6\xa6\x9b\x9c\x1f\x9d\xd6\xa2\x30\xad\xf5\x43\xd8\x5f\x28\xb9\xe7\xdc\xb2\xde\x30\x69\xcb\x62\xa7\x58\xeb\x35\x2d\x32\x95\x12\x7b\x9b\xd4\x2b\x13\xa2\x61\x40\xa7\x32\xc0\x30\x88\x9c\x61\x7f\xe4\x0f\x06\x81\x87\xf3\xd6\x1f\x8d\xa2\x42\x12\xc5\x1e\xbe\xe7\x31\xd1\x30\x17\x1a\x10\xcd\xad\x9e\x55\x1b\xaf\x26\x73\xb3\xf3\x57\x2e\x5f\xbe\x78\xe6\x6b\xcf\x3e\x0e\xa7\x8e\x9c\x46\x16\x5f\x3d\x81\xca\xe5\x04\xa9\x8e\xbc\x9a\x63\x27\x7f\x05\x0d\xa2\xef\xf9\x40\x25\x7b\x5e\xa1\x70\xde\xb2\xac\x9e\xb2\xd5\x73\xb8\xbd\x8a\x54\xee\xd2\xa0\xd5\x5c\xeb\x0f\x06\x6e\x84\xfb\x90\x46\xca\x29\x79\x55\x77\x7a\xdf\xb4\xf4\xcb\x5e\x9a\xad\x55\x8d\xef\x89\xe6\xe6\xd6\xbe\x53\x87\x6e\xe3\x2c\x64\x3c\xfe\xad\x38\x0e\xbb\x60\x2a\x0d\xa9\x2d\x6d\xb5\xdb\x6e\x2f\x91\xf1\x73\xa5\x7f\xa6\x5a\xaa\x7a\x48\x96\xc3\xd8\x4e\xfe\x58\x49\xb5\x35\xec\x75\x26\x82\x78\x14\xa2\xd1\xb1\x14\xb2\xae\xa2\xa8\x94\x71\x9f\xa7\x13\x77\x60\x13\x3b\x0b\xba\xa3\xea\xa0\xdb\x3b\x14\x0e\x82\x3b\x2c\x5c\x1d\x54\x72\x47\xc9\x73\xd4\x48\x68\xac\x3e\xc1\x97\xbf\x24\xaf\x40\x64\x47\x7f\x8c\x94\x6f\xd5\x89\x93\xe9\xd6\xf6\x7a\xa8\x4d\xeb\x15\x5d\xaa\xb9\xe5\xd4\x95\xa2\xdd\xdc\xac\xe6\x97\xb6\x34\xe3\x9c\xae\xa2\x01\xf4\x7b\x9b\xed\x13\xeb\xab\x37\xef\xdd\xdc\x5e\x87\x4e\xbf\xcb\xea\x8c\x4a\x5f\x17\x87\x7d\x38\x75\xf4\x0e\xf0\x1d\x67\xd2\x0d\xd2\x0f\xa5\x6a\xf8\x6f\x47\xbd\xc1\x7c\xb7\xd5\x3e\xd4\xeb\x76\xe7\xb7\x9b\x9b\xd0\xc3\xcf\xd0\xe7\x29\xb4\x41\x17\xcf\x38\x73\xf2\x6e\x18\x73\x27\x96\xdc\x04\x96\xa4\x8c\x3f\x8b\x5a\xed\x4a\x2d\x1d\x4c\x6d\x77\xb7\xfa\x92\x93\x89\x44\xea\x37\x0a\x15\x82\xa3\xd5\xab\x17\x4f\x59\x53\x0b\xbc\x3f\x96\x16\x87\x8b\x49\xb0\x15\xb9\xf1\xb3\x2a\x4a\xab\x41\x2f\x58\x22\x20\xe9\xb7\xbb\x27\x2d\x90\x55\xf2\xb6\x50\x4b\xde\x0a\xf5\x18\x2f\xf8\x37\x90\x52\x5d\x1e\x8a\xe0\x65\x54\x3c\x0b\xe5\x54\xfb\xdb\xd6\xc6\x2b\x34\x17\x00\x03\x40\xfc\xbf\x50\x21\x22\x6b\xd0\x1c\x33\x26\xb5\x68\x27\x8e\x5d\x77\xc6\x27\x4a\x5e\x69\x02\x6c\x0a\xcd\x84\x7a\xb7\x4f\xbb\xd0\x3b\x8d\x6c\x9c\xb4\x56\xd4\x50\x1d\x87\xd2\xe2\xf6\x30\xbe\xb2\x3d\xda\xea\x52\x5b\x0f\xe6\x03\x59\x4c\x7b\xb6\x30\x37\x55\x28\x24\x85\xe6\xd6\xe6\xb4\xdd\x8f\xbe\xff\xd0\xfe\x23\x10\x42\xf2\x7c\xd7\x4a\x3e\x23\x9c\xb8\x18\x0c\x06\xf5\xde\xf6\xf6\xb1\x74\x30\x7a\x17\x9d\x97\x5a\xa5\x0e\x6e\xa1\xf0\x0a\x92\x95\x6b\x3d\x88\x9f\x9b\x02\x79\xaa\x64\x97\xe4\x7a\x39\xb8\x62\x74\x83\xcd\x79\x4f\xe4\xb2\xe7\xb6\xcf\xca\xa1\xa4\x65\xc1\xdd\xd8\xc8\x4d\x6e\xb2\xf0\xb2\x44\x7f\x36\x6d\x5c\x80\x68\xa1\x98\xa3\xb8\xb9\xda\x93\x99\x98\x97\x82\x24\x04\xdc\x69\xc2\xad\x82\xe3\xd0\x46\x3e\x3a\x42\xda\xeb\xa8\x38\x0a\x54\x12\xa2\xac\x4f\xf0\x58\xf1\x4e\x9d\x0c\x11\xf1\xd9\x31\x3d\x56\x2b\x0b\x97\x22\x39\xd4\xa8\x85\x52\xe9\xa2\x04\x82\x74\x80\x63\x8d\x8c\xbe\x52\xc0\x7d\x73\x70\x8e\xc7\xe4\x51\x30\x97\x13\xcd\x12\x60\xd1\xbe\x70\x92\x85\x51\xe8\x82\x3b\xc7\x05\x32\xa2\x52\x1f\x14\x38\xa1\x83\x18\x55\x18\x0e\xfb\xa5\x20\x18\x95\xc2\x30\x28\xc4\x71\x1c\x7c\xe2\x77\xfe\xaf\xb8\x74\xfa\xdb\xed\xa4\x38\x09\xe9\xf6\x79\xfd\x85\xaf\x7d\x1d\xee\xb9\xff\xdd\x30\x1a\x06\x9c\x5f\x12\x22\x80\xf7\xba\x43\x88\x70\x8e\x47\xb8\x77\xaf\xb6\x43\x68\xf5\x23\xb0\xe8\x1a\xe4\x4b\x48\x8b\x0a\x0e\x20\x41\xd2\x25\x97\xda\xe0\x4a\x5a\x5c\xd0\x0b\x22\xbd\x62\x8f\x2d\x4c\x45\x83\xde\x73\x2f\xbe\xd0\xf8\xf0\x07\x3e\x70\x8b\xc3\x1d\xac\xfa\xa9\x60\x20\xa5\x08\x0b\xe7\x69\xf8\xa8\xca\xab\x78\x4c\xd4\x13\x3e\x0c\x63\xd8\xdc\x6a\xeb\xfe\x60\xa4\x7d\xd7\x05\x4a\x1d\x20\x64\x58\xdc\x3f\x4b\x17\xf0\x52\x08\xe8\xa4\xcc\x59\x95\x67\x60\x9e\xb0\xe4\xe6\x7c\x51\x69\xda\xab\x53\x3f\x8f\x6f\xa1\x3b\x5c\x0e\xe8\x4e\xf6\x37\x55\xc9\x43\x17\x15\x9f\x9f\x65\x8e\x0c\x86\x43\xb8\xba\x72\x03\xc6\x6a\x75\x6e\x2a\x42\x31\x07\x62\x38\x41\x10\x31\x95\xa5\x4b\xca\xfd\xd7\xef\xff\x76\xf8\xd1\xef\xfd\x01\x98\x38\x7d\x1a\x82\x7e\x1f\x81\xdb\x85\x51\xba\x0a\x7f\xf3\x9f\xfd\x18\x65\xf3\xc2\x9f\xfe\xd6\x9f\xc1\x7d\x33\x77\x51\x2b\x3f\xd8\x0e\x9b\xf0\xc3\x8f\xfd\x08\xd2\xc9\x22\xcc\x7a\x93\x30\x66\x55\xf5\x74\x6d\x02\xc6\x0f\xfb\x70\xfb\x60\x00\xbd\xf8\x25\x7d\xec\x3b\x37\xe1\xbb\xef\xf8\x31\xb8\x77\xfa\x6e\xb4\x3b\x29\x8c\xe2\x00\x7e\xf1\xa5\x7f\xf4\xb1\x95\xd5\xeb\x0a\x56\x61\xf3\xd2\xef\x9f\xfb\xcd\x33\x8d\xb7\x77\x9b\x9e\x16\x95\xd4\x05\xe5\xc5\xa2\x88\x03\xe5\x4a\x1b\xdc\x58\x8b\x8d\x06\x31\x68\x57\xd0\xd5\x75\xe8\x22\x05\x0e\x95\xb9\x51\x16\x25\xe2\x8e\x83\x7f\x53\xc9\x00\x17\x94\x23\x6b\xa2\x3c\x0f\x8e\x82\x50\x0d\x9c\x95\xb7\x18\x53\xa6\x17\x95\xa1\x5d\x94\x78\x67\xe2\xb0\x9c\x84\xa1\xb2\x4e\x08\xda\x3c\xcf\x94\x36\x03\x6e\x76\x35\x5e\x6d\x7a\x51\xe7\x1d\x22\x59\xa1\x67\x35\x0b\x0c\xd0\x79\xa3\x18\x01\x7b\xba\x58\xe5\x8a\x7c\x57\x29\x64\xdd\xad\x14\x77\xb0\xa2\x6d\x44\x41\x20\x07\xdd\xae\x3b\x6a\xf7\x92\xce\x36\xb9\x84\xba\x6e\x38\x18\xa1\x9d\x8b\x71\x5e\x26\x76\xb6\x2e\xf9\xc2\x86\xe5\x72\x49\xd2\xeb\x6b\x2b\xcb\x87\x8f\xa0\x32\xe1\x9e\x01\xa0\x47\x01\xe8\xaf\x42\x18\x89\x62\xcd\xcb\xea\x7b\x15\x4e\x38\x05\x3b\x61\xe7\x2c\xf9\x8f\x55\x17\x12\xb0\xd9\xf9\x59\xd1\x47\x63\xda\x6e\x75\xa8\x55\x18\x94\xa7\x2b\x56\x10\xc4\xe9\xa5\x4b\xaf\x1e\xac\xfb\xe5\x29\xcd\xf5\xff\x94\x9c\x25\x4b\xa8\x5f\x29\xdf\x44\x0c\x86\x01\x93\xe9\xc9\x46\xc3\x8a\x91\x12\xdf\x5a\x5e\x9b\xc2\x31\xaa\x56\xc8\xfd\xaa\xb9\x88\xff\x22\xfe\x26\x4d\xfd\x16\xce\x2f\x24\xf4\x89\x47\x71\x59\x9c\x7b\x76\xc1\x2a\xd5\xcb\x85\xe2\x74\xec\x92\x3a\x4d\xd9\x4d\x79\x6b\x75\xe5\xae\x28\x0c\x6a\xa3\xe1\xe0\x14\x81\x0b\xb1\x5b\x36\x62\x9e\x77\x03\x47\xf3\x72\x2c\xd2\x97\xc3\xf6\xe8\x84\x18\x89\x58\x3a\x62\xdb\xd4\x40\x99\x56\x22\x62\x6f\x93\xd7\x9d\xfc\x08\xd8\x93\x26\x6f\x3c\x28\x29\x2a\x89\x10\x89\xf2\x68\x18\xc2\xb0\x1f\x58\xa3\x51\x68\x53\xb6\x7b\x4c\x6a\x36\x55\xc2\x34\x4e\x31\x67\x69\x63\x73\x43\x97\x6b\x25\x7d\xf7\x9d\xf7\x3d\xd1\x6a\x37\x27\xb7\xb6\xb6\xe6\x1f\x7f\xfa\xcb\xdc\x78\x87\x12\xfe\x84\x78\x63\x6b\x5a\xc9\xfd\xaf\x5d\xa0\xe4\xb9\xc5\xf9\x83\x27\x26\xf1\xd1\x13\xde\x1d\xa9\x15\xfd\x99\xb2\x92\xd5\x46\xa5\x3e\x3b\xe8\x36\x7b\xa0\x63\x07\xd5\xaa\xb7\xff\xd0\x7c\x96\x7b\x9d\x8a\x3c\x8b\x0b\x8d\x95\x97\x84\x11\xd7\xf1\x13\x08\x25\x3a\x46\x7e\x37\xbc\x73\x73\x63\xeb\x5e\xfa\x9b\x2e\x47\x49\x7d\x05\xc8\x7b\x4a\xe0\x3b\x3b\x35\x07\xe3\x8d\x49\xaf\x3c\x56\xaa\x39\x9e\x6c\xca\x34\xae\xa9\x78\x18\xa0\xd9\xb0\x6b\xde\x04\xfe\x64\x99\xdc\xf2\xf8\xbd\x5e\x65\xed\xda\xda\xbd\xa3\x41\x70\x90\x1a\x0a\x0d\xf0\x7c\x53\x58\x8c\xba\x73\xd1\x5a\x2f\xfa\x05\xb8\xeb\xf4\xbd\xbc\x4d\xca\x8b\x41\x13\x73\xc6\xf6\xf4\xcd\x52\xd1\x2d\xc0\x56\x64\x67\x85\x46\x50\xa9\xf8\x45\xcb\x56\xea\xd6\xda\x0d\xee\x2c\x68\xaa\x3f\x13\xda\x4f\xaf\xb7\xd2\xfa\xc1\xab\x37\x2e\xc3\xda\xc6\x1a\xe5\x17\xec\xd4\xa9\x53\xe3\xa2\xcb\xf8\x3a\x29\xee\x43\xfb\x8f\xf2\x7c\x4f\xdb\xd1\xf7\x74\x9a\x2d\xb8\x7c\xfd\x02\x97\x56\x0e\x83\xd1\x6b\xae\x5e\xd6\xe7\x64\x4d\x0d\xef\xba\xef\xdb\x38\xf6\x8a\x54\x7e\x49\x7b\xfa\x4a\x39\x75\x4a\x9d\x4e\xc4\x61\x26\x5a\x9c\x6e\x81\xd3\x15\x28\x99\xd7\xeb\xf4\xda\x7c\x2c\x0c\x14\xa9\x58\xd2\xcd\xf8\x64\xaf\xdb\xab\xb6\xbb\x4d\x2e\xe3\x0c\x02\xd3\x3c\x89\x0c\x28\x9d\xc7\xd9\xc9\x59\x38\x7c\xf0\xf8\x42\xbd\xd2\x58\x28\x48\xef\xd4\xc8\xeb\xff\x21\xce\x80\x49\xcf\xaa\x0d\xfb\x1a\x05\x36\x75\x63\xa4\x6e\x21\x31\xd8\xec\x3c\x2e\xa3\x38\x76\xa9\xa7\xa5\xe2\x52\xc9\xad\x95\x8d\xb3\x48\xc0\xaa\xd1\x20\xbc\x2d\x9f\xb3\x94\xf7\xe0\x78\xce\x72\xea\xa8\x0b\x81\x15\xbc\x38\xef\x8d\x1d\xb2\x64\xb0\xda\xee\xb5\x23\x95\xb9\x06\x28\xb3\xb9\xea\xbb\x75\x17\x81\x64\xf5\xfa\xe5\x3b\xc6\x8b\x0d\x26\x51\xae\xd6\x8b\xae\x93\xe8\x8d\x2b\xcb\xef\xbd\x7a\xf9\xe2\x1d\x23\x6a\x1f\x8c\x8b\xcd\x77\xaf\xc1\xc2\xdc\x22\x8e\xdd\x91\xe3\x95\x72\xf5\xb8\x2f\xad\x03\x6d\x39\xfa\x83\x5a\x0a\xc7\xb4\xa5\xd7\x43\x2f\xee\xa7\x59\xae\x40\x92\xf0\xe5\xea\xe8\x9c\x50\xc8\x05\xf1\x30\x35\xf9\xf4\x74\x18\x38\xff\x71\xc1\x9b\x2c\x3c\x61\xa5\x26\x6f\x05\xc1\x80\x7a\x7b\x4a\x4a\x97\xe0\x6c\x42\x9d\x57\x3c\x20\x94\x8b\x18\xff\x4b\xe3\x58\xe2\x31\x28\xdb\x8e\x91\x1f\x85\xa8\x0c\x22\x34\x8a\x23\x65\xe9\xc4\x4e\x54\x24\x35\xd5\xba\xe3\xda\xbe\xeb\xcc\x3d\xe2\xf4\x81\x39\xb5\xd5\x6c\x6a\xee\x7e\xc9\x9d\xe2\x24\x97\xe0\xc5\x83\x50\xdb\xbe\xa7\x2b\x88\x25\x14\xbf\xa7\x7e\xed\x49\xc4\xfd\xcf\x35\x5f\x56\xd4\xa2\x56\x33\xdc\xb1\x8e\xbf\x47\xf9\x77\x2e\x72\xd2\x91\x45\xd7\x88\xc3\xa1\x4b\x23\xe0\x6b\x29\x50\x9f\x7a\x95\x52\xa2\x81\xb8\xf1\xf4\x1f\x0c\x0e\x9d\xfc\x28\xc2\xc3\x24\xee\x74\x11\xbe\xfc\xa7\x5f\x81\x13\x77\xdc\xaf\x97\x37\xba\x28\x54\x02\xee\x05\xdf\xc3\x9f\xe8\xa1\xf5\xef\xe1\x26\xf0\xbc\xc0\xdc\x62\x05\xa6\x10\x84\x6b\x45\x1b\xca\x38\xfe\x2e\x5d\x83\x82\xca\x4d\x51\xa4\x36\x7b\x21\x6c\xaf\x6f\x42\x5f\x17\x8a\x5f\x79\xe1\xdc\xc2\x87\xef\x39\xfa\x3c\xae\x0b\x6d\x5a\xd0\x1a\x89\x80\x3a\x04\x0a\x08\x9c\x24\x7e\x7d\xdf\x67\x12\xd7\x6a\xf7\xa1\xd3\xe9\x43\x18\xa7\xe6\x1a\xea\x59\xf5\x6c\x9a\xc6\xf0\xd0\x3b\xde\x0e\x3f\xf1\x13\x3f\xe9\xfc\xca\x2f\xfd\xc2\x20\xe5\xd8\x05\xfb\xcd\x53\x13\x17\xd1\x29\xec\x29\xb4\xa4\x24\x0c\xfb\x5b\xa8\x41\xcf\xaf\x77\x9e\x5f\x29\x0a\x6d\x78\xa0\x52\x54\x2b\x63\xe3\x1e\xf4\x57\x23\xa8\x55\x2b\xf0\xd0\xdb\xdf\xc6\x4c\x2e\x0a\x93\xbc\xf7\x70\x96\x8c\xa4\xd8\xc5\xd0\x8d\xfb\x7c\x41\xf7\xdf\xfe\xd5\x5f\x85\x8f\xfd\xb5\x1f\x02\x85\x8c\x44\xf1\xe5\x0e\x07\xd4\x4b\x19\xfa\xbd\x3e\x24\x38\xc3\x22\xba\x58\x3b\x3e\x7f\xb5\x75\x95\x3b\xff\xac\x54\x56\xe1\x50\xa3\x0c\x1d\x04\x77\x6a\x57\xd9\x43\x22\xd1\x8f\x90\x39\x59\x3d\x68\x0f\xb7\x20\x0d\xa9\x5e\x3c\xe6\x8b\xd0\xcb\x59\x51\x62\xea\xd1\xa1\x90\x47\x2c\xfe\xee\x63\xff\x03\x4b\xa0\x5f\xf9\xe8\xaf\x41\x3f\x0d\xf8\x72\x7f\xd4\x7b\xe0\xf0\x53\x25\xf8\x97\x27\x9f\x83\xd1\xcb\x45\x71\x97\xd3\x81\xc2\x62\x0d\x3a\x76\x80\xb4\xa5\x28\x2e\xb6\x57\x60\xea\x66\x5d\x3c\x78\xf6\x9d\xb0\x7e\x7c\x0b\x5a\x2f\x34\x85\xdd\x47\xb0\x74\x62\x61\x95\x1a\x54\x80\x21\x4a\x36\xc5\xf7\x3c\x6a\x1a\x40\x2e\x54\xa1\x1c\x52\x82\x09\xe7\x7a\x53\x3e\x26\x64\x95\x16\x6c\x35\x12\xba\xf8\x48\xc2\xcd\x54\xc9\xe0\xab\x3c\x1b\x2d\xbf\xe0\x42\x9e\xe1\x95\x5f\x12\x56\xe6\x17\x74\xc8\xdb\x57\xec\x64\x75\x93\xf1\xdc\x41\x01\x4a\x6a\xa6\x4b\xc2\x6a\x6e\xec\x1f\xf1\x27\x68\x01\x8e\xfa\x03\xab\xd7\xed\x7b\xc3\x5e\xbf\x18\x20\xd3\x8c\xa2\xd0\xc1\xd7\x1d\x72\x91\x9b\x32\x5f\x14\x66\x38\xfd\x67\xaa\x73\x8e\xe5\xa5\xc3\x6e\xab\x5b\xea\x77\x5b\xa7\xea\xa8\x68\xb8\x64\x3e\x55\xcf\x25\x71\xdc\xc6\x19\x58\x1c\xf4\xdb\xf7\x13\x10\xa3\x81\x2e\x24\x71\xf4\x08\x79\x14\xe8\x6f\x6a\xdd\x4b\x3d\xe5\x49\xa1\x08\xcb\xfa\xc2\x28\x4d\x3e\x45\xd7\x02\x5e\xbd\xbe\x62\xf9\x56\x41\xba\x48\x86\xa2\x20\x54\xeb\xb7\x56\x4e\x2f\x9c\xbe\x0f\x70\x1f\x98\x28\xa4\xda\x7e\x1a\x79\x65\x70\xeb\xe6\xba\x15\x8c\x02\x3e\xba\xa5\x7d\x55\x0b\x55\x6f\x72\xed\xda\xa5\x7b\x29\x21\x8f\x54\x6a\x56\x78\xf3\x02\xd2\xd2\x1e\x1a\xb2\xd5\x66\xa7\x85\xd3\x82\x92\x8b\xa4\x37\x5b\x9f\x9f\x74\xc7\xed\x62\x88\xd0\x35\x6c\xf7\x8b\xa8\x5a\xef\x6b\xb7\xb7\xef\xd8\x40\x45\x47\x06\x8c\x92\x28\xa9\xff\x39\x5d\xd2\xf0\xce\x53\xf7\xc0\xa4\x3f\xbd\x80\x03\x4c\x45\xed\xc5\xa1\x8a\xbf\x84\xdb\x69\x44\x5e\x7c\x5d\x67\x8d\x06\x59\xf1\x28\x53\x22\xba\x13\x67\xc9\x93\x15\x85\xda\xe9\xa3\x4d\xe7\x3d\x91\x89\x13\x89\x10\x0d\x55\x80\xf6\x1e\xa9\xb8\x88\x12\x72\xec\x51\xa3\x48\x90\xdc\x34\xdc\xca\xbf\xdf\xee\x6f\xc0\xfa\x86\x0b\x33\x73\xb3\xea\xd1\x47\xdf\xf3\xf1\xf3\xe7\xcf\x9d\x5a\xdf\x58\xdf\x77\x73\xed\xe6\x52\x14\xc7\xdf\xb4\xf9\x03\xb5\x79\xbd\x89\xa0\xf6\xe0\x3d\x0f\xc1\xe4\xf8\x94\x67\xa5\xee\xbb\x53\x2b\xfd\x03\x24\x9a\xda\x76\xbd\x62\x7f\x14\x5a\x95\x4a\x8d\x02\x95\xea\x85\x17\x9f\xbf\xe3\xc6\xb5\x1b\xf7\xd0\xf8\xd3\x79\x21\x42\x70\x78\xf1\x28\x02\x62\x17\x36\xb6\x6f\x42\xbb\xdb\x9a\xdf\x6a\x6e\xce\xd3\x25\x27\xa9\x9f\x40\x88\x8f\x79\x77\x33\x4b\x6e\x43\xab\xd3\x82\xbb\xcf\xde\xfb\x54\xc5\xab\x5d\xa3\x48\x69\xb3\x35\xb2\x70\x99\xd6\xc6\xfc\xa9\x6a\xa1\x56\x71\xa9\x6f\xc9\x95\x4b\x17\x8f\xdd\x5a\x5e\x7d\x07\x1d\x5b\xb7\xdf\xc3\x6d\xf7\xde\xd0\x9e\x96\xb6\x7b\xf5\xc6\x25\x26\x51\xec\x24\xb1\xe4\xb5\x34\xb5\xe4\x56\x3b\xd0\xfd\xa1\xe5\x93\x91\xaa\x17\xc7\x64\xe2\x3a\x7a\xd0\x0f\xfc\xad\x5b\x5b\x07\x0f\xee\x3b\xc8\xfb\x49\xdf\x45\x45\x3e\xbf\x72\x6b\x19\xfa\xc3\x01\xcf\xb1\xa3\xa7\x4f\x3f\x35\x35\x33\xbb\x3a\x31\x35\xb3\x15\x06\x23\xef\x0b\x9f\xfc\xc4\x77\xdd\x58\xbb\xee\x11\xe8\x11\x79\xbc\xb9\xb1\xca\xb5\xfc\x54\x0e\x49\xa0\x35\xbf\x78\xe0\x7c\xb5\xd1\xd8\x3a\x7c\xfc\xd4\x79\xda\x9f\x73\x2f\x7c\xfd\x4c\xf7\xe6\xfa\xbd\xac\xd8\x71\x9d\xe0\xf4\xf1\xfa\x23\x17\xbf\x5b\xb0\x36\x9a\x4e\x81\x75\x2e\x02\xc0\xf4\x98\x4f\x8e\x02\x54\x8f\x89\x17\x46\x01\x35\x52\x62\x8f\x43\xb7\xdf\x99\xa4\x66\x4a\xeb\x5b\xeb\x7c\xbc\x6f\x76\xce\x68\xec\xb6\xdb\x5b\xf0\xf0\xdb\xdf\x03\xbe\x2c\x4c\xba\x41\xe5\xe1\xa6\x08\x3e\x95\xa4\xf6\xe4\x72\xbb\x3f\x50\x31\xea\xe1\x54\xba\xf3\xe5\xd9\x29\xa7\xee\x15\xe8\xb2\x24\x41\x7b\x50\x0d\x9a\xad\xb3\xdd\xed\xed\xd3\xdf\x64\xce\xee\xb7\x53\xb1\x5f\x28\xbb\xd6\x95\xe1\x63\x9e\x3d\x3e\xd6\x43\x66\xa1\x33\xef\x11\x77\x92\xaf\x3b\x2e\x2d\xe9\xc1\x60\x58\x2b\x08\x97\xf7\x19\xc9\x86\x9f\xac\x0f\x7e\x74\xf5\xc6\x72\xbd\xd9\x69\xf3\xb8\x66\xc9\x97\xd0\xee\x75\xb8\x39\xd4\xdb\xee\x7c\x80\xda\x33\x1f\xf7\x6d\xe7\xcc\x40\x26\xcf\x8a\xbe\x53\x1f\x08\xd5\x35\x3d\x6f\x94\x71\x09\x2b\x52\xd5\xdc\x0e\x5f\x98\x20\xbf\xb9\x58\x13\x81\x6b\xac\x38\xfb\x1b\x7f\x2e\xd2\x59\xfa\x91\x29\x76\x40\x50\x97\xa6\x59\xbd\x32\x17\xe0\xa1\xac\x78\x5c\xf1\x48\x76\xa9\x02\xca\xa6\x36\xc3\x71\x40\x31\x74\x4b\xc5\x01\xe2\xea\x28\x4d\xa3\x48\xa9\x30\x22\x97\x80\xf4\x1d\x5f\xbe\xe7\xed\xf7\xea\x0e\xee\xb7\xc7\xdb\x92\x5c\xf2\x24\xcd\xba\xd4\x94\xdb\x27\xe2\x90\xb3\x0d\xbc\x52\x41\xd7\x4a\x3e\x40\x89\xfb\xa1\x93\x5f\xdf\x64\x8c\x9b\xab\xa5\x29\xc9\xca\x4a\xeb\x30\xd2\x32\x88\xfc\xb8\xd3\xf3\x23\xd7\xb5\x62\xd7\x16\xf1\x48\x66\xd9\x4b\x88\x8d\x96\x03\xf1\xd5\x2f\xfc\x56\xe2\x4d\x3f\x6c\xa9\x95\x97\x41\x74\x2f\xc2\xe7\x1f\x7f\x4e\x0f\x11\x67\x22\xae\x8c\xa2\xd6\x26\x8e\x76\x1b\x25\x98\xde\x57\x86\xb9\xb1\x02\xd4\x4b\x0e\xd4\x7c\x07\xca\xbe\xe9\x54\x97\x22\xde\x75\xfa\x23\x1c\xe3\x21\x02\x73\x07\x36\x6f\x5c\x05\xef\xea\xe3\x17\x1e\xba\xef\x9e\x2f\x7d\xf7\xc7\x3e\xba\x96\xb5\x2b\x30\x05\x06\xb8\x5f\x74\x55\x34\xba\x68\x0d\x1d\x57\x1f\xa5\x13\x01\x39\x95\xc2\x51\xbe\x12\xf5\x72\x56\x2c\x86\x4d\x20\x96\x0c\xca\xad\xf5\x26\xfc\xc4\x8f\xfc\x98\xf3\xdb\xff\xe6\x5f\x3b\x6b\xcb\x57\x86\xda\x64\x55\xb2\x7a\x30\x21\x79\x3c\x07\x05\xd7\x84\x74\x10\x2f\xff\x43\x80\x0e\x7b\x40\x7d\x27\x6e\x2b\xe4\x76\xda\xeb\x8d\xec\xd9\xa3\xe3\xf0\x5c\x88\x93\x3f\x88\x39\x2b\x2f\xd5\x2a\xeb\xe0\xb0\x77\x0b\x59\x93\x66\x7c\x9f\x0c\xfb\xc3\xf7\xbf\x03\xbe\xf7\xa3\xdf\x05\x4f\x7c\xe1\x39\xb8\x7a\xf2\x22\x04\xd7\x11\xd0\xaf\x00\x7c\xe4\x7d\xdf\x0f\xb6\xe3\x71\xfd\x3a\x9d\x8f\xc0\x5f\x85\xe2\x7f\xe7\xc2\xc0\xb3\x60\xbd\xe2\x20\x9b\xa1\x9d\x25\xb7\x86\x89\x43\x6d\x7c\xa5\x03\x3f\x73\xe3\xe7\xe1\xd7\xab\xff\xca\x5c\x6f\x1c\x01\xae\x33\x6a\x81\x38\x8c\xa3\x17\xbf\xf6\x92\xe8\xb7\x7f\x60\x1c\x3e\xfd\x99\x27\xa1\xd0\x44\x82\x2c\x3c\xdc\xf6\x0c\x0e\x1e\x2e\x02\x9f\x0a\xd6\x5d\x94\xe4\xb8\x65\xba\xec\xaa\x65\x69\x52\x4f\x4e\xd1\x01\xbe\x02\x99\x32\xf1\x7b\x49\x97\x70\x74\x34\x0f\xba\x89\x55\xf0\x45\x1b\x40\x87\x48\x54\x2e\x6f\xd3\x55\x9a\x60\x94\xf6\xc1\xc6\x49\x50\x90\x3e\x5d\xd5\x0c\xf7\x91\x4a\x4f\x7c\xa1\x03\x64\x4d\x6e\x04\x89\x6d\x21\xf0\x9a\xde\xcb\x59\xec\x42\xbf\xd9\x88\xff\xfb\xcd\x4f\x88\x10\x4f\xf4\xe6\xc6\x2d\x4e\x16\x39\x72\xf2\x24\xdc\xb8\xb9\x02\xbd\x6e\x87\x8f\x93\xae\xfa\x43\x06\x8f\xdc\x4a\x73\xfb\xf6\x23\xab\x0b\x85\xb9\xb2\x91\x2b\xdc\x81\x2b\x8b\x71\x05\xa7\xa0\x4d\xf8\x62\xd3\x25\xb2\x38\x97\x9f\xdb\x79\x51\xda\x2c\x24\xe4\x69\x98\xa8\xcf\x88\x83\xa7\x16\xbb\x14\xcb\x38\x77\xe1\xb9\x87\xbc\xac\xb7\x3e\x75\x86\x43\x03\x78\x04\xd5\xd7\xaf\xb4\x3a\xdb\x6c\xac\x3a\xdd\x36\xbb\x31\xa9\x0f\x38\x01\x02\x91\x36\x32\x3e\x04\x20\x87\xf6\x1f\x86\xfd\x73\x07\xee\xb5\x8a\x85\x3f\x2c\x57\x8a\x82\xd8\xf6\xcc\xcc\x41\xa4\xa0\x69\x7a\x75\xf9\xf2\x51\x5b\x5a\x63\x04\xfa\x59\xe3\xb6\x27\xb4\x4c\x5b\x78\x93\x83\x61\x97\xd3\xd7\x4a\x5e\xd5\xf2\xab\x4e\x88\xaf\xab\x76\x6b\xeb\xce\xe3\x8b\xc7\x72\x95\x35\x42\xcd\xfb\x0a\xb9\xf9\x96\x6f\x2d\x77\xe2\x28\x76\xad\xc4\xf6\x8e\x2c\x1c\x9b\xf3\x1b\xd2\x8a\xd3\x38\x5a\xbe\x76\xe1\x1d\xe3\xe5\xf1\x77\x17\x5c\x1f\xd6\x46\x03\x56\x68\x64\xd8\x79\x5f\x71\x7c\xc8\xd0\x3f\x7f\xfe\x19\x78\xe0\xec\xc3\x9c\x7f\x81\x63\x74\xbb\x12\xd1\x17\xf0\xac\x55\x52\xbb\x1d\x71\xfe\xba\x34\x10\x6e\xdc\x24\x90\x13\xb1\xac\xf2\x90\xcf\x77\x9e\x04\xce\x8b\x5b\x51\x62\x29\x5f\xb8\x18\x27\x21\x55\x73\x8b\x18\xcf\x31\x0e\xb1\x4c\xe5\x6e\x57\xb3\x9d\xd8\xb8\x58\x59\xbb\x4e\x24\x5a\xce\x22\xa8\x1f\x3f\x7e\xfc\x1c\xdd\xdf\xd8\x7f\x07\xc4\xde\x07\x7a\xeb\x85\x17\x9e\xbb\x73\x63\x7d\xfd\xd0\x85\xab\xe7\x27\x1a\xb5\x31\xce\x9f\x43\xcd\x78\x28\xb1\xd5\xf3\x96\x57\x74\x12\xd5\x95\x0e\x1a\x35\x6a\xc5\xba\x7c\x63\xe5\x60\x07\x8d\x35\x81\x4e\xad\x52\x85\x63\x87\x4e\xb0\xcb\x9e\xc0\x75\xe5\xd6\x2a\x8f\xcb\xde\xdb\xe2\xa1\x43\xaf\x96\xab\x95\x1e\x19\x97\xd3\xb7\xdf\xf9\xe2\x1e\x5f\x84\x5c\xdb\x5c\xeb\x0f\x22\x55\x1a\x2b\x4c\x97\xab\xb3\x75\xae\x61\x7a\xee\xc9\xaf\xde\x3f\x6c\x76\x8e\x91\x8a\x26\x60\xc8\x5b\xfc\x9e\x38\x73\xe6\xe9\x52\xa5\xdc\x3b\x78\xf8\xd8\x35\xfa\xfe\x4b\xcf\x3c\x75\xb6\x6e\x95\x6e\xcb\x63\xcc\x69\xd1\xbe\x46\x93\xb4\x39\xe8\x53\xfa\x33\x77\xc0\x9c\x98\x9c\xa6\x1e\xbf\xc9\xc5\x8b\xaf\x1c\x2b\x78\x3e\xee\x6f\x03\x56\x6e\x2e\x33\x38\x13\xe1\xa0\x31\x3c\x78\xf4\xf8\xf3\x47\xef\xbc\xeb\xa9\xd7\x74\xc5\xb3\x12\x32\xee\x1e\x1d\xd7\x32\x8e\x29\xb9\xe3\x73\x62\x72\xe4\xf6\x33\x4f\x1e\x3e\x75\xc7\x73\x59\xe7\x54\x9d\x35\x18\x80\xda\xc4\xcc\xc6\x70\x73\x3b\xcb\x52\x4e\x21\x76\xe4\x06\x92\x70\xdd\x0b\xbb\xb8\x10\x5c\xee\xda\x57\x72\x4b\x68\x45\x3d\x45\x49\x84\x78\xba\xbd\x72\xa9\x82\x73\x7e\x13\xae\x2e\x5f\x82\xed\x8e\xe9\xad\x4f\xfb\x54\x28\x95\xba\xfb\x8f\x9f\x7a\x79\x62\x76\xfe\xc6\xc4\xd4\xec\x86\x49\x59\xd1\x70\xe9\xe5\xe7\x4e\xad\xbc\x72\xee\xe1\x35\xdc\xff\x83\xfb\x96\x48\xf1\x1c\x76\x6d\x7f\x02\x6d\xc5\x86\x65\x55\xeb\x11\xaa\xb6\xa5\x89\x85\x49\xbf\x62\xf1\x65\x62\x56\x2f\x9c\x3f\x3b\xe1\x56\x1e\x28\x59\x3e\xdc\xfa\x16\xe6\x2c\xfe\xce\x6d\xba\xe8\x7c\xd1\x2f\x56\xdc\x58\xe1\x97\x94\xb9\xb2\x8b\xad\x71\x65\x79\x1e\x5d\x90\x46\x45\x41\x50\x53\xff\x1f\x6b\xef\x01\x66\x69\x76\x96\x07\x9e\x73\xfe\x74\x73\xa8\x9c\xbb\xab\x73\x9a\x1c\xa4\x99\x91\x6c\x69\x24\x14\x11\x36\xc8\x08\x6c\x30\x60\xf6\xf1\xe3\x35\xbb\x78\xd7\xbb\xeb\xfc\xd8\x18\x1b\x5b\x66\x41\x12\x0f\xc2\xe0\x45\x64\x23\x82\x31\x0b\x68\x14\x00\xa1\x34\xa3\x49\x3d\x41\x33\xdd\x3d\x9d\xbb\xab\xaa\xbb\x72\xba\xf9\xfe\xf9\x9c\xfd\xbe\xef\x9c\xff\x56\xf5\xcc\x08\x09\x3f\xdb\xc3\xa5\x4a\x55\xb7\xfe\xfb\x87\x73\xbe\xf8\x7e\xef\x9b\x4f\x19\x56\x17\x5a\xdd\x56\x0e\xce\x3d\x87\x81\x86\x9b\xf3\x9a\x33\x47\x8e\x7c\xe3\xd4\x3d\x0f\x3e\x87\xf7\xf0\xc2\x37\xce\xbe\x75\xf9\xda\xd5\x77\x3e\xfd\xe2\xd7\xd8\x3d\xa7\x1e\x60\xc5\xa1\x21\x4f\xe5\x91\xc7\xdc\xb1\xa5\xcd\x65\x46\xf4\xa3\x8b\x56\x58\xf4\x49\x51\x33\x82\xb8\xcf\x69\x71\x38\xc4\x96\xc5\x2c\x3d\x47\xad\x2c\x5b\x1a\x71\x11\xca\x5b\x08\x45\x29\x69\x56\x9e\x86\xdc\x70\x2b\xa9\x18\xa3\x01\xcb\xc6\x32\x05\xc1\xd7\xa4\xa2\x1e\x10\x3a\x6b\x1c\x25\x10\x38\x42\x85\x95\x00\x88\x1e\xd8\xdb\x1e\x79\xab\x70\xb8\x0b\x49\x74\x5b\xe5\x6c\x57\x65\x8a\x6d\x48\x2e\x83\xd2\xa6\x38\xf6\x85\x2c\x9c\xc8\xe7\x6e\xe9\x93\x65\x85\x82\xab\x72\x9e\x07\xef\xe5\xc8\x87\x43\xa3\x66\x36\xa1\xfa\x15\x8d\x7c\xc5\x31\xe2\x3b\xe3\xa8\xd7\x6b\xc7\xed\x4e\xb5\x0f\xf7\xb7\x00\xeb\xac\x00\x3f\x44\x75\x21\x3b\x46\x87\xb5\xf4\xe7\xbe\xed\x9c\x28\x84\xdc\x46\xd6\x4e\xd6\xbe\xbd\xa1\x94\x3d\xce\x9c\x4a\x8e\x79\xa3\x65\x56\x98\xa8\xb0\xa9\xd1\x02\x1b\xaa\x40\x12\x53\x70\x59\x19\x7c\x43\xce\x48\xf4\xfa\xe0\xf7\x9a\x3e\xce\xa3\xb7\xd8\xea\xd2\x75\xd5\x79\xfe\xf3\x8b\xa7\x27\x87\x5f\xf9\xb1\x8f\xfe\xe4\xa5\x4a\xb1\x92\x92\x58\x18\x25\x07\x9c\x7b\x8e\xab\x1c\xd7\xa5\x14\xd7\xc7\x52\x7e\x0f\xe5\x60\x23\xda\xf7\xc8\xb5\x92\xa2\x14\x6d\xa2\x29\xd2\x25\xd1\xe5\xa7\x24\xfb\xdb\xef\xa3\x4c\x2c\x67\xff\xf4\x1f\xff\x9f\xf9\x7f\xfa\x4f\xfe\xf7\x0e\xf8\x50\xc5\x48\xb3\x81\x13\x9f\x00\xd2\xa9\x52\xd1\xa6\xe8\xd2\xf3\xf9\x76\x98\xe2\xde\x84\x08\x76\x27\xed\xae\xb5\xd9\x70\x65\x86\xd9\xf9\x1c\xf5\x15\x6a\x45\x97\x8e\xaf\xc7\xe6\xe5\x9e\x12\x9a\xa9\x0b\x23\xd7\x2f\x3e\x20\x34\x08\xf3\x73\x73\x4c\x3c\x28\xd8\x72\xf3\x26\x0b\x70\xb5\xcd\xc0\xc3\x58\x5b\x67\x18\x04\xd3\x1c\x61\x0d\xa2\x9f\xfb\x21\x7c\xea\x9a\x81\x70\x92\xfa\x44\x69\x64\xa5\x65\x03\xe1\x5a\x8b\x47\xc1\x68\xd9\xdf\x60\x97\x5b\x67\x59\x84\x5a\xb8\x68\x50\x47\x31\x63\xe6\xec\xf5\x1a\x82\x92\x28\x11\x0d\x01\x81\xb4\xd8\xa5\x7b\xaf\xb2\x53\x9b\xc3\xac\x7b\x34\xcf\xec\x5a\x8d\xd0\xa7\x28\xac\xe2\xc2\x67\x1c\x19\x9b\x60\xac\x92\xb2\x1b\xfd\x4b\x4c\x5d\x44\xdc\x07\x18\x83\x1c\x38\x7d\x44\x8c\x77\x7b\x14\xed\xf7\x21\x78\xb0\xb0\xca\x09\x8e\xb0\x34\x9f\x90\xea\x4f\x01\xdc\xb4\x2e\xb6\x66\xd4\xb5\x98\x69\xc6\x06\x4b\x63\xd3\x8d\xc6\x1d\xf9\xdf\x5e\xfa\xef\xbc\x5a\xaf\xb3\x9d\xad\x2d\x8e\xd8\x03\xc7\xf3\x60\x61\x16\xd9\xc5\x2b\x17\xa8\x33\x75\xec\xe4\x29\x06\xf1\x31\xcb\x95\x4b\xe4\x59\x22\x19\x43\xe4\x5e\xe6\xd8\x17\x2c\x96\xca\x88\xa4\xe4\x58\x8d\xc0\xc8\xbe\x58\x2c\xf0\x61\x77\x88\x95\xcb\x65\xce\x7c\x6e\xc9\xae\xb4\x78\x20\xdc\xd4\x97\x79\xb0\x5a\xe5\x34\x22\x84\x6b\x5e\xa1\x88\xb4\x06\x10\x39\xc3\xd5\x31\xe7\xd8\x03\x87\x90\xdb\x8e\x5d\xba\x7a\xfe\xa1\x56\x63\xe7\xbd\x87\xe6\x0e\x43\x26\xb2\x06\x99\xe1\x26\x6b\xb6\x1a\x23\x3e\xf1\xb6\xfb\x54\x0a\xbd\xc3\x19\x1c\x3c\xfc\xd9\x0c\xd1\x8c\x5c\x4b\x41\x1a\xb3\x48\xc8\xeb\x10\xb6\x38\xed\x4e\x0b\xcc\xb6\x25\x86\x46\xeb\x34\x20\xb8\xbe\xb1\xf2\x28\x3a\x7c\x74\x1c\x84\xfa\x15\xfc\x22\x6c\x6f\x77\x6d\x63\x03\x77\x27\x95\x60\x87\x6a\xc3\xb6\x72\x54\x74\xfd\xc6\xe5\x7b\x5c\xdb\xc9\xa3\xb0\x8b\x41\x1a\xbc\x9c\xc2\x31\xbb\xfd\xbe\x1f\x86\xe9\x48\x51\x94\x4b\xb3\xb3\x73\x55\x6f\xc8\x56\xfd\xd0\xcf\x5f\x7c\xf5\xe5\xef\x39\x7e\xe0\xd8\xc1\xf1\x91\x49\x2a\x2b\x9f\x3c\x7a\x17\x3b\xcc\xd2\xaf\x25\x2a\x69\x96\x87\xea\x57\xd0\x41\x43\xa4\x5f\x7b\xe5\xf9\xe7\xfe\xfe\xca\xfa\x6d\xca\x1a\xbd\x7c\xae\xc5\xcb\x10\xe4\x08\xd5\x17\x65\xcb\x13\x38\xfc\xb2\x37\x60\xa8\x41\xb2\xcc\x20\xba\x89\xdf\x87\x54\x90\x34\xb5\x13\x91\xfd\x41\xd8\x21\x5c\x27\x05\x9b\x92\x40\xea\x94\x0a\x0b\xdd\xb8\x80\xf3\xe4\x1a\x31\x28\xad\x41\xe0\x2b\xf6\x18\x6f\x6e\x23\x59\x4c\xbb\xa5\x50\xa0\xa8\x5e\xaf\xab\x12\x56\xb0\xb3\xfa\xf8\x5e\x05\x86\xef\xb1\xd9\x72\x76\xf7\x03\x0f\x9f\x5b\x5d\xb9\xbd\xb3\xb5\xb8\xf2\x7e\x94\xac\xa4\xb7\xe6\x6d\x44\x2b\x5a\x60\x15\xe0\x2e\x7a\xbc\x17\x47\x76\xce\x29\xc9\x07\x1f\x7d\xf4\x99\xeb\x57\x2e\x1f\x5f\xba\x71\xf3\x38\x56\xc0\xd0\x10\xa0\x72\x14\xb6\x2e\x0e\x1e\xcd\x5f\xb5\x5c\xa7\x83\x47\x3d\x73\xdf\x03\xe7\x07\xe4\xde\xaf\xdb\xdf\x7e\x14\x26\x9b\xbb\xdb\x61\xb7\xd7\xb7\xeb\xb9\xe1\xc2\xf0\xcc\x30\x9d\xd9\xab\xcf\x3d\xf3\x28\x3c\xe4\x63\x98\xf9\xfb\x1d\x1f\x7c\x9f\x17\x9d\xb8\xff\xbe\x17\x0f\x1d\x3f\x79\xe5\x4e\x30\x21\x63\x51\x3f\x18\x9e\x38\x74\x54\x07\xf4\xae\x58\x00\x2b\x1b\xf6\xfa\x7d\xd5\xef\x07\x88\x39\xa6\x31\xf8\x5c\xa9\x48\x50\xa3\xf5\xa5\xdb\x27\x46\xeb\x23\x54\xb6\xc6\x72\x36\xda\xe7\xda\xc8\xe8\xca\xfc\xa9\x33\x2f\x94\x87\x86\xb7\x70\xfb\x76\x3b\x3d\x9c\x6f\xb0\x8b\xc3\xf9\xe8\xc6\x95\x4b\x27\x30\x80\xc4\x16\xc4\x2e\x04\x9a\xb8\xa6\x46\xa7\x67\x6f\x1e\xbe\xef\xc1\x27\xe1\xdc\x42\x3c\x26\x66\xf6\xbb\xad\x76\x3c\x5e\x1e\x73\xbc\xb2\xad\x5a\xdb\x5b\xd3\xa8\x50\x97\xb1\x50\x26\x8e\xb3\xcc\x6d\x21\xf1\x7d\xba\x2e\x83\x08\xe2\x61\x0b\x7e\x16\x6f\xac\xdf\x9a\xc6\x00\x63\x76\xf2\x80\x1e\xf3\xd3\xb8\x1a\x36\x34\x3e\x71\x7b\xf6\xc8\xb1\x0b\xd3\xf3\x47\xaf\xdd\x41\xbb\xa5\xc7\x53\xd4\x91\x33\xf7\x9e\x6b\xef\x6c\xcf\xb4\x3b\xcd\xa3\xd9\x5e\x01\x87\x32\x1a\x0a\xb6\xe6\x49\xbb\x3c\x59\x9f\xcd\xbb\x25\x4b\x41\x60\xe0\x5d\x7d\xe1\xd9\x0f\x1e\x9f\x39\x3c\xb7\x7f\xcd\x42\xe8\xfb\x24\x38\xbd\x56\x61\x74\xf4\x0a\x31\x24\x36\x77\xab\x17\x9f\xfe\xea\x60\xcd\xba\xf9\x7c\x53\xe6\x0b\x29\x38\x0e\x15\x87\xa9\xc3\xb4\xee\x02\xab\x16\xab\x36\x64\x26\xc9\xc6\xda\xca\x38\x18\xdd\x1a\x96\xe9\x91\x46\x18\x5b\x29\xc8\x03\x32\x77\xe4\xf8\x97\x0f\x9c\x3c\xf3\xac\xd1\x7e\xa1\xf1\xb5\x33\xf7\x3d\xfc\x75\xbf\xd7\xad\xb6\x36\x37\xef\x5f\x5c\x5d\x68\x1c\x1d\xad\xbf\x86\x63\xf6\x41\x5e\x6d\x31\x5b\xd2\x38\x3e\xd5\xc6\x52\x0d\x6e\xc5\xc9\x22\xa3\x6f\xa4\x92\x38\xd5\x5c\xfa\x0c\xf9\x1a\xd1\x41\x59\xc4\xbd\xc5\x15\x01\xd6\x33\x56\x40\x1a\xe5\xc3\xf6\x35\xce\x5d\x6b\x6d\x6f\x4b\xa5\x69\x08\xfb\x43\xa6\x84\xa9\x85\x83\x62\x83\x26\x01\x9b\x66\x21\xf0\x2e\x4d\x70\xc0\x2d\x85\x7d\xcf\x3f\xf0\xf8\x77\xa4\x1b\x5b\x9b\xac\x02\x81\xaa\x25\x34\xc8\x0d\x3e\x87\x1c\xbb\x6d\xe8\x5e\x05\x65\xe0\x3a\x3e\x24\x95\x34\x61\x43\x4c\x63\xa9\x1c\x66\xd1\xe0\x68\xb1\x85\xa3\x19\x87\x35\x63\x5e\x92\xe4\xa8\xb0\x09\x01\x9b\xdf\xe9\x76\x5d\x08\x7a\x7b\x7e\xe8\x17\x20\x31\x22\x52\x2d\xe9\x42\xaa\x1b\xc7\x91\x5c\xfc\x6d\x30\xf0\x6f\xb5\xb9\x55\x60\xa5\x32\xd8\xfc\xf1\x31\x96\xab\x81\x03\x1f\x2b\xb1\xb1\xa1\x1c\x38\x73\x78\x81\x7f\x83\xac\x5c\x61\xc2\x99\x24\x29\xeb\x04\x21\x24\x90\x98\x78\xad\xb1\xa5\x2f\x3f\xd1\x95\x9d\x5b\x17\xde\xfb\x9e\x77\x5c\x38\x71\xe8\x48\x07\x41\xb0\xd8\x07\x77\x5c\x9b\x00\xbe\x82\x34\x13\x14\x11\x75\xc1\x7e\x40\xd9\x57\xea\xa1\xa3\x6e\x09\x86\x7a\xd8\xa2\x56\x1a\xb4\x48\x3f\x4f\xc8\x63\x68\x29\x5e\xcf\x73\xd8\xed\xe5\x55\xf6\x03\xdf\xfb\xfd\xde\x2f\x7d\xea\x53\xf9\x2b\xe7\x5e\x0a\xc8\xa5\xea\x34\x1e\xe7\x1f\x19\xeb\xc3\x92\x46\xac\x57\xc1\x53\xdf\xca\xa1\xab\x37\x79\xc1\xff\x5b\x08\xe5\xe2\x6e\x01\x49\x8b\x6a\xc3\x15\xf6\xf2\x4a\x9b\xbd\xf7\xc4\x08\xc3\xbe\x85\xe5\x30\xca\xe4\x32\x21\x00\x41\x1a\xb9\x36\xcb\x66\x5d\xd1\x59\xfc\xcf\x3f\xfc\x43\x6c\x0b\x32\xdb\x3f\xfa\xa9\x3f\xd4\x9f\x92\x83\x33\x3c\xcd\x29\x0f\xe1\x39\xb8\x10\x1c\x0e\x41\x4f\xbe\x03\x17\xee\xc3\x05\xe7\xc0\xa9\xa2\xee\xae\xcd\xb5\x18\x00\xd1\x5b\xc1\xe2\x99\x74\xc0\x43\xc1\xfb\x43\xf0\xf0\xfd\x84\xc5\x3d\x70\xa6\x18\x21\x24\x18\xdc\xd8\xfc\x07\x37\x3f\xc4\x7f\xea\x7b\xff\x23\xbb\xc6\xaf\x30\x52\x01\x94\x9a\x58\x22\x25\x5d\x6f\x0a\x42\xa9\xb4\x84\x6d\x6e\x4c\xe9\x75\x89\x49\x0f\x1c\x0f\xe6\xc9\x33\x8e\x89\x94\x3a\x95\x86\xa3\x5a\xbf\x07\xd5\x2a\xcc\xdf\x0d\x08\xa2\xf0\x22\x83\x30\x34\x4c\x56\x8a\x14\x9f\x34\x63\x94\xa4\xcd\xf6\xde\x93\xef\xa3\xde\xb9\x1c\xd3\xb4\x1d\x91\x8c\x88\xd2\xf5\xed\x47\xff\xba\x11\x7e\x44\x70\x6c\x6a\x94\xa4\x24\xc7\x45\x1a\xa3\x86\x2a\x16\x06\x2c\xd2\xc6\xa5\x9f\x65\xe3\x78\xa6\x87\x2f\x62\x2f\xb6\x02\x37\xb2\x83\x4e\x58\x08\x58\x50\x4c\xa3\xb4\x9a\x88\xb4\x0a\xbb\xa7\x02\xab\xbb\x08\xef\xc1\x29\x05\xab\x5e\xab\x63\x7d\x46\xbc\xfc\xea\xf3\x8f\xaf\xae\xde\xfa\xe0\xdc\xe4\x2c\x95\xcf\x31\xa3\x5b\xdd\x5a\x83\x05\xd7\xa7\x87\x5c\xab\xd6\xaf\x0d\x0d\x8f\x5c\x1f\x1f\x9f\xba\x3e\x31\x3a\xb9\xc2\xd8\xde\xc8\x5c\x36\x4a\x97\x91\x77\x74\xbb\xbd\xfc\xc2\xc2\x82\x18\xad\x8d\x5a\x6e\xcd\x4a\xfc\xa0\x5f\x09\xfb\xbd\xbb\x46\x87\xc6\x33\xc1\x8b\x35\x70\x7e\xdb\xbd\x6e\xdf\x6b\x34\x9b\x38\x8c\x24\x90\xb8\xb1\x36\x34\x64\x61\x1b\xa2\xd5\x6a\x1c\x3d\x38\x73\x68\x50\x6e\x8f\x85\x42\x03\xea\x6e\xed\x6c\x85\x15\xaf\x3c\x31\x7f\xe8\x40\x8e\x3b\xd8\xdc\xef\xe7\xbf\x71\xf6\xd9\x8f\x8c\x54\x87\xc6\x87\xeb\xa3\x54\x5e\x66\x8e\x38\x2b\x0a\xea\x29\x8c\x58\xd2\x6e\x70\x77\x63\x73\xf3\x91\x8d\xad\xb5\xdc\x95\xcb\x97\x1e\xc2\xbe\xee\xe2\xf2\x0d\x86\xe3\x78\x23\xa5\xc9\x17\xb1\x80\x07\x99\x7f\xbb\x1f\x33\x8b\x67\xb5\x30\x23\xd5\x30\x98\x5f\xd3\x84\xa6\xcc\x28\x87\xe8\xb1\x2c\x03\x1b\x40\x0a\x24\x24\x0a\x8e\x1c\x2e\x13\x78\x49\x27\x4a\x11\xfb\x84\x65\x77\x24\xfa\x55\x6a\x5f\x55\x6b\xd0\x96\xe7\xbc\x17\x25\xa2\xb7\xb3\xc3\xd6\x76\x76\xf7\xf2\xf1\x8c\x10\x10\x2d\x9d\xa0\x29\x8e\x74\x76\x64\xd6\x1e\x9a\xa8\xd2\xef\xd7\x96\x97\x4f\x8c\xc3\x35\x62\x84\x8e\xcf\xdb\xa9\x55\x16\x11\xc3\xd1\xea\xfb\x16\xd2\xc8\x2d\xac\xaf\x42\x4a\x59\x12\x23\x13\xd3\xbb\x90\x39\x3e\xfb\xc8\x3b\xde\xfd\xec\x57\x3e\xf7\x99\x0f\x8f\xd4\x47\xca\x79\x2f\xcf\x26\x27\x66\x3a\xa5\xf9\x89\x67\xd8\x3e\xed\x10\x7c\xa1\x93\xed\xf5\xfd\xc4\x86\x7c\x08\x82\x43\xdb\xc9\x61\xdb\x46\x58\x11\x38\x0c\x58\x8a\xf6\xc8\xd4\x88\x8d\xac\x22\x17\x5e\x3a\xfb\x40\x59\xe4\x8f\x79\x43\x75\x72\x16\xd3\x07\xe6\x17\x8f\x3d\xf8\xe0\x57\x32\xa3\xd0\xef\xf5\x85\x67\xe5\xb9\xc8\xb1\xe4\xf6\x8d\xeb\xf3\xa3\xa5\xa1\xa9\x7c\xae\x40\xd9\x7b\xea\xda\x0b\xc8\xfb\xb2\xdd\x68\xaa\x58\x13\x83\xc9\xc9\xe1\x09\x44\xe1\xc5\xcb\xb7\x16\xa7\xc1\x1a\x94\x0f\xce\x1e\xa1\x32\x31\x96\xd0\x47\xe6\x0f\x3d\x55\x9f\x99\xa5\x52\x79\xbb\xdb\xe7\xab\x1b\x6b\x22\x0d\xb8\x38\x71\xea\x70\x88\x81\x55\x6b\x7d\xed\xc4\xc9\x43\xa7\x09\x30\x08\x2b\x27\x9c\x3c\x73\xf7\x67\xbd\x4a\x75\x13\xef\x65\xab\xdb\xe3\xcb\x2b\x2b\x02\x82\x11\x59\x2b\xd5\x2c\x67\xca\xc1\xae\xb5\x6a\x6f\xac\x9f\x3a\x79\xf7\x23\x7a\x7c\x4c\x88\x76\xe8\xd9\x4b\x28\x2a\xd4\xe8\x74\xac\x54\xb3\xaa\xa9\x7c\xbe\x88\xe3\x63\xe9\xc6\xd2\xe2\x21\x0c\x18\xea\x95\x21\xac\x78\xb1\x43\x87\x4f\xde\x3a\x75\x60\xee\x8f\xb2\xb9\x92\x30\x8a\x79\x13\x82\xb2\xad\x9d\x5d\x08\x08\xfc\xb8\xe8\x96\xe4\xc9\x03\x87\x8b\xb0\xee\x52\x1c\x47\xc2\xca\x01\x56\x1f\xf1\x79\xc6\xc2\xea\x43\x2a\x29\x27\x86\x86\x3d\xc4\x97\x85\x81\x9f\x3b\xf7\xf5\x2f\x7f\xcf\x68\xb9\x3e\x58\xb3\xd2\x73\x9e\x8f\x2b\xde\x93\xc8\x53\x63\xb5\x3b\xf7\xb4\x56\x56\x1e\xda\xd8\x5c\xf5\x6e\x5c\xbe\xf0\xd6\xfd\x6b\xb6\x5a\x9c\x7d\x16\x92\x5e\xd9\x68\x76\xc0\xa1\x27\x22\x63\xa1\x2c\x8f\x54\x38\x02\x87\x36\x57\x56\x0e\x14\xf3\x05\x36\x36\x3c\x4e\x15\x8e\x4a\xa5\x1e\x8c\x1d\x3e\xfa\xdf\x8b\xb5\xa1\x9b\xe8\x98\x77\x1a\xbb\xf1\x56\xab\xd1\x2d\x17\xcb\xe9\xcc\xd8\xe8\xf0\x83\x8f\xbc\xf3\x09\x38\xc2\x13\x19\x00\x07\xac\xeb\xd6\xae\xe5\x6f\xf0\x40\x73\xbe\x67\x96\x8a\xe2\x5b\x58\xce\x42\x53\x0b\x29\x67\x40\x13\x6b\x54\xdb\x10\x9d\x9d\x4a\x53\xa0\x1f\x90\x29\x6b\x96\x7e\x0d\x4e\xa1\x1d\x90\x52\x7c\x00\x77\xc5\x73\x95\x2f\x25\xa9\x10\xc6\x58\xa6\x56\xd2\x4e\x14\xc2\xf0\xc8\xa4\x8a\xbf\xf5\x9d\x1f\x42\x3b\x29\x5d\xcb\x55\x6e\xde\xd6\xec\x69\x98\x99\xa3\xf4\x19\x65\xe6\x3a\x4e\x46\x67\x8e\x36\xc2\x76\x84\xa6\x80\xe5\xe4\x5b\x20\xc8\x20\x4e\x6f\xaa\xee\xba\x28\xf5\x6b\xd1\x31\x90\x7e\x9e\x5b\xb6\x25\xfd\x28\x88\x76\xdb\xed\xa0\xd1\x69\xfb\x9d\x1e\xf8\xf4\x28\xca\xc3\xef\x1c\x89\x03\xff\xb9\x1c\x4b\x7b\xbb\xe1\xd0\xd4\xac\x0d\xf1\x2c\xe3\xbb\x0d\x76\xef\xbb\x86\xb1\x6f\xce\xa6\x86\x0b\x6c\xb8\xea\xb2\x0a\x04\x0b\x9e\x45\xb6\x89\x87\x71\xc4\xda\x7e\xa8\x9a\xcd\x26\xbb\xf0\x27\x9f\xee\xef\xdc\x7e\x6d\x71\x7a\x76\x7a\xf1\xe0\xf1\xfb\x76\x47\x87\x87\xa2\xa1\x7a\x2d\xad\x54\xcb\x90\x7c\x15\xf1\x7c\x48\xb2\x15\xa7\xb7\xb0\xac\x9e\xa4\x31\xdd\x3f\x32\xdf\x18\xf5\x90\xab\x92\x9a\x9c\x92\xf4\x21\x10\x87\xad\x68\xec\x0e\x71\xbf\xa4\x6b\x00\xfb\x07\xd7\x6d\xb3\xd5\x63\x3f\xf5\x6f\x7e\xb2\xf2\xc3\x3f\xf4\x7d\xdd\x5e\xb7\x9b\x12\x91\xbd\x9e\xe3\x53\x90\xe5\xe8\x3d\x0e\x9f\x61\xff\x25\x39\xb9\x1c\x00\x7d\x75\xb9\x36\xdd\xd3\xbe\x58\x0a\xa2\xdb\x9b\x6a\x69\xb9\xc3\x4f\x1f\x1a\x67\x2f\x5c\x5b\x04\x87\x3e\xca\x9a\xcd\x06\xbb\x70\xe9\x12\x3b\x71\xec\x18\xab\xd5\xaa\x1a\x37\x66\x0c\x97\x91\x5d\x64\x88\x22\xa7\x08\xd8\x46\xd3\x69\x0a\xc1\x08\x7a\xc7\x66\x1d\x92\x3e\xb9\x92\x74\x3a\x53\x2f\x65\x12\x87\x81\xf2\x82\xa1\xbe\xb3\xe5\x92\x3a\xa3\x2e\x83\x6a\xfd\x0c\x1a\xc6\xc7\x91\xeb\x04\xe3\x07\xac\x5e\xf8\x1c\x47\x42\xb8\x88\xb9\x75\xe2\xd0\x21\xf7\xc3\xff\xe8\x6e\xef\x52\xfe\x8f\xb9\x75\x53\xf2\x77\x1f\x9a\x40\x7b\x08\x51\x1d\x3c\x64\x51\xe0\xfc\x2e\x1f\xd2\x86\x08\x45\x5d\x35\x45\xb7\xad\x47\xd5\xb0\x7a\xa4\xb5\x68\x7d\xea\xa1\x0a\x3a\xc9\x48\x73\xff\xd3\xba\x42\x55\xa2\x94\xf0\x71\x1c\x25\x55\x0c\xd0\xcd\x10\x2b\xd3\x94\x1b\x3e\xae\x44\x83\xdc\x38\xf6\xa3\x14\xb2\x3b\x60\x5f\x89\xa6\x85\xb5\x13\x4c\x95\xf6\x29\xa9\xb4\x71\xec\x91\x02\x95\x4c\x3e\x42\x1a\xfa\x49\x35\x00\xc4\xe5\x8c\x0a\x56\xa6\x10\xa9\xe9\xa5\xa4\xd1\x77\x06\x63\x2c\x7c\xdf\xb2\xfb\x1d\xdb\x6d\xb5\xd2\x42\xa7\xe9\x14\xfb\x5d\x56\x09\x7d\x56\x86\xb5\x50\x00\xab\x95\x83\x75\x85\xf3\xb3\xd6\xf0\x04\xaa\x0f\xc9\x5c\xdf\x6f\xcf\x63\xf4\x88\xe3\x40\x88\xd8\x45\x20\x56\xa1\x5c\x78\x06\x36\x40\xe3\xe4\x89\x13\x2f\xbf\x4e\x4d\x14\x69\x7f\x59\xaf\xd7\x51\xad\x76\x4b\x3b\x2e\x8d\xbe\xb7\x5a\xad\xb6\xe8\x76\xba\x38\x30\xc0\xa7\x26\x87\x2d\xd7\x4e\xe2\x4b\x8b\x97\xdf\x8a\x28\x63\x9c\x36\xa0\x04\xc1\x92\xd7\x5c\x47\xe6\x1b\x51\x83\xe5\x73\x29\xcd\x92\x57\x0a\x15\x51\x1d\x17\x71\x10\xf6\xaa\x7e\xa7\x73\x62\xe2\xd8\x7d\x99\x23\xdd\x10\x5e\xba\x1b\x85\xbe\xe5\x77\x77\x0a\x27\x0e\x9f\x2e\xba\x79\x99\xde\xb8\x71\xfd\xf8\xc2\xb5\x1b\x6f\xab\x15\xab\x55\x44\xed\x62\x2b\x00\xc1\x59\x70\xf8\x87\x7b\x7e\xf7\x61\xcc\x4e\xb0\xff\x89\xaf\x76\xaf\x63\x4a\x5d\x02\xd6\xe1\x70\xab\x3e\x31\xf6\xb4\xca\x59\xd7\xe1\xc4\xd3\x8e\xd3\xbf\x15\x27\xd2\xf0\xbb\x32\x4d\x47\x9c\x81\x11\x07\x69\xa7\xc8\xca\xe6\xd2\xd0\x0b\x68\xfe\x1e\x78\x7a\x09\xa4\x16\xb1\xb0\x91\x32\x25\x8c\x5d\x65\xa7\x4a\xab\x7a\x52\xc3\x49\xf3\xa1\x52\x8b\x4a\x99\x4a\x7e\x36\xf3\x60\x22\x3e\xb1\x37\x19\x27\x0c\x7e\x82\x73\xe4\xb5\x3f\x30\x79\xd0\x2a\x8f\x16\x13\x88\x91\xf9\xc5\x17\x9f\x7f\x5b\x9e\x7b\xf3\x88\xa6\x46\xf6\xac\xc2\x50\xed\x9c\xb0\x9d\x76\xaf\xd7\x43\x0a\x48\x91\x1d\xec\xfc\x95\x2b\x6c\x62\x68\xd2\x9e\x39\x38\x1e\x6f\x6f\xac\x0f\x83\x15\x28\x63\x19\x9b\x38\xaf\x2b\x85\x2b\x18\xf8\x83\x51\x17\x18\x60\x77\xbb\x28\xac\xd3\x97\x90\x29\xb3\xb9\xa9\x39\xaf\x5c\x2f\xc8\x8c\xfa\xd5\xf5\x3c\x3e\x37\x3d\xeb\x35\xb7\x3b\x82\xe7\x45\xba\xb9\xb9\x3e\x2c\xdb\xfe\x5d\xb3\x47\xce\x30\x54\x83\xab\x4e\x4e\xbc\x98\x1b\x1b\x3a\x8f\x06\xbc\xdd\xea\x80\x99\x72\x79\xa1\x9a\xa7\xa6\xf2\xca\xd2\xd2\xd4\xfa\x95\x6b\xef\x7c\xe8\x9e\x47\x33\x25\xb1\x30\xce\x39\x37\x21\xab\x63\x9b\xbb\x2d\x46\xc9\x07\x98\xde\x4a\xb9\x4a\xed\xc1\x95\x9b\xd7\x8f\xcf\x4e\xcd\x61\xd5\x89\x21\xb9\x90\x3b\x32\xf2\x24\xaf\x55\x2e\x21\xaf\xc6\xea\xda\xba\x58\x59\x5b\x23\x1c\xe6\x89\x03\x47\x09\xee\xb8\x78\xf1\xc2\xa9\xe1\x32\xb8\xda\xda\x30\x55\x8c\x44\xb5\xf2\xb2\x2a\x57\x36\x90\xbf\x62\x7b\x77\x87\x6f\x6c\x6e\x19\x05\x08\xae\x46\xeb\x63\xf8\x3c\xd3\x85\x8b\xe7\x4e\x0f\x55\xea\x1e\xae\x6b\xcc\x1b\x63\xcf\xb9\x80\x3e\xa8\xd1\xea\xa0\x8e\x84\x26\x93\x03\x4b\xe0\x15\xdd\x04\xaf\x29\x68\xb7\xe6\x8e\x42\xc6\x8c\x55\xc4\x1c\x82\x27\x2a\xe5\x6b\x38\xf5\xdc\xe9\x74\x59\xbb\xdd\xe2\x9b\x5b\xdb\x02\xc7\xa8\xc0\x71\xf0\x91\xf2\x88\x35\x3b\x3d\xcd\x59\x5e\x26\x5b\xeb\xab\x63\x49\xa7\x73\x2c\x37\x93\x47\xf6\x4b\x0a\xbc\xfc\x42\x79\x29\x53\x9d\x5d\xbc\x7a\xe9\xf8\xca\xb5\x4b\x7f\xad\x5e\xac\xbc\x7e\xcd\xbe\x25\xf2\xbb\x6f\xf9\x66\x6b\xb6\x5a\x1b\x69\x96\x27\xa7\xbf\x92\x16\xf3\x97\x91\xbb\x63\x65\x75\x15\x0b\x47\xb6\xd2\xfa\x66\xbc\x5c\x29\x11\xe5\xa7\xdf\x6e\xce\x1f\x9a\x3d\xcc\x30\x90\xc2\xaa\x4c\x7e\x62\xe2\x53\xcc\x71\x1a\x08\xde\xbb\x7e\x73\x41\x75\x7b\xbd\x54\xb8\x42\x76\xfc\x7e\xd7\x72\x44\x6f\xb8\x52\xab\x7a\xdc\xaa\xc0\x3a\xee\xa7\x16\xdb\x59\xab\x46\xaf\x58\x44\xaf\x4e\xc4\x24\x84\x31\x32\xb3\xa7\x52\x13\x33\x68\x86\x3a\x4b\x0c\x98\x86\x94\x45\x7d\x5e\xd4\xcb\x45\x3e\x19\xc3\x99\x9e\x1a\x64\x29\xb9\x55\x9a\x5f\xc5\x2c\x9b\xf6\x04\x62\x99\x10\x2c\xd7\xb5\x7a\x1c\x32\x65\x86\xa3\x6a\x1c\x99\xf0\x50\xe9\x04\x36\x4e\x75\x68\x4c\xbc\xeb\xed\x8f\xab\xc5\x5b\x2b\x0a\xb1\x58\x94\x95\x13\x51\x0a\x51\xa1\xea\xa9\x03\x74\xec\x08\x76\xa3\x76\x2c\x04\xb7\x48\x73\x8c\xce\x1c\x7e\x68\x43\x5a\x8b\xd3\x50\x9c\x12\x1b\x4d\xd4\x43\xb2\x1b\x16\xf5\xab\x15\xd8\x38\x54\x42\xe7\xbd\x20\x08\xdb\xfd\xae\xdf\xed\x63\xd9\x2f\xc8\xc5\x69\x02\xae\x5e\x0a\x9d\xd2\xa7\x21\xf3\x3f\xef\x8c\x1c\xfb\x71\x97\x35\x5f\x64\xd3\xc5\x84\x85\xc5\x51\xc8\xcc\xe1\xd8\x9e\x45\x21\x7e\x04\x7b\xa8\x0f\x47\xea\x74\x9a\xec\xc6\xd9\xa7\xa3\x85\xb3\x5f\x5c\xab\xd4\x0a\x37\x4f\x9c\x3e\xd1\x9a\x18\x1d\xef\x1e\x9c\x9e\xee\xce\xcf\xcc\x85\xe3\x23\x23\x69\x29\x0f\x06\x0b\xa9\xf1\x71\x2c\x4f\xe9\x67\x5a\x2c\xe5\x19\x66\xaa\x18\xa0\x47\x71\x42\x12\x41\xa4\x48\x4a\xf8\x04\x08\x52\x2c\x42\x9b\x31\x1a\x8a\x20\xd0\x9a\xa4\x04\x99\xc6\xcc\x73\x1e\x5b\xbc\xbd\xcc\xde\xfd\x8e\x77\xba\x27\xef\x7d\xa0\xfc\xe2\x53\x5f\x8b\xcd\x88\x8e\x60\x46\xdc\x47\xe2\x9c\x3e\x38\xf6\x37\x12\xcb\xf8\xd6\xfe\xec\x3c\x35\xce\x3c\x73\xe8\xa9\x16\x62\x6a\xa6\xfd\xfe\x6b\xe1\x95\xf3\xa7\x73\x0f\x7f\xe4\x14\x6c\x6a\x88\x2a\x77\xc0\x60\xec\x6e\xd1\x5c\xf9\x50\xbd\x4e\x65\x77\x2c\x29\x64\x7a\x0a\x3c\x43\x17\x69\x86\x1f\xc8\x74\x62\x36\x7c\x78\x9c\xb1\x43\xf0\xd8\x91\x8e\x03\x2f\x48\xe8\x06\x8c\x84\x08\x25\xb5\x95\x8e\x5e\x1c\x8b\x14\xcc\x90\x90\xc6\x85\x14\x1d\x89\x4a\xb0\x1c\x81\xb7\x19\x9d\x37\xb1\xcb\x62\x49\x3e\x86\x75\x12\x69\x06\xe6\x70\xbb\x2f\x0e\x54\x2b\xf6\xf1\xbb\x90\x74\xa3\x03\x81\x32\x0e\xa6\x61\x73\x25\x25\x90\x20\x62\xc8\x30\x90\xa4\xb2\x2a\x91\x63\x73\x1a\xe8\x03\x1b\x04\x2f\x04\x72\xda\x9c\x48\x8d\x48\x17\x17\xcf\x46\xb3\x8b\x71\x99\x29\x3c\x61\xc5\x58\xe1\xda\xd3\x99\x9b\x92\x44\x23\x4f\x5c\x9b\xf0\x1d\x06\x01\xda\xe9\xa5\x64\xd0\x2d\x2b\x83\x38\x20\xa5\x08\x16\xba\x50\x28\x46\x68\xd9\x53\x42\xca\x6b\xfd\xe9\x81\x48\xb7\xb5\x57\x80\x35\x2a\x75\x06\x38\x67\x18\xed\x34\x17\x85\x46\xa3\xa2\xa2\x1a\xe4\x09\x71\xc2\x6d\x48\x24\x50\x74\xa5\x04\x51\x5d\x09\xde\x57\x86\xb7\x17\xe1\x03\xf2\x0c\xa5\x66\x2c\x3d\x84\xdf\xed\xb5\x79\x75\xb4\x94\xbc\xfd\xb1\x47\xbf\xf8\xa5\xbf\xf8\xca\xa9\xaa\x71\xbc\x13\x63\x93\xeb\xc5\x61\xef\x69\xd3\x2f\xc8\x77\xbb\x60\x64\xda\x6d\xde\xed\xb4\xd0\x30\x28\x83\x10\xe3\x83\x19\x1b\x49\xe0\x4e\x1c\x2c\x11\x8e\x03\x61\x1a\x3c\x99\x6a\xb5\x84\xd7\x6a\xb5\x1a\xcd\x93\xa7\xf6\xd8\xde\x98\xe5\xa9\x8b\x70\x0e\x5e\x0f\x0c\x9a\x63\xe9\xc6\xd2\x68\x6d\x04\x03\x6f\x7e\x6b\x69\xe1\xa4\xe7\xba\x39\x34\x4a\xb4\xe8\x6c\x75\x03\xf7\xa2\xdf\xeb\xa6\x79\x2f\x97\xcb\x97\x1d\xd6\x6a\xb5\xea\xdf\x78\xe1\xa5\x0f\xd6\x2a\x55\x86\x99\x3c\x38\x70\x76\xe5\xe6\x25\x1c\x55\xa4\x8c\x10\xfb\x8f\x68\xec\x71\x6d\x61\x94\x8e\xa5\xdc\xf9\xf9\x83\xd7\x67\x66\xe6\x96\x47\x27\xc7\x5f\x33\x43\xd2\x0e\x7c\x09\xaa\xc2\xad\xc7\x6e\xd4\x94\xba\xb2\x4e\xee\xd5\x50\x98\x9a\x01\x02\x6e\x90\xfd\x06\x0b\x42\xcf\x57\xf3\x84\x6a\x0e\x61\xbc\x42\xb0\x57\x1e\x3d\x0c\x5c\xb2\x29\x42\x7d\x39\x2c\xd4\xb2\x5b\x72\xf2\x85\xbc\x68\xf7\xda\xaa\xd3\x6d\x6b\x1c\x8c\x96\x10\xe1\x46\xf6\x9a\x73\x43\xfb\x4b\xa2\xa6\xca\x16\xc3\x95\x11\x3e\x39\x39\x21\x9d\x22\xd6\x8c\x98\x38\xff\xdc\xd3\x8f\x7b\x4a\xcc\x17\x0a\x05\x72\x12\xc5\x5a\x75\xd5\x1d\xa9\xbd\x88\x21\xc7\xfa\xfa\xba\x20\xa1\xa6\x7d\xfb\x15\x33\x34\x3c\xff\xe5\xa5\x9b\xf3\x08\x6c\x74\x89\x32\x57\xe2\x78\xd0\x2a\xde\x9b\xcd\x8d\x6d\x8e\x65\x66\xfc\xd8\x6a\xa1\x62\xcf\x4e\xcd\x30\xb7\x84\x3c\x43\x92\x79\x9d\xe4\x9d\xae\xb2\x0e\xfa\xae\xfc\x4a\xea\x89\x05\xc8\x0e\x71\x54\x29\xbd\x79\xfe\xfc\x03\xf7\x1c\xba\x1b\x0c\x65\x09\xde\x5b\x5c\x08\x4a\xce\x2b\x58\x66\xec\x35\x03\xbb\x50\x2b\xc6\x04\xc4\x04\xe3\x76\xfe\xb9\xaf\xbf\xbd\xb7\xbd\x7d\xe2\x81\x33\x0f\xeb\xcc\x13\x3e\x2f\x71\xc4\x4d\x08\x98\xd2\x46\xbb\x8d\x59\x3c\x55\xc5\xea\xc5\x3a\x04\x0a\x56\xd8\xef\xf5\xbc\xb0\xd1\x3c\x34\x0b\xc7\xc6\x65\xc0\x73\xa2\x1d\x95\x4b\xaf\xa1\x71\x7f\xed\xd2\x25\xcb\xf7\x03\x32\xc7\xd5\x7c\xcd\x2a\xd6\xf3\xd8\x00\x65\x8d\xdb\x8b\xf7\x3d\x78\xea\x41\x32\xe4\x16\x66\xda\xe0\xd0\x71\xd3\x2e\xdd\x5a\x12\x5d\xc8\xce\xb3\xfb\x50\xcd\xd7\xad\x72\x2d\x17\xe1\x43\x6b\x2d\x2f\x3d\x70\xef\xb1\x7b\xf5\x2c\x31\x06\x18\x79\xf7\x35\xc4\x56\x6d\x6f\x6d\x65\x53\xd9\x7c\xb8\x54\x43\xd8\x0c\x04\x42\xab\xe3\x36\xb7\x3c\x0c\x68\x31\x90\xe7\xb6\x08\x65\xde\xbb\x8a\x8b\xf4\xd6\xad\x45\x1b\x47\x98\xc0\xda\xf0\xf1\xd2\x90\x98\x9c\x98\x54\xc5\x5a\x8e\x54\x94\x77\x37\xd7\xc7\x97\xcf\xbf\xfa\x9d\x63\x23\x13\x2c\x00\x27\x8d\x99\x98\x55\x2e\x3d\xe5\xd8\x16\x29\x19\xb5\x9b\x3b\xd5\x8b\x2f\x3c\xf3\xa1\xbf\xca\x9a\x9d\x3d\x70\xe8\xf2\xf4\xcc\xc1\x85\xfa\xf4\xdc\x2b\x99\xc0\x05\xea\x00\x94\xdd\xbc\x68\x85\x11\x2d\xc6\x6a\xae\x0c\xc1\x94\x1d\x05\x7e\x3f\x97\x06\xfe\x3c\x96\xf0\xa9\x02\xea\x38\x17\x23\xdb\x69\x40\x10\xc2\xaf\x5d\xbb\x8e\x12\xa7\x0a\x47\xa9\x84\x56\xd5\xe6\x8d\x56\x03\x72\xbc\xe0\xb6\x5b\xce\xfb\xb9\x6a\xde\xb7\x3d\x27\xad\xd8\x36\xe1\xec\x6c\x9c\xf0\x61\x5a\x00\x06\xcb\xdd\x36\xd8\x28\x64\xd4\xe3\xd4\xdf\x15\x44\x82\x83\xf3\xe0\x44\xe0\xa2\x39\xac\x0d\xb3\x2b\x39\x59\x74\xde\x52\x11\x91\x0e\x66\x9b\x02\x19\x3f\xf4\xb0\x3a\xce\xc8\x26\x09\x47\x02\x29\x0f\xae\xb9\x85\x53\x11\x10\xf9\xc3\x02\xe2\x2e\xcd\x0a\xdb\xfc\x1f\xfc\xe0\x0f\x8b\x5e\xa7\xaf\x8a\xe0\xb4\x1c\xc7\x35\xce\x1c\x6b\x69\x9a\x90\x8a\x1c\xba\x11\x64\x11\x74\x6e\xc2\xd0\x3a\x2a\x56\x81\x00\x60\x65\x75\x59\xfd\xa7\x9f\xfd\x7f\xd8\xd1\x43\x47\xd4\xe3\xef\x78\x07\x3b\x30\x77\x40\x95\x20\x3b\xa6\x4a\x1f\x04\x61\x18\x04\x15\xbd\xbc\x1c\xaa\x56\xa3\x91\x7a\x3d\xd8\x6d\xee\xf6\x21\x48\x2e\xc4\x49\x92\x43\x80\x30\x5a\x5b\x51\x12\x49\xd0\xdd\x08\x4e\x9f\x29\xb8\xbb\xb7\x8e\xb1\xd6\xee\x36\x3b\x32\x83\x38\xda\x88\x45\xfd\x88\x38\xdd\xfb\x51\x9f\xad\x9c\x7f\x21\xbd\xfa\xf4\x17\x56\xf2\x65\x6f\xe1\xd0\xd1\xb9\xd6\xe8\xd0\x48\x6f\x6c\x78\xa4\x3f\x35\x36\xee\x8f\x0f\x8f\x46\x43\x95\x5a\x9c\xf3\x0a\x64\xb2\x71\x76\x1e\xce\x9b\xb7\x3b\x6d\x76\xed\xda\x35\xf5\xc7\x9f\xfd\x2c\xbb\x78\xf1\x02\xfb\x37\xff\xf2\x27\xd8\xe1\xc3\x47\x58\xb3\xd1\x60\x54\x79\xc0\xd1\x3d\xcb\x90\x92\x1a\xde\x4b\xaa\xd2\x22\xa6\x50\x48\x92\xf3\x46\x03\x85\xfe\x6f\x61\x69\x95\x7d\xe2\x3f\xfd\x74\xf5\xbd\xef\x79\x57\xa7\xdf\xed\x4a\xa6\x55\xb8\xe4\x9e\x86\xef\x9b\xe8\xa1\x1f\xfc\x3f\xe0\x43\xbe\x70\x87\x43\xc7\x68\x20\x20\xaa\x39\xed\xd8\xa9\xb3\x12\x06\x67\xbb\x3b\xaf\x3c\x9a\x5b\x7d\xdb\x01\x76\xea\xd8\x24\xfb\xc2\xf5\x65\xf6\x63\x6f\x39\xc6\x22\xa3\x85\x8e\x9c\x35\x99\xfc\x75\xc6\xb3\xcd\x8d\x78\x18\xce\x9a\x37\xa2\x16\xfb\xb9\xef\xfc\x28\x7b\xdf\xfb\x1f\x67\xdf\x46\xd9\x3f\x1b\xdd\x52\x7b\x04\x2b\xfb\xe8\x4a\xf6\xff\x0e\xd6\xda\xaf\xfc\xea\xef\xb0\xdf\xf9\xd4\xcf\xca\xce\x76\x4a\x84\xf8\x38\xba\x97\x90\x44\x96\xa1\x82\x23\x36\x4f\x84\xad\x69\x16\x55\x44\xec\x23\x09\x2e\x02\x31\x19\x81\x12\xa8\x84\x43\x60\x0d\xf0\x55\x24\x65\x47\xde\x4c\x13\x21\x11\x7b\x1c\x55\x08\x54\x4a\xce\xda\x31\xe3\xe8\x5c\xcf\x8e\xe9\x39\x71\x41\x1c\x41\x38\xd6\xc6\x8d\xd0\xb6\xd0\xb4\xa3\x14\x64\x33\x1a\xc1\x62\x66\x98\x53\x63\x06\x07\xba\x50\x59\xd5\x8a\x50\xf1\x52\x33\xc1\x99\x0c\x9d\x0f\x94\xf8\x0c\x59\x34\xce\x0a\x27\x61\x6a\x25\x51\xe2\xca\x28\xce\xcb\x38\x84\x57\x54\x82\x48\xb8\x08\xe7\x92\x87\x4f\xcc\x09\xe4\x61\x30\x2c\x38\xb1\x1f\xc0\x96\x4a\x61\xa1\x35\x46\x60\x03\x31\xd4\x3c\x47\xe3\xea\xe5\xf9\x75\x5b\x24\xce\xd6\xe6\x06\xdb\xdd\xd9\x66\x18\x4d\x67\x43\x6a\x79\x2f\x6b\xbd\x12\xf1\x39\x37\x7c\x85\xba\x24\xad\x59\xd1\xd9\xc4\xf0\xb4\x28\xd6\x54\xba\xbe\xb9\x31\x01\xf7\x73\x0c\x89\x3d\x70\xc7\x5b\xe0\xa0\x73\x9e\x44\xce\x77\x27\x8d\xdb\xa2\x90\xc3\x47\x22\xf8\xf8\x78\x89\x79\x5e\xea\x75\x5a\x8d\x83\xd8\xbb\x34\xad\x03\xe6\xe4\x92\x75\xee\x48\x27\xec\x6d\xdb\x15\x8f\x59\x79\x47\xaa\xb6\x0c\x4a\xba\x3f\x69\x31\x04\x89\xe5\xf3\xe8\xec\xfa\x0c\x51\xc2\x38\x22\x75\x70\x7e\xf6\x12\x38\xd2\x0e\xae\xb3\xf1\xf1\xd1\x95\xfa\x50\x6d\x7b\xdf\xe2\x70\x07\x7a\xd6\x8c\x0d\x7b\xa1\x3b\x64\xe5\x92\x57\x99\x97\xb4\x32\xfa\xde\xcc\x79\x67\x62\xe9\xd9\x74\x38\x3e\x1b\x2c\xb3\xcb\x18\x15\x1f\x24\xf6\x02\xad\x94\xa7\xa8\xb9\x67\x45\x3c\x71\x20\xe0\xb4\x12\xe4\xfe\x0e\x05\x9b\x9a\x9e\xab\x7a\x79\xc7\x44\xc3\x35\x1e\xf6\x63\x6c\x45\xf0\x4e\xb7\x29\x9b\xbd\x96\x32\x72\xa4\x18\xf8\x58\xb5\x62\x4d\xc0\x7d\xe7\xa5\x72\x49\xba\x65\x44\xd8\x49\xd6\xdc\xd9\x1a\x59\xb8\x78\xe9\x31\x97\x3b\x23\x58\x4c\x43\x90\x5b\x7d\x64\x78\xb5\x7e\x70\xea\x0b\x4a\x46\x6c\x6d\x63\x83\x35\x1a\x5b\x7a\x00\x40\xed\xc9\x82\xba\x2e\xb2\xe7\x46\xe9\xee\xc6\xc6\xe4\xfc\xf8\x1c\x65\x31\x52\x89\xd0\x4f\xa3\xcd\x34\x4a\xd9\xee\xf6\x0e\xaf\x96\xea\x7c\x7c\x78\x4c\x95\x86\xf2\x01\x02\x36\x5b\xbb\x9d\x72\x31\x64\xef\x76\x1c\x6f\xa4\x07\xd9\x49\xcf\xb2\x6e\xb1\x40\x24\x0a\x1c\x5c\x6b\x73\xa7\xd2\x6b\xb6\xa6\x10\xcf\x80\x4e\xba\xc3\x83\x97\x03\x3f\xc4\xf9\x20\x86\x83\x1d\xf0\x3d\xbb\x7d\xf5\xe2\x7d\x4b\x57\x2f\xdf\x97\xc4\x91\x37\x52\x1f\xa6\x35\x34\x18\x31\xe3\xec\x1a\x38\xa1\x64\x63\x6d\x03\x6c\x44\x44\x55\xdb\xda\x58\x15\xb3\xf1\x74\xf1\xd2\xf9\x13\x43\xf0\x7e\x2c\x51\x23\xae\x22\x72\xac\x97\x60\x9d\xa6\xdb\x3b\xbb\xbc\xd3\xee\xf2\xac\x92\x37\x31\x32\x4a\xe5\x8e\xa5\x2b\x17\x4e\x43\x76\x5b\xc1\xe3\xe3\xfb\x63\xd7\x7e\x09\x47\x66\x30\x33\xef\xb4\xda\x2a\x13\x7c\xb1\x21\x0d\x9d\x1b\x9f\x42\xa7\xa2\x96\xae\xbc\x76\x66\xb4\x3a\x52\xc1\xcf\xa0\x40\x3f\xe7\xbd\x88\x02\x9a\xcd\x46\x53\x75\x5b\x6d\x2b\x3b\xd1\x7a\xa1\x44\x86\x6a\x7b\x65\x79\x36\xe7\x79\x7a\x62\x03\xb6\x66\x62\xf1\xab\x08\x90\x86\xa0\x94\x17\x79\x9e\x4f\x8d\x4f\x08\xc8\x1c\xa5\x57\x71\xa2\xec\xa6\x2f\x5d\xba\xf0\xd0\xd6\xed\xc5\xb7\x61\x0b\x00\x9d\x79\x0b\xce\xb9\x3e\x32\xba\x54\x1c\x1a\x3a\x9b\xe1\x77\xd2\x20\xc8\xfd\x65\x6b\x76\x72\xee\xe0\xab\x5e\xbe\xd0\xc4\x4d\x39\x32\x3e\xb9\x58\x1b\x1e\x5d\x63\xfb\xe5\x67\x0c\xc0\xc2\xad\xe4\xd9\x3d\x67\x8e\x83\x33\xb8\xc4\x3b\x9d\x0e\x9f\x18\x1a\x46\x67\xc8\x17\x96\xae\x9f\xc6\xe3\xe2\xb8\x1b\x5d\x92\xe7\xbc\xec\x42\x92\xd0\x6b\xb5\x88\xe5\x29\xe7\x3a\xd8\x0e\x48\x04\xa4\x7e\x8e\xe7\x48\xd8\x1f\xd2\xcb\xe7\x54\xa1\x58\x94\xe0\x90\x28\xf0\xb3\x5c\x4e\x9d\x6f\x5d\x1a\xa6\x3e\x26\x26\x61\x44\x60\x8b\xbc\xe9\x9c\xc2\x01\xa9\x33\x17\x45\xe2\x57\x98\xa1\x53\x24\x6b\xeb\x92\xb7\xca\x68\x23\x2d\x4d\xbf\xaa\xc5\xf1\xb0\xee\x09\xd9\x69\xcf\x0f\xb8\x00\x67\xda\xb7\x7c\x58\x38\x58\x24\xd0\x44\xb1\x18\x1b\x60\x08\x31\x3a\x31\x67\x9d\x3a\x7a\x5a\x61\x55\xa6\x98\x2b\x68\x7a\x54\x52\x55\xd3\xe0\x37\xae\x79\x0a\x94\x65\x67\x0c\x70\xd4\x72\x24\xb0\x9c\xed\x38\x0a\x83\xd9\x4f\xff\xde\xef\xb3\xe7\xcf\x3e\x97\x3e\xf3\xdc\xb3\xea\x0f\xfe\xf8\x0f\xd9\x5d\xa7\x4f\xb3\x07\xee\xbb\x5f\x3c\xfa\x96\x47\xd8\xe1\x43\xf3\xbc\x5e\xab\xc3\x35\x17\x64\x00\x7b\x64\xbc\xdd\x81\x78\xb2\xd5\x6f\xc3\xc6\xec\x40\x70\x09\x41\x95\x0b\xf1\x2b\xc1\xa1\x78\xde\x0d\x97\xbf\xf8\xf1\xe0\xc4\x47\xfe\x6d\x4e\x45\x9b\x2c\xec\x35\x59\xab\xe7\xc3\x1a\xee\xb3\xad\x6b\x17\x92\x85\x57\x9f\x02\x9b\xe2\xdf\x9c\x39\x38\xb5\x0b\x41\x5a\x77\xb4\x3e\xdc\x9f\x1c\x1d\xf3\xa7\xc6\x27\x43\x70\xec\xc9\x70\xbd\x9e\x0c\xd7\x6a\x12\xcb\xfd\x98\x85\x9f\x3b\x7f\x8e\x7d\xf9\x6b\x5f\x55\x4f\x3e\xfd\x94\x7c\xfe\x85\xb3\x44\x69\x8b\xcf\xb6\x52\xad\x89\x5f\xfe\x85\x5f\x62\xa8\x51\x82\xe0\x66\x5d\x7e\x17\xc4\x0a\x37\xe8\x8b\x65\x72\x7d\x08\xcb\xe1\x9a\x9c\xcf\x71\x1d\xac\x16\xb1\xe3\xc7\x8e\xdb\x8f\xbe\xeb\x3b\xaa\x7f\xf1\x99\x3f\xda\x32\xad\x3d\xb1\x9f\x27\xea\x0d\x0e\xbd\x78\x9a\xbd\xde\xa1\xe3\x42\x0e\x75\x61\x9c\xbe\xa7\xd2\x7b\x1a\xdf\x08\x36\xd7\x5e\x0a\x9e\x7f\x66\x3a\xf7\x77\xfe\xd6\x19\x76\x19\x0c\xc0\x57\xae\xef\xb2\x77\x1d\x1b\x66\x41\xaa\x06\xa5\x76\x7a\xb8\x2a\xa5\x85\x4d\x64\x2c\x98\x59\xe3\xcc\xa4\xed\xb0\x0e\xeb\x1a\xd0\x9a\xbc\xa3\xdc\x8f\x8d\x17\x3a\x4d\x69\x9c\xb7\xa5\xb5\x07\x84\xf9\x99\x32\x18\x37\x0d\xef\x53\x99\x1e\x22\x66\xb3\x1c\x41\x6b\x0d\xbf\xc3\xad\xdc\x84\x7d\xb3\x73\xc4\x22\x67\x0f\x19\x30\xdc\x3c\x6e\x69\xb9\x05\x08\x0c\x33\x2a\x58\x4e\x6b\x16\x9b\x17\xe8\x98\x11\xfc\x41\xc8\x67\xa1\x19\xdb\x18\x66\xde\x42\x2b\xad\x61\x46\x4d\x4a\xf4\xba\x2e\x4f\xde\x19\x3f\x0f\xc7\xfb\xe9\x57\xc8\x83\x98\x4a\x12\x6d\xc1\xd2\xbe\xd4\xda\x00\xa4\x10\xae\x67\xd3\xc5\x40\x64\x4d\x3b\x70\xcd\xf0\x96\x89\xca\x10\xa1\x8c\x34\xd3\x7e\x86\x84\xc6\x48\x35\xe8\xa0\x58\xa3\xad\x8d\x96\xa3\x34\xc4\xa5\x9a\x6d\x2e\x92\xb1\x1d\xa6\xa1\xe7\xcb\xb0\x10\x26\x56\x29\x91\x56\x01\x19\xd3\xc0\x78\xe7\x21\xf7\x77\x95\xd0\xaa\x6a\xf8\x37\xe5\xca\x30\x5c\xb1\xa3\xd6\x37\x76\xe6\x91\x33\x00\xc1\x76\xe4\x78\x5d\x6b\x15\x05\x85\x3b\xbe\x8f\x05\x21\x09\xa9\x66\x96\x8e\x1b\x99\x31\x72\xe2\x08\x77\xd1\x8b\x48\x0d\xb2\x4e\x32\xc2\xb5\xfa\x38\xdc\x65\x97\x5d\xbf\xb9\x7c\x1a\x67\x9b\xb3\xe3\x0a\x97\x2f\x80\x9b\x16\xcd\x66\x0f\x95\xcd\x89\xc7\xc0\xf1\x4a\xc2\xab\xe4\xe3\x20\x08\xf2\xbb\x3b\xed\x43\xa7\xe6\x47\xb2\xbe\x72\x28\x1c\xbe\x0b\xf7\xc1\xea\xf5\x7c\x12\x22\x8f\xfd\x94\x4d\x8e\x8f\xef\x1e\x3f\x71\xf8\xd5\xdd\xcd\xe6\x3d\x98\xc9\x23\x60\x68\x6c\xaa\xf2\x27\xcc\x96\xdb\x77\x44\x7e\x7b\xc8\x68\x0a\x23\x65\x22\xbd\xa8\x9f\x1e\xcf\xf1\xe2\x09\x88\xd8\xca\xcc\x4e\x5e\x84\x9f\xbc\xca\x63\xb7\x6e\xe5\x54\x6f\x6f\x0c\xc3\x08\x64\xf0\x81\x88\x8b\xa6\xfb\xb5\x48\x6f\x1a\x3c\x5d\x62\x81\x3d\xb0\x90\x6d\x4d\xc1\xcd\x85\xe3\x5a\x76\x92\x12\x23\x1c\xd8\x42\xee\xe5\x0a\x6e\x21\x6f\xd9\xed\x76\xb3\x1c\xb4\xfd\xf9\xd1\x99\xf1\x73\xf9\x82\xc5\xf2\x85\x8a\x1a\x19\xab\xf0\x01\x14\x43\x97\xc9\x12\xb5\x2f\x52\xf5\x3b\x9d\xf2\xea\xad\xdb\x27\x36\x97\x57\xee\xa6\x26\x4e\xaa\x81\x97\x93\xd3\xb3\x0b\xa3\x87\xe6\xbe\x24\xe1\x69\xac\x6f\xae\xa7\xcb\xab\x6b\x5c\xe9\xfa\x75\xa6\x38\x63\x60\x2a\x09\x11\x5b\x85\x7e\xe0\xe2\x6c\xb8\xd9\x47\xed\x34\x8a\x88\x41\xea\x9e\xbb\x4e\xa7\x03\xfe\x7c\xc8\x90\x5a\xeb\x6b\xa7\x8a\xd2\xf9\x6b\x09\x38\xa3\x46\xaf\x8b\xbd\x8f\xaf\x31\xe9\xf6\x51\x24\xa7\x52\x2b\xcb\xf5\xe5\xa5\x29\x9c\x2f\x47\xd4\xb4\x2e\x59\x13\xd4\x55\x42\xb0\x58\xe9\xed\xee\x1c\xbe\x75\xf3\xea\xfd\xbb\x8d\x5d\x0f\x11\xda\x9c\x64\x29\x53\xcd\xb1\xad\x35\x8e\xda\x21\x93\xb7\x91\xf8\xa3\xb1\xbd\x8d\x1b\x87\xd9\xdc\x61\xe5\x42\x01\x49\xb5\x55\x6f\x67\xfb\xf0\xbd\xc7\xee\x36\x2d\x38\x11\x46\xb6\xb8\x8e\x3f\x5f\x5b\x59\xe1\xc2\x18\x81\x92\x5b\x12\xe5\x92\x87\x38\x2a\xb5\xb5\x74\xf3\xfe\x7b\x8e\xdd\x63\x1a\x51\x22\x0c\x5d\xeb\x3c\x02\x56\x36\x56\xd6\x68\x2f\xd2\xb8\x2e\xec\xab\xc3\x33\xb3\x2a\x5f\x15\x71\x07\xb2\xe2\xdd\x5b\x0b\x8f\xde\x0f\x19\x3d\x65\xbf\x96\x68\x25\x39\xf7\x02\x7d\xc6\xda\xaa\x12\x46\x59\x05\xcf\xb6\x5c\x2a\x92\xfc\x63\x7b\x67\x6b\x76\x76\x74\x12\x82\x17\x3d\xe9\xe1\xf3\xe4\x1a\x6e\xbc\x7a\xad\xa2\x86\xaa\x95\x68\xbf\x16\xd0\xda\xc2\xb5\x87\xb6\x56\x6e\x3d\x18\x85\x61\x0e\x7b\xf3\x88\xfa\x77\x1c\x9b\x55\x87\x47\xaf\xd6\x66\xe7\x9e\xc0\xf7\xac\xae\xac\x8a\x91\xea\x28\x1f\x1b\x9b\xdc\x98\x3b\x7c\xf4\xac\xdf\xd8\x7d\x38\x5b\xb3\xa5\xb1\xd1\xdf\x3a\x6e\xf1\x8d\x3d\x99\x75\xbe\x7f\xe4\x41\x13\x0d\x27\x69\x8e\xf9\xd1\x3d\x05\xdb\xbb\x17\xec\x64\x2d\xb5\xd8\x57\x23\x87\x3f\x5b\x2b\x57\x58\xd0\xeb\xc3\x39\x55\x39\x76\xfb\xba\xad\xc6\xfc\xd1\xe9\xc3\x19\x0e\xa3\xc1\x10\xb7\x10\xc5\xb2\x01\x1b\x0d\xce\x49\x68\x43\x27\x42\xdb\xb1\x7d\xd7\x71\x42\xd7\xb6\xa3\xbc\x9b\x8b\x3d\x70\xf4\x0e\x73\x64\xce\x71\x13\xc3\x3d\xad\x50\x68\x9a\x84\x94\x11\xfa\x4d\xfb\x96\x34\x5a\xb0\x6a\x40\x7a\x93\xe8\x54\xa9\x37\xce\x33\xa0\x5a\xa6\xe0\x23\xc9\xbe\x23\x2f\x0c\x56\x09\x50\xfa\x00\xd7\x0e\x96\xc2\xd1\xb3\x40\x3e\xcd\x7c\xdf\x17\x08\x62\x8e\x91\x0b\xdd\x8f\xe1\x21\x22\xd9\x8c\x44\x29\x4e\xeb\xef\x7e\xf8\xfb\xac\x56\xab\xab\x5c\x4b\x03\xc7\xc8\x79\xeb\x39\x35\xd4\x63\xc1\xe7\xa7\xf4\xf1\x75\x09\x1e\xbf\xa7\x5a\x02\xfc\xbe\x52\x2a\xb3\x27\xbf\xfe\x34\x7b\xfa\xd9\xaf\x93\x57\xc4\xba\x9f\x1f\x85\xea\xb9\x97\x5f\x64\xcf\xbc\xf0\x82\xfc\xaf\xbf\xf7\xbb\xea\xf0\xc1\xc3\xe2\xc4\xb1\xa3\x6c\x76\x76\x16\x5e\x33\x71\xa5\x50\x12\x93\x90\x4d\xf7\x43\xbf\x1b\x44\xa1\x1b\x46\x91\x1b\xc7\x11\x0e\x21\x63\xbd\x80\xad\x37\x57\xbb\x6f\x4d\xd7\xdd\x4a\x6d\x48\xf4\xb7\xd6\xd9\xed\x85\x9b\xea\xe6\x8b\x7f\xbe\x9d\xca\xfe\x8d\xb1\xc9\x89\x9d\xe1\xda\x74\x0f\x02\xd8\xfe\xf8\xe8\x58\xff\xe8\x81\xf9\x70\x74\x78\x38\x2e\x15\xc0\xdc\xc6\x89\xbc\x71\xf3\xa6\xfa\xec\xe5\xcb\xea\xda\xb5\xab\xea\xd5\x0b\xe7\xd5\xa5\x2b\x97\xe4\x56\x63\xd7\xe0\xa2\x48\x98\x84\xd6\xd0\xe7\xbe\xf8\x79\xf6\xb9\x3f\xfd\x53\xf1\xc1\xf7\xbd\x9f\xed\xa0\x40\x99\x81\xa6\x61\xf9\x30\x36\x59\x87\xe6\x2f\xd5\x42\x47\x29\x01\xb7\x2c\xcd\x81\x0f\x81\xcd\xda\xfa\x0e\xfb\xc9\x7f\xfe\xaf\xcb\x2f\x3d\xfb\x74\xa7\xb1\xb5\xd9\x1b\xb0\x80\x9b\x2c\xfd\x0d\x0e\x5d\x06\xec\xf5\x25\xf7\xc8\x38\xf3\xbe\xf9\x5a\x30\x53\x57\x56\x67\xe7\x73\xad\xeb\x2f\x1c\x71\x9f\x99\xaf\x8b\x77\x3d\x32\xc3\x5e\x39\x7f\x8b\x55\x96\xdb\xec\x91\x03\x43\x2c\xc0\x32\x0d\xdc\xe8\xf3\x17\x2e\xb0\x83\x07\x0f\x72\x2c\x83\x50\x17\x59\x73\x3a\x73\xd7\x83\x65\x85\x8b\x07\xd1\x88\x48\x1b\x0b\x97\xd0\x85\x28\x06\x4b\x7b\x88\xde\xbe\x76\x73\x81\x1d\x98\x9d\x61\x51\x18\xb1\xdb\x60\xcc\x4e\x1d\x3f\xca\x6e\x2e\x2d\x21\x22\x9c\x8f\x0c\xd5\xd9\xf9\x4b\x97\xd9\xf1\xe3\x07\x79\xff\x5a\x9d\xb5\xd7\x24\x3b\xf2\xde\x94\x40\x6d\x18\x3f\x46\x89\x74\xea\x93\xf3\x5e\x5a\x99\xca\x6b\xa2\x2f\xdc\xbb\x29\x29\xaf\x61\x86\x9e\x08\xed\x54\x89\x33\x3e\x8d\x74\x26\x8d\x56\x3d\x47\x1c\xf7\x7b\xb4\xab\x5a\x89\x99\xca\xf5\x86\x55\x4c\x18\x62\x15\xc3\x99\x86\x19\xab\x44\x28\xb4\x76\xd0\xb6\x66\x42\x30\x5c\xa1\x9c\x54\x04\x70\x74\x43\x0c\xc4\xd9\xc8\xa9\x52\x06\x4e\x4d\x73\xfd\xbd\x16\x94\xd1\x4e\x3b\x93\x29\xd4\xd3\x20\x19\xf5\xa8\xe6\xd6\xd6\x95\x26\x29\x84\x21\x29\xcd\x58\xfe\x71\x28\x47\x26\xbe\x9b\xda\xbd\x82\x72\x7b\x05\x19\xf9\x79\x96\x46\x39\xf0\x46\x1e\xfa\x66\xae\x27\x45\xa8\xda\x5b\xa8\x0d\x59\xdc\xce\xb1\x4e\xa7\x3f\x3e\x52\x1d\x36\x24\x2e\x7c\x4b\xe4\x73\x8d\x20\x0c\x45\xc2\xbd\xd8\x2d\xe5\x69\x14\xc5\xa8\x45\x09\xa2\x79\xa5\x39\x70\x14\xfd\x90\x5a\xc1\x88\xf8\xdb\xf5\x79\xe6\x9d\x02\x73\xaa\x55\xaa\x0e\x6d\x6d\xee\x1c\xba\xe7\xc4\x1c\x65\x54\xe4\xa0\x73\xde\x42\x04\xab\x72\xbb\xe9\xc3\x79\xe6\x29\x50\x2a\x15\x46\x21\x18\xf2\xd8\xd2\xf2\xd2\xb4\xa0\xcd\xab\xd7\x81\xb0\xf9\x2a\xf2\x69\xb7\x3b\x2d\x08\xce\x34\xc3\x68\x0c\x29\xb0\x03\x3f\xdb\x6d\xb4\x47\x10\xc5\x8d\x7d\xc7\xc9\xb1\x69\x58\x99\xb9\xe3\x90\x27\xb7\xb1\xa4\xca\xf6\x8d\xeb\xb7\x1a\x9d\x79\xbf\xef\x97\x7b\xad\xde\x7c\x9a\x48\xaa\x42\x78\x4e\x9b\x9c\x53\x65\xa4\xb8\x25\xf0\x91\xda\x18\x49\xda\xb4\x79\xa4\x01\x01\x69\xca\xbd\x81\x48\x1e\xb1\x6c\xa3\xf4\x01\x04\x79\x56\x1c\xa4\x0e\xa2\x8c\xe3\x38\xb1\x13\xf8\x0a\xeb\x55\xd0\xbd\x50\x5a\xca\xd6\xcb\xe7\x51\xf0\x84\x83\x63\x9a\x5e\xb8\x72\xe3\xa1\x13\x8d\x53\x0f\x4d\x4c\x4e\xaf\x3a\x39\x67\x95\x3b\x7c\x95\xb9\x62\x7b\xbf\x6c\x7c\xd0\xee\x4f\xf5\xba\x9d\x91\x0e\x64\xc2\xcd\x9d\x9d\xa9\x76\xb7\x4d\x1c\x0d\x78\x0e\x98\x15\x1f\x3e\x79\xea\xe9\xf1\x99\xe9\xcb\xf8\x07\x5b\xbb\x5b\xf1\xd6\xd6\x16\x3c\x44\x6e\x13\xda\x43\x83\x61\x74\x7c\xc0\x29\x92\x54\xd8\x87\x83\x3d\x15\xd1\x94\x42\xbb\x81\x40\xb3\xd1\x22\xb3\x0f\x47\x56\x7a\x53\x73\x88\xa7\x2e\x64\xf0\x27\x3b\xbb\x3b\x27\x6d\x61\x57\x52\x30\xa0\xbc\xd7\x66\x95\xe1\xa1\x6f\xe4\x8b\xb9\x1b\x31\xb1\xa0\xb5\xac\xe1\xa1\x6a\x0a\x46\x3f\x44\x52\x96\x17\xce\x3d\xcb\xee\x3a\x7e\x1f\x02\xd1\xbe\x37\x89\x02\x42\x97\xe3\x78\x19\x92\xb8\xe0\x38\x57\xa9\x5a\xdd\xca\xe5\x0b\x2d\x19\x46\x47\x06\xb6\xc3\xe2\xd7\x3d\x08\x73\x3a\xad\x1e\x73\xa8\x14\xc7\xd8\x38\x38\xb7\x42\x59\x44\xdb\x5b\x1b\x63\x69\x18\x8c\x61\xef\x9c\xa8\x8e\xc1\x99\x83\x63\x08\xbb\xcd\x36\x44\x23\x21\x77\x4d\x7c\x3d\x39\x34\x02\xcf\x8a\xa7\x8b\x37\xae\x1c\x09\xfb\xfd\x6a\x17\xce\x13\xf1\x18\x22\x97\xbb\xe6\xe0\xf3\x6d\x77\x54\x1a\x86\xcc\x35\x48\xc5\x7a\xa9\xca\x47\x27\x2a\x11\xee\xae\xf3\xcf\x3d\xf5\x7e\x17\x72\x42\x9c\x27\xc7\x7f\x6e\xb5\xfc\x22\x6c\xc1\x60\xb7\xd9\x54\x61\x17\xc7\x4a\x35\x80\xab\x00\xeb\xb5\x50\xb1\x63\xc8\xbe\xbc\x7e\xab\x39\x57\x9a\x3b\x3a\x30\x7a\xb1\xa5\x96\x84\x11\x33\x97\x49\x92\xeb\x6c\x6f\xdd\xd5\xeb\xb4\xc6\x77\x36\xd7\x8f\x61\xc0\x84\xe3\x72\x08\x8c\xc2\x2d\x5d\xc8\xe7\x83\x43\x27\xce\x7c\x71\x6c\x7a\xee\x0a\xae\x9c\x95\x95\x55\x0e\x0e\x9d\x0d\x95\x90\xb5\xca\x96\xed\x66\x63\x5c\xee\x5b\xb3\x9e\x14\xf7\x04\x42\x7e\x15\x1e\x5e\xb0\x27\xfc\xca\x59\xaf\xd1\x38\x11\xf8\xfd\x5a\xd0\xed\x9e\x50\x69\x3a\xa1\xd7\xac\x47\x6b\x36\x3f\x54\x5b\xe3\xcc\x55\x7e\xbf\x27\x0b\x76\x5e\xe4\x2b\x6e\x84\x9b\xc8\xef\x74\xe7\x11\x50\x48\xb7\xc1\x11\x2f\xe3\xa2\x08\xc2\xc0\xb7\x6d\xd1\x35\x74\xaf\xe0\x64\xad\x58\x80\x43\xf7\x72\xb9\xae\x97\xf7\xfc\x5c\x2e\x1f\x7a\xb6\x1b\xe7\xbd\x7c\xe2\x0a\x9b\x74\x87\xb8\xd1\x73\xb4\x2d\x41\x00\x2e\xd7\x76\x49\xf4\x1e\x8f\x47\xd9\x30\x8d\x8c\xe9\xbc\x11\x91\xef\xf8\x3e\x6d\x7c\xa4\x66\xe4\xd1\x84\x48\x92\x19\x41\x13\xc7\xf5\x06\x8a\x70\x41\x04\x89\x12\x24\xfc\xed\xde\xb6\x1d\xc6\xb1\x00\x87\x6b\x25\x98\x11\x83\x69\x38\x30\x7b\xd8\x3a\x7e\xf8\xb8\x5a\x86\xec\x5c\x77\xe1\x50\x90\x48\xfb\x26\x02\x52\x53\xfe\x63\x51\xf6\xaf\xcb\xed\x16\xf5\xf2\xf1\xbe\x43\x76\xab\x30\x5b\xfd\xf4\xef\x7f\x3a\x41\x65\x23\x0b\x35\x12\x0c\x38\x09\xed\x21\x4e\xfc\x35\x7b\x1d\xf5\xc2\xb9\x97\xe5\xd9\x57\x5e\x44\xfb\x9d\x56\x8a\x45\xcb\x42\xb1\x23\x2f\xd7\x77\x0a\x39\xdb\xc9\xb9\x5e\xbe\x98\xf7\x20\xc8\x75\x54\x84\x95\xb8\xd4\xb2\x0b\xb9\xf0\xd9\xff\xf7\x3f\xf3\x77\xbe\xef\xfb\xca\xcf\x3d\xf3\x17\xed\x4e\x77\xfb\xf6\xf8\xd4\xe4\xfa\x50\x6d\xa6\x3b\x5c\xab\xfb\x10\x0c\xf4\x27\x47\xc6\xc2\x42\xa1\x10\x3d\xfb\xec\xf3\xf1\x85\xd7\x5e\x93\x0b\x8b\x8b\x72\x77\x67\x2b\xed\xf6\x7b\x38\x43\xaf\x82\x24\xd6\x7a\x4e\x78\x1d\x0e\x31\xf6\x72\x3d\x39\x83\x59\xa9\x12\xbd\x30\x90\x1f\xff\xe4\xc7\xd8\x5b\x1f\x7e\x58\x60\xa0\x87\x78\x07\x4e\xba\xa4\xc8\xf2\x46\x02\xb6\x74\xdd\x34\xca\x25\x84\x49\x52\xa4\xd6\xef\x92\x36\xd9\xc6\x63\x47\x8e\xda\xef\xf9\xe0\xdf\xa8\xfe\xfe\x6f\x7c\xaa\x6f\xda\xa0\xfc\x9b\x66\xe8\xaf\xfb\x47\x0e\x1d\x6e\x88\x0f\x0f\xa8\x07\x4f\xb2\x67\x1c\xba\x8b\x75\x67\x95\x6e\x25\xeb\x8b\x9f\x69\xbf\xfc\xa5\xa1\xfa\x81\xb1\x22\x7f\xf0\xae\x19\xf6\xdc\x6b\xcb\xf0\xf1\x0d\xf6\xd8\xa1\x21\xbe\x41\xda\xce\x8c\x00\x72\x70\xdf\xb9\xa5\xa3\x30\x88\xda\x02\xde\x6c\xb5\xa9\x6f\x84\xad\x1a\xad\xf1\x4e\x92\x51\x8c\xac\x24\xdc\x0c\xec\x21\x52\x4c\x66\x21\xbb\x54\x89\xca\xcf\xb0\x20\x69\x30\x9f\x40\x55\xc5\x22\xb2\xb7\xc1\x46\x8f\xb9\x57\x45\x26\xb2\x54\xeb\x95\x53\x54\x93\xd8\xd5\x4a\xad\x90\x24\xc4\x7f\xcb\x75\xd2\x8d\x2b\x86\xde\x20\xe8\x73\x0c\x95\xaa\x63\xdb\x19\x0f\x8e\x50\x03\x41\x16\x25\x32\xa1\x34\xb4\xf6\x29\x21\xa2\x0d\xe7\x22\x05\xb2\x9a\x42\x41\x93\x36\xa1\xe6\xa0\xce\x9c\x8d\x66\x3a\x37\x6c\x84\x86\xcb\x9d\x82\x81\x01\x18\x4a\x9b\x62\xa1\x01\x74\xfa\xac\x0c\x4d\xbc\x51\x6a\xb3\x8c\x3a\x1c\x37\x94\xaf\x3a\x88\xd6\x34\xa6\x1a\x0b\xc9\xe5\x40\x15\xda\xec\x47\x01\xb6\x8a\xc7\x39\xf0\x88\x1e\xbc\x5c\xfc\xca\xd1\x91\xa3\x2f\x54\xa9\xcd\xf4\x9e\xa0\x8d\xeb\x95\x3c\x82\xc6\x37\x9b\x8d\xd1\xa2\x93\x27\xb6\xaf\x5c\x3e\xbf\x80\x3b\x09\x59\xc5\x8a\x95\x62\x8f\x74\x7a\x35\x7b\x23\x26\x4a\x02\x19\xe6\xe0\xf9\x39\x71\x94\xd0\x74\xfd\x40\x96\xd2\x4c\x00\x40\xf6\x80\x55\x0f\x75\xf5\xda\x95\x43\x60\xf0\xbc\x56\xb7\x49\x65\x46\xaf\x94\xbb\x84\xd1\x4e\xbf\xdb\x85\xec\x30\xe2\x46\xfc\x9d\x15\x30\x60\x80\xef\x77\x76\xb6\x47\x90\xa0\x04\x79\xce\x11\xd4\xe3\x39\x6e\x1b\x63\x22\x30\xc8\xc2\x74\x6a\x90\x3e\x86\x97\x44\x8e\x0d\x0d\xd5\xb6\xaf\x6d\x5e\x9f\x3e\xfb\xea\xb3\xec\xc4\xa1\x93\xe8\xb4\x4e\xc0\x5d\x38\x81\x59\xa7\x34\x7d\x08\x34\xe4\x88\xc8\x46\xca\xd0\xd8\xcc\xf6\x62\x50\x89\xa5\xb9\x07\x1f\xba\xff\xcb\x6e\x0e\x9c\xab\x48\xfd\x7c\x21\x6c\x09\x5d\x2d\xdc\x2f\xaa\xae\xad\xb8\x49\xda\x11\xc8\x93\x20\x92\x23\x4d\x6d\xb8\x7e\xb8\xf6\xc8\x93\x41\xe2\xc9\x18\x7e\x96\x48\x5b\xe3\x16\x19\x95\x1d\xa3\xa0\x95\x5a\x95\x32\x3f\x7c\xe8\xe0\xe2\xd5\x4b\x57\xee\x3e\x77\xf9\xd5\xf2\xed\xb5\xa5\xa9\x91\xfa\xe8\x14\x96\x44\x31\xe3\xa6\x99\x54\x0c\x5e\x21\x73\x44\x10\x14\x1a\x79\x64\x40\xc3\x31\x4e\xfc\x19\x06\x35\xb3\x07\x66\x17\x4e\x9c\x39\xf3\x62\xa1\x58\xec\xe0\x8d\xdd\x69\xed\x74\x3b\xdd\x9d\xb8\xe0\x09\x8f\x4a\xfb\x89\x06\xd2\x28\x03\xc8\xc0\xd5\x16\xc3\xfd\x29\x57\xeb\x6a\x7a\x6e\x76\xe1\xda\xc5\x4b\x23\x5f\x7f\xe1\x2b\xec\xe4\x91\x33\x2c\xe7\xe6\xde\x8d\xc7\x45\x6e\x01\x74\xd0\x78\x8f\x75\xd0\xc0\x48\x05\x71\xfe\xd0\xb1\x4b\x95\x89\x91\xb3\x78\xb1\x8b\x8b\x8b\x02\xde\x07\x26\x47\xf0\xa3\xc7\x4e\xdc\x58\x5e\xba\xb9\xbc\xb5\xb5\x3d\xf3\xb5\xe7\xbf\x8c\x7d\x4d\xb2\x16\x31\x01\x7c\x24\x52\xd2\xb6\x4f\xdf\x7b\xdf\xcb\xc7\x4e\xde\xf5\xda\x85\x57\x5f\xbe\x7f\xeb\xf6\xad\x23\x2d\x08\x22\x10\x8b\x01\x6f\x6e\x39\x96\x05\xf7\xc3\xe7\x58\xfe\xc5\xe5\x3c\x39\x31\x2a\x21\x61\x64\xeb\xcb\x0b\x47\x30\x70\xc7\x6b\x27\x8a\x61\xc7\xdb\x74\x60\x71\xf4\x20\x40\x70\xf4\xd4\x06\x45\xa8\x95\x6a\x31\xc5\x2c\x6d\x7d\x79\xe9\x88\x26\xab\xb9\xc1\xf2\x5e\x81\x0d\x4d\x4c\xb6\x6c\xe1\x62\x2b\x08\x7b\xbc\x5a\xff\x16\x33\xe9\x4a\x95\x78\xbd\xcf\xbf\x72\xf6\xc1\x76\x63\x77\xac\x00\xcf\x1a\xc7\xbe\xe6\xe6\x0e\xdf\xca\x97\x8b\xe7\x71\x0f\x6d\x6d\xac\x23\xa5\xa0\x65\x76\xa5\x1a\x2a\xd7\x31\xa7\x50\xeb\xab\xb7\xe7\x08\x68\x05\x0b\x1e\xc7\xe7\x70\x2f\xc0\x7d\xf8\xc7\x01\x31\xac\x25\x04\x08\xdc\x69\x6c\x13\x2b\x1e\xce\x88\xe3\xfd\xc3\x87\x9e\xcf\x17\x82\x43\x47\x8f\x9f\x3d\x7a\xf2\xee\xe7\xb9\x26\x5d\x61\xb7\x57\x56\xf8\xc6\xc6\x26\xda\x1a\x85\xf6\xad\x54\x2b\xa8\x6a\xad\xbe\x76\xfb\xe6\xf5\x03\xfb\xd6\xec\x3d\xb0\xc8\xee\xf9\x76\xd7\xec\x5d\xf7\xbd\xe5\x0f\x0b\x9e\x77\x1d\x49\x98\xb0\x37\x3e\x5e\x9f\x82\x4c\x9a\x27\x57\xaf\x5e\x38\x15\xc5\x61\x0e\xfb\xf1\xf4\x7c\x84\x73\x03\xcd\x59\x37\xe8\xaf\xbb\xe0\x94\x8c\x4a\xb5\xb4\x6c\x3b\xb6\x5d\x3b\x74\x8b\x39\xbf\x50\x29\xf9\x5e\x29\x1f\x15\xaa\xf9\xc8\xb2\x2d\x64\x5d\x4b\x2d\x72\xa0\x4c\x66\x74\x4a\xae\x2d\x88\x46\xc6\xb2\xa9\x67\xad\xc0\x36\xea\x3a\x1c\xf5\xca\x05\xa1\x7c\x50\xb3\x3b\xd3\x21\x26\x87\xcf\xb4\xca\x9c\xc1\xfb\xa8\x4c\x48\xb6\xd7\xef\x89\x7e\x9a\xf0\x36\xac\x4f\x3f\x8d\x59\x3b\xe8\x5b\x41\x12\x59\xb1\x24\x8e\x6c\xeb\x1f\xfc\xc8\xdf\xb3\x1a\x9d\x8e\x36\xb3\xa6\xac\x6e\x59\x0e\x11\xc9\xe0\xf3\x37\x58\x2b\xa5\x9d\xbb\xd0\x96\x46\x57\x82\x14\x04\x28\xec\x77\xff\xe0\xf7\xd3\xcb\xd7\xaf\x46\x38\x3d\x8a\xc6\xc4\xc6\x4a\x2a\x71\xe6\x1b\x41\x4d\x5d\xb1\x27\xc1\x2d\x14\x89\xd9\xed\xb4\xe2\x14\xd9\xe5\x10\xac\x26\x53\x0b\x9c\x91\xf3\xd6\xc7\x1e\x73\x20\xd3\xb7\x59\x0f\xdf\x02\xcb\xce\xb2\x52\x88\x2c\xb7\x9f\x79\xea\x8f\xa2\x5a\xad\xde\x9a\x9a\x39\x8e\x19\x79\x6f\x6c\x78\xd4\x1f\x1f\x19\x09\x47\xeb\x23\xd1\xe4\xf8\x78\x7a\xf3\xe6\x42\xf2\xb1\x8f\xff\x4c\x0a\xfb\x2a\x51\x46\x1c\x85\x6b\x2a\x61\xe4\x2d\x49\x99\x31\x74\x46\x06\x84\xe2\x91\x34\xa3\xed\x86\x68\xe6\xc5\xf3\xaf\xaa\xff\xf2\x2b\xbf\xcc\xfe\xe5\x3f\xf9\x17\x02\xd7\x38\x8e\x52\x83\x95\xa5\x7e\x39\x6d\x05\x52\xdd\x14\x46\x12\x57\xe7\x95\x04\xd0\x26\x9c\x22\x63\xeb\xeb\x1b\xec\xa3\x3f\xf1\x93\xe5\xaf\x7e\xf9\x8b\xed\x8d\x5b\x8b\x2d\xb6\x27\x24\xfd\x97\x8e\xad\x0d\x7a\xe8\x70\xa0\x3e\xd8\xb7\x36\xc4\x48\x65\xac\x8a\xc1\x43\xc3\x54\x8b\xa8\x60\xe3\xee\x0b\xfe\xf5\x4b\xa3\xce\x97\xbe\x90\xab\x78\x1f\xba\x9b\xdd\x77\x66\x96\x5f\xbc\xb9\xc9\xb6\x2f\x6e\xb3\xc7\x66\x4b\xec\x81\xbb\xce\x90\x52\x10\x3a\x66\xcc\x46\xb1\x1c\x83\x0b\x11\x41\x01\xa3\xe3\x63\xe4\xb4\x92\x54\xd3\x0d\x62\x39\x45\x58\x28\xcd\x2d\xd9\xc4\xc8\x08\x79\x15\xec\xf5\x8c\xc1\xf7\x48\xad\x09\x51\x12\xcb\xa4\x45\xa7\x27\x27\xb1\x4f\xcf\x8b\x53\x09\xcb\x4f\xc0\xe5\xc6\xa6\x77\x85\x04\xf5\x02\xe2\xc8\x34\x75\xfd\x66\xd3\xb3\x68\xdc\x00\xc5\xc2\x84\x1e\x43\xd7\x89\x58\xc6\xe0\x2a\x28\x93\x1c\x70\xbb\x69\x64\x94\x86\x36\x2b\x43\x39\xb2\xe7\xa4\xb5\x74\xaa\xd1\xea\x42\x74\xbb\x29\x83\x6b\x5e\x1f\xa6\x69\x5e\x15\xcb\xd8\x5c\x33\x84\x15\xcf\xc6\xbb\x38\xd7\x4e\x9f\x67\x08\x08\xb2\xcb\x2a\xab\xfe\xef\x11\xf7\x0c\x4a\xf3\x7b\xe0\xb8\x3d\x9a\x9e\x8c\xd0\x4c\x19\xc5\x33\xc9\x93\x40\xda\x51\x90\x82\xd3\x55\x56\x1a\x2b\x5b\x26\xe8\x84\xe1\xfb\x44\x97\xf1\x09\x00\x68\xa2\x71\xe4\x35\xe3\x89\x9e\x89\x5c\xdf\x5a\x63\x13\xa3\x53\xcc\xab\x15\x96\x91\x98\x21\x4a\xe3\x5d\x27\x9f\xeb\x0b\x2b\x1b\xa9\x57\x48\xdb\xe8\x20\x78\x44\x69\xc5\x28\x07\x71\xa4\xd2\xe0\x24\x8c\xbe\xbd\x82\x80\x80\xfe\x60\x67\x67\x67\x04\x47\x2c\x96\xd7\x6e\xd3\x08\xd0\xe4\xf0\xd4\x4d\xbc\x65\x3b\xdb\xdb\x46\x2b\xda\x74\x50\x1c\x9b\x62\x9f\x6e\xb7\x57\xc6\xb5\x80\x60\x21\x44\x74\x8f\xe7\xc7\xdb\x52\x3a\x44\xbc\xa0\x25\xde\x31\x23\x6b\xb3\xa1\xd1\x21\x75\xdf\xdd\xf7\x9e\xdb\x58\xdf\x9a\x6e\x36\x9a\x23\xcf\xbd\xf2\x9c\x96\x22\xf5\x3c\x0a\x10\x35\xeb\xa1\x06\x1a\xa1\x51\xcc\x26\xc6\x0a\x85\x7c\x78\xfc\xc4\x91\x73\xa7\x4e\x9d\x78\xd5\x40\x38\x92\x7c\x35\xb8\xc4\x8d\xfc\xb4\x18\x68\xdb\x28\x35\x40\x67\x18\xaa\x57\x52\xe4\x8b\xe1\xbe\x45\x8a\xc4\x6e\x62\x3f\x71\x23\x70\xe8\x10\x38\x3a\xe8\xd0\x15\xcb\xaa\xcc\x5c\x75\x83\x96\xaa\x14\xea\x11\xf6\x27\x1f\x7f\xf7\x3b\xbe\xf0\xdc\x73\x67\xdf\xb6\xb2\xb1\x36\x05\x2f\x3a\x3f\x08\x54\x0c\xab\x9f\x76\xe8\xc4\xbe\x27\x35\x0b\x1d\xfe\xfe\xd0\x91\x43\x97\x8f\x1c\x3d\x72\x65\x78\x78\x78\x5b\x57\x25\xc2\xb0\xd1\xdf\xd9\x09\xa3\xbe\xcc\xb9\xdc\x8b\x70\xdb\x80\x9d\x4b\x94\xa1\xcf\x52\x7b\x3d\xb3\x76\x7b\x47\x8d\x4d\x0c\xa9\xfb\xef\xbb\xff\xd5\xed\x8d\x8d\xa9\xad\xcd\xad\xe9\xed\x17\x9e\x24\x40\x6a\x06\x54\x43\x47\xa5\x09\x81\x2c\x36\x34\x3c\xd4\x9e\x3f\x76\xec\x15\x64\x56\xc3\xbf\x5f\x58\x58\x14\x7e\x57\x23\xe7\x9b\xbb\x3b\x62\x62\x72\x22\x7d\xcf\xfb\x3e\xf4\xc4\xa5\x8b\xe7\x4e\x5d\xbd\x7c\xe9\x3e\xbf\xd7\xa7\x9e\xc1\xd4\xec\xec\x8d\x89\xc9\xa9\xdb\x47\x8f\x9f\x7a\x2d\xfb\xf0\xa0\xdf\xad\x60\xe9\xfd\xc2\xd5\x57\xd9\x99\x63\xf7\xb0\x6a\x69\x6c\xcb\xb1\x90\x10\x2c\x40\xe7\x40\xc9\x49\xb9\x9a\xc3\xbe\x95\x5a\x59\x5a\x38\x8d\x05\xab\x8b\xd7\xcf\xb3\x13\x87\xcf\xb0\x4a\x75\xf2\x16\x66\x7b\x7e\x9f\x84\xe4\x06\x11\xaa\x0f\x8e\xb3\x26\x2a\xec\xe4\x99\x7b\x5f\x7a\xe6\xab\x5f\x9c\x03\x47\xea\xb5\x82\xf6\xed\xd1\xd2\xe1\xf3\xc8\xc1\x1c\xf4\x7d\x48\xee\x2d\x61\x24\xef\x31\x0b\x95\x7a\xbc\x49\x77\x22\x88\x8e\x56\xa5\x9b\xa5\xf1\xd1\x2f\x21\xd8\x6c\x7d\x63\x23\x89\x22\xa4\x1e\xb5\x06\x63\x1b\x08\x54\x43\x3b\xd4\x69\xee\x8e\x61\x70\x83\xac\x8b\xcf\x7d\xe3\xeb\x6c\xb7\xd5\xa0\x75\x6d\x9b\xcc\x93\xee\x5b\x92\x0c\xf0\x3f\xc3\xa3\xe3\x4b\xb3\x73\x07\xaf\x1c\x39\x71\xe6\x5c\xb6\x21\x1b\x8d\x26\x5f\x5a\xba\x25\xe0\x33\x70\x4d\xd2\x75\x74\xfb\x1d\x36\x61\x8d\xb2\x7b\xee\x7d\xe8\xb9\xdd\xed\xcd\x83\xcd\x56\x6b\xe2\xdb\x5d\xb3\x79\xc8\xfa\x0f\x1c\x3e\xf6\xf4\xc9\x33\xf7\x3d\x83\x0b\x13\x3f\xff\xda\xd5\xeb\x18\x58\x4b\x58\xcf\x54\xdc\x68\xec\x6c\x4f\xe0\xbe\xc1\x7b\x79\xfa\xe8\xdd\xac\x5c\xf0\x30\xd1\x92\x22\xef\xee\xe6\x44\x31\x34\xc6\x45\x81\x33\x8f\x1d\xd7\x4a\xc0\x91\x87\xa5\x4a\x31\x76\x20\x21\xf5\xf2\x6e\x42\xa5\x74\x9b\x53\x79\x5b\x67\xe1\xba\x94\x2e\xc8\x69\xe8\x9f\x65\x2a\x61\x68\x08\xb1\x6f\x9e\x69\xb8\x1b\x69\x03\xea\xb9\x9b\xb7\x68\xae\x57\x2d\xda\x92\x05\xc3\xd4\x5c\x8d\x93\x14\x82\xa2\x90\xfb\x41\x60\xc1\x75\x8a\x38\x95\xc8\x25\x43\xf3\xe8\x61\x94\x60\xf5\x47\x61\x00\x86\xd3\x0e\xda\x6c\x6a\xea\x46\x33\xfc\x31\xb0\xb4\xba\x22\x4a\x6a\x65\x0c\x9d\xf9\xc2\xd2\x82\x7a\xe2\x0b\x4f\x60\x3b\x21\xe2\xe8\xd0\x85\xa6\x76\xa4\x0a\x30\x38\x6f\x64\xcc\x84\x04\x81\x23\x67\x0d\x66\xc5\x28\x93\x41\x1a\x26\x42\xa5\x28\xe5\x04\x67\xda\xc7\x28\xa8\x5a\x2e\x83\xd9\x71\x70\x2d\xd0\xfc\xa9\x6d\x5b\x49\xa9\x50\xf0\x6b\x95\x5a\x0f\x7c\x4d\x6f\x6c\x68\xb4\x4f\x8e\x7c\x68\x38\xaa\x95\x6b\x49\xa5\x5c\x82\x4c\xbf\x44\x6a\xb3\x69\x9a\x22\x51\x28\x38\x71\x14\xf9\xa1\xd1\xa8\x04\x5d\x36\x8e\xdf\x0d\x68\xde\x8c\xa6\x25\xf2\xfa\x73\x44\x69\xe9\xc4\x95\x0a\xad\xbf\xf6\x3b\xbf\x29\xbf\xeb\x83\xdf\x25\x8e\x1f\x3d\x82\x76\x90\xae\x1b\xe9\x6e\xa5\xca\xb0\x66\x14\xd8\x68\x72\x33\x3c\x64\xaa\x73\x8e\x72\xb9\x4c\xa3\x79\x38\xb5\x52\xa8\x54\xed\xc1\x1c\x92\xfa\xf6\x32\x74\x2d\x66\x94\xa6\x90\x32\x89\x2e\x3c\xc4\x06\xfc\x25\xaa\xf8\xb8\x4c\x0f\x99\xa1\x9b\x74\xba\x9b\x9f\x6f\xbf\xfa\x52\x09\x43\xb7\xe2\xbb\xde\x7d\x52\xdd\x77\x72\x82\x6d\x35\xbb\xec\x89\x85\x16\x3f\x5e\x8d\xd4\xc9\xf1\x22\x1b\x2a\xb9\xcc\x81\x55\x84\xd9\x71\xbd\x52\x64\xd3\x63\xa3\x26\xd7\x33\xda\xd4\xf0\x5a\x23\x72\x99\x88\xcf\xce\xcc\xb0\xeb\x37\x6e\xc2\xd7\x69\x9a\x01\x85\x4d\xc9\x8e\x1e\x39\xcc\x6f\x2f\xdf\x66\x60\x34\x59\xbd\x56\xe5\x97\xaf\x5e\x63\x47\x8e\xcc\xf1\xce\xe5\x2a\xeb\xac\x29\x3e\xff\xde\x18\x01\x62\x70\x62\x0e\xce\x2d\xaa\x76\xbb\x91\x04\xbd\x6e\x8c\x60\x5a\xc8\x2e\xc0\xc5\x3b\x78\xae\x32\x4a\x42\x8e\x6a\x40\x7a\x14\x1a\x61\x34\x18\x58\xe9\xc5\x93\x2a\x2d\x44\xa7\x75\x83\x07\x02\x9b\x7c\x00\x81\xa6\x40\x4c\x18\x27\x2d\xb5\x56\x3a\x33\x72\x6d\xa6\x9b\xa5\x67\x40\xc8\xe8\x66\x49\x07\x11\x17\x1a\x05\x76\x3e\x60\x0f\xc9\x32\xfd\xec\x27\xba\xb8\x4f\xe0\x3f\x4b\x4f\x9d\x0f\x50\xef\x83\x8a\xfd\x9e\x02\xba\x9e\x71\xa3\x20\x4e\x89\x08\x0c\x52\x0c\xf6\x3a\x8a\xa5\x1b\x41\x10\x0a\xbe\x3a\x8d\x25\x49\x2e\xeb\x69\x39\x3a\x29\xe4\x26\xe5\x69\xaf\x1b\x5a\xe5\x1a\x3c\x8f\xd1\xb1\x95\x9d\xf5\xb5\x4a\xab\xd7\xde\x1a\xb5\xe7\xb7\xa2\x24\x0d\x12\xdb\xdb\x12\x22\x4f\x25\x23\xdc\xaf\x90\xa3\xda\x31\x8f\xd2\x48\x86\x2a\x44\xf0\x5d\x2c\x93\x38\x52\x16\x24\x5a\x42\xab\x11\x51\x94\x23\x1b\xed\xbe\x2a\x0d\x0f\xab\xc3\x47\xce\x5c\xd8\xd9\xd9\x1d\xf6\xbb\xbd\x99\x50\x46\x37\x94\xe5\x6d\xa0\xb6\xf1\xe6\x76\x0f\xee\x87\x6d\x02\x44\xc5\x1a\xed\x80\xe5\x2a\x35\x79\xf7\xbd\x6f\x7d\xf6\xe9\xee\x97\xca\x60\xb4\x47\xdb\x7e\x67\x79\x3c\x77\xf0\x42\x00\xdb\x6d\x7b\xd7\xb7\x83\x88\xe6\x05\x95\xbf\xd5\xe6\xf9\x52\x57\xd6\x87\xaa\xdd\xf7\xbf\xff\x6f\xfe\xc1\xc5\x4b\xe7\x4f\x41\xd0\xe0\x5d\x7a\xed\xfc\x5b\xbb\xfd\xe4\x0d\x8b\xf5\xc8\xb1\x63\xdf\xc8\x79\x6e\x34\x3c\x3c\xba\x35\x33\x3d\xb3\x42\x86\x39\x25\xea\xe9\xb6\x5d\x4e\xaf\xfa\xc2\xe9\xb1\xc4\x66\xfb\x15\x58\xd4\x40\xcd\x45\x4f\x0f\xd0\x89\xc6\xa9\x15\x86\x12\x1c\x48\x2a\xfc\x9e\x92\x7e\x57\xa9\x30\x80\xe0\x29\x92\x10\x28\x41\x86\x9e\x71\xc2\x71\xad\xd7\x7b\xad\xb7\xe8\x1f\x9c\x9d\xcf\x15\x8b\xd5\xe6\xbb\xde\xf9\x1d\x9f\xdd\xd8\xda\x1c\x59\x5f\x5b\x9d\x59\x5d\x5d\x3d\xd4\x6a\xb6\x46\x58\xb8\x77\x8e\x60\x98\xdb\x07\xe7\xe7\x2f\x61\xd6\x7e\xfa\xf4\x5d\xaf\x64\x91\x5a\xbf\x1f\xc6\x41\xdc\x6b\xf5\xa2\xb6\x76\xec\x31\x73\xe0\x7e\xcb\x38\xc2\xcf\x45\xa1\x0c\x23\x98\xbd\x17\xf9\x31\x70\x16\x6c\x75\x65\x43\x4d\x4e\x8e\xcb\xef\x78\xcf\xfb\x9f\xb8\x78\xf1\xc2\xc9\xcd\x8d\xf5\x99\xb5\x95\xd5\x01\xc5\x2c\x27\x86\xb8\xc3\x17\x47\x47\x47\xb7\x8e\x1c\x3b\x71\x91\x69\xad\x6e\xb6\xb4\xb8\x68\x35\x77\x1b\x5c\x1b\x6f\xdc\x7f\xab\x54\xa9\x9a\x9c\x9c\x94\xa7\x4f\xdf\x73\xf1\xf4\x99\x7b\x2e\xf2\x41\xbb\x9e\x0d\x22\x9e\xce\x6e\x87\x57\x87\xaa\xaa\x00\x8c\x32\x73\xcd\x54\x2e\xb7\x97\xc1\xe1\x20\x8a\x3e\x64\xd1\x6b\x4e\xc1\xdd\x44\x5d\x87\x30\x04\x27\x6d\x51\x4a\xc5\x22\x3f\x50\xc5\x6a\x51\x1d\x39\x7e\xe2\xc5\xab\xaf\x5d\x78\x0c\xa9\x63\xa5\x2b\x9e\x06\x67\xd3\xea\xf5\xfa\xb0\x58\x43\x46\xef\xd5\x5e\x53\x6e\xed\x6e\x26\x23\x23\x75\x6b\x62\x7c\x7a\xe3\x7b\xbe\xff\x47\xfe\xcb\xfe\x79\xda\x46\xab\x95\x42\xe6\xc7\x75\xcb\x90\xac\x3c\xeb\xf4\x3b\x72\x92\x8f\xb1\x7b\x1f\x78\xe4\x45\x7c\xed\x5f\x0b\x70\xfc\x74\x7d\x73\x53\xd2\xdc\x89\xa5\xd9\xdd\x70\xd8\xa3\x5c\x2b\xd3\x58\x53\xaf\xd5\x9a\x43\x86\xb7\x42\xae\x48\x4e\x76\xfe\xd8\xc9\xa7\xae\x5d\x7e\xed\x21\x08\x52\x72\xd9\x31\xe6\xe6\x0f\x9d\x2b\x95\xab\xcd\xbb\xee\x7d\xf8\xec\x1e\x3e\x57\xb1\x56\xab\x03\x99\xd2\x3a\x43\xa0\x1a\x01\x1b\xc4\x1e\x36\xa9\xd1\x6e\xc8\xe6\x6e\x8b\xd7\x87\x6b\xc1\x07\x3e\xf4\x91\x5f\xbf\x70\xfe\xe5\x7b\x31\xa3\xbe\x76\xf1\xc2\x3b\xdf\x6c\xcd\x1e\x3c\x7c\xec\x19\xcf\xf5\xfc\xe1\x91\xb1\xb5\x99\x99\xf9\x9b\xc6\x77\xaa\x6e\xa7\xa3\x16\x6e\x2e\x5a\xfd\x7e\x1f\xaf\x35\xe9\x74\x3b\x6a\x84\xd5\xf9\xf8\xc4\xf4\x8d\x5b\x8b\x37\xde\x86\x8c\x70\x1d\xbf\x7b\xa1\x62\x4d\xec\xc0\xdb\x1b\xf9\x7a\x6e\x23\x27\x5d\xb2\x0d\x42\x3b\x19\xe5\xe4\x1c\x70\xe2\x5e\x9a\x2b\xe5\x12\xc7\xb5\xd3\x5c\x0e\x41\x72\xe4\x84\x08\x78\x46\x73\xd1\x94\x33\x1b\x2b\x91\xe9\x3f\x62\xb6\x2d\xb5\x3c\x31\x92\x77\x28\x33\x5a\x93\xf9\x6e\x42\xb1\x93\x00\x1b\xcf\xc6\xd0\x07\x41\x31\x8d\xe5\x42\x30\xe4\x07\x5d\x11\xf8\x7d\x1e\x86\x01\xf7\xfd\x9e\x15\x47\xa1\xc0\xef\xc1\x81\xcb\x7f\xf5\x1f\xff\x75\x7c\xfc\xc8\x19\xf1\x83\x1f\xfe\x08\xc7\xa9\xa8\x3e\x71\xf7\xeb\x06\x98\x2e\xad\x6b\x73\x67\xca\x90\x1a\x4c\x0d\x81\x1b\x8e\xa9\xfd\xfa\x6f\xfe\x7a\x08\xf7\x02\x7d\x52\xea\xb8\x2e\x71\x3c\x49\xa1\x77\x6f\x2a\x53\x91\xd8\xa9\x20\xde\x79\x30\xd6\x28\xe4\x44\xad\x41\x48\xe2\xb5\xd4\x1d\x5e\x9c\xc0\xa9\xe3\x2e\x64\xdf\xa2\x08\x4e\xba\x90\xcb\xfb\x52\x4b\x78\xc7\xb5\x72\x25\x80\x9f\xfb\x63\xc3\x23\xc1\x48\x6d\x38\x1a\xaa\x81\x23\x2f\x95\x53\xcf\x71\x14\x56\x36\x72\xb9\x9c\xe6\x78\xb6\xed\x84\xc7\x22\x11\x28\xe6\x29\x2c\x4c\x77\x52\x7d\xcf\x69\xa4\x8e\x0a\xb3\xa9\x4e\xdc\x6c\x54\xa0\xd2\x0e\x41\x1b\x41\x74\xf7\x3b\xed\x06\xfb\xf7\xff\xf7\xbf\x4f\x7f\xff\x37\x7f\x17\x0e\x15\xe9\xc0\x51\x68\x4e\x14\xac\xfd\x62\x56\x4e\xba\x02\x82\x13\x60\x0e\xab\xd9\x23\xc3\x55\xb6\xb1\xbd\xad\xfe\xdd\xc7\x7e\x2e\xf8\xd2\x9f\x7d\xa6\xb9\xb3\xbe\xda\x1d\x24\xa2\x34\x3d\x25\xb3\x2c\x70\xef\xdf\x27\x7f\xf1\xe7\xd9\xff\xf5\x0b\x3f\xfd\xfa\xc9\x74\x74\xe0\x45\x04\x87\xc2\x6b\x1c\x5e\x63\xf0\x42\x24\x53\xd9\xc8\xaa\x52\x13\xa4\x34\xf5\x5d\x95\x63\x67\x3e\x58\x7e\xcb\x5b\xe6\xf9\x23\xf7\xcf\xb2\x6a\xd5\x85\x13\x68\xb3\x1e\x6a\xdb\xc2\x0d\x9f\x2e\xbb\xac\xec\xd9\xac\xe0\x3a\x7c\x61\x71\x81\x89\xb8\xc3\xde\xf7\x8e\xb7\x6b\x9e\x64\xb8\xf8\xcc\x00\x41\x36\xc3\x71\x76\x96\x32\x0c\x54\xb9\x4a\x12\xe2\xbf\x8d\xe0\x21\x51\xcf\x15\xb2\x8f\x00\x16\x06\x96\xcb\x65\x68\x21\x2d\x2f\x73\x4a\x04\x92\x41\x36\x2b\xfe\xc9\x5f\xfe\xd5\xed\xcf\xfd\xe1\x67\x7e\xed\x6d\x8f\xbd\x6b\x47\x67\xdb\x86\x33\x41\x57\x40\x38\x1e\x93\x78\x5a\xe0\xfb\x18\x81\x6e\x4c\x8f\x96\x65\xe2\xd9\xcc\x4c\x24\xa1\xe3\xdf\x53\xcf\x66\x5c\x6f\x5a\x9d\x21\x2b\xaa\x54\x59\x03\xc6\x50\x1d\x52\x12\x84\x9d\x65\x50\x3d\xf3\x81\x06\xbc\x4b\x70\x39\xaa\xc2\x68\xf7\x2f\xb2\x91\x72\xfa\xc6\x80\xe2\xe9\x6f\x0d\xf0\x63\xcf\x7b\x0f\xd4\xbc\xf7\x18\x4a\x95\x39\x1f\xac\x5c\x24\x7e\xe8\xfa\x5d\x3f\x17\x76\xfd\x62\xbf\xd5\xab\x44\x7e\x58\x4e\xc2\xb8\x08\x51\xa4\x87\xfc\x0d\x9a\x7f\x86\xc3\xe2\xb3\x92\xf1\xd1\x71\x39\x35\x35\xe1\xbd\x9e\x05\x30\xe1\x72\x2d\x70\xe5\x4d\xaa\x53\x71\x2a\xef\x8a\x38\x8c\x9c\xb0\x1f\x78\x51\x3f\x28\x06\xf0\x82\xe3\x16\xd3\x38\xc9\x41\x78\x8a\x99\xba\x65\x0c\x07\xa2\x0c\xe3\x63\x87\x0f\xdb\xc5\x52\xe1\x0d\xcc\x82\xcb\xcb\x2b\x72\x63\x63\x13\xe1\x65\x96\xd6\x50\x26\xf4\x42\x7a\xfc\xc8\x11\xd8\x4c\xc5\x37\x14\x85\x56\x56\xd6\xf8\xda\xea\xba\xa5\xf6\x78\x8c\xb4\x61\x9d\x9d\x95\x63\x63\xa3\x2a\x53\x89\xdf\x23\x4a\xbd\x63\xa1\xee\x51\xdf\x18\xc8\x58\xca\xd2\x8e\x74\x92\x65\xbb\x24\x76\x2d\xc7\xd2\x7d\x43\xc3\xfe\xc6\x06\xc2\x2c\x19\x60\x7a\x20\x94\xc9\x92\x28\xb6\x82\x7e\xec\x04\xbd\xc0\xeb\x77\xfc\x82\xdf\x0d\xca\x61\x3f\x2a\xc4\x51\x92\x83\x0c\xc4\x51\x48\xa4\xcd\x8c\x02\x2f\x33\xd3\xaf\xf0\x6f\x72\x62\x52\x54\xca\x55\x91\x2f\xe4\xdf\x30\xa9\xf1\xcd\x26\x38\xfc\xd0\x8f\x3b\x3d\xd4\xc5\xeb\x6e\x83\x01\x0e\xc1\x70\x60\xf5\x52\xe0\xe4\x02\xfc\x0a\xee\x7b\x54\x48\xe2\x34\x0f\x01\x95\xa7\x74\x64\x24\xf6\xc9\xbd\x93\x33\x9e\x9e\x9a\x56\xe8\x88\xb3\x8e\xda\xbe\x1b\xb1\x17\xbf\x6b\xca\x52\xde\x68\x34\x14\x38\x23\x30\xb2\xd9\x8c\xea\xbe\x79\x44\xdc\xd0\xb9\x9c\x82\x4c\x1d\x1c\x36\x4e\x22\x78\x74\xfc\x6e\xb7\xcb\x91\x4c\xa3\xdb\xed\x48\xd7\xf1\xe4\xe1\x23\x87\xc4\x9d\x6a\xa9\xfa\xdf\xe2\xd2\x22\xdb\xd9\xde\x11\x64\x88\xc1\xe0\x56\x2b\xd5\xf4\xd0\xa1\x79\xeb\xf5\xf4\xb6\xf8\xe5\xda\xb5\x6b\x69\xbb\xdd\xb1\x0d\xb8\x12\xdf\x8f\x91\x77\x9c\xcb\xe7\xe2\x99\xa9\x69\x27\x9f\xcb\x3b\xb8\x63\x20\xc3\x8b\xdb\xdd\xae\x5c\x5d\x5b\x63\x32\x4e\x5d\xd4\xff\xcd\x44\x0b\xf1\x6f\x2a\x55\x54\xb5\x9b\xb4\x20\x50\xb2\x34\xaf\x7c\x94\x40\x60\x91\xdc\x86\xb5\x47\x6b\x35\x41\x0d\x73\xca\xe3\xf8\x50\x71\xc4\x3a\x7c\xea\x40\xb8\xb1\xbe\x32\xfe\xda\xf3\xcf\xfc\xc0\xdb\x1f\x7e\x27\xad\x85\x56\xd8\xbd\x3a\x7c\xe0\xe0\x13\x7b\xd0\x4a\xb3\xe5\x06\xc2\xa9\x4c\xf5\xba\x3d\x05\xe7\x91\x34\xe0\x3e\xf4\x7b\x7d\x66\x70\x24\x42\x69\xdc\x8b\x9e\xd5\xda\x93\x4f\x63\x07\xe6\xe6\xe4\xd8\xf8\x68\x3a\x50\x08\x30\x28\xd7\x7d\xe1\xd1\x1d\x75\x21\x52\x16\x4c\x53\x0c\x12\xe4\xea\xca\x2a\x6f\xeb\x60\x21\xab\x04\x25\x9e\xe3\x05\x67\xee\x3a\xed\x81\x63\xce\xb6\xc1\x20\x6b\x60\x45\xeb\x3c\x1b\xe2\x0b\x9a\x43\x1d\x81\xe2\x42\x3a\x0e\x4a\x9b\x32\x89\x6a\x7c\x0e\xaa\x91\x61\xa9\xdd\xd6\xd9\x37\xb1\xaa\xd1\x00\x4e\xb6\xfc\x35\x95\x3b\xa1\xd8\xf7\xed\x05\xa2\x4b\x1a\x9c\xac\x0e\xed\x6c\x61\x29\xbe\xf7\x3f\xb3\x19\x75\x3a\x0f\x22\xc1\x82\xaf\xad\x6e\x8b\xef\x34\x1b\xd6\x56\x6b\xc7\x5a\xdb\x5a\xf7\x20\x18\xf3\xda\x9d\xb6\x17\x04\xa8\x15\x10\x59\x78\xef\x50\x49\xad\x54\x28\x5b\xef\x79\xfc\x7d\xfc\xbb\xde\xf7\x41\x22\x58\xc1\x9e\x32\x55\x5c\x2c\x5d\x6a\xd7\x50\x11\xcd\xf2\x54\x1f\xaa\xab\xcf\x7d\xfe\x73\xc9\xc7\x7f\xfe\x13\x1d\xb8\x3e\x48\xd6\xac\xd8\xcd\x7b\x89\xe5\xda\x92\x7a\x05\x02\xa5\x50\x13\xe4\x0c\x20\x5b\x1c\x85\x11\xca\x4b\x82\x73\x8f\x2d\x48\xea\x6c\x70\xee\x96\x8c\x13\x08\xc8\x11\xd0\xca\x9d\xff\xed\xc7\x7e\xbc\x30\x3d\x33\x9d\xdb\x6d\xb6\x88\x89\x1b\xb2\xff\xa4\x5e\xae\x44\xa3\x43\x23\xd1\x50\xb5\x96\x14\xf3\x05\x74\xf6\x29\xb5\x28\xa8\x6a\x83\xad\xe0\x3c\x7b\xf2\xe9\x67\xe4\x0f\xfd\xfd\x1f\xe9\xf6\x42\x48\x3b\x6c\x9e\x40\xf4\x8a\xb6\x15\xb3\x75\x48\xdb\x25\x05\x4b\x2c\xc3\x58\x11\x58\x87\xd9\x70\xbd\x2e\x7e\x2e\x78\x69\x6c\xd9\x21\xc0\x96\x3b\x70\xc2\x1f\xfb\x77\x1f\xb5\x7f\xf4\xef\xfe\x28\xdf\xd9\xd1\x34\xc5\x4a\x6a\xea\x57\x04\x5d\x22\x15\x2c\x56\xf2\xb0\x8a\x81\x4f\xe1\x37\x7f\xf7\x77\x92\xdf\xf8\xad\x5f\xe9\xdf\x5e\xb8\xde\x81\xe7\x1c\xc2\x7b\xe3\x3b\x46\xca\x53\xa9\xbe\x9d\x0c\x9d\x99\x3f\x42\xa4\x49\x67\x9f\xea\x9a\xb5\xef\xf7\xe8\x20\xec\xee\xea\x67\xda\xe7\x9b\xe7\xc3\xd5\xd5\xef\xae\x5c\xb9\xf1\x16\xef\xbe\xbb\xa6\xd8\x89\x43\x35\x36\x33\x3d\x46\x23\x5e\x6b\x41\xc8\x16\xfb\x70\xa2\x9d\x90\x2d\xed\x86\xec\x54\x4e\x93\xa5\x68\x69\x39\xae\xd5\x8c\xc0\x41\x95\x2b\x65\xd6\x85\x0d\x53\x29\x0b\x2a\xbf\x63\x0f\x70\x74\x64\x84\xf9\xed\x0e\x46\xd6\x3c\x2f\xf2\x0c\x16\xbb\xaa\xd4\xca\x2c\x69\x83\x73\xef\x42\xa4\x51\x26\x16\x42\xae\x51\x64\x4a\xae\xee\x2e\xc7\x17\x57\x5e\x8b\x2d\x5b\xab\xa4\xa5\x14\x0c\x60\xac\x6e\x93\x2c\x20\xb9\x6e\x1a\x0a\xd7\xb9\x3a\xd3\xb3\x4b\x5c\xd8\x0e\xcd\x84\x93\x76\x2c\xb1\x7d\x53\x18\xcb\x09\xa8\x40\x23\x92\xba\x73\x2a\x68\xe8\xdc\xfc\x67\x52\x68\x4b\x88\xbd\x8a\x38\xb9\x6a\xa4\xa2\x30\x3f\x12\x03\xcf\x4e\x0a\x6d\xd8\xb3\xa6\x51\x2d\xdc\x7c\x14\x5a\x64\x6e\x7b\x90\x8a\x1b\x35\xf6\x7d\xe4\x6c\x7c\x20\x59\xaf\xff\x07\xbe\x35\x85\x0c\xdd\x8f\xd3\x08\x29\x05\xbb\x91\x15\x05\xa1\x17\xfb\x91\x4b\x3a\xe5\x29\xf5\x6d\x74\x4f\x01\x8d\xa5\x65\x85\xab\x1b\x2b\x41\xca\x13\x35\x5c\xab\x43\x5c\xe5\x14\x60\xbf\x76\x61\x33\xb4\xfa\x6e\x7a\xd5\x42\x90\x81\x4e\xfb\x05\x51\xa0\xa5\x70\x2c\x54\x97\x4f\x22\x1b\xa2\x6b\x0f\xf5\x8c\x51\x7d\x49\x2b\x22\x28\x0d\x09\x10\x38\xf5\x91\x26\xd7\x17\x6f\x04\x53\x13\x13\x76\xb1\x50\xb4\xf3\xf9\x9c\xdb\xef\xfb\x29\x18\x3e\xb9\xb1\xb9\x41\x40\xae\x6c\x76\x9e\xca\x53\xf0\x93\x6b\x0b\xd7\xa3\x99\xe9\x69\x30\xc2\x05\x01\x86\x5b\xf4\x7a\x5d\x22\xf2\x58\x5b\x5b\x17\x06\xc1\x7f\xc7\x02\xbc\xbd\x7c\xdb\xde\xda\xde\x62\xe5\x52\x49\x0d\x0f\x0f\xa9\x22\x7c\x1d\x8c\x43\xee\xa9\x99\x43\x96\xeb\xcb\xbe\xef\x07\xb0\xba\x7b\xca\xe6\xbb\x6e\xd1\xeb\xe5\x5c\x2f\x52\x89\x03\xa1\xb3\x6d\x6a\x25\x66\xa4\x9e\x2b\x96\x95\x0d\x75\x1d\x1b\xf7\xa4\xfe\x64\xd4\x8f\x22\x34\x90\x85\x48\xcb\x84\xc4\xa5\x38\xf2\xf9\x93\x6c\x7d\x42\x9e\xc4\x4c\x28\x58\x03\x89\x35\xf8\xbf\x8d\xad\x0d\xbe\xb1\xb5\xce\x10\x04\x5a\xab\x12\xd5\xab\x82\x6b\xdc\xaf\xb1\x43\xdc\xdd\x90\x75\xa5\x51\x12\x26\x51\x18\xf8\xb1\x8a\xda\x5e\xce\x09\xea\xd5\x62\xe8\x78\x76\x6c\xa1\xb2\x64\x9a\x5a\x91\x4f\xb0\xa3\x84\x54\x24\x39\x8d\x17\x60\x84\x62\x2a\x9c\x83\x80\x87\xee\xd5\xfa\xda\x6d\xd6\x6c\x6c\x89\x4a\xa5\xa2\xea\xf5\x21\x43\x31\xbb\xc7\xf6\xd8\xef\xf7\xe4\x6e\xb3\x91\xf6\x20\x43\xee\xf7\x03\x22\x05\x32\xc4\x9d\x06\x84\xb9\xe7\x6c\x21\x90\x51\x0b\x37\x3a\x7c\xbf\x1c\xad\x59\x9c\x12\xb3\xa1\x50\xf4\x92\xeb\xd7\x62\x0c\x20\x9c\x42\xbe\x48\x11\x2c\x64\xce\x6a\x7b\x6b\x1b\xdb\x2e\x9a\x3c\x0c\x71\x18\x0a\x25\x7c\x1b\xf1\xd2\x92\x0c\xc6\xc7\x26\xbc\x1c\x5c\x24\xe1\x22\xfc\x20\x5e\x5b\x5f\x4b\xfc\x5e\x1b\xa1\x58\x06\xf0\xad\xc5\x82\x21\x86\x4e\x99\x0c\xe2\xf5\xcd\x5b\x5d\xca\xbc\x90\x0a\x33\x4a\x3c\x58\x7a\x9e\xa5\x52\x57\x93\x8a\x4a\x0d\x77\x80\xc0\x10\x9e\x42\x12\xf8\xed\xf0\xd6\xed\x7e\x88\x06\x9e\x26\x41\x11\xc4\x19\xa7\x1e\x4b\x62\x17\xa9\xea\x68\x3a\xc0\xf4\x56\x2a\xc8\x66\x17\x27\x6a\xfd\xf6\xad\x39\x54\x6f\xcb\xd8\xed\xea\xc5\xc2\x15\x19\xc5\x0a\x41\xb9\x68\xc0\x33\x47\x8b\x1c\x0c\xe0\x60\xe3\x2e\x04\x08\x3d\xbf\x1f\x68\x9b\x2b\x05\x05\x74\x52\x42\xb0\x00\x06\x5a\x4f\x7e\xec\xf3\xfd\xda\xd9\x2e\x5c\xbf\xc1\xd6\x57\x56\xac\x32\x64\x81\x23\x23\x23\xaa\x52\x29\xcb\xfd\xf1\x1d\x01\x68\xb0\xdf\x0c\x81\x42\xb3\xd5\x92\xf8\x8c\x50\x83\x85\xf6\x2d\x3e\x1f\x03\x14\x20\x6d\x20\x6a\x94\x45\xf1\xad\xdb\x37\xdb\x10\xdc\x16\x3d\x37\x97\x37\xd4\x86\x0d\xab\x20\x6e\x17\x66\xf9\x75\xad\x25\x60\x91\x66\x6b\x26\x8e\x85\x17\x6e\x83\x67\xc0\x59\x23\x62\xc0\x8c\x85\x56\xff\xd2\xd2\xc0\x08\xbe\x91\x9a\x48\x89\xea\xe8\x2a\x35\x6a\x1c\x26\xea\x50\xb6\x41\x98\x13\x2b\x9c\xde\x6c\x26\x8f\x1e\x44\x2e\x03\xb0\x8f\xe1\x89\xd5\xd9\x7b\xaf\x2d\xe2\xfe\x2e\x0b\x3a\xbb\x3c\xec\xb5\x64\x1c\x76\x92\x38\xf1\x2d\xb0\x29\x60\xe3\x63\x0c\x98\x25\x6a\xaf\x6f\xef\x74\xd2\xdf\xfb\x6f\xbf\x2e\x9e\x7d\xee\x6b\xe2\x7f\xfa\x81\x1f\xe1\xf7\xde\x7d\x97\xa1\x46\x8d\xb5\x20\x0b\x39\x73\x89\xa3\x67\x6c\x67\x6b\x43\x7d\xfa\x77\x7f\xab\x9f\xa6\x41\x68\x09\x27\xf6\x5c\x0b\x59\xb9\x13\x37\x87\xfd\x6b\x1b\x59\x3f\x50\x03\x9d\xa1\x4e\x57\x2f\xc2\xce\x03\xb7\x83\x10\x39\x69\x60\xe3\xa7\x34\xa7\x83\x4c\x6c\x9a\xc1\x13\x7e\x59\xaf\x56\xc3\xd3\xc7\x4e\x24\xdb\xbb\xbb\x02\x2b\x36\x10\x30\xc9\x72\xb1\x14\x97\x0a\x45\x99\xf7\x72\x92\x66\xec\x2d\x7b\x0f\x65\x43\x55\x02\x1b\x89\x75\x30\xf0\x42\xba\x5c\x88\x5e\x04\x52\x32\xc4\x58\xd4\xc4\xfc\x0a\x7e\x2f\x35\xf3\x04\xb9\x10\xea\x7a\xc7\x69\xa2\xf4\x64\x16\xd7\x65\x2b\x62\x9d\x46\xee\x90\x94\x7d\xe2\x17\x3f\x99\xbe\xe7\xf1\xef\xb0\x47\x86\x47\x19\x12\x47\xd1\x30\x94\xd2\xd3\x03\xf9\xbc\x03\x01\x75\x9e\x3d\xff\xc2\x0b\xea\x3f\xfc\xec\x47\xa3\x73\xaf\xbe\x04\xb1\xad\x1f\x10\x62\x4e\x3f\x97\xec\x31\x0e\x56\xde\xb7\xe3\xd0\x33\xb6\x38\x44\xd4\xf4\x5e\x27\xd6\x92\xfd\xae\x94\x39\xf5\xb8\xbf\xa0\xd6\x2f\x7c\x3c\xdc\x3c\x3f\x52\x7c\xed\xc8\x07\x4b\x87\x4e\xbf\xc3\x9d\x3b\x30\x06\x19\x44\x99\x8d\x0e\xa3\x44\xa0\xc7\x72\xae\xc5\x51\x55\xd1\x11\x92\xed\x97\x07\x45\x80\x00\x82\xe7\x30\x33\xf0\xfb\xa8\x81\x5b\x20\xde\x63\x9c\xe7\x85\x0d\xa1\xa3\x37\xc7\xe6\x98\xad\xf7\xba\x5d\x56\x2a\xe7\x59\xd8\x65\x3c\xd8\x86\x63\xcc\x67\x73\xdb\xd4\x07\xe2\x70\x13\x79\xab\xdf\x12\x7a\x41\x68\x9c\x81\xd4\xbc\xc3\xb4\x14\x33\x01\x7b\xe3\x25\x8d\x8d\xc7\x7b\x6e\x69\x16\x19\xb8\xf9\x48\xb8\x40\xcc\x7c\x8c\xef\x25\xcc\xc6\xb9\x0b\xed\xa1\xe9\x33\x2d\xf3\x3d\xa7\xc8\x40\x7b\x6e\x3e\xc8\xcf\x05\xdb\x97\xa3\x1b\xf5\x2e\xd3\x60\xd1\xe1\x04\xcf\x8c\x72\x76\x4b\xf7\x04\x6e\xd4\x5e\xfe\xc4\xf9\x1d\x4e\xce\xac\x0e\x9d\x25\xc4\x10\xfd\x85\x32\x96\x21\x2c\xb4\x30\x41\x1d\x6b\x34\x38\x24\xe3\x4d\x01\x98\xd6\x08\x8e\x21\xc0\xf0\x6d\xcf\xee\xad\xac\xdd\xee\x6c\xb7\xb7\x3b\xe0\xec\x7c\x88\x70\x43\xa4\x77\x13\x31\x5d\x13\x21\x12\x71\xe9\x43\x40\x60\x25\x7e\x94\x8b\xfb\x61\x02\x99\x29\x8b\x83\x48\xa4\x08\x8a\x4b\x90\xf3\x51\x7a\x54\xf5\x20\xda\x52\x1e\xc3\x66\x40\xa0\x4d\xb0\x74\xeb\x16\x52\xef\xe1\xef\x2d\x30\xaa\x10\x00\xa4\x39\x38\x0f\x17\x23\x49\xa3\x95\x8e\x25\xa9\x58\xcf\xc7\x8a\x68\x61\xe1\x66\xaa\x0b\x26\x0a\x23\x58\x1b\x45\x13\x30\x92\xc5\xd6\x68\x36\x12\x67\xd6\x1a\xfd\x8b\xe0\xf9\xb7\x9b\x4d\xb5\xba\xb2\x92\xf9\x1a\x6a\x86\x70\xa1\xe9\xd4\xe1\xb8\x91\x70\xac\xd0\x76\x1c\xdf\x81\x98\xc2\x2d\xe4\x7a\x09\x4b\x7d\xec\x14\xd8\x31\x5c\xa3\xb0\xa4\x7e\xd4\x7b\xda\xb4\x83\xfe\x1f\xdb\x87\xf2\x23\xe6\x4b\x29\x92\x30\xb6\x23\x3f\xf0\x70\xae\x1a\x02\x26\x30\x4a\x90\x7f\x44\x60\xb1\x62\xe5\xc1\x49\x3b\x5c\x13\x3d\x99\x65\x44\x15\x9a\x81\xba\x4b\x14\xb5\xd5\x6e\xa3\xc3\x34\xf1\x01\x19\x64\xea\xb5\x61\x6c\x09\x2f\x08\x34\xad\xd8\x71\x45\xe0\xe4\xec\xc0\x2b\x3a\x81\x97\xb7\x02\x37\x2f\x42\x27\xc7\x20\xf2\x44\x1d\x5c\x9c\x2c\x48\x73\x96\x0b\x0f\x22\xc2\x7e\x07\xe4\x4a\xf0\x13\x30\xc5\x2e\x38\x62\x94\x0e\x12\x7c\x50\x7b\x37\x33\xe0\x41\xa4\xc2\xa0\xa3\xb6\xb6\x56\xb0\x12\x01\xce\x0e\x82\x01\xc1\x31\x92\xa5\xb2\x24\xd3\xf8\x07\x0b\x12\x37\x1b\xc7\x8f\x25\xf2\x13\x68\xf6\xce\x41\xd4\xa8\xf6\xb1\xdf\x48\x96\xe1\x47\x06\x09\x2b\x92\x86\x24\xb0\xde\x93\xd0\xdf\x4d\x96\x16\x1b\x58\x27\x15\x10\x64\xd8\x70\xbf\xe0\x98\x0a\x65\x3e\x6c\xdd\x6e\xe2\x08\x6e\x8b\xc1\xbd\x44\x91\xbf\x1b\xae\xaf\xb5\x1a\x78\xed\x08\xb2\x4c\x62\xe9\x82\x83\xce\x81\x47\xc4\x67\x4d\x33\x51\xe8\xb4\x60\x05\xc6\x90\xbe\xc4\x36\x87\x7b\xc3\xe3\x44\x10\x13\x04\x15\x81\x24\xbe\x62\x1c\x2d\x20\x6e\x3f\x84\x00\xeb\x35\x6d\xc3\x33\x87\xf5\x07\x6b\xd0\x46\xac\x0f\x09\x29\xc4\x69\x6a\x83\xb1\xe4\xf4\x67\xb8\x16\xa5\x76\xb8\x08\xb1\xaa\x97\x2d\x69\xa7\x7d\x48\x02\x9a\xe3\x73\x13\x07\x07\x31\x0b\x1c\x62\x09\xbc\x0c\xbb\x70\xee\x15\x38\x03\xd2\x09\x45\xdf\x86\x65\x54\x6c\xc0\x43\xb0\xc0\x93\x02\xcd\x3d\x90\x05\xb1\x12\x95\x3a\xb4\x13\x74\x69\xda\x96\x19\x01\xd4\x9d\x3c\x19\x2c\xe9\xf5\x55\xa3\xbf\x2b\x1a\xeb\x4b\x54\xd2\x23\x16\x36\xe4\xd0\xe4\x44\x51\x89\xeb\x96\xae\x53\xcb\x05\x68\x02\x36\x24\x45\x53\x99\xcf\xd4\x26\x0a\xef\x7b\x6a\x2b\x2b\x4e\xfd\x46\x7f\x63\xad\xb7\x5a\xaa\x7a\x6d\x88\xc9\xfb\xe5\x6a\x2e\x28\x56\x72\xb0\x50\xb9\xd6\x40\xd2\xf5\x72\x53\x09\x57\xd4\x1b\x27\xe6\x82\x48\x0d\xc8\x18\xb0\x4c\x3c\x28\x19\x18\x1c\x4c\x36\x01\x8d\x4e\x4c\x83\x7c\xf4\x31\xe8\x37\x29\x21\x8b\x74\xa0\xa2\x4b\x8f\x8a\x1b\x6c\x9c\xd1\x7e\xcb\x86\xe7\x55\xc2\x13\xda\x4d\xa1\xd5\x61\xb5\x7c\x4f\x6e\xf3\x16\xd8\xfa\x28\xea\xf4\x7c\x6e\xf3\x88\xc7\xe8\x46\x78\x84\x43\xa1\x60\x3f\x48\x0d\x14\x23\x38\x75\xf5\xc6\x39\xf9\x6f\x7f\xfa\x5f\xb1\x47\x1f\x7a\x8c\xff\xe8\x0f\xfd\x88\x98\x9a\x9c\xa2\xb2\x3d\x04\x58\xca\x76\x2c\x56\x2c\xe6\xd8\x27\xff\xf3\x27\xc1\xc6\xdc\xec\xe7\xf3\x6e\xe4\xba\x3c\x2e\x16\xec\xc8\xcd\x59\xb2\x58\xce\x81\xf1\x43\xb5\x05\x01\x19\x3a\xae\x22\x26\x42\x54\x1a\x55\x34\x30\x67\x13\x53\x2d\xe1\x57\x88\x0c\x0b\x96\x05\x86\xc5\x4c\x78\xb6\x1b\xcd\x4c\x4e\xf3\x72\xa1\x44\xd8\x2e\xdb\x76\x09\xc5\x6f\x21\x47\xbc\x01\x6a\xee\xab\xfd\x0d\xbc\x61\x8c\xcc\x49\x31\x84\x85\x11\x9e\x9d\x8a\x2d\xd7\xc1\x08\x1f\x97\xaa\x44\x94\x3b\x02\xda\xb2\xdc\x8d\x86\xae\xb5\x75\x10\x38\x10\xc5\x34\x31\x09\xc2\xae\x31\x7f\xe7\x0b\xab\xb7\xd5\x47\x3f\xf6\x33\xf2\x17\x3f\xf1\xf3\x02\xfd\x1b\x32\xcc\xb9\x1e\x91\xec\x60\x12\xc3\x3e\xf6\xc9\x9f\x4b\x3f\xff\xa7\x9f\x8d\x9a\xad\x06\xfa\x5f\x44\x16\x83\x75\x37\x64\x6f\x52\xa7\xa1\x6c\x5f\x39\xf3\xdb\xcd\xd0\xf7\x8f\xb0\x75\x5f\xe7\xcc\x11\xfe\x0a\x07\x57\x65\x58\xdb\x48\x5b\x85\x28\x34\xd8\x0d\x6b\xe1\xda\xab\xbf\x9c\xac\x5f\xf8\xc3\xdc\x37\x6a\x47\xdd\xea\xcc\xbd\x6e\x7d\xf8\x80\xa8\x8e\x4e\x71\xaf\x50\x62\xdb\xeb\xcb\xec\x6f\x3f\x52\xe7\x19\xc9\x0d\x66\xcd\xf5\x6a\x6d\x50\xdc\x99\x9c\x98\xd0\x40\x39\xb8\xb1\x53\x53\x93\x1c\xc1\x56\xc3\xc3\xf5\xc1\xd9\xcc\xcc\x4c\x93\xf1\x29\xce\x86\xbc\x38\xa7\x98\xc1\xd5\xd1\x49\x61\x5e\x8d\xa5\x9f\x5e\xdf\x17\xfb\xea\x5b\x9a\x7e\x95\x66\xc2\xa9\x1a\x9b\xb9\x5c\xad\x45\x6e\x42\x30\x33\x9f\x66\x5c\xb7\x96\xb0\xcd\x0e\x21\x58\x66\xb4\x29\x57\x1a\x68\x5a\x2b\x83\xcc\x57\x59\x2b\x9c\xef\xf1\xde\x28\x36\x70\xda\x83\x9d\xae\xf6\xd7\x29\x07\x24\x21\xf2\x9b\x6a\xe1\xec\x11\x80\xab\x7d\x65\x4b\x23\x7a\x83\x05\xb0\x84\x3b\x56\x0a\x2e\x0c\xec\x0c\x98\x1e\x89\x9a\x21\x70\xf2\x48\x00\x0f\xa9\x21\xb7\xe9\x39\x71\x8e\xce\xd6\x57\xa1\xea\x72\x87\x37\x55\x0f\xfe\x73\x78\x9f\x79\x58\xba\x32\xfc\xb7\xb4\xb7\x29\xec\x43\x0c\x89\x0d\x69\xaa\xab\x02\x85\x9c\xfd\x10\x69\x29\x9c\xad\x88\xe1\x97\x79\x23\xf4\xa2\x99\x00\x38\x2c\x32\x8b\xfb\x74\x6c\x81\x72\x64\xc4\xc5\x82\x00\x90\x3c\xbe\x17\x8e\x4a\x8c\x4c\x06\x70\x80\x4e\x2d\x82\xbf\x84\x73\xe1\x21\x44\xaa\xb1\xe9\x40\x20\x70\x04\xfb\x2b\x1e\x47\x18\x84\x52\x8e\x26\x02\xd6\x18\xd8\x8c\x42\x88\x9b\x79\x3d\x53\x72\x97\x9a\xbb\x8f\xce\x1a\x9d\x16\x5e\x5f\xc4\x6d\x11\x08\x47\xf4\xad\x18\x5f\xb6\x0f\xff\x2b\xb4\x7a\x56\xac\xc1\x2b\x4c\xb3\xb3\xaa\x8c\x37\x91\x6b\xd9\x49\x23\x30\x45\x20\x43\x65\xc6\x11\x52\x86\xa3\x69\x96\x8c\xa4\x2b\x23\x96\x4f\x03\xd5\x87\x6c\xaf\xc8\x53\x55\x44\x2e\x5e\x0c\x3e\xc0\x86\x38\x06\xf8\x20\xf6\x3f\x3c\x3e\x48\xff\x99\x46\xbf\x6a\x24\x71\xaa\xdb\x1e\x48\x4c\xcc\x31\x00\x0a\x1d\xd7\x0a\xac\x20\x0d\xdd\x20\x09\xdc\x5c\x12\x3a\xf9\x28\xb6\x1d\xc8\x3a\xd1\x86\x26\xd2\x8a\x83\xc4\x0b\xfb\x71\x10\xfb\x90\xb3\x84\x69\x08\x59\x67\x88\x81\x12\xec\x33\x47\x65\xa4\x12\x7b\xe5\x1c\x25\xf4\x6c\x06\xde\xe3\x14\xcc\x32\xe4\x29\x02\xef\x75\x6c\xdb\x70\x9f\xf1\x19\x13\x2a\x94\x63\xe5\xc6\xa1\xb9\x40\xc9\x20\x80\x42\x6e\x01\x26\x8c\xcd\xe2\x77\x90\x9b\x28\x9a\xb5\x11\x83\x6a\x11\x9c\x3f\x24\x42\x10\x8c\xc8\x04\x8e\x99\x60\xb9\x11\x39\x03\x30\x4b\x85\x50\xc3\x85\x97\x83\x63\xf1\xd4\x25\x82\x73\x80\xb8\x3b\xb4\x5d\x16\x7a\x70\xf7\x72\x39\xb0\xf1\xb6\x80\x70\x50\xda\x31\x5c\x45\x14\xa6\x32\x89\x10\x5b\x24\x13\x2a\xb6\x43\x5a\x82\x02\x59\x60\xcb\x20\xc8\x61\x60\xb0\xf1\xfd\x1c\xb3\x55\x2b\x0a\x24\xd2\x1b\xb3\x38\x82\x25\x98\x10\xc3\x2e\x16\xc8\x52\xcb\xe1\x09\xbe\xcf\xf1\x58\x64\x3b\x49\x8c\x41\x13\x24\xa3\x0e\xbc\x97\x23\x1d\x72\x8c\x84\x4b\x09\xf8\x20\x2d\x02\xc6\xf2\x4e\x89\x0f\x4f\xb3\xa8\xdf\xef\xe6\x5a\x8d\xe6\xb1\xf2\xa1\x8a\xee\x53\xda\x6a\xa3\x52\x87\x44\xdf\xef\xab\x5a\x3d\x0c\x2c\xba\xce\x34\xb1\x21\xaa\xb0\x1c\x08\xb2\x5c\x15\xb9\xf0\x19\xf8\x99\xe8\x01\xe1\x3a\xed\xd0\x67\x6e\x14\xa8\x24\x0c\x14\xc2\xa3\xf0\xda\x6d\xa9\x5b\x98\x42\xc9\xc1\x60\xa1\x91\xa8\x1a\x70\x15\xa5\x7a\x2d\xe0\x33\x82\xe3\x59\x18\xbc\xb1\x98\xbe\x22\x61\x25\xb2\xa1\x26\x0a\x3e\x99\x39\xf0\xd5\x91\x9a\x8d\x91\xeb\xa0\x59\x85\xae\xab\xfc\x7c\x51\xfa\xe5\x9a\x0c\x86\x46\x64\x34\x32\x9a\x86\x43\x63\x49\x5c\x2a\x05\x09\x76\x69\x07\x9d\xa3\x0c\x8e\x9b\x6a\xf2\x43\x2c\x61\x9b\xee\xf6\x20\x92\x1d\xc0\xd1\x99\x46\xab\x53\x59\x8c\xb8\x18\x52\x62\xb1\xd6\xf8\x10\x95\xfd\x3f\x5d\xc7\xd1\x72\x76\x99\x08\x42\x56\x8a\xc8\x4c\x17\xa5\x0f\x3e\xe1\x3c\x38\xdc\x10\x70\xaa\xfd\x48\xa0\x38\x24\x86\x27\x88\x9c\xc7\x1d\x15\x2b\xf4\x85\x48\x99\x4c\x7c\xee\x10\xb7\xa6\xb8\x7e\x04\x78\x64\xd6\x0b\xda\xfc\x4f\xfe\xf4\xb3\xec\xec\x4b\x2f\xb1\xef\xfb\xf0\xf7\x8b\x8f\x7c\xf7\x77\x8b\x6a\x6d\x98\x80\x7a\xcf\x9f\x7d\x5e\xfe\xc9\xe7\x3e\xd7\x0d\x43\x19\x41\x72\x1c\xa9\xd4\x8b\x30\x7e\xb0\x03\x54\xc3\x72\x24\xe6\x2d\x11\x9c\x48\x37\xc0\xea\x93\xc5\xdb\x3d\x58\x03\x69\x2a\x7a\x41\xa2\x50\x5e\x3a\x49\x12\x2c\xbb\xa7\x04\xee\x4d\xb0\x56\xa7\x10\x02\xc0\x6b\xa5\x2a\x47\xe9\x2c\x35\xe8\x4a\x71\xf5\xcd\x95\xca\x38\x56\x6f\xb0\x1c\x8e\xd5\x05\x38\x8d\x18\xd6\x2e\x1c\x06\x5e\x48\x75\x0a\x29\x20\x1c\xd8\x32\xf3\xc6\x03\x3e\x35\xf3\x1d\x99\x56\x6c\xcf\xe8\x9c\xcf\xd2\x8d\x76\x7c\xe7\x1f\xff\xd9\x13\xe9\x87\xbf\xfa\x37\xf9\xe3\x7f\xfd\x71\x2a\x76\x34\x5b\x4d\xf6\x6b\xbf\xf9\xab\xf2\x53\xbf\xf1\x2b\xf1\x8d\xc5\x9b\xba\xac\x0e\x2e\x8d\x48\xde\x90\x64\x15\x49\x54\x89\x38\x57\x91\x1c\x9e\x51\x8e\x60\xdf\x0a\xe5\xfe\xcd\xc6\xd8\x42\x76\x47\xbc\x82\x91\x82\x32\x10\x2c\xa5\x6b\x33\x98\xc1\x51\xa6\x05\xb7\x29\xd9\x8c\x7a\xeb\x1b\x71\x6f\xf9\xc9\x70\x15\x75\x73\xdc\x22\x04\x8d\x39\x0e\x8f\x55\x2c\x95\xbf\xdf\x65\xec\x3d\x76\x4a\x33\xd6\x82\x35\x76\x77\xa9\x77\x50\xab\xd5\xf9\xe6\xe6\x26\x1b\x1a\x1a\x22\x61\x92\x56\xb3\xcd\xc6\xc6\x46\xd9\x6e\xa3\x81\xbd\x74\x9e\xcf\xe7\xd9\xe6\xd6\x16\xfc\xbe\xca\x93\xad\x2a\x0b\x9b\x8c\x95\x4f\xf4\x08\x95\xed\x79\x5a\x6f\x16\x22\x74\xab\x1f\xf4\xb5\xf1\x96\x86\x54\x9e\x66\xde\x25\xd7\xfc\xc4\x06\x69\xaa\xd4\x00\x47\xc0\x07\x6d\xae\x3b\xae\xef\xce\xc0\x86\x7f\x2b\x4e\xbb\xbf\xc4\x2f\xbf\xf9\x22\xe1\xdf\xc6\x9b\xbe\xa9\xfc\x1d\x2a\x1a\xc1\x7f\xcc\x4d\x5d\x11\xa7\x6e\xe0\x48\x88\x67\x69\xfb\x50\x4b\x20\xd5\x0e\x9d\x4a\x68\x21\x6c\x35\x58\xe6\x69\x17\xd6\x61\x27\x16\x71\x2f\xe4\x90\x77\xf3\x28\x96\x34\x19\x6a\x3a\xc1\x66\x19\x3a\x60\x06\x1c\xe9\xc6\x70\xbc\xd4\x86\xc4\x19\xbe\x62\x31\x2f\xc5\x12\x93\x50\x04\x8a\xc4\x85\x89\xd8\x24\xd8\x52\x10\x26\x08\xd9\x87\xd3\xc0\x08\x92\x74\xe8\xc0\x71\x44\xf0\x3e\xc8\x1b\x44\x3c\x70\xe8\x5c\xe7\x0a\x18\xc0\xc3\x22\x09\x88\x18\x9f\xeb\x09\x54\x0c\x12\xe0\x38\x28\xcf\x43\x52\x96\x54\x3b\xd4\x7d\xf7\xc1\xd8\x9f\x4e\xad\x75\x86\x40\x08\x53\x5c\x8f\x94\xe5\x10\x27\x03\xea\xa6\x84\xf0\xd3\x00\x62\x65\x08\x75\x79\x00\x67\x1b\x70\xb8\x48\x78\x57\x42\xe4\x7e\x54\xb2\x36\xf3\xaa\x2c\xd3\x9a\x50\xe4\xd4\xd9\xa0\x89\x99\xa5\xee\x34\x87\x83\x2e\x38\x82\x70\x35\x42\xed\x54\xb8\x9e\x10\xce\xd5\x57\x89\x42\x7a\x2e\x70\x88\x5c\xb7\x9f\x14\x59\x84\xbd\xf2\x34\xdf\xd3\x42\xd0\xf0\x5a\xca\xc4\x62\x34\xde\xf0\x1d\x06\x32\x11\x84\x5d\xa1\x85\xaf\x84\x87\x90\xf3\xc6\x56\x04\x39\x56\x9f\x32\x78\x49\x01\x23\x38\x26\x15\xc9\x00\x02\x8a\x88\x5c\x79\x2c\x43\x70\x96\x78\xaf\xb5\x72\x9e\xa2\xbd\x6b\x0d\xaa\x3a\xdc\xf4\xd3\x29\xb8\x61\xa8\xe4\x11\x0b\x1b\x03\x07\x06\xd9\xa5\x22\xe7\x6b\x26\x27\x2c\x30\x81\x78\xaf\x31\xa3\xc6\x4a\x0b\xf6\x33\x2d\x96\x41\x3a\xf6\x96\x99\xa0\x2a\x09\x3e\x07\x8d\x51\x62\x94\xf1\x5b\x2a\xb6\xf1\xfc\x1d\x8e\x0e\x8e\x06\x6c\x64\xca\xc1\x91\x33\x17\x02\x1c\x17\x59\x2a\xcd\x84\x51\x1c\xd9\xe0\x68\x13\x1e\xc4\x29\x87\x90\x04\x42\x4d\x14\x52\xe0\x98\xde\x33\x2f\x8e\x14\xbd\x24\xe2\xad\x35\xcf\xa2\xb2\xe1\x5e\xc3\xb6\x0d\x3d\x78\x45\x70\x47\x04\x8d\xea\x31\x0b\x12\xe7\x30\xa2\xf7\x43\x20\x45\x25\x6e\xa2\x90\x48\x21\x68\x8b\xa3\x58\xc0\x9d\xb3\xc8\x99\x63\x29\x3c\x09\x61\x81\x85\x12\x27\x3e\x14\x4e\x87\x99\x78\x8d\x2e\xbd\x36\x36\x6e\x77\xdb\x22\xbd\x7a\x7d\x79\x16\x7b\x93\x38\x8e\x86\xb4\xc7\x8e\xb0\x17\xe1\xe7\x72\x67\xc7\x0f\x7b\x6d\xbb\x03\x6b\x05\xee\x17\x65\xfe\x91\x83\x15\x1f\x0f\x9c\xba\x6d\x61\x65\x29\xd5\x04\x3d\xa9\x1d\xf9\xa9\x07\x01\x83\x17\x45\x69\x0e\x82\x08\x57\xe2\xf3\xc2\xe0\x06\xf7\x85\xcc\x70\x8b\x9c\xed\xa3\xc7\xc2\xdc\x16\xb3\x71\x7a\x3e\x18\x80\x22\xba\x5a\x60\x70\x67\x89\x44\xab\x84\x29\x44\x68\xbb\x71\x24\xe1\xbe\x28\x47\xeb\x97\x90\x3b\x88\xe1\x5e\x43\xf2\x27\x7a\x10\x0f\xb5\x39\x77\xda\x82\x3b\xbd\x34\x71\x82\xc0\x77\xa3\x5c\xc1\xa6\x1e\x18\x89\x92\x90\xbd\xa3\xbc\x3b\x33\x6b\x3a\x0b\xa7\xe9\x60\x45\xa6\xda\xb1\x3c\x0d\x70\x93\x24\xa6\xc2\xb4\x68\x2a\xcf\x8a\x97\x54\xff\x30\xa2\xa9\x34\xdb\xa9\x55\x55\x4d\x61\x9d\xa6\x5b\x84\x96\x6a\x51\x7a\x6e\x9a\xfe\xce\x74\xf7\x52\x95\x57\x38\xee\xb7\xd1\x8d\xc4\x7a\xb3\xcf\x5b\x41\x28\xda\xfd\x28\x69\xf6\x03\xab\x0f\x4f\xab\x1f\x86\x0e\x2c\x66\x27\x8e\x23\x2c\x3a\xe1\x58\xa8\x45\xc0\x35\xac\x34\x82\x03\x46\x0c\xc1\x6e\x67\x41\xfd\xc4\x4f\x7f\x94\x7d\xfe\xcf\xbf\xc8\xfe\xd1\x3f\xfc\x5f\xac\xc7\x1e\x79\x4c\x7c\xe2\x17\x7e\xa9\xbd\x70\x6b\xb5\x87\x69\xbd\x6d\xb9\xd1\x8e\xe5\x27\x05\xb7\x94\x14\x0a\x15\xb9\xbe\x13\xc8\x5c\xa9\x00\x96\xc9\x61\xbd\xb0\xcf\x76\xe4\x36\x78\xbb\x54\xe0\x4b\x2f\x00\x6a\x91\x40\xfc\x40\x3d\x6c\x0b\xc7\xd7\xf0\xb2\x22\x88\xc8\x70\xfa\x4a\xd8\xe2\xaf\xe4\x04\x91\x52\x56\x92\xac\x0f\x01\xb0\xc8\xeb\xd1\x3e\x77\x98\x9e\x47\xc9\x1c\xfa\x1d\x66\x9b\xe2\x20\x9a\xa0\x26\xda\x34\xa2\xbe\x25\x5e\x09\xde\xf6\x7b\xfc\xa3\x9f\xf8\x99\xe4\xb1\x47\xde\xe6\x7c\xf5\xa9\xaf\xc9\x8f\x7f\xf2\xe7\x92\x67\xce\x3e\x03\x71\x0f\x58\x1e\xc1\x35\x5b\x2b\x3a\x74\x85\x3d\x73\x8e\x33\x8f\x89\x26\x2c\x87\xfd\x17\xa7\x3a\x30\x0b\x62\xf6\x57\xc9\xd0\xf7\xbb\xab\xfd\x99\xba\xd6\x1d\xc3\x05\x09\x0b\x0e\xde\x01\x5e\x55\xa1\x90\x07\x66\x71\xa8\x28\xe2\x30\xa2\xfa\x43\xc3\x83\x28\x43\xcc\xea\x02\xb4\x8b\x02\xbd\x43\xb7\x03\xde\x98\x8c\xa1\x8e\x8f\x3c\xcf\xcb\x46\xa1\x68\x0e\x9d\x28\xfe\x84\x45\xbc\xb8\x68\x6a\x0a\x10\xe6\x0b\xc3\x4a\x55\x2c\x68\x41\x82\x6d\x7f\x83\xbd\x7c\xee\x12\xf3\xaf\xae\xa1\x06\x2e\x3b\x72\xf8\x30\xbb\x72\xed\x3a\x27\x3e\x6b\xbd\xda\x74\xc1\x43\x2f\x5c\xbe\xd7\x6d\x65\xd8\x4b\xdf\x93\x0e\x23\xe7\x2e\x79\x36\x9c\x6c\xc6\xdc\xf4\xbc\xe8\x1e\x8f\xe8\x9b\xf8\x78\xfe\xa6\x1e\x9d\xef\xf3\xd3\x9c\xf3\x37\x71\xcc\x7c\x1f\xc3\x99\xfa\x96\x77\x9e\xbf\x4e\xfe\x6e\x5f\x8c\x85\x9d\x6f\xd8\x83\x08\x87\xa1\x2c\x25\x30\x59\x39\x23\x65\x4f\xed\xd0\x71\x0a\x2c\x82\x70\xae\x0f\xcb\x3c\x48\xb9\x04\x1b\x9b\x62\xfe\x89\xf3\x9b\x02\x85\x7d\x08\xcc\x97\x21\xf1\x19\x52\x5a\xc3\x7f\xa8\x9e\x07\xb9\x1e\xc4\x9d\x09\xbc\x09\x1c\x9a\x08\xb9\x9e\xd4\x4b\x09\x82\x80\x8b\x8a\x32\x6e\x78\xf6\x36\x7c\xae\x85\x59\x32\xd7\x94\x6b\x98\xf1\x52\xde\x4f\x6e\x86\xd4\x81\xa8\xbc\x8e\x4e\xd7\x62\x21\x2c\xe6\x88\xbe\xea\x09\x03\x8b\x2a\x00\x52\xff\x47\xdf\x21\xf6\x46\xd2\x24\x85\x18\x18\xc7\xcc\x51\x52\x89\x50\x65\xce\x3c\xc5\x8c\x1f\x23\x57\x70\x25\xe0\xbc\xe0\x98\x8e\x88\xc0\xd5\x46\x28\x71\xcc\x88\xce\x8d\xf8\x57\xf4\x6c\xa2\x9e\x70\x37\xc5\x46\x65\x32\x5b\x4b\xd7\x0b\x25\xd1\xe8\x18\x6c\x43\xd6\x37\xa3\x3a\x6f\x4c\x0f\x4c\x10\xcf\x5b\x8a\x06\x99\xa5\xc2\x45\x1e\x18\x38\x1b\x9b\xa8\x9c\x08\xd7\xaa\x2b\x38\xc2\x50\xc1\x33\x53\x4a\x45\xe0\x16\x05\x1d\x10\xf0\x80\x01\x09\xe0\x89\x44\xe4\x6c\x5d\xf8\x0a\x71\x98\xb0\x59\x02\xd9\x69\xca\x35\x27\xa6\x56\xf4\x16\x0a\x73\x1d\xd8\xd0\x18\x83\xa2\xba\x2f\x47\x8a\xd8\x10\xee\x79\x0e\x1e\xb9\xa7\x74\x10\x61\x2c\xf8\x60\x81\xa6\xc4\x10\xc6\x20\x08\x81\xe7\x22\xb9\x44\xb5\xb2\x88\x5b\xe0\x1c\xc9\x4c\xd3\x63\x41\x02\x6f\x6a\x6d\x28\x14\xec\xc1\x39\x41\x45\x74\x8e\x9c\xed\xe3\xa8\xa0\x36\x08\xa3\xcf\xb0\x4c\x05\x02\xef\x1e\xee\x73\xc8\xf6\x55\xc8\x85\x8c\x70\xe9\x10\x48\x8f\x80\x3e\x0c\x9c\x10\x96\xd0\xc9\xa6\xd0\x9c\x10\x1c\x35\x80\x2d\xe9\x43\x50\x11\xc0\x35\x86\x18\x00\x0a\x42\x40\x4b\x72\xfe\x69\xcc\xbc\xcc\x69\x19\x12\xe4\x18\x02\x86\x08\xa7\xd3\x10\x9f\x6c\x44\x0a\x05\xa4\xdd\x9e\xfe\x1b\xe9\x62\x20\x62\x4a\x49\x68\x44\xf1\xb9\xc4\x58\x1e\x27\x06\xbd\x94\x7a\xda\x79\x78\x6f\xc2\x74\x35\x1c\x8d\xa0\x93\x85\xea\xe3\x75\x4f\xb4\x1a\x32\xbe\x71\xe3\xd6\x21\x9c\x35\xbf\x72\xf3\x22\x3b\x75\xf4\x2e\x56\x60\x43\x2f\xc1\x27\x36\x97\x6e\xb6\xb6\xb6\x77\x92\x16\x05\x9a\x58\xf1\xe1\xb0\xde\x45\x1a\x52\x15\x0a\xe2\x10\x21\x6c\xcc\x8e\x50\x70\xc9\x66\x78\x2e\x18\x84\xca\x34\x0f\x9f\x9b\x53\x48\x31\xac\x45\x1e\xac\x6c\xba\xd4\xf4\xf1\xa4\xa9\x64\x49\x0c\x86\xd1\x5d\x72\x7d\x3c\x64\xb4\x0a\x31\x53\xc7\xf0\x8d\x9e\x0d\xb5\x9a\xe0\x58\xd4\xd2\x52\xe8\x75\x1d\xb3\x1f\xf1\x3a\x03\xb8\x7d\x3d\xcb\x92\x1d\xcb\x4a\xba\xae\xe7\xf4\x1d\x57\xc5\xb9\x1c\x06\x1a\xdc\xb4\x0e\x35\x13\x56\x6a\xc2\xd5\x8c\x4a\xd7\x15\xae\x92\x86\xed\x05\x65\x1d\x18\xf1\x4c\x29\xcd\x30\x4d\xcd\x3f\x54\xb8\x30\x00\x34\x33\x3d\x83\x68\xb8\x14\x29\x57\xc1\x4b\x61\xa9\x2a\xc2\xed\x86\x89\x10\x62\x89\x24\x2c\x0b\xcc\xaf\x53\xbd\x2d\x20\x85\x82\x45\x95\xb2\xbe\x8b\xa7\x6f\xb3\x76\x7f\x97\x9f\x6f\x5f\xe6\xbd\xb0\xc1\xba\x51\x57\x74\xd3\xae\xe8\xc7\x3d\x81\xf7\x0d\x8e\x0a\x8e\x0a\x2b\x3a\x29\xda\x7d\x9b\xfe\x00\xdb\x6d\x60\xbd\x28\x7b\xc5\xe4\x0b\x31\x0f\xb0\x17\xbf\x72\xf6\xc9\xf4\x95\x8b\xaf\xc8\x33\x27\x4f\xf3\x67\x9f\x7b\xb6\x17\xc7\x84\x9e\xd6\x4e\x0d\x96\x51\x43\xec\xa4\xbc\x07\xd6\xc9\xb5\x18\xef\xb8\x5a\xd1\x4a\xb3\x2f\xef\x37\xae\x5a\xcf\x9b\x19\x14\x8f\x32\xd2\x52\x12\xf5\xcc\x43\xaa\x0d\x19\x39\xdc\x6f\xed\x00\x35\x1b\x19\xaa\x9f\xc1\x55\x24\x14\xe9\x18\xbd\x59\x3d\xaa\x66\x41\x14\x09\xf7\x80\x80\x38\x7b\x02\x67\xf8\x87\xa9\x61\x21\x49\x8c\x8e\xa3\x18\x0c\x95\x5b\xda\x60\x9e\x3d\xff\x8d\xf4\x3d\xdf\xf3\x81\xf4\xfa\xcd\x1b\x69\xab\xdd\x4a\x32\xdb\x01\xef\x4f\x0c\xfd\x3a\x64\xe7\xd4\xcf\xa0\xda\xa1\x5e\x2e\x70\xb3\x5c\x3d\x2a\xe9\xcc\x8f\xaa\xe8\xd2\xea\x1b\x1d\xfa\xeb\x10\xee\x7f\xe9\x7c\xba\x01\xca\x71\x63\x64\xf1\xe9\x22\x01\x78\x97\x6b\xe4\x7b\xde\x00\xe8\x6c\xfa\xaa\xcb\xb4\x6e\xd6\x6b\x87\x07\xe7\x24\xa9\x81\x50\x9a\xfb\x8c\x23\x09\x59\xd6\x84\x04\x32\x42\xcf\x2a\x10\xef\x30\x5e\xbc\xed\x38\x03\x45\xa2\x52\xb9\x4c\x59\xf6\xd2\xce\x65\x36\x7d\x3a\xcf\x4e\x1e\xfb\x00\x41\xfb\x9f\xf8\xfc\x9f\x46\xbf\xf3\xe9\xff\xfa\xb2\xc8\xbb\x3e\x32\x5a\xe9\x05\x8a\x01\xa0\xe4\x83\xe1\x18\x5c\xf4\x3c\xdd\xd3\xff\x34\x00\x78\x65\x18\x79\x8c\xdf\xd0\xee\x4d\xbd\xfe\xa1\x0e\x46\xe1\xdf\x98\x48\xf3\x7d\xa4\x3d\x72\x20\xab\x75\x67\xc5\xfc\x4d\x32\x72\xf1\xa6\xc7\xbb\x43\x29\x7b\xff\x4f\x06\x01\xc9\x1d\x1d\x1e\x8b\x34\x01\x30\xd7\xc4\x08\x2e\xb0\x08\x79\x21\xd2\x8c\x52\x12\x0d\x1f\x5c\x73\x24\x45\x1a\x29\xc8\xc8\xb1\x9b\x87\x4a\xac\xdc\xb6\x85\x63\xa8\xef\x06\x92\x9e\x48\xcf\x6a\xb9\xe8\x07\x85\x90\xb0\x85\xb1\x7b\x97\x72\xcc\x2e\x03\x54\xd0\x81\x18\x94\x66\x42\xa4\xee\x5f\x63\x39\x17\x9c\x28\xa2\x3d\x99\x1e\x79\x43\xf7\x9d\x28\xcc\x35\x03\x72\xec\x12\x01\x3d\xba\xc2\x6d\x1c\x42\x0c\x4e\x17\x0c\x3c\x45\xa0\x92\x16\x29\xba\x45\x0c\xd4\x91\x7d\x04\x32\x4a\x64\x43\xa4\x0c\x51\x32\x6b\x30\x68\xc0\x07\x78\x5c\x2a\x5d\x32\x94\xca\xb3\x70\x5a\x9c\x3e\x1b\x16\x3c\x7c\x8f\x5f\x2d\x24\xd9\x17\x92\x19\xee\x5d\xc2\x98\xd0\x8d\x56\x06\x79\xc0\x0c\x97\x11\xdf\xc7\x84\xac\x74\xd8\xa9\xab\xd8\x1a\x01\x44\xe0\x2e\x64\xd2\x13\xf8\x59\x70\x45\x0a\xb7\xa4\xa4\x8c\x3f\xa1\x72\x35\x66\xe9\x54\x49\xc0\xd8\xdc\x4c\xce\x2a\x03\x81\xc0\xf1\x16\x2a\xf8\x62\x51\x9a\xe9\x56\x43\x9c\xda\x29\x95\xdc\xc1\xa4\xc5\xd2\x81\xbb\x6a\xa5\xa4\x9c\x84\xf3\xab\x18\xcb\xe8\x79\x53\xea\x55\x0a\x4a\xda\xd0\xbc\x39\xb8\x81\xc1\xa6\xa2\x91\xe7\x0c\x5f\x54\x2e\x37\xce\x36\x03\x66\x28\x5a\xd6\x48\x46\x6c\x2b\xfa\x0c\x6e\xa7\x21\x04\x35\x70\x3f\x70\x6e\x93\xb2\x4b\xcd\xf6\x87\xf4\x45\x70\xfe\xf0\xd7\x8e\x2e\xd8\x29\xf1\xfa\x81\x01\xdc\x6e\xba\x7d\x46\x04\x6b\x04\xd5\x21\xb7\x0f\xd7\x00\xc1\x48\x80\xc8\x0d\x7c\x76\x9c\x0a\xa9\x68\xf5\xe1\x9c\x12\xcc\x2a\x99\x99\x09\x84\xf3\x10\x0a\x1d\x63\x80\x0c\xa0\xd4\x40\x45\x79\x6c\xc4\x76\x20\xff\x33\x96\xe7\x69\x8c\x47\x59\x26\xc2\x92\xa4\x9d\x28\xb1\x92\x44\xed\x72\x82\xb2\x61\xa0\x41\xe7\x0a\x99\x3a\xbc\x5c\xd2\x13\x20\x4f\x84\xf5\x38\x15\xcb\x0c\x6d\x29\x51\xed\xdc\xca\xc3\x4a\x2d\x63\x55\x08\x2c\x66\x4c\x95\x9e\x2c\xb8\x25\x5a\xd2\x48\xd3\xb5\x5b\xa2\x19\x9b\x71\xbb\x8e\xdf\x7d\xb9\x58\x1b\x3e\x1f\xf8\x81\x7f\x73\xf9\xc6\x45\xd4\x6d\xc4\xcf\x97\x58\xd1\x02\xb3\x1d\xb3\x24\x44\x3a\x12\x9c\x16\xc7\x24\xd5\x01\x87\x68\x2b\xdb\x2a\x88\x02\x58\x1b\x3b\x07\x97\xe2\xc1\x0e\x71\xe1\x61\x79\x19\xe1\xd6\xa0\x4d\xb4\x0f\x83\xa4\x05\x98\x89\xf6\x17\x9d\x77\xa4\x28\x29\x82\xe0\x05\xce\x53\x63\x02\x68\x3d\xa2\x00\x86\x67\xec\xa7\x67\xec\x27\x37\xa0\xe4\x50\x21\x5b\x67\xa4\xfa\x12\x51\x83\xdd\x38\xec\x4b\x3f\xd9\x96\x3b\xf2\x52\x7c\x55\xfd\xfc\xdf\xf8\x59\xc5\xfe\x07\xfe\x1d\xfb\x93\xbf\x3d\xf8\xfe\x9f\x8d\x3d\xce\x36\x56\x96\xd9\xad\xeb\x03\xf9\x77\x56\xff\xc0\x77\xb2\xc6\x9f\x7d\x61\x4f\x23\xfa\xa1\xb7\x30\x76\xb4\xca\xd8\x97\xfe\x03\x63\x1b\xef\x43\xf6\x09\xfd\xf3\x07\x3e\x00\x56\xbd\xc1\x58\xa1\xc8\xdc\xf5\x8b\xfc\x75\x13\x16\xf8\x28\xad\xbd\xef\x29\xc0\x49\xe9\x19\x52\x60\x8e\xd7\x27\x90\x1f\x48\xd0\x7a\xc4\x80\x1d\x07\xdd\x21\x03\x6e\x74\xdb\xc9\x53\xcf\x3f\x13\x13\xfc\x9f\x53\xa9\x39\x43\x75\x53\xa0\xa4\x02\xbc\x95\x2e\xf9\x78\x72\x6e\x8e\xf5\xa6\xd2\xdf\x4a\xbd\xd1\x39\x07\x51\xc0\xc4\x1e\xfe\xf8\xdb\x48\x69\xb5\xfd\x08\xa8\xcf\xa2\x91\x96\x19\xc2\x9f\xce\x03\xfd\xbb\x6d\xe1\x79\xec\xcf\xee\x4c\x6b\x5a\x65\x65\x40\x22\xc3\x53\x9a\x86\x84\x28\x43\x95\xa6\x3f\x57\x2f\x5f\x3a\x07\xd7\x4c\xd6\x4a\x27\xca\x8a\x30\x1b\x6f\x10\x48\x83\x00\x9d\xa0\x1b\xdc\x88\x46\x5a\xa3\x65\xfa\xea\x9e\x9c\x62\x36\xfb\x1f\xfb\x07\x06\x1b\x9d\x82\x88\x8d\x3f\x91\x86\x8a\x36\x30\x99\x7b\x6e\xe0\xb8\xf1\x6e\x6b\x67\x5e\x32\x2f\x5d\x42\xd5\xb9\xf3\xfe\x9b\xcf\xdb\xed\x36\x11\x3b\x0c\xd5\xeb\x6a\x77\x67\x87\xd7\x87\x86\xb0\xb7\x8e\xda\xb3\x7c\x6c\x6c\x8c\xe1\xd8\x0c\x8e\xd1\x94\x4a\x45\x8e\x60\xbf\x7c\x3e\x8f\x83\xe4\x7c\x62\x64\x82\x55\x2a\x15\xf6\xd5\x27\xbf\x1e\xfd\xf3\x7f\xf1\xcf\xbe\x9a\xd8\xfc\xf9\x62\xb9\xd0\x4d\xe2\xc8\x8c\x77\xf0\xfd\x38\xf1\x4c\xd1\x52\xed\xf9\x09\xe3\x2c\x94\xe6\x70\x57\xfb\x91\xbd\xcc\xfc\xc2\x8c\xb0\xf0\x81\xd8\x26\xdf\x9f\x2b\xef\x1b\x14\x52\xfb\xfc\xb1\xc9\x78\x33\x4a\x32\x53\xcf\xd6\xb3\x88\x5a\x15\x9c\xb1\xbd\xbc\x48\xdd\x99\xbf\xf3\xd7\x67\xf2\x86\x66\x91\x67\x4e\x3d\x9b\x63\xa7\x9f\xa1\xa1\x16\xf8\x8c\xc1\x07\xc8\x24\x32\x84\xf7\x38\x43\x42\x98\x4a\x45\xef\x40\xd2\x7a\x42\x2a\x13\xd6\xd2\xc6\x11\x00\x3d\xaf\x3a\x18\x06\x23\x2e\x7b\xcd\x9f\x2c\x2c\x0d\xd7\xa4\x04\x96\x9a\x6b\x09\x64\x50\x7a\x16\x35\xd1\xe7\x81\x8b\x0f\x73\x2c\x30\x4a\x34\x9d\x4e\x13\xab\x58\x56\x41\x8f\x94\x10\xac\x48\xd3\x8f\xdb\x14\x79\xa3\x2a\x13\x92\x70\x5b\xb8\x50\x89\xf7\x2c\xd5\x40\x41\x54\x80\xc0\x52\x7c\x8a\x5d\x43\x5c\x4b\x09\x95\xdb\x29\xec\x60\x7a\x1c\x30\x1b\xff\xd7\xbb\x8a\x60\xc0\x54\x8e\xa2\xf2\x25\xd3\xa5\x29\xdb\x44\xaf\xc8\x2f\x80\xbd\xc0\x84\x68\x6d\xd1\xdd\x5b\x34\x1c\x28\xb3\xa0\x60\xf0\x64\x08\x08\xa8\x0b\xf0\xdc\x54\xdb\x85\x66\x5c\xcc\xe8\x60\x51\xec\x44\xff\x21\x91\x47\x60\x3f\x90\xc8\xfa\x52\x16\xe3\xfd\xa0\xae\x07\x4d\x9e\x32\x4b\x0d\x1e\x33\xed\x07\x69\x28\xff\x90\x22\x11\x37\x26\x06\x1d\x09\x05\x21\x10\x74\xd0\xbc\xaa\x4d\xdd\x56\xe2\x2f\x4c\x89\x1e\x43\x0d\xf0\xf6\x54\x21\x42\x74\x31\x42\x69\x1c\x0c\x0c\x28\x8f\x96\xf0\x99\x09\x7c\x76\xc8\xb2\xde\xf7\x00\x80\x45\x9f\x85\x95\x98\x04\xfb\xe5\xe8\xd4\x11\xe9\x85\x53\xf3\xfa\xbe\x98\xe5\x65\xe3\x6d\xc0\x28\x8d\x63\x68\x82\xc7\x11\x7a\x0e\x62\xcf\x06\x92\x91\x41\xa4\x75\xca\x34\x38\x91\x74\xe1\x15\xa1\xd3\xd0\x91\x27\xc2\x5c\x0b\xd7\x6e\x18\x57\x88\x22\x67\x8b\xa1\x98\x19\x29\x83\xf3\x50\xf4\x62\xa1\x94\x10\x48\x22\x30\x52\x51\xa5\x92\xc2\x4a\x0c\x8f\xe8\xb3\x13\xc2\xc3\xd3\xcc\x0d\x1a\x3d\x2c\x8e\x26\x38\xa9\x8c\x14\x48\x14\xa2\xa2\x09\x47\x38\xa3\x40\x87\x4d\x70\x23\x23\xcd\x4d\x45\x63\xa6\xe9\x21\x50\x49\x3b\x67\x29\xb2\xec\x59\x80\xac\x29\x21\xb8\xc9\x90\xc1\x10\x36\xdb\x8d\x74\x7c\x66\x44\x3c\xf6\xf0\xe3\xbf\x0d\xff\xfb\xb7\xb9\x99\xbf\xc7\x6b\xee\xf6\xba\xb7\xe0\x78\xdb\x88\xa9\x43\x92\x63\x78\xb4\xf8\x35\x41\x15\x6b\x5f\xf9\x69\x04\xb1\x58\x20\x43\x95\x03\x7f\x5b\x13\x55\x44\x72\xa2\x83\xc7\x8c\x31\xc0\x11\x28\x38\x0b\xac\x04\x64\x19\xfa\x1d\x0e\x9d\xc8\x46\xb0\x94\x46\xd5\x13\x0c\x56\xd1\x29\x91\x60\x74\x42\xa8\x00\xb3\xf5\x05\xa9\x3e\x71\x44\x8d\xa1\xb8\x3a\xb6\x2e\x6c\xfd\x73\x91\x65\x69\x11\x56\x0b\x20\x58\x8f\x1c\xe6\x24\x05\xab\x20\xbf\xf7\x7d\x1f\x96\xec\xff\xa7\x7f\xca\xe0\x4b\xee\xfc\xd9\x1b\x33\x9a\xc1\xeb\x0d\x42\x0a\xfa\xe7\xd1\xcc\x5d\xca\x5d\x3e\xff\x3a\x93\xc6\xd3\x7d\xcc\x0f\xc6\xa9\x13\x87\x43\x4a\x95\x20\x41\x85\x05\xcd\x5d\x47\x26\x83\x32\x2a\x5c\x03\x74\xaf\x88\x4a\x0d\x1b\x30\xe8\xd4\xa4\x71\x7a\x29\xb1\x00\xb1\x74\xbb\xa3\xec\xe9\x3a\x8f\x17\xb6\x14\x38\xb5\x3b\x8b\x99\x8a\xdd\xe9\xe0\xf7\x4d\x10\xf6\x7a\xfd\x3b\x92\xb0\x6f\xdd\x4d\xd5\x09\x0f\x2a\xf0\x49\x43\xd9\xa8\x94\x41\xf9\xe3\xf0\x7c\xa4\x39\x06\x20\x53\xbe\xf3\x3c\xa8\x40\xa8\xc7\xf3\x4d\xf9\xdc\x8c\x63\x51\x52\xa2\x07\x69\x49\x66\x54\x12\xce\x07\x15\xe7\x4d\x00\x60\x5e\x94\x7d\x62\xa5\xcf\xd8\x15\xec\xa2\xc3\xd6\xf2\xe0\xb6\x55\xf2\x77\x3c\x88\xbf\xb2\x43\x97\x6d\x1f\x0d\x36\x98\x68\x8b\x32\x24\x5c\x60\xf4\xe1\x8a\x67\x0e\xdd\x35\x2f\xe2\x7b\xd7\x5f\x79\x41\x2b\x96\x93\x13\x70\x4c\xe4\xa9\x5e\x77\xcf\x55\xa5\x52\x65\xcc\xe8\x7e\x8f\x8e\x8e\x92\xd7\x44\xe9\xd4\xd1\xd1\x11\xb2\x74\xd5\x6a\x35\x6b\x85\x2b\x2c\xcf\xe3\xef\x0b\xe0\xd4\xf3\x85\x3c\xff\xf3\x2f\xfe\x45\xf8\x0f\x7f\xfc\x7f\xfd\x7a\x20\xe4\xf3\x85\x6a\xa5\x85\xec\x43\x9a\x94\x60\x30\xcf\x9d\xe5\xd6\x03\x05\x4b\x43\x6a\xa3\xf8\x9e\x3f\x56\xc6\xed\x53\x7d\x58\xdd\x91\x2a\xef\x85\x71\xfb\xa3\x02\x93\x5d\x0c\x28\x63\xd4\x7e\xbd\xeb\x3d\xfd\x85\x6c\x86\x7d\xaf\x70\x4c\x42\xeb\x19\x41\x96\x01\xd9\xed\x23\x8a\x13\x66\x60\x7d\x1f\xcb\x9c\x3e\x5f\x21\xf6\xca\xf0\x7b\x50\x7a\xec\x03\x91\x11\xb1\x14\x5a\x6c\xd2\x6d\x4d\x4c\xa9\xcf\x78\x7d\x74\x3b\xe8\x44\x0c\x05\x91\xc8\xa8\x14\xd9\x80\xc0\x5e\xa3\xfc\xb3\xeb\x35\xb3\x78\x3a\xbb\xc5\xc2\x33\x38\x16\x2b\x11\x44\x1f\xaf\x34\x04\x41\x91\x72\x03\x8e\x1a\x91\x03\x15\xba\x27\x44\x90\x52\x2a\xc7\x23\x99\x47\x4a\xbd\x8e\x44\xcf\x4e\xd3\xcf\x25\x15\xd8\x2d\x4d\xbd\x27\x49\xae\xc9\x60\x72\xa9\xa4\x45\x65\xf7\x44\x67\x9f\x9a\xb9\x47\x13\xb7\xa9\xc1\xcc\xb5\x22\x85\x79\xda\x03\x44\xe6\x40\x78\x6f\x72\xe4\xba\xbd\x27\x98\xe1\x6a\x12\x9a\x46\x39\x23\x52\xe1\x19\xbe\x87\xaa\x5e\x8c\xca\x93\xb4\x7d\x8c\x20\x84\xc8\x7a\x32\x06\x54\xa4\x6f\x12\x23\xfd\x28\x4e\xd5\x40\x1a\xfd\x91\x86\x57\x88\x32\x08\x45\x9f\xce\x07\x42\x35\x7b\xe8\x1a\x02\x3e\x49\xdd\x74\x40\x80\x1a\xc1\xcf\x12\x72\xba\x42\x2b\x52\x65\xc5\x00\xcd\x24\xc5\xb3\xb5\x33\x18\x81\x23\x35\x4f\x9c\x1b\xa2\xe2\x3a\x98\x2f\xdc\x72\xc8\x10\x99\xca\x08\xc3\x02\xad\x03\xc0\x0d\x9e\x99\xea\xa1\x78\xb5\x09\xdd\x43\x92\x91\x49\xf1\x33\x53\x0b\x2b\x0c\x9a\x55\x90\xf6\x44\xea\xc0\xe3\xd2\xa6\x03\xcf\x90\x2b\x13\xa8\x6a\xa4\x36\x06\x06\x8a\x78\x08\x28\x93\x96\x86\x68\x49\x19\xa5\x59\x41\xd5\x06\x8a\x1a\x49\x57\x93\x91\x9b\xc2\x3e\x7c\x88\x8c\x04\xa4\x70\x26\x4d\x2b\x16\xf9\x1b\xe1\x6c\x93\x14\xe1\x7c\x98\x72\xeb\x81\x29\x6c\x75\x91\xfe\x84\x14\x7c\x50\x0c\x35\x0a\x01\xd8\xea\x4c\xa9\x98\x9b\xe8\xce\x6e\xaa\xf9\x9c\x84\xd4\xf3\x9f\x08\xf9\x34\x6a\x3a\xc4\x38\xea\x72\x57\xe4\x54\xce\x65\xa4\x9c\x80\xd2\x9d\x3c\x6b\x51\xca\x4c\xcf\x5e\x3f\x65\x16\xaf\xad\xad\x06\x08\xcc\x9b\x9e\x99\x72\x8a\xd4\xc7\x43\xd1\x90\x64\xb7\xdd\xed\xac\xbd\xf8\xea\x8b\x37\xe0\x03\x63\x3c\x7b\xe4\xd5\x0b\x55\x98\x06\x2c\x90\x3e\xfb\xff\xd8\xbb\x96\x1e\x39\xae\x2a\x7c\xcf\xad\xea\xee\x99\x71\x0c\x22\xe6\x6d\x29\x48\x59\x0c\x31\x2c\x10\xd9\x20\x21\x04\x89\x50\x7e\x0a\x62\x03\xff\x01\x11\xc1\x82\x0d\x6b\xfe\x03\x24\x02\x45\x6c\x82\xe4\x48\x20\x05\xf1\x08\xb0\x01\x84\x84\x63\x43\x1c\x14\xa1\x24\xf6\x8c\x67\xfa\x55\x75\x0f\xf7\xbc\xee\xbd\x55\xfd\x98\xee\x76\x4f\x62\x91\xb4\xd5\xf2\x74\x77\x75\x75\x3d\xcf\xf3\xfb\xbe\x33\x6d\x1f\xe0\x19\x8e\xdc\x10\xef\xb6\xff\xc1\xeb\xd5\x67\xe0\x1c\xc7\x34\xc4\x99\x01\xc1\x23\x06\x2b\x09\xcb\x95\x1c\x70\x91\x9d\x83\x2b\xa0\xe4\xa8\x7c\x3b\xd4\xac\x94\x29\xe7\x9c\xae\xb4\xe1\xaa\xbf\x6a\x88\x58\x9f\x1c\x77\x37\x30\x08\x4b\x46\x59\x87\x35\xfa\x06\x3b\x3d\x02\x2e\x36\xf4\x96\x3a\xee\x65\x2d\xc2\xd2\xd1\xc7\xbd\x9c\x0d\x3e\x81\xc3\xf9\x7f\xa1\xb7\x42\xc5\x13\x80\xad\x24\x70\x69\x59\x80\xc7\x12\x3c\xca\x64\x0b\xc7\xa2\x9e\xb5\x33\x87\xdf\x72\x8b\x4d\x46\x90\xb4\x1c\xf3\xc6\x84\x92\x27\xb8\x68\xc0\xd1\xdc\x7d\x17\x7b\xfe\xb7\xe3\xd8\x45\x82\xa1\x68\x60\xc6\x4b\xef\xfc\x5c\x1d\x3a\x5c\x0c\x7b\xca\xc4\x7f\xa1\x68\xea\x40\x34\x2c\x3a\x9f\x7c\xf6\xc3\xa9\xcc\x11\x98\xf9\x27\x70\x18\xfe\x55\x96\x6f\x83\xb2\x0f\x6c\xf4\x28\x6a\xf6\x0d\x4e\xa9\x79\xa8\xed\x19\x90\x65\x43\x3a\xcf\x4c\x54\xa6\x2a\xa1\x97\xf0\xba\x09\x4b\x9d\xf9\x2e\x0e\x1d\x29\x0a\xf1\xa3\x43\x70\xa2\x32\xd4\xca\x7c\x37\x3e\xc8\x4d\x1a\xe4\xc2\x80\x1d\xa8\x34\xc1\xa4\x7a\xf9\x44\x0f\x09\x35\xc3\xaf\xd8\xcc\xb4\x61\x3d\x20\x4b\x86\x87\x87\x07\xb0\x76\x5c\xaa\xe8\x05\xe7\xab\x22\x84\x74\xb2\x8e\x8f\x8f\xdd\x4f\x5f\xf8\xd9\xf9\xf7\x7e\xf8\xfc\xab\xf3\xda\xfd\xbe\x3e\x3c\xbc\x3f\x9d\x4e\x03\x14\x74\x2f\xe5\x14\x99\xb6\x6e\x12\x6c\x91\x56\x5c\x7a\x4f\xa7\xaa\x68\x23\x59\xb2\x54\x57\xfa\x6e\x60\xa1\x03\x51\x91\xf3\x3a\x0c\x4d\x1b\xf4\xfc\x59\x21\xdd\xea\x74\x12\x11\xa3\xf8\xb9\xfd\x6a\xdb\x0c\x26\x36\x97\xd3\x39\x97\x54\x02\x7d\xf6\xe8\xda\xc3\xf7\x02\x2f\x4e\x21\x87\x3a\xa3\xbc\x2e\xdd\x7e\xa9\xe5\x78\x22\xd4\xc9\x3c\x00\xa2\x17\xe9\x9e\x08\x42\xbc\x62\x8c\x8b\xaf\x25\xdd\xe4\x19\xee\x95\x2f\xcf\xac\xd5\x14\x0c\xba\xcf\xd3\xeb\x44\xae\x97\xc8\xc1\xd4\x4a\x26\x20\xae\x27\x98\x94\x8c\xc6\x22\xeb\xe9\x28\x71\xa7\x82\x18\x71\xa9\x24\xb5\x0d\xb2\xd3\x1c\x5a\x27\xd2\xb0\xa9\x74\xb0\x49\x27\x86\xb2\x60\x69\xb5\x6a\x84\x10\xf4\x73\xa1\x88\x36\x7c\x3a\xb2\xa4\x4e\xbe\xe5\xcc\xe1\x71\x39\xda\xe8\x36\x34\x13\x58\x1a\xe3\x5c\x04\x76\x4d\x0a\x80\x92\x00\x89\x9d\x17\xe1\xe4\x97\xf0\x46\x0e\x44\xa4\xfa\xe1\xd3\x08\x5e\x2f\x02\x3b\x08\x45\x73\x4d\xc6\x0f\x53\xad\x81\x87\xe0\xf2\x09\x0b\x3c\x9c\xc7\xab\xba\xa0\x4d\x00\x74\x92\xb3\xd3\xdb\x3a\x20\x17\x3d\xa3\xcc\x05\x34\x2c\xf1\x80\xd3\xb9\x00\x3e\xe8\xf8\x3d\xbd\xa0\xcc\x60\x82\x0d\x54\x44\x4b\x06\x2a\x61\x0b\x33\xf1\x4e\x87\x33\xa5\x06\x91\x4e\x09\x12\x59\x0a\x2e\x4a\x93\x7f\x66\x4d\x86\x86\xb5\x4f\x82\x61\x9e\x48\x9a\x53\xf2\x1c\x59\x2b\x18\xaf\x9d\x97\x30\xa7\x1f\x33\x69\x46\xfa\xcb\xac\x35\x50\x30\x33\x92\x68\x2d\xe9\x71\x91\xd1\x21\xc7\x1c\x24\x43\x91\x81\x43\xad\xe4\xc3\x32\x3f\x9e\x24\x3d\xd8\x81\xc7\xeb\x20\x50\xc6\xab\x40\x2a\x76\xf8\x71\x57\x2a\xa7\x6e\x9c\xb5\x96\xc9\x91\xd3\x3d\xd4\x20\xc3\xd8\xa3\x31\x69\x78\xfd\x74\x0c\x2a\xea\xf9\x0a\xc8\x33\x1a\x96\x01\xeb\xac\xc7\xe5\xc2\x81\x3f\xf0\x1f\xa9\x3e\x5a\x1d\xc0\x01\xd1\x8c\x86\x35\xd4\x6d\xbc\xfe\xdb\x78\x17\x68\x18\x20\x5c\x2b\xea\xb5\x23\x25\x14\xe8\xc6\x6f\xbe\xf1\xe6\xc9\x1b\xff\xbe\x7b\x2f\x86\x15\x27\x8c\x29\xc1\x70\x3e\x27\xc9\x2a\x22\x96\xc7\xef\x4d\x63\x82\x4e\xe2\xb1\x13\x98\xe2\x49\x78\xc0\x4e\xbc\xb4\x43\xf4\x3a\x3e\xdd\x8d\xc1\x71\x3c\x50\x57\x09\x21\xdd\xce\x71\x66\x75\x2d\x9f\xf4\xcd\x5c\x57\xe2\x88\x0e\xf0\x08\x46\xa5\x23\x4e\x60\xb9\x9e\xdf\x30\xc7\xdd\x2f\xdb\xdb\x77\xec\xfb\xf8\xec\x73\xcf\xec\xd5\xa1\x6b\xd9\x63\x33\x87\x8e\x3d\x3c\x91\xbd\x57\x8c\x3c\x9c\x55\xd1\xa9\xb7\x1d\xa7\x5e\x70\x73\xc1\xf6\xc7\x6b\xb8\xdd\x82\xb6\xf0\x75\xac\x26\x8f\x23\xa1\x3a\x8e\x8e\xba\xe2\xac\x9c\x0d\x2a\x5d\x20\xe4\xcc\x67\xf1\xfa\x3b\xff\x66\xfc\xca\x2f\x2f\xf0\xc4\xc5\xef\xa7\xd1\x5b\x80\x27\x0f\x4e\xa4\x18\x4b\xcd\x1e\xdf\x6f\x7c\x76\x63\x11\xd3\x4b\x21\xdb\x71\x4a\xb3\xc8\x9d\xde\xe3\xcc\x05\x45\xd1\x5d\x6f\xe2\xf5\x3a\x99\xe3\x0a\xec\x99\xa2\x71\x19\x2f\xc1\x36\x5a\x50\xef\x22\x18\x4a\xc6\x19\xb4\x50\x28\xa1\x07\x94\x1c\xf3\xe0\x54\x38\xd4\x1f\x8d\x70\x5d\x20\xb7\xad\x43\x87\xea\xe3\x57\xfb\xfd\x01\x09\xed\xd0\xb5\x45\xe3\x57\x0e\x1b\xf1\x3f\x9d\x9f\xa9\x5d\x26\x67\x3e\xd1\x08\x94\xf1\xca\xb7\xee\xdc\x6e\x5f\xf8\xc5\xcf\x09\xfe\xdf\x03\x04\x22\xf4\x22\xc7\x25\xc8\x33\x4a\x34\xeb\xf0\xfa\x9d\x3b\xd3\xe7\x7f\xf4\x83\x3f\xcc\x0f\xaa\x3f\x56\xc3\xe1\xbd\x79\xc3\x0c\xd4\x60\xd2\x2e\x49\x1b\x83\xb2\x19\x9f\x9c\xa1\x7e\x24\xf6\xda\xab\x9c\xab\x37\x25\x38\xf3\x95\x6a\xf8\xed\x7b\x49\xfa\xc5\xea\xf4\xa6\x10\xcb\xb3\x54\x4d\x7a\x2c\x7f\x96\x13\x5f\x00\x1b\x97\xe8\x65\x59\xad\x9f\x7b\x09\xe7\xd5\x79\x4b\x64\x9a\x4d\x82\x5d\xfd\x04\x25\x4a\x54\xb8\x32\x14\x01\xb0\x99\xaa\x29\x0a\x04\x0b\x0c\x58\x6b\xd9\xe7\x4a\x7f\x50\x98\xc0\x1c\x8b\x24\x12\x96\x5d\xc3\xac\x9e\xa3\xa5\x36\x34\x09\x7a\xbd\x15\x54\x50\xa6\x33\xd4\xc4\x65\x35\xd2\xf2\xee\xd7\x7d\xcf\xe7\x2e\x1b\xb8\xd4\xd0\x50\x0a\x4c\xd9\x50\xb0\x59\xa3\x50\x8c\x86\x2e\xa2\x2a\x23\xe3\x4b\x46\x8b\x66\x10\xb1\x1b\x65\xc3\xd2\xc8\xdb\x24\xf2\xe5\xbe\xc2\x2e\x60\x51\xf5\xa3\x8b\x9d\xc3\xe2\x98\xcb\x34\x38\x5f\xe5\xef\x32\x21\x49\xca\x83\x1a\xdc\xa6\x21\x2f\x7a\x0d\x84\x74\xa5\x32\x13\x90\x83\xbe\xd0\x47\x56\x0a\x5e\x33\x18\xdd\xdb\x54\xba\x44\x34\x47\xcb\x0a\x06\x3e\xd6\x31\xb6\x6c\x06\x83\x05\x10\x68\x22\xda\x5c\x5e\x90\x52\xa0\x21\xe4\xd0\xd8\x0b\x28\xed\x04\x01\x40\xb3\x3d\xb4\xe1\x20\x06\x10\x2a\x1c\xbe\xe6\x93\xdc\x97\x66\xaa\xa7\xc2\xf4\x04\x85\xc3\xe2\x06\x4c\x15\x60\xe0\xb0\x86\x2b\xcc\xc2\x0d\x9c\x62\xb1\x58\x52\x74\xb7\x6c\xd8\x90\xf2\x6d\x2a\xa7\x53\x2e\x9a\x99\xcf\xda\xe5\x90\x30\x43\x53\x58\x4c\x2c\x6e\xd9\x07\x90\x8a\x88\x50\x0b\x79\x7e\x80\xa8\x21\xc7\xdf\x6d\x1a\x19\xb2\x52\x3f\x4e\x6a\x8e\xd5\xc8\x8f\xaa\x1a\x06\xf3\xe8\x90\xb9\x77\x1e\x9f\xc4\xb6\xa8\x8d\xc5\x4a\x0e\x32\xbe\x37\x8e\xc6\xf2\x3c\x1e\xb4\xb3\xb8\x8a\xb3\xf8\x53\x67\x34\x70\x8a\x06\x12\x4d\xc2\xa4\x3d\x69\x4f\xb9\x0b\x4f\x1b\x40\x3d\xe9\x8b\x0c\xa1\x2e\x83\xd1\xb1\x33\xa6\xe8\xa9\xc1\x71\x79\x17\xc1\x0a\xa3\x9e\xfe\x5f\xe1\x8c\xf1\xe6\xcb\xaf\xa0\xcb\x34\x37\x58\xf6\xfd\x7d\x3b\xf2\xae\x43\xc7\x85\xf7\x56\xc2\xa3\x57\x7d\x90\xc5\xe5\xdc\xec\xf0\xf1\xb8\xd2\xef\xb8\xe1\xe4\xfb\x0b\x05\x81\x4e\x8f\xdd\x6a\x8d\x41\x09\xb9\x6c\x7b\xb9\x4f\x27\x23\xaf\x9a\x20\x97\xa0\xd1\xca\xe2\x35\x10\x9e\xfa\x31\xba\xd7\x5e\xea\xac\x74\x76\xf0\x24\x0e\x27\xb7\xa0\xd7\x43\x2f\x7b\xa1\x32\x78\x2a\x26\x33\x93\xa9\x0c\x2b\xba\x76\xed\xda\x56\xc7\x89\x28\x17\x9a\x5d\x0b\xe4\x2e\x57\x1c\xba\xdb\x72\x78\x1d\x87\xe3\xbb\xb0\xe0\xd4\x8d\x35\xeb\x4c\xbd\x42\x8f\x44\x25\xca\xe1\x92\xac\xeb\x2d\x47\xb6\x60\x50\x3b\x8e\xa3\xa5\xa4\xbf\xf6\xdc\x6f\xe3\xd0\x61\xe5\x69\x15\x68\xfd\x62\xd5\x42\x86\x1c\xa0\xf6\xd3\xa7\x9a\xc1\xcf\xb8\x34\x1f\xc3\xe8\xdf\xfe\xf5\xcf\xef\xbc\xfa\xdd\x6f\xd5\xab\xeb\x1d\xd8\x8f\xb3\x8c\xf7\x3e\x89\xbb\x7a\x16\xad\xc1\x69\xfc\xfb\x6d\x7f\x30\xb8\x0d\xa3\xfa\xed\x68\x3a\xa6\x8a\x2f\xa0\x19\xbe\x14\x00\x05\x97\xf5\x09\xc9\x3a\x59\xe6\xcf\x42\x02\xc8\x79\x30\x63\x8f\x54\x52\xd5\x6b\xf9\x51\xdd\x25\xeb\x51\xd0\xa8\xe0\x0a\x72\xe6\x94\xdb\xe9\x90\x16\xec\x05\x02\x50\xce\x51\xc9\x2a\xae\xa2\x7a\x9a\x45\x67\x52\x82\x9e\xd3\xc9\xdc\xde\x57\xe2\x6f\x99\x66\x82\x49\xc6\x1a\xf7\xdd\x95\x22\x72\x79\x7d\x28\xec\xd0\xd6\xb6\xcb\x95\xa9\x5c\x17\x6b\x0f\x85\x52\x77\x8a\x3b\x96\xa0\xfa\x01\x71\xed\xb5\x90\x5d\x75\xaf\xde\x95\xba\x03\xcb\x8a\x61\x4b\x38\x79\xe0\x56\x14\xce\x16\xd0\x05\x2b\x36\xa4\x0f\x59\x2c\x1a\x23\xfd\x10\x46\xf5\xf6\xb1\x44\x2e\x66\x42\x02\x60\x77\x13\xc0\x1a\x00\xa5\x06\x4b\x52\x54\x2d\x0e\x34\xa6\xf2\xb5\xbd\xc6\x24\x82\xe3\x12\xc4\x3e\xff\x56\x56\x01\x49\xf5\x59\xb4\x20\x22\x7b\x58\x28\xb7\xc9\x48\x77\x90\xac\x27\xf6\x17\x2e\x74\xc7\x85\xb9\x19\x52\xb2\x28\x76\x3b\x24\xf1\x4e\xb4\xe5\xf4\xa2\xd2\xc1\x3b\x92\x4f\x6b\x19\xde\xe5\xed\xb1\x65\xd5\x27\x07\xdd\x19\xc6\x95\xa3\x5d\xea\x8c\x69\x6a\x1a\xbb\xb2\x28\x5f\x37\xf1\x04\x14\x7b\xdc\x20\x96\xa3\x04\x09\xe2\xde\x08\x38\xdd\xe5\x80\x4f\xe1\x0d\x0a\x20\x02\x8d\xa4\x2a\x69\x67\xc5\x94\x3a\x30\x48\xcd\xd7\x4d\x05\xf4\xac\x48\x1e\x6c\x4c\xe0\x32\x4a\x7e\x6c\xc4\xb4\xd8\x0c\x37\x8e\x16\xe1\x01\x89\xbf\xc5\xb7\xce\xe2\xa7\x63\x42\xb1\x87\xf8\xb3\xbf\x6b\xfe\x24\x88\xaf\xf9\x6a\xe3\xb7\x06\x74\xb6\x57\xe7\xaa\xce\xfa\x52\x1c\xf6\xb2\xc7\x4f\x8e\xbe\xbd\x7e\x47\x16\x32\xf4\xe5\x5c\x9b\xe5\x25\xf8\xfc\x9d\xd9\xdf\xbe\x84\xc3\x1b\x7f\x29\x1d\x2d\x2c\x24\x80\x88\x02\x12\x12\x40\x31\x0a\x63\x92\x92\x56\x92\xda\x89\x17\xd7\xbc\x15\x03\x13\xcf\x6e\xfb\xf5\xaf\xa0\xbb\xbd\x89\xd7\x4a\x8d\x50\x94\xb4\x06\x65\x62\x47\x8b\xf8\xab\x5f\xdf\x6c\xbf\xfc\x8d\xaf\x62\xed\x2b\x92\x11\xa7\x49\x72\x9c\x81\xfb\x94\x08\x41\x42\xc9\xa3\x0c\x93\xe3\xea\xc9\xeb\xb7\x6e\x9d\x9b\xe0\x7d\xf7\x40\x7c\x2d\xfe\xfd\x9b\xae\x53\x1f\x3f\x8d\xc3\xc3\xd7\xfa\x4e\x1d\x9c\xdd\xa6\xa0\x75\xa4\x0a\xb0\x23\xa6\x2b\x91\x37\x55\x56\xe3\x7e\x37\x9c\x99\xc3\xc1\xe0\xc2\xdd\xad\xf7\x78\x6d\xe0\x1a\xee\xfa\xdc\xe5\xb9\xea\x0f\xb8\x3f\x44\x68\xe7\xa3\xa1\x5f\xe3\xcb\x61\x39\xba\x1e\x6d\x1d\xef\xe8\xf3\x44\x5f\xcf\xa4\x17\x23\x32\x07\x74\x0a\x5b\x57\x64\xf6\x98\x6d\xba\xe0\x12\x83\x9a\xc8\x16\x8a\x2d\xe5\xd3\x5f\xd1\x48\x55\x21\x5d\x32\xe3\xb9\x11\x10\xaa\xb4\x17\x05\x35\xe6\xf2\xf0\x15\x57\xf4\xbd\xbd\x8d\xef\xd2\x24\xda\x9b\xfb\x87\x94\x35\xb6\xae\xeb\xed\xb3\xd7\xcf\xae\xa5\x9c\xb9\xe6\x7a\xea\x53\x5a\x49\xc0\xb2\x1f\x93\x3c\x4c\x12\xac\x2f\x35\x51\x5d\xe7\x6f\x5b\x36\x73\xef\xa1\x0f\xe5\x5b\xea\x6d\x33\xe2\x4b\xd5\x28\xbb\xc9\x43\x3a\x1e\xd0\xfd\x2a\x16\xb3\xfd\x36\x63\xe8\xc3\xea\xfb\xf2\x82\xe5\x16\x7e\x7a\xc9\x72\x70\xf1\xf5\x5a\x46\x4a\x85\x05\x83\x32\x5d\xea\xd1\x0c\x60\xb1\xcc\x26\xe5\x73\x5c\xa4\xc3\x98\xae\x6d\xae\x3e\x06\xa5\x18\x99\x6a\x57\x69\x36\xad\xf7\x87\x26\xa7\x08\xd0\xc9\xd8\xd4\x51\x4b\xa6\x6f\xe5\x3f\x97\x68\xd0\x65\x90\x80\x45\x16\x26\xf2\x63\xcc\xd3\x53\xe3\xe9\x44\xfa\x13\x3b\x12\x85\x90\x7e\xc3\xb2\xe5\x54\x11\xc1\x5c\xba\xa4\x0a\x43\x43\xc4\xef\x2e\xc9\x12\xa5\x48\xcf\xec\x5b\x97\xd6\xab\xd5\x0c\x94\x2a\x4b\xae\xd0\x78\xd5\x62\x19\xd4\x58\x14\xe1\x5c\xd1\xba\x24\x47\x9e\x8e\x7b\x34\xee\xee\xb1\xc1\x63\xee\xb0\x3a\x6a\x87\x7e\x48\xea\x72\x4c\xd7\xa4\x29\xd4\x2a\xca\xdc\x28\x96\x47\x10\xf7\xe0\xc6\x3a\xfe\xf9\x9c\x34\x10\x18\xc9\x1e\xc3\x8c\xa9\x9b\xe1\x86\x8e\xfb\xff\xff\x81\x9b\x44\x12\xb8\xde\x81\xaf\xa1\xe0\x12\x58\x4c\xd1\xd8\x7d\xc7\x8e\xdd\x82\x61\x31\x7a\x20\x59\xa9\x7c\x8f\x35\x4f\x7c\x11\xd7\x06\x12\x8b\x1b\x2c\x4c\x03\x56\xb9\xe7\x32\x28\x8b\x2c\xdd\x1f\x9f\xe2\xfd\x7f\xfe\xbd\x15\x00\xa8\xe2\x44\x6c\x24\xa4\x4b\x71\x6e\x60\xde\x77\xcc\x8f\x1d\x01\x3b\x43\xe0\xff\x0d\xec\x96\x99\x37\xab\x1f\xb3\xf0\x39\x1c\xfa\x3b\xdd\xd6\x83\xc1\xeb\x45\x7c\x39\x65\x3d\x58\xf0\x50\xb9\x2a\x38\xaa\x09\x65\xbc\xf1\x29\xdc\x85\x87\x0e\x3b\x5c\x2a\x8d\x66\xe8\xa7\x0a\xf6\x98\xe9\xcd\x66\x40\x90\x4d\xec\xba\xd0\x9b\xa4\x6c\x7f\x1a\x3f\xa7\x39\xb0\xe4\xcc\xcf\x1c\xf0\xba\x5b\x57\x60\xd3\xb9\x05\xb3\xc8\x29\xcb\x6b\x4f\xbc\xa5\x02\xc2\xe8\x0c\xc8\x5e\x56\x06\x30\x15\x89\x95\xc7\xcb\x59\x7d\x87\x3a\xa6\x0e\xce\x1b\x78\x28\xdb\xf9\xac\x15\x24\x83\x4c\x34\xd3\x55\x44\x79\x82\xd6\xe7\x2c\xdd\x40\x75\xa5\x0a\x5d\xd7\x4d\x09\x17\xb2\xeb\x6c\x5d\x59\xb8\x71\x00\xb0\xec\x28\x42\xaf\x8c\x06\x1b\x7a\x53\xd8\xda\xfb\x6e\x5e\xef\x81\x2d\x5c\xfa\x43\x67\x46\xb0\x7c\x55\xb8\x66\x49\x5c\x59\x86\xb8\x78\x5b\x72\xc8\x87\x2e\x01\x42\x60\x71\xaa\x4c\xd7\x89\xba\x8c\xc4\x4f\x22\x3a\xda\xbf\xd3\x2c\x23\xb7\x03\x38\x88\x4f\xa5\x1a\xc4\xd4\xe9\x4e\x95\x07\xcb\xfe\x35\x20\x10\xc7\x1a\x04\x4d\xa7\x0d\xf9\xd6\x19\x48\x54\x54\xf4\x3a\xa5\x9f\xe4\xf8\x59\x7c\x07\xa0\xd3\x8f\x54\xbe\x1c\xbf\xd5\xa8\x35\x2c\xd8\x1f\x45\x08\x5a\x2a\x29\x14\x30\x0d\x0f\x5d\x1f\x22\x02\x1f\xb8\xa4\x4e\xb3\x78\x86\x06\x15\xf7\xb3\xaf\xd7\x9f\x75\x5a\x66\xb7\xe6\x17\xe7\xda\x24\xa4\xa4\xf6\x0d\x0a\xfb\x33\x8e\xbb\x77\x4e\x9f\x35\xae\x99\x5f\xf1\x57\x9a\x2b\xee\x4a\xf8\x40\x3b\xf1\x7e\x79\x1d\x71\x73\x4f\xb0\xe3\x63\x76\x2f\xae\xe1\xf3\xc7\x6e\xf8\xd6\x3f\x96\xf5\xd7\xb5\x02\xd3\x0d\x9a\x67\x47\x4f\xa3\x9b\xbd\x15\x8d\xe8\xb4\x40\xd4\x6f\xb4\xa5\x98\xfa\xd0\x92\xb2\x35\x3a\x0a\xc8\xb4\x27\xa5\x12\x0a\xa6\xae\x93\x8b\x5e\x3c\xdc\x81\x95\x10\x08\xd8\x41\xbd\xef\x40\x12\xaf\x2d\x8a\xf6\x45\xa3\xdd\x46\xdc\xc4\x0c\xce\xaa\x8f\xe1\xb0\x7d\x77\x71\x7f\xbd\xef\x96\x42\x4b\x3b\x33\xdc\x3e\xdf\x5e\x98\xb6\x36\xfa\xc2\xf5\x9d\x6c\xe4\x9a\x87\x22\xdd\xdd\x91\x93\x89\x6d\xf4\x4c\x13\xda\xb6\x58\x2f\x96\x37\x26\x45\xda\xfa\xff\x4c\xdf\x07\xb7\x5e\xf5\x65\xd5\x7b\xdb\xbc\xde\xf5\xb3\x87\x59\x76\x93\xd7\x17\xad\x7f\x5b\x67\x7d\x19\x4e\x1c\x2e\xdb\x1e\x5d\xe2\xf7\x71\x0f\xef\xe3\x9a\xcf\xf7\xf9\xfa\x61\x96\x75\x8b\x3d\xc7\x87\xda\xae\x5d\x97\xd9\xf8\xf3\x1b\x83\x63\xf8\x74\xf5\xa9\x6a\x18\x3d\x7c\xed\x06\xcc\x07\x07\x1e\xef\xcc\xb4\x2f\xeb\xf9\x51\x65\x8f\x50\x79\xb3\x1a\xea\x69\x61\x33\xc2\xb3\xcf\x3d\x13\xdc\x07\xf8\x71\xf3\xe5\x57\xd2\xdf\x2f\x9e\xbf\xf4\x7e\x6d\x06\xec\xf9\xbe\x86\xe2\xe9\x55\x55\x91\xb8\x22\x03\x96\x95\xa6\xd7\x0c\xb7\x63\xe8\xa8\x00\x5a\x2d\x01\xcc\x75\x26\xa1\xd7\x09\xb8\xa4\x89\x19\xfc\x9c\x91\x9b\x84\xf1\xe4\xff\x95\x7a\xa7\x3d\xa9\xc1\x93\x9f\xc4\xf7\x71\x7f\xf7\x56\x72\xc7\x0d\x36\x3a\xe8\xcd\x33\xd6\xf2\xfb\x44\x7f\xd7\x6f\x69\xe4\x4d\xd0\x26\x2b\xe7\xc8\xb3\x2d\x7e\x67\x57\x87\xb5\x8d\x63\xdb\xd5\x31\xc2\x9e\xb7\x63\x9b\xef\x6f\xe3\x54\xe1\x3d\xb8\x49\x1f\x65\xc7\xfe\xb0\xeb\xdc\x26\x30\xd8\x35\x20\xd8\x35\x70\xd8\xc7\x6f\xee\x63\xd9\xbd\x9d\x2f\x02\xa7\x09\xed\xeb\x88\xae\xb8\xd9\x11\x1c\x59\xd0\x5f\x17\xd5\x3f\xcd\xce\x2e\x97\xf6\xf5\xe1\xe3\x91\xbc\x67\x8b\xec\x3c\x55\x96\x5a\xe1\x36\x0a\x4d\x4e\x34\x41\x72\xfb\xda\xe5\xa1\xb6\xac\xd2\x00\xc4\xe6\x02\x22\x8b\x40\x4b\xff\x90\x35\x30\x89\x06\x44\x93\x0c\x88\xcd\xe2\x1f\x85\xfd\xdd\x8b\x43\xdf\x74\xa3\xdb\xc2\x21\x4f\x0a\x67\x0e\x3b\x9f\x9c\x92\xfa\x71\xf1\xf7\x60\xc3\x03\xba\x6b\x66\xba\xab\x23\xdd\xa7\x83\xbd\x9c\xd2\xf8\x87\x8f\xcb\x30\x50\xfb\x70\x72\x78\x49\xeb\xdf\x97\x03\xbe\x54\x67\xd9\x2b\x93\xb7\x31\xd3\x34\x4a\x97\x95\xd8\xdf\x73\xda\xd7\x87\x8f\x47\xea\xfe\xeb\x0a\xbb\x74\xff\xf6\x50\x75\xb2\xf8\xbe\xa1\xc4\x25\xd7\x4c\xe8\x5f\x3f\x8f\x62\x40\xf8\x3f\x01\x06\x00\x57\xd0\xa1\xda\x22\xdd\x04\xb9\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\xae\x43\x81\x18\x96\xb2\x00\x00")) - folderTime48 = HexToBytes("folderTime48", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x02\x15\xfd\xea\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x00\x57\x02\xf9\x87\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x14\xa4\x49\x44\x41\x54\x78\xda\xd4\x5a\x0b\x74\x1c\xe5\x75\xbe\xf3\x9e\x7d\x69\x77\xf5\x7e\xbf\x2d\xc9\xb6\x24\x4b\xb6\xe5\x18\x63\x9b\x02\xb6\x29\x07\x14\xc2\xa3\x60\x08\xcf\x90\x26\xf8\x00\x69\x4e\x7a\x9a\x93\xa4\x49\x93\x26\xa4\xa1\xed\x49\x09\x24\x0e\x49\x4e\x08\x01\x92\x50\x30\x01\x43\x5c\x12\xb0\x01\xc7\xd8\x01\x5b\xc2\xc6\xd8\x8e\x89\x1f\xb2\xde\xda\xd5\xae\xf6\x39\xbb\xf3\x9e\xbf\xf7\x9f\x95\x8d\xa9\x25\x70\x4a\x4f\x7b\xba\x7b\x46\xbb\x3b\xbb\x33\x73\x1f\xdf\xfd\xee\x77\xff\x11\x43\x08\x81\xff\xcf\x0f\xfe\xf4\x9b\xc7\x9f\x7b\x0a\x06\x0e\x0c\x00\x27\x89\x00\x56\x08\x08\x09\xe1\x5e\xe7\x03\x0e\x65\x80\xe5\x58\x60\x45\x16\x78\x59\x06\x96\xe7\xc0\x36\x33\x60\xea\x19\x60\x58\x41\xe2\xe5\x50\x25\xcb\x30\x21\x86\x61\x04\x0c\x92\xe1\x10\x48\x00\x81\x08\x1e\x66\x31\xf4\x70\x8c\x1b\xb1\x1c\xb0\x0d\x1b\x8f\x73\x80\xd8\xef\x5d\xcb\xc1\xf7\xe5\x15\x0c\x7c\x65\xd3\xa7\x81\xe3\xf8\x0f\x74\x80\x39\x9d\x81\x6b\xef\xb9\x03\x9e\xfd\xc5\xcf\x01\x8a\xf0\x80\xd4\xe5\x00\x26\x6e\x8c\x3a\xc7\x21\xf8\x7b\x86\x05\xf0\x4a\xc0\x55\x17\x43\x51\x5d\x18\x08\x33\x02\xba\x7a\x22\x20\xc9\xc2\xfa\xf2\xaa\xb6\xfe\xaa\xea\xc6\xde\xd2\xd2\x70\x95\xcf\xcb\x7b\x79\x9e\xe3\x2c\xcb\xb1\x33\x39\x43\x89\xa7\x8c\xb1\x64\x5a\x1f\xc8\xe6\xcc\xad\x86\x6e\xbf\xea\x68\xb6\xad\xc6\xf3\xa0\x4c\x28\x40\xa6\x73\x00\xaa\xe9\x9e\x1e\x34\x02\x55\xcb\xf6\xc1\xc8\x1b\x3f\x02\x81\xf7\x9f\x5f\x06\xbc\xb2\x07\x8d\x0f\x80\x18\x10\xc0\xb6\xfd\xe0\x98\xbe\x82\xa1\xe7\x06\x1e\x44\x9f\x08\x45\xf5\xd5\x20\x95\xa4\x21\x9f\x7c\x5a\xf2\x07\x8b\xef\xec\xeb\xdb\xb0\xa9\xbb\xbb\x73\x51\x4b\x53\x98\xf5\xfa\xc1\xd0\x0d\xdd\xca\x6b\x3a\xb1\x2c\x3c\x9b\xc8\x33\xa5\x7e\x39\x28\x09\x42\xc9\x74\xc2\xe8\x7b\xfb\x78\xf2\x33\xef\x0e\x65\xf6\x4e\xc7\xd4\xef\x6a\x61\xff\x73\x46\x69\x11\xa4\x47\x33\x90\x9b\x54\xc0\x44\x27\x08\x82\x20\xe0\xf3\xfd\x79\x10\x9a\x33\xd2\x70\x6e\x7d\x08\xb2\x08\xfe\xda\x72\xf4\x62\x3f\xa4\xc6\x5f\xea\x6e\x5b\x76\xd3\x03\x6b\xd7\x7d\xe2\x92\xae\xce\x90\x99\x33\xb2\xf9\xfd\x87\x8e\x92\xd8\x58\x0c\x64\xdb\x86\xa0\xc8\x83\x0f\xb7\xac\x69\x11\xc5\xb4\x1d\x4e\x12\xac\xc5\x0b\x2a\xb5\xab\x2e\x68\x60\xd6\x2e\x29\xbb\x60\xfb\x60\xf4\x99\x43\x47\x13\x3f\x4f\xb2\xf0\xb7\x45\x84\xa4\x28\x8c\x72\x53\xe8\x84\x66\xff\xf9\x35\xf0\xfe\x07\x3b\xf7\x5e\x81\x07\x6f\x79\x18\x2c\x73\x2b\xd8\xda\x91\xfe\x0b\xae\xb8\xef\xe1\x4b\x37\x5c\x50\x13\x2a\xb5\x95\xdf\xbd\xf6\x16\x31\xc7\xa7\x61\xdd\xc2\x32\x58\x75\x79\x1b\xd4\x57\x06\xc1\x8f\x30\x1b\x9b\x9c\x84\xc6\xba\x3a\xc8\xeb\x16\x9c\x9c\x4c\xc3\x6b\x6f\x8f\xc3\x23\x8f\xfd\x9e\x74\x76\xd6\xe5\x6e\xdd\xd0\xc1\xec\xac\xf4\x7d\xea\xb5\x37\xa7\x16\x4f\x38\x70\x03\xd6\xc2\x88\xad\x59\x60\xe6\xf2\x40\x3e\x92\x03\x24\x77\x6e\x06\x10\x3a\x52\x51\x11\x38\xcc\x4e\x8c\xd0\x1b\x57\xad\xbe\xfa\xe1\x9f\x5d\x7e\xe5\x8a\xa2\xac\x93\xca\x3e\xf6\x93\x3d\x70\x5d\x47\x08\xae\xbd\xad\x17\x6a\xab\xcb\xc0\xc0\xe2\x74\xf0\x00\x9b\x30\x10\x9d\x49\x42\x6d\x4d\x2d\x78\x90\x1c\x7a\xdb\x2a\xa0\xb7\xa3\x1a\xc6\xa7\x62\xf0\xf8\x4b\xc7\xe0\xdf\x7e\xbc\x83\xdc\x7d\xdb\x9a\x6c\xc0\x57\xff\xb1\xe7\x77\x8c\x3e\x3b\x66\xda\x97\x9b\x8a\x6f\x3a\x9b\x30\x81\x61\xce\xcf\x81\x39\x42\xcd\x01\x31\x4f\xa0\xed\x2a\xa5\x89\xd9\xcd\x04\x4e\x10\x91\x71\x0e\x83\xaa\x3c\xbf\xb2\xeb\xa2\xaf\x3f\xb4\x66\xdd\xd2\x40\x44\x9b\x51\xb7\x3d\xf6\x2a\x7c\xeb\xf2\x66\xb8\xe7\xfa\x3e\x18\x8d\x4c\x41\x34\x99\x71\x0d\x77\x90\x1c\x1c\xa4\x9e\x05\x4d\x4d\x40\x79\x02\xeb\x18\x10\x49\x30\x93\x48\xc2\xf0\xe8\x10\x7c\xe5\xf6\x0b\x61\xd3\xa5\xed\xf0\xed\x1f\xbc\x0c\x2d\xe5\x4c\x76\xfd\x9a\xea\xa5\xc5\x65\xde\x1f\x8b\x61\x99\x97\x42\x32\x96\x1f\x33\x27\x84\x3f\xdc\x01\x46\x40\x06\x1a\x06\xb0\x27\x67\x8b\xd8\x72\x4f\xc4\xcb\x2a\x68\xda\xaf\xca\xaa\x5a\xaf\xbd\x6f\xf9\xda\x8b\xeb\x6c\xaf\xae\xbd\xfc\xcb\x5d\xf0\xaf\xd7\x2c\x82\xbe\xee\x7a\x50\x10\xb7\x0d\xb5\xb5\xa0\x6b\x06\x92\x80\xed\x52\xa1\x65\x5b\x20\x4b\x12\x3a\xe2\x14\x36\xe2\x80\xae\x1b\xb0\x70\x41\x1b\xd8\x96\x0d\xeb\x57\xb6\xc0\x37\x6f\x58\x0e\xdf\xf9\xd1\x4e\xe8\x69\xf1\x29\x3d\xdd\x65\x9f\xf0\x87\xe4\xcf\x8a\x21\x0c\x16\xcf\xc0\xf9\xb4\xa8\xb9\x69\xc6\x51\x11\x45\xbf\x41\xbb\x0d\xb7\x17\xb0\x9c\x00\x84\xdd\x4b\x0b\xf8\xd6\xe6\xde\xeb\xd7\x54\xb7\x7b\xf3\xdb\x9e\x1f\x80\xcf\x5f\x58\x03\xdd\x0b\xab\xd0\x78\xd3\x35\xcc\x23\xc9\xc8\x1e\x48\x41\x46\xc1\x09\x35\xaf\xc1\xd4\x74\xcc\x35\xc4\x46\x87\xe8\xfe\xe2\x60\x10\x7c\x5e\x2f\x18\xa6\xe9\x3a\xbb\xba\xb7\x01\xee\x5c\xdd\x02\x0f\x3f\xb3\x8f\xac\x5f\x59\x6e\x94\x56\xf9\xff\x4e\xf0\x09\x65\x2c\xcf\x9e\x4f\x02\xe6\xa9\x56\x06\x79\xcc\x38\x88\x99\x78\x07\x4f\x22\x00\xc3\x65\x11\x16\xbb\x1b\x43\x95\x97\xdd\xd8\xd4\xd5\xc4\x1c\x1d\x99\x72\x3a\x1c\x0d\x16\xd5\x0b\x70\x72\x2c\x82\xd1\x26\x6e\x44\x0d\xc3\x9c\x35\xde\x71\xf7\xe5\x35\x0d\xc6\xb1\x88\x31\xf4\xee\xf7\x74\x9f\x69\xda\x48\x02\x96\x9b\x11\x06\x9f\xa7\x86\x47\x61\x43\x4f\x11\x30\x69\x0d\x86\xe3\x49\xbd\xa7\xab\xb4\x41\x90\xf9\x9b\x81\x63\x40\x14\xbd\x1f\x85\x46\xf1\x4b\xe6\x75\x20\x72\x17\x30\xf2\x10\x96\x86\xb1\xbe\xa8\x72\x55\x47\xb0\x56\x36\x7e\xff\xf2\x01\xf8\xce\xea\x06\x08\x84\x3c\xf0\xa7\x53\x23\x2e\x67\xcb\xd8\x8d\x69\xe3\xa6\xd8\x65\xd1\x38\x82\x46\x63\x33\x80\x91\xb1\x09\xe8\x5b\xd2\x83\x70\xb2\x81\xc3\x7d\x84\x25\x6e\x64\x39\x7c\xa6\xf3\x59\x38\x36\x74\x0a\x56\xf4\x74\xc2\xa6\x75\xad\x70\xff\xae\x63\xf0\x57\x97\x2d\xb7\xe4\x80\x78\xad\x3a\x9e\xfd\xfe\x0b\x2f\x3c\x6b\xf1\xfc\xfb\xfb\x81\x89\x99\xab\xaf\xaf\x87\xde\xde\xde\x0f\x77\xa0\x3c\xa8\x81\x50\x72\x10\xa2\x56\x44\x06\xa7\x76\x4d\x51\x75\x83\x98\x31\x55\xad\xdc\x36\xa0\xab\xb5\x14\x4c\x2c\xd6\xbe\xde\x1e\xd7\x50\x8a\x79\x8a\x71\x0a\x41\x8e\xa3\xe9\x47\xcd\x60\x59\x30\x19\x89\xb8\x11\xb7\x31\xf2\xd4\x78\x96\x23\x20\xf1\x22\x08\x2c\x0f\x3a\x3e\x17\x34\x37\x41\x56\x51\xe1\x82\x85\x15\xe0\xbc\xfc\x27\xd0\xed\xbc\xb9\x7e\x45\xa8\xb7\xb2\x7d\xe5\x8d\x8f\xfe\xec\xf1\x2d\x98\x38\xed\x6c\x9b\x34\xcc\x6a\x7f\x7f\xff\x07\x38\x80\x11\x24\xb3\xe0\xab\x2c\xab\x81\xa2\xe0\x04\x44\xc7\x0f\x97\xf0\xc1\x75\xed\xc1\x9a\x12\x32\x1d\x4f\x41\x4f\xb5\x1f\xfc\x3e\x19\x92\x8a\xee\x1a\xc7\x71\x1c\x08\xd8\xb0\xa8\x03\xd4\x11\x8a\x6f\x13\x99\x8b\x47\x23\x63\xf1\xb8\xeb\x14\x2a\x0a\x90\xb0\xa0\xd3\xd9\x0c\xbc\xf3\xc7\x3f\xc2\xe8\xc4\x04\xf8\xfd\x5e\x68\xae\xab\x87\xaa\x8a\x0a\x44\x8c\xcd\x5e\xdd\x5d\xc6\x16\xb3\x36\xbb\xaa\xbb\x52\x5a\x56\x71\xe3\xc5\x92\x13\x7d\x73\xf0\xad\xb7\x8f\x8b\xa2\xf8\x7e\x84\x9f\xc5\xb1\xe7\x38\xe0\x24\xb0\x89\xe4\x31\xdd\xa2\x04\x25\xc5\xe1\x4e\xd9\x2b\x7b\x4b\x7c\xbe\xc5\x9a\x50\x5d\xc1\xfb\xfd\x76\x26\x19\x85\x36\x6c\x66\x02\x27\x81\x2c\x30\x2e\x6c\x50\x36\xc0\xeb\x6f\xed\x45\x9a\x2c\x68\x99\x9e\x45\x9d\x50\x12\x0e\xc3\xe0\x81\x03\xb0\x6b\xd7\x4e\xd8\xbf\x6e\x1d\x68\x58\x1b\xfb\xde\x1a\x84\x4c\x2e\x07\x6d\x2d\x2d\x98\xb9\x5e\x28\x2b\xab\x60\x73\xba\xcd\x31\xc8\x76\x92\x2c\xb1\x6b\x3a\xeb\x61\x0c\x59\x30\xc1\xd9\x90\xd3\x98\xb2\xde\x9e\x9e\xda\xbd\xfb\xde\x1a\x42\xbd\x76\xa6\x35\x53\xed\x46\x09\xe2\x5c\x07\x0a\xb4\xcb\x38\x4a\xbe\x01\x8a\xcd\x25\x5c\x45\x68\xd1\x0d\xb7\xdc\xf8\xb9\xa6\xaa\xba\xb0\x89\xca\xeb\xbb\x5b\xff\x60\x1d\x1d\xd8\x6c\xa1\x77\xb0\xaf\xd2\x03\x43\xa3\x12\xa8\x08\x1d\xc1\xc3\x83\x86\x5d\x96\x24\xdf\x3b\xc9\x9e\x03\x7b\x11\xef\x0c\x3c\xf9\xf4\x93\x10\x9f\x8a\xc2\xd5\xb7\x7c\x12\x36\x5e\x77\x3d\xac\x5f\x73\x11\x2c\x5d\xd2\x0d\xa2\xd7\xc7\xa6\x14\x4d\x48\xe4\x0c\xce\xe7\x95\x19\xd5\x34\x9d\x6c\x3e\x4f\x64\x9e\x25\x1a\xd2\x71\x1e\xb3\xa8\xe6\x0d\xb1\xa3\xa3\xbd\x1e\x6b\xab\x0c\x8d\x8e\x9c\x1d\xf5\xb9\x33\xe0\x36\x5e\xa6\x98\x2d\x97\x3f\xef\x5c\xa9\xdd\x45\xca\x72\xcc\x45\xfd\xab\xad\x96\xa2\x16\xb7\x11\xfc\xae\x72\x07\x33\x3c\xb1\x05\x16\x56\x34\x83\x58\x5c\x03\x33\x26\x81\x89\x74\x14\xde\x9d\x19\x02\xd3\xf0\xc1\xe1\xfe\x01\xf0\xb1\x1e\xec\x1a\x0e\x34\x5e\xd3\x02\x13\xfb\xb1\x97\x28\x78\x7a\x9b\x85\xd5\xcb\xfb\xe0\x9b\x5f\xfc\x32\x64\x54\x8d\x4d\x69\x86\xc0\x81\xce\x15\x87\xfc\x8c\x4f\x16\xb1\xd6\x09\x49\x24\x33\x8c\x6d\x39\x67\x46\x13\x1b\x8b\xdd\x42\x9d\x5d\xdf\xd0\x50\x81\x8f\xd6\xb1\xb1\xb1\x88\x20\x08\x05\x84\xcc\xf6\x94\xb9\x21\xc4\x00\x6a\x57\xb6\x03\x92\x28\xb3\x53\xc4\xfc\xe9\x83\x4f\x38\x61\xb9\xc4\x6d\xc6\x2f\x1d\xdd\x01\x43\xad\x51\x18\x2d\xce\x00\x1f\x3a\x0c\x0c\x36\x1a\x3b\x63\x81\x91\xd2\xc1\x73\xd0\x0b\x5f\xdb\xfd\x1d\x90\x3c\x32\x76\x5c\x0b\x72\x63\x0a\x00\x8a\xdb\x8e\x86\x25\xe0\x35\xfc\xf0\xa5\x2f\xfe\x3d\x1b\xc9\xe4\x04\x41\x12\xb8\xda\xea\x52\xc6\x23\x0b\x04\x29\x95\x18\x58\xd8\x26\x1a\x23\xa1\x12\x46\x52\x65\xb2\x7a\x9e\x70\x02\xb2\x99\xa9\x13\x41\x62\xf2\x82\xe8\x95\xdb\xdb\xdb\x3b\x87\x87\x87\x77\x9f\x76\x80\x46\x7f\xfe\x1a\xa0\xf5\x8b\xf3\x05\x0c\x61\x2d\x72\x36\xb9\x7f\xe0\x1f\x67\x25\x28\x6e\x55\x1c\x30\xe5\x3c\x46\x47\x07\x2d\x6b\xd0\x49\x02\x7b\x45\x61\x64\xc8\x3a\x19\x78\xe0\x95\x6f\xb9\x9f\x41\x75\xd5\x88\xfb\x68\x6b\x5b\xcc\x5d\xb6\xfa\xe3\x7c\x55\x63\x03\x57\x5a\xe4\x65\x64\x81\x43\xc1\xe9\x10\xd3\xa2\x5d\x1a\x2f\x45\xe5\x06\xbe\x52\xd9\x91\xce\x99\xcc\x64\x5a\x65\xa4\x9a\x22\x62\xab\x49\x3b\x54\xe5\x9f\xc1\x53\x78\xba\xba\xba\x3a\xb6\x6f\xdf\xee\x47\xdc\x2b\xd4\x70\x9a\xa6\x0f\x2c\x62\x77\x08\x8b\x22\x66\xbc\x68\x60\x98\x0e\x0a\xf8\xe3\x00\x0b\x0c\x7d\x4d\xcf\x1a\x2d\x92\x02\xdc\xcd\xc2\xf0\xc1\x60\xd0\x48\x1b\x52\x67\x02\x0f\x46\xd2\x6b\x2b\xef\xe6\xae\xb8\xe0\x1a\xa1\x7f\xed\x55\xec\xca\xee\x2e\x4c\x16\x21\xd8\x07\xe8\x86\x19\x22\x2e\x44\x0a\x30\x71\xce\x7c\x56\x71\x32\x33\x09\x61\x25\xf4\x90\x35\x8c\x7c\x79\xa9\x67\x0a\xcf\x5a\xde\xda\xda\x5a\xe2\xf5\x7a\x1b\xd2\xe9\xf4\x11\xca\x76\x94\x46\x75\x5d\x9f\xdf\x01\x17\x88\x29\x7c\x93\x9f\xdd\x64\xfc\x9c\x45\x0e\xf7\x80\x0b\x0b\x90\xde\x8b\xb0\xeb\x2c\x8d\xba\x5e\x90\x4c\x5d\xf5\x2b\xb8\xfe\x95\xd7\x0a\xab\xbb\x56\xb1\x65\x45\x01\x26\xe8\x0b\x20\xf5\x3b\xc4\x22\xb3\xd1\x86\x42\x04\xd1\x5e\x37\xea\xb4\x2b\x27\x33\x59\xa0\x34\x99\x52\x6d\x60\x59\x8e\x99\x19\x8f\xf3\x61\x0f\x8c\x97\x86\xe5\x34\xca\x93\x85\xe5\xe5\xe5\x62\x63\x63\x63\xc7\xee\xdd\xbb\x8f\x50\x1a\x56\x55\xd5\xed\x2f\x73\x3b\x80\x11\xf2\x17\x85\xe1\xeb\xf7\x7f\x13\xf9\x3f\x00\xae\x28\xa6\xc6\x62\x5b\xa7\xba\x8e\x99\x7d\x3d\xcd\x5a\x34\x09\x16\x2a\xcc\x7c\xde\xe2\xcb\xfc\x35\xfc\xb2\x05\x4b\xd9\x12\xbf\x97\x71\x6c\x93\x60\xca\x89\x86\xd3\x95\x81\x9d\x08\xed\x9a\x55\xa7\xb4\x40\xe1\x4c\xf4\x31\x77\x20\x89\x32\x52\xac\x09\xf1\xbc\x89\xbd\x44\x80\xc8\x44\x8c\xe9\xae\xf6\x1e\xc4\x21\x39\x80\x30\xf3\xfa\x7c\x3e\x7d\xd1\xa2\x45\x1d\x7b\xf6\xec\xc1\x04\x70\x36\xcd\xc2\xfc\x10\xc2\x46\x24\x63\x11\x7d\xa6\xff\x4e\xf0\xf9\x3c\x1f\xaa\x43\xd0\x26\x1e\xaf\x8b\x63\x2f\xce\x3a\x78\x5e\x6a\x93\x43\x35\x34\x1d\xf8\xf1\x22\x31\x2b\x8e\xc6\x52\x7d\xc1\x9d\x31\xfc\x3d\xf8\x60\x06\x2c\xdb\x8d\x44\x3c\x8f\x9d\x9a\x3a\xa9\x1a\xe8\x3c\x31\x34\x4d\x31\x93\xc9\x44\xbb\xc7\x1b\x60\x32\x99\x8c\xd2\xd2\xd2\x12\x0e\x06\x83\x95\x78\xee\x09\x5a\xcc\xd4\x89\xf9\x21\x84\xcf\x8c\x92\x01\x2f\x3a\x60\x61\x63\x1a\xd9\xcd\x41\x79\x3b\x40\x92\x8c\x83\x07\xc5\x15\xc7\x72\xa0\x5a\x0e\xcf\x62\x03\xb0\x6d\x8b\xf3\x79\x24\x14\x6d\x16\x11\x05\x81\x1a\xef\x76\x5c\xc6\xcd\x0e\xb2\x94\x5d\x80\x0b\x85\x0d\xc5\x3a\xf5\x4d\x51\x35\x77\x3f\x4d\x25\xfd\x1c\x53\x34\x8a\x50\xec\xda\x0c\x4c\x4c\xa7\x71\xf4\x30\xc6\x8e\x4d\x9a\xab\xbc\xfc\x70\xa6\xb4\x38\x74\xc8\xe3\xf1\x8e\x54\x55\x55\x79\x10\x4a\xed\xc8\x46\x13\x14\x3e\x67\x37\x32\x76\xce\xc0\xe2\x05\x0b\x58\x25\xd8\x91\x31\x74\x54\xc3\xb0\x85\xd4\x11\x96\xe3\x2d\x46\x94\x50\xef\xb0\x18\x7a\x3a\xc6\xd2\xd5\x11\xa0\x1b\x35\xd6\x65\x17\xbb\x10\x61\x03\xbf\xa4\x06\xd3\xf7\x14\x6a\x74\x52\xa3\xb0\xc9\xb9\xfb\x1c\x88\xa2\x14\x89\x1b\x0e\x96\x14\x1a\x3f\x91\xe4\x74\x55\x8b\xf9\x64\x4e\x55\x0c\xae\x65\xc7\xbe\xa1\xca\x23\x87\x0e\x6a\x4a\x4e\xe1\x11\x46\x4e\x47\x47\x47\x2b\xbd\x3e\xcf\xf3\xef\xcb\x00\x3b\x9f\xcc\x76\x9d\x40\x8b\xe4\x10\x06\x8b\x47\xae\x46\x69\x81\x72\x99\x49\x65\x91\xcf\xb1\xe8\xa8\xb1\x74\xf2\x3a\x6d\x38\x85\x05\xe5\x75\x6a\x98\x49\xe1\x81\x9f\xcd\xb3\x1c\x30\x5d\xc6\xc1\x1f\x13\xbc\x24\x27\xc2\x68\x52\x83\x84\x4e\x3d\x27\x10\x89\xa4\x39\xdb\xb4\x52\x3e\x9f\x14\x9d\x4c\x69\x2d\x91\x74\x8e\x49\x73\x65\x55\xc3\x53\x89\xf6\xc8\xe4\x44\x00\x15\xa8\x8d\x75\x50\x8d\x0e\x04\x69\xf4\xcf\x5e\x8c\x9b\x4b\x8d\x32\x08\x05\x8e\xc2\x81\x60\x4d\x24\x4f\xf1\x20\xa2\xa2\xcd\x40\x1a\xe3\x24\x50\x84\xd9\x78\x42\x96\xea\x17\x4a\x8b\x22\x36\x34\xca\x26\x34\x16\x86\x61\x21\xa3\xcc\x36\x1a\xbc\x06\x75\x84\x16\x29\xa5\x48\x0d\x45\x5f\x1e\xbf\xcf\xa8\x16\x28\x28\x3d\x5c\x47\x35\x8b\x49\x67\x54\x54\xdf\xce\x8c\x41\x48\x74\x2c\x9a\x6d\x41\xb6\xf2\x04\x8a\x3c\xc0\x8b\x32\xa3\x64\x94\xae\xe1\x53\xc3\xd1\x92\xd2\x72\xb3\xb9\xb9\x59\x0e\x87\xc3\x8d\xe3\xe3\xe3\x07\xe7\x67\xa1\x02\xb1\x50\x0f\x51\x58\x3a\xae\xa7\xe5\xdd\xc8\x0e\x01\x6c\x09\xa4\xd8\xc5\x37\x1d\x90\xe3\x1a\xa1\x78\xc2\xe6\xc0\x11\xd3\xad\x59\x0e\xe1\x82\xbe\xe1\x2b\x35\xda\x6d\x36\xf8\xcb\x34\x1a\x6b\x22\xc3\x30\xac\x53\xc8\x00\xa6\xcb\x34\xe9\x3e\x9b\xc9\x6b\x26\x93\xcb\xab\x66\x2a\xa7\x26\x52\xaa\x85\x72\x8a\xb4\xa2\x70\x14\x65\x91\x73\xeb\x41\xc0\x89\x8c\xf1\x35\x97\x24\x47\xe2\x0b\x4f\x9d\x1a\xd2\x97\x2e\x5d\x9e\xa9\xad\xad\x6d\x3f\x72\xe4\xc8\xc1\x44\x22\x31\x7f\x06\x68\xf1\x61\x04\xed\xd3\x75\x30\xb6\x87\x87\xaa\x65\x04\xe2\x10\x01\xbf\xe4\x77\x99\x1c\xa1\x6b\x0b\x81\x52\xd6\x42\x15\x8a\xc5\x8b\x91\xd7\x5d\x2e\xa7\x0d\x86\x7e\x76\xcf\x41\xfb\x1c\x0a\xba\x3c\xbe\x73\x10\xe7\x74\x66\x30\x74\x93\xa1\x30\x44\x09\x6e\xa6\xf2\xaa\x12\x53\x50\xc7\xda\x54\x12\x89\x95\xe1\x00\x8f\x0a\x17\x0d\xc7\x59\x82\xc7\x57\x3a\x52\x48\x02\x0a\xc5\x9a\xf6\x05\xe3\x13\xef\xc4\x6a\xeb\xea\x9d\xc5\x8b\x17\xb7\x6e\xdd\xba\x95\xc7\x66\x66\xcd\xef\x00\xcb\xb8\x4c\xe3\xae\x49\x22\x14\x9a\xd7\x51\x8a\xb0\xa1\x1a\xaa\x5c\x6a\xa4\x86\xc9\x28\x37\x26\x73\x8e\xc0\xd2\xc8\x5b\x34\xf2\x3c\xe2\x9f\x16\x28\xca\x34\xd3\x99\x0d\x02\xf6\xc3\x74\x8e\x4c\xc4\xe3\x84\x60\x44\x78\xc6\xa1\xa7\xd6\x55\xdb\xc9\xc7\xe9\x1f\x9b\xf5\x4a\x92\xb7\x38\x2c\xf1\x38\xe0\xb0\x6e\xc4\x91\x8a\x71\xd0\xc1\x42\xa5\x65\xc2\xd0\xc1\x08\x7b\x67\x75\xbd\x67\x3a\x31\xda\x72\xf2\xe4\x89\x5c\x55\x75\x4d\x53\x2a\x95\xae\x8b\x46\xa3\xa7\xe6\x71\x80\x10\x81\xe7\x19\xdd\x30\x98\x77\x4f\x1c\x87\x78\x62\x06\xd4\x7d\xcd\xd0\x73\x79\x09\xc4\x50\x20\xf9\xa4\x80\xab\x04\x35\x1d\xab\xcf\x5b\x45\xd2\x39\x0d\x31\x2e\xe0\x3c\x60\x60\xe4\x79\x77\xb0\x97\x25\xd1\xa5\x47\x1d\x07\xfd\x44\x22\x69\x10\x43\xb7\x24\x49\xc4\x11\x83\x35\x66\x4c\xce\xc9\xd9\x9c\x4f\x14\x65\x7f\x58\x16\x30\xc2\xac\x5b\x43\xa2\x1b\x75\x70\x0d\xe7\xdd\x00\x62\x1f\x01\xba\xe0\x6b\xbb\x75\x26\x57\x34\xd7\x4e\x0d\x1f\x98\x0e\x86\x8b\xf9\xc5\x8b\x17\x2d\x47\x43\xe7\x71\x80\xe3\x48\x22\x1e\x33\x7e\xfd\xfc\x73\x76\xdf\xd2\x3e\x06\xe7\x59\x72\x32\x3b\x00\xde\xf8\x2a\xe8\x5d\xb2\xc8\x6d\xe1\x05\x7c\x13\x32\xa5\x10\xdb\x74\x70\xe4\x32\xb0\x5c\x90\x59\x0c\x93\x36\x28\x06\x12\xc9\x3c\x36\x28\x24\x5a\xb4\x4a\xf2\xfa\x94\x1c\x23\xa7\xc7\x74\xa8\xcc\x5a\x5c\x50\x92\x05\x31\x24\xf3\xe0\xc1\x50\x17\x8c\xc7\xa8\x53\xa3\x39\x66\x16\x36\x2c\xe6\xb0\xb0\x52\x6d\x61\x93\x33\xb1\xe8\xa9\xf6\x31\x89\xc8\xab\x6c\xa0\x31\x1a\x8d\x4d\x97\x57\x55\x85\xce\x5e\x6f\x79\x3f\x8d\x32\x5c\x5a\x75\xcc\x97\xef\xfb\xde\xfd\xc7\x72\xf9\x2c\xb9\x6d\xe3\xf5\xdc\x95\x57\xae\xc1\x29\x2a\xe5\x8e\x8a\xd4\xf8\x54\x3a\x03\x33\x58\x44\x7e\x94\xf2\x69\x9c\x65\x55\x2c\xd2\x74\x36\x07\xb1\x99\x2c\x4c\x45\x92\x4c\x5e\x37\x59\xf4\xc9\x3e\x19\x53\x66\x0e\xc7\x1d\xf5\x44\x96\xab\xd4\x58\x4f\x20\x1c\xf2\x88\x25\x41\x19\x42\x01\x19\x02\x7e\x09\x02\x3e\x09\x7c\x5e\x01\x3b\xbe\x08\x5e\xaf\x08\x28\xb1\xdd\x6c\x10\x57\x9e\x14\x96\x5c\xb0\xc8\x21\x83\xd7\x4b\x27\x67\x40\xe7\x83\xe5\xc7\x26\x33\x5d\xc3\x23\x63\x93\xfc\xfc\x9d\x98\x64\x78\xaf\x67\x4b\x4a\xc9\xc1\xc6\xbb\x6e\xbf\xe3\xd1\xef\x3d\xdc\xbe\x64\x71\x37\xce\x49\xac\x8d\x30\x70\x33\x50\x1c\x2a\xdc\x37\x60\x58\x81\xf0\x0c\x43\x62\xf1\x0c\xbd\x18\x83\x2d\x9e\x41\xf8\x5b\xc3\x53\x29\x65\x2a\x6b\x1a\x06\x2b\x78\x03\x01\x6f\x43\xb1\x4f\x00\x99\x46\x5d\xa4\x51\x2f\x6c\x82\x30\x8b\x77\x84\x0e\x37\xbb\x00\xe7\x58\x05\x6a\xa5\x4b\x33\x9a\xaa\x83\xa2\x64\x21\x9f\x55\x70\x34\xd0\x20\x9f\x8c\x9a\xef\x0e\xbe\xbe\xe5\x9d\xbd\xaf\x3f\x30\x32\x7c\x72\xb0\xad\xb9\x71\xbe\x79\x00\x23\xa0\x1a\x31\xec\x54\x5b\x32\x5a\x9e\xdc\x7c\xf7\x9d\xb7\xfc\xc3\x17\xbe\xdc\xf6\xc9\xeb\x6e\xf0\x20\x2c\x88\x45\xdb\xa9\xfb\x33\xbc\x30\xeb\xd8\x8c\x69\xc0\x74\x5c\xa1\x1f\xac\xe8\xb4\xa2\xa0\xa6\xc1\x62\x90\xd0\xf0\x40\x28\xec\x17\x19\xd9\x23\x80\x07\x8b\xd4\x23\xa1\xe1\xe8\x80\xe8\xc2\x06\x1d\xe0\x0b\x85\xca\xce\xde\xcc\xa0\x38\xa7\xba\x48\xa5\x51\xcf\x29\xa0\x64\xb3\xd8\x23\xd0\xf0\x74\xcc\x3e\x31\xb8\xe7\x37\x7b\x5f\xf9\x8f\x87\x46\x86\x4f\xbd\xd6\xde\xde\x01\x5d\xdd\x4b\x3e\xb4\x91\x81\x93\xca\xc7\x78\x59\x78\x56\xc5\xe2\xfc\xc6\xbf\xfc\xd3\x75\xef\x1c\x3e\x54\x1d\x08\x06\x1d\xa4\x49\xc3\x5d\xf0\x73\xe5\x9a\xcd\xd4\x2d\x58\x55\x31\x62\xd4\xf9\x6c\x8e\x37\x78\xd9\x23\x05\x82\xa1\x90\xcf\x2f\x31\x1e\x0f\xe7\x42\x82\x6e\x32\x1a\x2f\xbb\xc6\x73\x2e\xd3\x88\x18\x72\x16\xa5\x09\xa1\xf2\xc2\x29\x14\xa9\xae\x9b\xa0\xe0\xb0\x4f\xa3\x6e\x68\x3a\xa8\xc9\x18\x1c\xdb\xb7\xeb\xb7\xfb\x76\x6c\xfb\xde\xc9\xe3\xc7\x76\x50\x93\x16\xf6\xae\x84\xcf\xdf\xbb\x09\xde\x78\xfd\xf7\x90\x47\x27\xcf\x71\x80\x32\x09\xba\x0f\x76\xb9\x17\x58\x4b\xa4\x4e\x44\x39\x81\xff\x8d\xee\x68\xca\x93\x8f\x3c\xd6\xda\xdc\xb9\xb0\xc7\x2e\xbf\x74\xc5\xc8\x44\xc4\x94\x59\x4c\x73\x36\x49\x36\xdd\xb6\x98\x0b\x36\xf5\xc8\xba\x43\x8a\x02\x88\x6d\xd9\x83\x58\x46\x3c\x7b\x29\x64\x64\xba\x8c\x82\x14\x29\xe2\x26\x30\x6e\xc1\xf2\x2c\xeb\x4e\x72\x05\xad\xe4\xb8\xd2\x83\xe2\x9c\x1a\xaf\x63\xc4\xd5\x74\x02\x86\x06\x76\xef\x7c\xe3\xc5\x5f\x3f\xf8\xee\x91\xc3\x2f\xd2\x69\x63\xe9\xda\x0d\xd0\x77\x71\x3f\x94\x97\x55\x22\x49\x28\xe8\xac\x36\xf7\xca\x5c\x57\xfb\x42\x98\xbc\xe8\x12\x18\x9d\x9c\x82\x88\x11\x73\xd7\x87\xec\xa4\x32\x85\xe1\x7a\x89\xd2\x56\x6a\x7c\x2c\x75\xfd\x75\x7d\x6b\x5f\x19\x0e\x55\xf2\xc6\x34\xa8\xd9\x38\xe4\x6d\x19\x56\xd4\x05\xe1\x78\x5c\x85\x40\x40\x02\x8f\x47\x98\x8d\x3c\xef\x42\x86\x1a\x2f\x8b\x88\x30\xae\xd0\x3f\x68\xa7\x70\xd7\x48\xb1\x1b\xab\x18\xe9\x6c\x3e\xe7\x52\xaf\x9e\x4e\xc1\xc9\x7d\xbb\xde\xd8\xf3\xc2\xd3\x0f\xfe\xf1\xe0\x81\xe7\xe9\x9c\xd7\xb8\xb0\x1b\x56\x5c\xda\x0f\xbd\xab\xd7\x81\x85\x19\xd2\x33\x49\x98\xeb\x86\x24\xf3\x5f\x77\xde\x73\xf7\xdd\xb0\xf9\x87\x3f\x3c\x7b\x17\x5d\x55\xaa\xc1\xad\xf5\x92\x4b\x2e\xbe\xa9\xe6\x8a\xfb\x6f\x3f\x7c\x62\x1c\x78\x2b\x05\x01\x32\x03\x7f\x7d\x73\x3f\xbc\xab\x88\x10\xf4\xa1\xb1\x18\x75\xea\x84\x4c\xa3\x8e\xd0\xa1\x45\x7a\x7a\x95\xdc\x76\x25\xb5\x03\x2a\x76\x6b\x05\xa3\x4e\xd7\x89\x0c\x94\xed\xa7\x06\xff\x70\x60\xcf\x73\x4f\x3e\xf4\xce\xc0\x9b\xcf\xe0\xcf\x94\xb5\x57\x7f\x12\x9a\x17\x2d\x81\xe6\xc5\xbd\x78\x2c\xd2\x33\x85\x0b\xd2\xb4\xad\xe6\xa0\xda\x93\x87\xdd\xaf\xed\x00\x1b\x0b\xfe\xa9\xa7\x9e\x9a\xbb\x06\x6c\xe7\x9c\x3b\x93\x66\x61\x4a\x06\x69\xf7\xae\x9d\x2f\xde\x7b\xe9\x81\x8b\x6a\x9b\xfa\x9a\xcc\xf4\x18\x28\x33\x79\xc8\x67\x66\xa0\xa2\xac\x15\x2f\xe6\xb8\x91\x97\x11\x36\xb4\x58\x29\xbb\x50\x31\x48\x75\x1e\x8d\xba\x8a\x05\x4f\x17\x7b\x35\xd3\x74\x8d\x1a\x3b\x38\x70\xf4\x8d\xad\xff\xbe\x79\x60\xd7\xab\xbf\xa4\x43\x6c\x65\x53\x2b\x7c\xfc\xb3\x5f\x80\xb6\x9e\x8f\x01\x2a\x23\xf7\x37\xa6\xa9\x7f\xb4\xc5\xdd\xb3\x56\x8c\xe8\x5a\xc3\x14\xca\x06\x66\xe7\x96\xcd\xbf\xb8\xea\xab\x4f\x7f\xed\xd0\x58\x05\x92\x8f\x0e\x91\x58\x1c\x3a\x17\x2c\x82\x14\xca\x13\x4a\x95\xb4\x40\x1d\x2c\x4c\xdb\x02\x37\xe2\xba\x6b\xb8\xea\xaa\x51\x53\xcb\x43\xe4\xe8\xc1\x93\x7b\x5f\x78\x7a\xf3\xe0\xce\xed\x8f\xe9\xa6\x95\x68\x5e\xb2\x0c\xae\xf8\xf4\xdf\x40\x49\x65\x0d\xf8\x02\x45\x48\x9d\x19\x3a\x54\xc0\xf9\xde\xbf\xe6\xe1\xfc\x1e\xf4\x6c\x59\xdc\xa6\xdf\x7a\xfb\xd0\x0b\x97\x1e\x7e\xe1\xb2\x05\xcb\x6e\x5e\x31\x35\xaa\xe1\x44\x15\x83\x00\x8b\xf4\x87\x83\x06\x71\x0a\xf3\x80\xcb\x2c\xc8\xe7\xae\xe1\xd8\x94\x4c\x43\x83\xe4\xf0\xf1\x89\xc1\x6d\xcf\xfc\xe8\xcd\x97\xb7\x3d\x82\xcd\x6f\xaa\xa9\x67\x39\xac\xb9\xfa\x46\x68\x5b\xb6\x12\x8b\xdf\xe7\xd2\x26\xce\x92\xff\xfd\x1b\xdd\xe7\xf1\xa0\xd8\x4a\xd3\x82\xfe\xf5\xa3\xdf\xdf\xfc\xa5\x0b\xaf\xec\x71\xaa\xab\xc5\xf4\x58\x1a\x34\x64\x0f\x22\x94\x40\x0e\x0d\xa5\xca\x34\xaf\xd2\x0e\xad\x63\xe3\xd3\x21\x39\x72\x3c\xba\xff\x77\x5b\x7f\x72\xf8\xcd\xd7\x7f\x9a\x48\x26\x47\xab\x17\x74\xc0\xed\xf7\x7c\x11\x6a\x3b\x3a\x71\x6c\x0d\x80\x8e\x50\xd1\xd5\x7c\x61\x2a\xfa\x28\x77\xea\xcf\xf3\x41\x65\x6c\xf6\xe4\xc8\xf8\x4b\x07\xb6\x3d\xb2\x75\xf9\x1d\x5f\xbf\x7e\x7f\x7c\x0c\xc7\xc1\x08\xf0\x65\x02\x44\x67\x12\x58\x9c\xd4\x70\x03\x32\x53\x23\xa9\x3f\xed\xd9\xfe\xd8\xbe\xed\x2f\x6e\x4e\x65\x32\xc7\x4b\xeb\x1a\xe1\xda\x3b\x3f\x07\x4b\xfe\x62\x03\xf8\x82\x41\x97\x36\x35\x34\x9e\x38\xce\xff\xcc\xbf\x1a\x9c\xcf\xa3\xac\xac\x1c\x70\x36\x35\xf6\xec\xd9\x3d\xb3\xe5\xf1\x47\x1e\xb8\xe8\x9a\x5b\x36\x54\xd6\xd6\x85\x22\x13\x47\xa1\x42\xc2\x89\x21\x32\x0d\x76\x7a\x5a\x39\xb6\xf7\xd5\x5f\x1d\x1d\x7c\xf3\xa1\xc8\xd4\xc4\x11\x5e\xf2\xc0\x5f\x7e\xfa\x5e\xd8\x70\xeb\x5d\x80\x7a\x03\x6b\x84\x71\x55\x26\x0a\x3d\x77\x16\xa6\x0e\x38\x74\x75\xc2\x5d\x2c\xa2\xff\x76\x60\x15\x6a\xc0\xbd\xa3\x63\xd3\x21\xbf\xc0\x42\x74\x59\xca\x0b\xee\xdc\xa1\x7e\xc0\x44\xf6\x21\xcb\x28\x0e\xb4\x77\xb4\xc3\xe0\xe0\x80\x13\x4b\xa6\xf7\x6e\x7b\xe4\x81\x87\x37\x7e\xe3\x07\x5f\x9e\xe0\xf2\x90\x99\x38\xa1\x1d\xfe\xed\xb3\x4f\x1f\x7f\x7b\xef\x83\x63\xc3\x43\xfb\x29\x20\x78\x9c\xa3\x9b\x3a\x7b\xb0\x67\x64\xe0\xf9\x1f\xfc\xb3\xbb\x48\xc0\xb2\xec\x99\xa2\x9a\x1d\xff\xdc\xd9\xbb\xa0\x30\x0b\x1d\x1a\x66\xa7\x41\xf7\xd5\x29\xdc\x34\x21\xc8\x5e\x7e\xc1\x84\xf1\x91\x61\xe8\xea\xea\x7a\xff\x4a\xdc\xd9\xdb\x5d\x77\xdd\x75\xde\x0e\xe1\x0c\x50\x7c\xd3\x2d\xb7\x7c\xf5\x53\x9b\xee\x7d\xa0\xa9\xb9\xe5\xc2\xff\xad\xff\x50\xd9\xb8\x71\xe3\x19\x7b\xf9\x8f\x72\x22\xec\xa8\x89\x5f\x3d\xf1\xc4\x7d\xff\x97\xff\x6e\xf3\x9f\x02\x0c\x00\xab\x97\x7a\x22\x3d\x1d\xbd\x78\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x69\x3c\x0b\x78\x02\x15\x00\x00")) - folderTimeCalIn48 = HexToBytes("folderTimeCalIn48", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x14\x14\xeb\xeb\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x00\x57\x02\xf9\x87\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x13\xb6\x49\x44\x41\x54\x78\xda\xd4\x5a\x79\x94\x54\xf5\x95\xbe\xaf\xea\xd5\x5e\xd5\xd5\xd5\x3b\xdd\x34\xdd\x0d\xdd\x0d\x74\xe3\x80\x80\x40\x00\x05\x01\x71\x8b\x68\xa2\x33\x01\x57\xdc\x62\x42\x8c\x59\x3c\xc6\x98\x8c\xe3\x24\xd1\x49\x72\x32\x0e\x18\x24\x27\x31\xb8\x8f\x28\x8a\xa2\x02\x8a\x28\x34\xbb\x8a\x81\x6e\x96\x06\xa4\xf7\xbd\xab\xba\xf6\xed\xd5\xab\xb7\xcd\xf7\x7b\x55\xdd\xc1\x25\xa1\x89\x27\x7f\xcc\xc3\x8f\xaa\xc7\x79\xf5\xde\xbd\xf7\xf7\xdd\x7b\xbf\xfb\x7b\x72\x9a\xa6\xd1\xff\xe7\x83\x67\x7f\x9d\xec\x4d\xd0\x40\x48\x24\xa3\x91\x23\xa3\x81\xa3\x8c\x4f\x1a\x89\x69\x95\x0c\x06\x2e\x87\xe3\xb8\x3c\x9c\x6a\xaa\xa6\x85\xe0\x70\xd4\xc4\x73\xc4\x2e\x62\xce\xab\xb8\xd6\x63\x08\x91\x92\x0c\xd0\xa0\x77\xe8\x0b\x0f\xb0\x5a\xad\xb4\x78\xf1\x62\xdc\xc7\xf0\xcf\x73\xe0\x0f\xef\xf5\xd2\x2b\x07\xbc\x94\x63\x37\x92\xd5\xcc\x53\x2a\xad\x58\xdc\x0e\xd3\x4d\xe3\xca\x9c\xdf\x28\x2d\xb2\x5e\x60\xb5\x18\xf2\xd8\x75\x89\xa4\x12\xea\x1b\x14\x0e\xb5\xf7\x84\x5f\x08\x47\x92\x5b\x0c\x9c\x42\xa2\x4c\x74\xb1\xe5\x00\xc5\xdb\x76\xd3\x07\x0d\xfb\xbf\xf0\x00\xb7\xdb\x4d\xc1\x60\xf0\x9f\xbb\x02\x56\x93\x81\x9c\x56\x23\xd9\x4c\x46\x42\x74\xc7\x4f\x9f\x54\xf0\xdc\x8c\x7a\xf7\xc5\x0e\x53\x9a\x72\x79\x8d\x4c\xaa\x4a\x26\xac\x4e\x4c\xe6\x5c\x89\xda\xdc\x71\x61\x31\xff\x86\x5d\xfb\xfb\x9e\x3b\xd5\xe6\xff\xb1\x91\x37\x86\xac\x16\x2b\xa9\x76\xdb\x97\x3e\xc0\x66\xb3\x51\x67\x67\x27\x67\xb1\x58\x46\xc5\x55\xa3\xd1\x48\xc5\xc5\xc5\x84\x55\x1f\xbd\x03\xc3\x07\x28\x52\xbb\x68\x56\xf1\xf6\xd9\xb5\xd6\x2a\x4e\x88\xd3\xb4\x62\x07\x55\x96\x78\x48\x95\xd2\x24\xa5\x25\xdc\xdc\x44\x5d\xde\x08\x9d\x08\xc6\xe8\xba\x25\x65\x2b\x6d\x56\x63\xed\x27\xc7\x06\xae\x36\xf0\xa9\x70\x2a\x25\x59\x88\xa3\x7c\x20\x41\x2a\x8d\xc7\xed\xe6\x03\x17\x7a\xbd\x5e\xae\xbe\xbe\x5e\xc1\x77\xac\x15\x35\x03\xbb\xb2\x9f\x5f\x7a\x94\x96\x96\x52\x73\x73\xb3\x4e\xbd\xd1\x3b\x00\x6f\x25\x45\xb3\x2c\x9c\x52\xf0\xcc\xfc\x89\x96\xaa\x22\xa3\x42\xf3\x2f\xaa\x24\x41\x10\xc8\xc0\x19\x48\xe1\x70\x99\x11\xb4\xc7\x75\x85\x2e\x9e\x16\xb9\x72\xe8\xe8\x90\x48\x74\xc9\xb8\xb9\x42\x30\xf8\xc7\x7a\x6b\xfe\xa9\xba\x2b\xbe\xff\xcd\xa6\x79\x27\x9d\xbe\xad\xbe\x3d\x74\x84\x5c\xb8\x6b\x2e\x50\x8e\x3c\x09\xa4\x52\xa9\xad\xf8\xfe\x11\x30\x15\xf8\x25\xd0\x03\x3c\x0a\xf8\x3f\x6f\x50\x32\x99\x3c\x7f\x0a\x69\xa0\x88\xc7\x65\xbe\x79\xf1\x74\xcf\x3c\xa7\x9a\xa0\xb9\x75\xa5\x7a\x72\x1a\x79\x0b\xa5\x52\x48\x6e\x03\xb3\x9e\x48\x92\x65\xe2\xcd\x56\x32\x9b\xcc\x34\xdf\x96\x43\xd1\x93\x7d\x34\x75\xfa\xd0\xb7\x16\x4e\x9e\x43\xc5\x72\x11\x15\x77\x14\x91\x6f\x81\xcf\x46\x8d\x34\x1d\xd7\x0f\xe2\xd6\x26\xe0\x02\xe0\x76\xe0\x26\xe0\x5e\x60\x0d\x70\x27\xf0\x02\x70\x3f\x70\xea\xf3\x14\x3a\x6f\x07\xd2\xb2\x66\x9c\x5a\x9b\x7b\x97\xdb\x24\xd1\x94\x92\x5c\x44\x3e\x45\x66\x18\xca\x2a\x4d\x30\x14\x24\x97\xd3\xa5\xaf\x04\xab\x24\xc9\x44\x92\xc2\xe1\x08\xf5\xc7\xba\x48\xc9\x3f\x45\xb2\x6b\x3b\xfd\xf2\xc3\x6e\xea\xec\x1d\xa2\x4f\xcd\x3d\x64\xae\x30\x8f\x29\x5d\x58\x7a\x77\x67\x43\xe7\xaf\x70\x6b\x09\x38\x92\xc5\xcd\xc0\xab\xc0\x5d\xc0\xd3\x40\x0b\xf0\x78\xf6\xbc\xff\x2b\x25\x31\x4a\x65\x65\x75\x89\x6d\x9a\x13\x09\x5b\x5a\xe8\x26\x19\x91\x56\x24\x25\x73\x81\x91\xa7\xbe\xbe\x3e\xaa\xaf\xad\xa7\xb6\x96\x36\x4a\x88\x49\x6a\x37\x9f\xa4\x9d\xe9\x0d\xa8\x40\x3e\xea\x0b\x0e\x51\xab\x65\x80\xbc\xc5\x29\xba\x2a\xff\x4a\xfa\xf7\xb9\x0f\x53\xde\x15\x79\xdf\x9b\x39\x73\xe6\xd3\xf1\x78\xfc\x6c\xc3\xfe\x37\xeb\xd0\x6a\xe0\x36\x60\x2f\xa3\x3c\xf0\x08\x70\xcf\x59\xd7\xe5\x03\x41\xbd\x8e\x8f\xe2\xd0\x8b\xb3\xd5\x6c\xa8\x71\xdb\x8d\xa8\x96\x44\xf1\x58\x94\x15\x7c\xf0\x5d\xa3\x34\x12\x97\xe7\x79\xda\xb6\x65\x2b\xfd\x78\xf5\x8f\xe9\xc9\xb6\x27\xc9\xe3\xf6\xd0\xfe\x4f\xf6\xd3\xde\xb6\xbd\xd4\xd8\xdd\x46\xed\x81\x00\x4d\xcb\x5d\x40\xaf\x2d\xdd\x46\x5b\x97\xbd\x43\x5f\xcb\xfb\x1a\x4d\x9c\x38\xb1\x78\xe5\xca\x95\xf7\x7e\xc9\xf3\x36\x02\x5d\xc0\xb7\xb3\xe7\xaf\x00\x16\xe0\x1a\x60\x09\xf0\x12\xf0\x1f\xe7\xbd\x02\x28\x59\x66\x82\xc1\x26\x44\x9b\x90\x0f\x43\x43\x43\x94\x48\x24\x28\x12\x89\x50\x5a\x14\xc9\xef\x1b\xa2\x8f\xfb\x3e\xa2\xc3\xfc\x11\xda\x7c\xe4\x35\xf2\xbb\xfb\xc9\xae\x99\x69\x96\x73\x1a\xfd\x62\xc6\x8f\xe8\xca\xf2\x6b\xc8\xa0\x1a\x40\xbd\x34\x29\x02\x4f\x8e\x02\x03\xfd\xf0\x87\x3f\xbc\xfb\xc5\x17\x5f\x7c\x0a\xf7\xe8\xfc\xdc\x33\x7f\x07\x3c\x03\x6c\x06\x06\x80\x75\xc0\x93\xc0\xce\x6c\xd4\xcf\x8c\x36\xfa\xfa\xc1\xba\xe9\x8f\x9e\x3d\x35\xe3\x57\xdb\xbb\x94\xdd\xa7\x07\x34\x59\x10\xb4\x50\x20\xa4\x05\x87\x82\x5a\xc8\x1f\xd2\xc2\x81\xb0\xe6\xeb\xf7\x69\x7b\xb6\xed\xd1\x96\xac\x5b\xa2\xa1\x86\x68\x33\x5e\x9c\xae\xbd\x7c\x7a\x83\x96\x96\x25\x4d\xc3\x7f\xc8\x0b\x0d\x0e\x6b\xb1\x78\x44\x8b\xf9\x24\x2d\x19\x96\x35\x76\x3c\xf8\xe0\x83\xab\xff\xc6\x63\x59\x0e\xfc\xea\xac\xf3\xbc\xec\xe7\x9a\xb2\xb2\xb2\x19\xac\xfa\x69\xd9\x4e\x7f\x2e\xe8\x14\x12\xd3\xca\xa7\x3d\xde\x54\x77\x08\xb4\x0f\x46\xe2\xa0\x8e\xa8\x57\x03\x55\x51\x49\x64\x55\x88\x37\xd2\xdc\x05\x73\xe9\xbe\x29\xf7\xd1\x13\x0b\x9f\xa0\x7d\xcb\x0f\xd0\xf2\x89\x2b\x48\x4e\x49\xc8\x89\x04\x29\xaa\x82\x85\x53\x33\x8c\xb4\x8a\x24\x0b\x1c\xce\x35\xba\xf5\xd6\x5b\x6f\xf7\x78\x3c\x13\xb3\xc6\x79\x80\xef\x00\xcf\x02\x31\x60\xdb\x59\x0e\x04\xb3\x65\xb7\x08\xf7\x39\x3d\xda\x26\x36\x92\x03\x76\x9b\x21\xde\xdc\x1e\xda\xec\x17\x0d\xd4\x1a\x4a\x91\x1b\x5d\x55\x81\x41\xcc\xc3\xe1\x9b\x25\xa5\x24\xcd\xad\x9d\x4b\x37\x4d\xb8\x89\x6c\xbc\x15\xe5\x35\xa5\xe7\x89\x7a\xf6\x75\x1a\xeb\x15\x0a\x3a\x56\x8a\x4e\x1f\x6d\x25\xaf\x6f\x90\x97\x24\xc9\x6a\x41\xa7\x36\x5b\x2c\x0e\x23\xcf\x5f\x8f\x5b\x8d\x05\xfe\xcb\x99\xe3\xfe\xc8\x8e\xea\x66\x42\x49\x36\x99\x2d\xac\xc2\x4d\xc3\xbf\x87\xd0\xb1\x13\xec\x9e\x0c\xe9\x74\x5a\xa7\x32\xee\xa1\x17\x96\x61\xb0\x73\x45\x51\xfe\x9a\x03\x4c\x26\x0c\xfa\xe2\xbf\x6f\x3a\x1d\xbe\xc5\x35\x35\xb7\xa0\x20\x28\x90\x87\x97\x11\x5d\x99\x9c\x2e\xd7\x88\x13\x76\x97\x9d\xce\xb4\x7c\x4a\x0e\x8f\x8d\x0c\xc8\x17\xf6\x00\x56\x5a\x87\x97\x93\x3d\x94\x5d\x2b\x1b\x12\x94\x5b\x64\xa7\xad\x3b\x0e\x1d\xb8\xf1\x8e\xef\x9c\xb8\xf2\xfa\x6f\x51\x24\x1a\xeb\x4d\x24\x84\xcb\xb6\xbc\xb6\xe1\x5b\xdb\x5f\x7f\xe9\xe9\xf2\xaa\xea\x1d\xd7\xae\xb8\xe3\xa9\xa2\x31\x55\x22\x9a\x28\x3d\xf9\xd8\x03\x73\x26\x8c\xcd\x3f\xf4\xc0\x4f\x1e\xa2\x13\x27\x4e\x38\xec\x76\xfb\x1c\x87\xc3\xb1\xa4\xa9\xa9\xc9\xbb\x73\xe7\xce\x3f\xe1\xbe\xc2\xb0\x1d\xcc\xf8\xfc\xfc\x7c\x7a\xe0\x81\x07\x32\x2b\x90\x4e\xcb\xac\x49\x75\x7e\xb0\xaf\xf3\xae\xa3\xad\x31\xe9\x68\xca\x48\x67\xa0\x4e\xad\x66\x33\x59\x79\x03\x89\x42\x82\x78\x44\xdb\x66\xe2\x29\x07\x55\xa8\xad\x77\x00\x7d\xc2\x3c\xe2\x18\x33\x7c\x38\x22\xec\x7b\x61\x51\x21\xf1\xb8\x76\xf3\x9b\x6f\x6f\xba\xfc\x9a\x6b\x95\xc2\xa2\x12\x2a\x1c\x53\x4a\xa5\xe5\x15\xb4\xf2\xfb\x3f\xdd\xf8\xe0\x6f\xff\x74\x9b\x2c\x2b\x8e\xdf\xfd\xfc\xbe\xa7\xf6\x6e\x7f\x7d\x59\x65\x59\xd1\x3d\x16\x33\xbf\x6c\xc9\x65\x4b\x8f\x55\x54\x8c\xbb\xba\xb0\xb0\x70\x75\x55\x55\xd5\x2f\x2b\x2b\x2b\x2f\x5f\xba\x74\xe9\x55\x08\xce\x05\x90\x24\xe4\xf7\xfb\x75\x04\x50\xf9\xba\xbb\xbb\xf5\x95\xc8\x34\x32\x44\x92\x51\x82\x4c\x86\xb7\x5e\xdb\x72\x72\x45\x60\x5e\xc5\xba\x59\xd3\x4a\x8a\xc3\xe0\x72\x81\x2c\x91\xdd\x60\xa6\x70\x12\x4b\x8a\x06\xe7\x35\x15\x53\x73\x6b\x07\x15\x17\x44\x29\xd7\x69\xa5\x38\x1a\x1b\x73\x84\xad\x80\xc9\x64\x22\x44\x8e\x4e\x1c\x3f\x1e\x5d\xbd\x66\xcd\xf3\xe5\xd5\x13\x37\x95\x8f\xab\xa4\x70\x3c\x41\x32\x1e\xc6\x9e\x93\x14\x64\x9a\x74\xc1\x85\xc1\xff\xfc\xed\x13\x1b\x8e\x1f\xfe\xf8\xcf\xbb\xde\x7f\xef\xad\x97\x9f\xff\x23\x5d\x73\xfd\x0a\xfa\xd7\x15\x37\xfe\xf7\x84\x71\xa5\x1e\x50\x2d\x07\x66\x09\xb8\xa7\x80\xfb\xd9\xa6\x4c\x99\x52\xd7\xd0\xd0\x70\x88\xdd\x7f\x38\x48\xec\x3b\x7b\x6e\x46\x4a\x68\x99\x6a\xc4\x66\x01\x49\x51\x5e\x7f\x67\x67\x4b\x63\xe3\xb1\xbe\x1f\xd4\x4d\x2a\xba\xb6\x62\x5c\x41\x85\x1b\xd4\x51\x55\x91\x02\x21\x3f\xb5\x9f\x6e\x8b\xef\xde\xf8\xf4\xae\xe4\x0d\x17\xb9\x7f\xf6\xd0\x4f\x16\x60\x65\x47\x0c\x3f\x7d\xea\x64\x72\xed\xda\x27\x5f\x6e\xeb\xe9\x5f\x77\xd5\x0d\x37\x36\x5e\x7a\xe9\x22\x8a\xa1\xaf\x64\x56\x8a\xd3\x97\xdb\x69\x52\x67\x73\xaa\xba\x4a\x35\x39\xae\x9f\xb9\xf0\x6a\xc7\xc5\x4b\xbe\x4e\x9c\x18\xa1\xb2\x31\xc5\x94\xeb\xc9\x5f\x64\x30\x1a\x99\x4e\x4a\xc0\x1e\x56\xca\x54\xfc\x96\x9b\x3c\x79\x72\x1d\x68\x64\xc6\x2a\xa7\xcf\x5e\x71\x66\x33\xff\x65\x72\xd6\xc8\x9b\xdb\x07\xc2\xf4\x83\x9e\x3d\xdd\x8f\x68\xb1\xfd\x75\x52\xff\xa1\x92\x74\xa8\xab\x5a\x08\xfb\x72\x94\x60\x57\x23\xd6\xec\xfd\xb5\xfd\xfb\x2a\xee\xbc\xe3\xb6\x8f\x20\x7d\xed\xed\xed\xed\xe9\x75\xeb\x9e\x7c\xa3\xcf\x1b\x58\x53\x35\xb1\xee\xe3\x9f\xad\xba\x1f\x6a\xd2\x81\x1e\x92\xd2\x8b\x81\x84\x5e\x62\x54\xe4\xcb\x5c\x56\xd3\x77\x63\x22\xf7\x75\x59\xe1\x4c\x1e\xa7\x8d\x2a\x8a\x3d\x54\x9c\xef\x26\x33\x9a\xa5\x20\xa6\x29\x96\x60\xe2\x51\xb5\x16\xe4\xba\xa2\xd9\xbc\x62\xfd\x40\xa9\xad\xad\x1d\xeb\x72\xb9\xca\x51\x5e\xdb\x58\xce\x0d\x27\xf9\x48\x12\x33\xd5\x20\xc8\x58\x0e\x40\x15\xd0\xbc\x82\x1d\x94\x8e\x0c\x50\xa2\xe3\x40\x98\x86\x9a\x0e\xe2\x92\x12\xe0\x38\xc0\x46\xae\x30\xfb\xcd\xe0\xa0\xf7\xf8\x63\x8f\x3e\xfa\xf4\xd8\xf2\xb1\xb5\x1f\x34\xec\xf9\xf5\xec\x79\x0b\xf7\x3c\x7c\xdf\x4f\xc9\x60\xb1\x50\x30\x1c\xc6\xf0\x93\x40\xb4\x0d\x56\x55\x4c\x2d\x53\x15\xe5\xbb\x69\x32\x2d\x44\xd5\xa5\x82\x5c\x37\x55\x95\xe4\x51\x51\xae\x53\x9f\x00\x53\x78\xb8\x00\x07\xd3\x32\x22\x8a\x35\x1a\x0a\x0b\x79\x2e\x9b\x25\x68\x36\xf1\x22\xe4\x3d\x7e\xaa\x28\x45\x45\x45\x39\xc8\x87\xba\x93\x27\x4f\xb6\xb1\x00\xb3\x15\xfd\x0c\x85\xca\xa8\x83\xa6\x6a\x47\xc8\xa2\x59\x49\x08\x1e\xd3\x1d\xd0\x14\xc8\xe5\x52\x8d\x84\x82\xc9\xd6\x70\x24\x16\x4e\x0a\x89\x41\x0e\x34\xc8\xcd\xf5\xe8\xc9\xc3\xa8\xf1\xea\x1b\x6f\x3e\x74\xcb\xca\x3b\xd2\x7f\x78\xe6\x45\xc9\x62\x73\x50\x14\x9d\x3b\x1a\x09\x91\x98\x88\xbb\x15\x49\x5e\x9e\xb4\x39\xef\x89\xaa\xa6\x0b\x39\x24\xfc\x98\x1c\x3b\x55\x16\x79\xa8\xd0\x6d\x47\x94\x39\xdd\x60\x11\x50\x64\xd0\x01\x3d\x43\x46\x25\x52\x34\x15\x0e\x69\xc6\x6e\x6f\x28\x7f\x7c\x69\x5e\x54\x9f\x58\x41\x25\x18\x6b\x98\x34\x69\x52\xdd\xe1\xc3\x87\xb7\xc2\x68\x6d\x38\xfa\x23\x2b\xf0\xf0\xaa\xeb\x80\x65\xd9\x7f\x32\x7d\x86\x52\x47\x4f\xb5\xa7\x5e\x7f\x73\x0b\x1d\x3d\xf2\x91\x5e\x32\xaf\xbb\x61\x39\x0d\xf6\xf7\xd1\xde\x5d\x3b\x68\xe1\x55\xdf\x4c\xdc\x71\xe7\xcd\x24\xc4\xe2\x34\xe4\xf3\x32\xca\x94\xc2\x98\x5b\x88\xb7\xde\x25\x1b\xb8\x6a\x4d\x33\xd0\xd8\x42\x27\x95\x17\xb8\x29\x0f\x94\x41\x8a\xe9\x94\x4a\xa3\x41\xca\xaa\xa6\x37\x3b\xd8\xaf\x7f\x67\x0e\x48\xb2\x6e\x31\xf5\x05\x84\x7c\x97\xc5\xe8\xcd\xf7\xe4\x24\x35\x9d\xf2\xaa\x04\x7d\x35\x0e\xd1\x2f\x44\x21\xf0\x31\xbb\x20\x14\x75\x1a\x65\x73\xc0\x98\xc5\x17\x0f\x45\x91\x3f\xc3\x39\xac\xe9\x48\x12\x29\x30\x24\x99\x90\xc8\xdb\xd7\x5b\x3d\x14\x8c\xde\x6d\xf3\x14\xde\x22\xf3\xfc\x18\x1e\xd4\xa8\x80\xc1\x25\xa0\x49\x8e\xdd\x04\x62\x70\xba\xe1\xb2\xa6\x4f\x7d\x3a\xf4\xa8\x63\x46\x43\x39\x85\xe1\x70\x0a\x54\x12\x25\x39\xfb\x49\xdc\xa9\x6e\x7f\xd9\x85\x26\x2e\x60\xb1\xda\xf0\x53\x55\x06\x85\xdc\x79\x79\x79\xd5\x3d\x3d\x3d\x3e\x26\x30\xbf\x74\xa4\xfc\x5b\x5a\xe9\xec\xad\x17\xf6\x9d\x95\x43\x76\x58\x0c\xca\x85\xbe\x21\xff\x3d\x49\x83\x73\xb9\xbd\x28\xd7\x6d\x31\x71\x94\xe7\xb0\x50\x3e\xaa\x96\xdd\x9c\x09\x48\x5a\x56\x47\xba\x34\xfb\x8b\x0d\x4a\xcc\x78\xdd\x68\x18\xaf\x43\xca\x22\xad\x50\x0a\x3d\x89\x05\x67\x20\x96\xce\xb5\x77\x0e\x14\xd4\x54\x94\xc4\xd0\xa9\x55\x44\x5f\xae\xa9\xa9\xa9\xed\xed\xed\x3d\xc8\x1c\x18\x76\x82\x1f\xb5\xe8\x43\x04\x53\xd0\x48\x4c\x27\x95\x97\x97\x5f\x52\x7f\xef\xfd\xdf\x2b\xaf\xae\x5f\x86\xee\x61\x75\x3a\x38\x72\xdb\x78\x72\xd9\x2d\x64\x36\x66\xb6\x4f\x44\x18\xc8\x28\x33\xac\x6a\xb8\x61\xe3\x59\xf4\x19\x5d\x24\x65\xc4\x01\x68\x31\x44\x3d\xb3\x02\x22\x24\x7c\x42\x10\x29\x1a\x13\xa9\x29\x94\xa8\xb0\x1a\xd2\x83\x90\x1d\xfd\x76\x9b\x7d\x00\x79\x50\x86\x72\xea\x40\x00\x13\xcc\x81\x2f\x2d\xa3\x9f\x3f\x74\x69\x80\x66\x86\xa1\x87\x9f\x37\x6f\xc1\x35\x75\x53\x67\x7d\xd7\x95\x5f\x72\x99\x0c\xca\x89\xa9\x04\x8d\xcd\xb3\x90\x05\x15\xc1\x98\xd9\x2a\x62\xd3\x1d\x7e\xa3\xe9\x89\xca\x0c\xce\x04\x5f\xd3\x57\x80\x51\x47\x66\xf4\xc3\x35\xcc\x70\xe6\x44\x4a\x87\xac\x23\x9e\x94\x28\x1c\x13\xa0\x7f\xa0\xb3\x90\xd0\xfe\x84\xd1\xf1\xde\xfe\x63\x05\xff\x32\xbe\xa0\xb1\x66\xe2\x64\xb5\xba\xba\xda\x09\x09\x51\x09\x89\xde\xcc\xf2\x71\xa4\x0a\xfd\xbd\x83\xcd\x03\xe3\x2a\x2a\xe7\x2c\xb9\xf2\xda\x35\x63\x2a\x6b\x66\x0b\x20\xa8\x00\x0a\xc5\x93\x11\x4a\x04\x06\x69\x5c\x5e\x8d\x4e\x09\x65\xc4\x61\xa6\x10\x35\xfd\x93\x3b\x8b\x76\x3a\xf7\x59\xe2\xb2\xe8\x2b\x8c\x3e\xf2\x08\x6d\x92\xa8\xaf\x51\x18\x1e\x8f\x43\xc9\xc2\x70\x15\xe3\xeb\x60\x24\x41\xc1\x78\x9a\x8c\x72\x4e\xad\xb3\xb3\xbb\x25\xd7\x93\xd7\x06\x3b\x34\xe4\x42\x4d\x63\x63\x63\xf3\xf0\xec\x7c\xce\xed\xb2\x64\x34\x48\x95\x95\x55\x8f\x95\x56\x4f\x9a\x9d\xc4\xd2\x32\x87\xd8\xc0\x73\xfa\x64\x33\x1d\x6e\x3c\x82\x99\x39\x04\xe3\x0d\x6c\x57\x23\x03\x16\x5d\x78\x93\x96\x54\x9d\x46\xac\x54\xea\x51\x4e\xab\x3a\x55\x04\x70\x9c\x21\xc5\x0c\x87\xac\x08\xc2\xf0\x60\x38\xa9\xef\x02\x62\x7e\x45\xd4\x25\x6a\xf1\xc6\x28\x2a\x69\x94\x93\x63\xa5\x9c\xe2\x32\xab\x5f\xb6\x4f\xed\x68\x6f\xcb\x17\x45\x91\xab\xab\xab\xab\x42\x52\x1b\x47\x9d\xc4\x03\x7d\x3d\xd4\xd6\xd5\x7b\x60\xdc\xe4\xe9\x8b\x60\x0b\x45\xa0\x6b\x06\xfa\x07\xa9\xbf\xb7\x87\x90\xc0\xd4\xd1\xd9\x4d\x39\xf9\x65\x30\x5e\xd6\x39\xf4\x57\x25\xaf\xe9\x60\xe3\x29\x8b\x3e\xfb\x64\xdc\xd7\xcb\x28\xa3\x4b\x42\x04\xd7\x31\xc1\x31\x76\x81\xcf\x21\x0c\x31\x5d\x43\x71\x4a\x42\x01\xdb\x90\x4b\x6c\x87\x90\xa9\x64\x93\xc9\x48\x9a\xa5\xa6\xaa\x7f\xa0\xb1\xbf\xb3\xab\x53\xc2\x0a\xb0\x72\x58\x02\xc5\xda\xc7\xb6\x60\xce\xb9\x02\xe0\x3e\x1d\xfb\xcb\x47\xab\x7b\x5a\x8e\x77\xaa\xbc\x19\xd1\xcb\x24\x9c\x1e\x61\x85\xa3\x33\xed\xdd\x3a\x1d\x84\xb4\xde\x84\x00\x55\xbf\x46\xd0\xa9\xc1\xba\x2c\x90\xca\x9c\x27\x40\xbf\x60\x54\x20\x5f\x30\x41\x09\xd0\x46\x43\xc4\x23\xf8\x5d\xf3\x40\x94\x4e\x7b\x13\xa4\xc2\x91\xbc\x3c\x94\x5e\xb7\x83\x9c\x10\x8a\x0e\x87\x15\x1a\xcb\x44\x9e\x82\x02\xa3\xd1\x33\x76\x72\x6b\x4b\x4b\x89\xdd\xe1\x28\x80\xcc\x9e\x00\xf9\x32\xba\x15\xd0\xa3\x95\x4c\x86\x1a\xb6\x6c\x7c\xf4\x9a\x7b\x26\xae\x97\x30\x83\x2b\x18\x68\xc8\x64\x03\xcf\x4d\xd4\xda\xed\xa5\x48\x38\x02\x63\x6c\xac\x49\x0c\x97\xac\x91\xf2\xcb\x56\x84\xd5\xfa\x24\xa2\xcd\xf2\x87\x25\x9e\x01\x95\x2a\x92\x92\xa9\x0b\x54\x09\x22\x71\xcd\x66\x83\x6e\xb8\x85\x6d\x6d\xb2\xa8\x1b\x99\x30\xe6\x18\xa3\x50\x1c\x32\x1b\xce\x7c\x79\x4d\xa1\xff\xf8\xc0\x78\x9f\xcf\xa7\x8e\x9f\x30\x61\x3a\xd4\xc0\x3e\xd6\x95\xcf\xe9\xc0\xb1\x63\xc7\xe8\x83\x9d\xbb\x68\xdf\xbe\x7d\xcf\x4f\x98\x36\xef\xdb\xf9\x53\x96\xce\xd2\x8c\x30\xd6\xe4\x84\xfb\x11\x1a\x08\x0c\x81\x52\x7d\xe4\x29\xad\x26\xc8\x87\x4c\xcf\xd0\x32\xf4\x61\x23\xa9\x80\xbc\x49\xa5\xd2\xc4\x31\x23\x30\x23\x84\xb1\x12\x3d\xe1\x14\x85\xe1\x00\xa3\x47\x9e\xc7\xc9\x76\x45\xc8\x84\xb9\xc3\x9c\x35\x9e\x47\x85\xc1\x69\xa6\xb2\x21\x28\x0a\xa4\x8b\xaa\x41\xc8\x78\xca\xc6\x63\x0e\x08\x20\x27\xab\xd1\xd4\xf2\xd0\x2f\x02\xe7\x74\x40\xdf\x23\x52\x14\x43\x52\x50\xe4\x17\xd7\xfd\xe6\xd7\x3f\x5a\x3b\x7f\x73\xda\x60\x27\xcd\x04\x60\x25\x40\x65\x3a\x83\xf9\x60\x5a\x41\x25\x0c\x95\xf4\x12\xca\xf4\x8d\x90\x4c\xe9\x86\x1b\x11\x6d\x03\xac\x8a\x82\x46\x03\xfe\x14\xc5\x40\x19\x8b\x05\xb4\xc8\x75\x90\xcd\x62\xd4\xa3\x6e\xe1\x39\x3d\xf2\xac\x83\xb3\xc8\x1b\xf4\xda\x8b\x8e\x2f\xb1\xf1\x11\x09\x8f\x20\x08\x98\x3b\x52\xaa\xd5\x99\x4c\xf1\xd5\xbc\x24\x0c\x59\xd8\x4d\x46\xdb\x07\xb2\x3a\x23\xf7\xe0\xc1\x83\x9f\x2c\xd8\xf1\x52\x43\xde\xcc\xe5\x97\xca\x06\x2b\xa9\x80\x66\xb0\xd0\xa9\x96\x2e\x9a\x32\x5d\x40\x82\x63\x30\x4a\x0a\x00\x22\x0e\x63\x38\x70\x20\x26\x48\xe4\x47\x82\x8a\x88\xa0\xd5\x6e\x06\x55\x6c\x64\xb7\x64\xb6\xf1\x47\x8c\xe7\x33\xc6\xf3\x78\x16\xc7\xca\x2d\x0a\x42\x5a\x44\xb2\x43\x62\x27\x21\xb1\xe3\xb1\x18\x1c\x88\x93\x04\x85\x3b\x34\x38\x24\x7f\xb8\xe3\xcd\xed\x01\xbf\xdf\x67\x64\x1d\xf9\x3c\xf6\x90\x98\xca\x73\x6e\x5a\xff\xf8\x0b\xab\xea\x97\xcc\x17\x39\xa7\x49\x81\x03\xbc\xd5\x49\xad\xbd\x83\x34\xd8\xd3\x4b\xbd\x61\xa6\x57\x51\xc7\x0d\x46\x4a\x20\xa1\xa3\x4c\xfc\x80\x36\x4e\x27\xe4\x05\x24\x86\xdd\x66\xd2\xa3\x6e\x35\x67\x22\x0f\x91\xa9\xd3\x86\x19\xcf\x7a\x87\x06\xca\x49\xd9\xde\xc0\xb6\x37\xe3\x10\x89\x89\x78\x8c\x24\x8c\xb4\xfe\xce\x33\xfd\x47\xf6\xbc\xfb\xd4\x5f\xf6\xef\xfe\xb3\x98\x4e\xf7\xb3\x01\x6a\x54\x8d\x6c\x58\xd3\x01\x29\x96\xf4\x2d\x6d\x9d\xed\x47\xdf\x5d\xbf\xd3\x73\xf1\xf7\xae\xf0\xf6\x33\xed\x2f\x51\x6b\x73\x3f\x75\xb4\xb4\x51\xd2\x51\x45\x61\x24\xab\x8c\x81\xdf\x02\x63\x9d\x4c\x13\x39\xcc\xe4\x60\x86\xeb\xc6\xf3\x64\x85\x03\x66\x18\x6e\xe1\x33\xbc\x37\x70\x7a\x8b\xce\xaa\x51\x56\xb1\xd2\x19\xc3\x11\xf1\x34\x22\xee\xef\x38\xe3\x6d\xdc\xfd\xce\xfa\x43\x0d\xef\xad\x4f\xa6\xc4\xce\x49\x75\xf5\x74\xfd\x0d\x37\xd0\xc6\x0d\x2f\xfd\x75\x26\x1e\xc5\xc1\x6a\x6f\x32\x3b\xcc\x78\xb6\xbf\xfe\xec\x7b\xcb\x6b\x17\x5d\xd2\x74\xd2\x6f\x4f\x05\x12\xc8\x07\x17\x75\xf4\xa1\x2b\x4f\xad\xc5\xf4\xa5\x52\x2e\x34\xbf\xdd\x99\x29\x81\x3a\xac\x30\xdc\x9a\xa1\x0c\x4b\x58\x33\x3e\x79\x26\x94\x28\xd3\x1b\x64\x44\x3e\x25\xb2\x2d\x94\x24\xfa\x43\x82\x44\xd4\xf7\x40\x57\x4b\xa0\x69\xe7\xd6\xe7\x3f\xdc\xb1\xf5\x4f\xb1\x78\xe2\x4c\x79\x75\x1d\xcd\x9f\x31\x9f\xe6\x5e\x34\x9d\x8a\x9c\x99\xf2\x3e\x2a\x2d\x74\xd6\x21\x65\x37\xa0\x5c\x83\xbe\x60\xdb\xe9\x9d\xcf\xec\x2e\xaf\xba\xf3\xaa\x3e\x4d\x24\x87\xcb\x44\x5d\xbe\x18\xcd\x2b\x30\x53\x14\xb7\x74\xbb\x41\x17\xf0\xdd\x9e\x8d\xbc\x75\x98\xf3\x7a\xb5\xc9\x24\x29\x7b\x38\x33\x9c\x09\xb8\x04\xf2\x86\x6d\x0e\x88\xa9\x14\x05\xbb\x5a\xa3\x4d\xef\xbf\xbd\x61\xff\xd6\xd7\xd7\x46\x62\xf1\x93\xce\xdc\x3c\xfa\xfa\x6d\x2b\x69\xf6\xe2\x65\xa0\x27\xa6\xb0\x48\x0f\x89\x62\x88\x86\x05\xf2\xf9\x38\x40\x59\x1a\xb1\xfd\x4c\xe7\x87\xbb\xb7\x6d\x5d\x31\xeb\x1b\xb3\x05\x2a\xcf\x37\xa4\xcc\x98\xd0\xfa\xc9\x20\x45\xa9\xb8\x70\x0c\x0c\xe6\x60\x38\x8f\xc8\x33\xe3\x33\xd1\x67\x74\xc9\xbe\x1b\xd4\xb5\x90\x04\xc9\x9c\x80\xc1\x09\x96\xe0\x90\x27\xa1\x9e\x4e\xe1\xe8\x7b\x6f\xbd\x72\x60\xdb\x1b\x6b\x21\x55\x1a\xcb\x27\xd6\xd3\x82\x05\x97\x53\xfd\xcc\x79\xe4\xca\xc9\x23\x11\xb9\xa0\xc8\x22\x59\x86\x7b\x0d\xfd\x63\x0e\x68\xd9\x6d\xc1\xee\x48\x3c\x65\xfa\x74\xf7\xb3\x6f\xcf\xfc\xb7\xc7\x6f\x6f\xe9\x02\x05\x78\x51\xdf\xb3\x19\x3b\x75\x02\x25\xa1\x75\x1c\xf6\x0c\xe7\x2d\x48\x58\x5d\x77\x69\xaa\x3e\x7b\x33\xc3\x93\x30\x98\x41\x04\x87\x23\x03\xbd\xca\xf1\xf7\xb7\x6c\xda\xbb\xf9\x95\xd5\xde\xc1\x81\x8f\x2d\x0e\x27\x5d\xb1\x72\x15\x5d\x72\xed\x0a\xfd\xc5\x4a\x1a\x74\x62\xfb\x52\x99\x99\x84\xfb\xfb\xef\xc8\xce\x23\x1f\x18\x95\x4c\x07\xf6\xec\x7a\x6d\xc6\x65\x9f\x5c\x32\xae\x6a\xde\x84\x88\x57\xa1\xc1\x50\x8c\xa6\xd9\x31\xf9\x43\x72\x38\x2c\x46\x7d\x68\x67\x8d\x08\xfe\x90\x84\x4f\x16\xe9\x84\x3e\xc0\x4b\x14\xf7\x7b\xd5\x53\x0d\xef\xbe\xb5\xf7\x8d\x97\xd7\xf4\xf6\x74\xef\xb5\xb9\xdc\x74\xeb\x23\x8f\xd3\x98\xca\xf1\x54\x54\x56\x41\x49\xb6\x33\x2e\x09\xc4\xa9\xda\xe8\x5f\xf2\x9d\xc7\xc1\x5e\xd8\xf9\xd3\x8a\x76\x7c\xd7\xc6\xb5\xcf\xdc\xf8\xeb\x4b\x1f\xfb\xd4\x38\x86\x84\x80\x40\x46\x31\x06\xea\xe4\xc3\x70\x39\x33\xfb\x32\x9d\x04\xa3\x85\xac\xe1\x89\xb0\x9f\x5a\x0f\x36\xbc\xbb\xef\x8d\x0d\x6b\xba\x3a\xda\xdf\x87\xe1\xda\xe2\x9b\xef\xa6\x69\x97\x5e\x41\x63\xab\x27\xb1\x0d\x01\x4a\x01\xa3\x7d\x01\xff\x8f\x3a\xa0\x0f\x5d\x40\xe0\x48\xd3\xb1\x4d\x4b\x0e\xbd\x71\x75\xcd\x82\xdb\xe6\xb6\x8b\x01\x42\x83\x21\x4b\xa9\x9b\xa2\xa8\x26\x29\x31\x05\x0d\x04\x8e\xc3\x09\x31\x16\xa4\xf6\x4f\xf6\xef\x39\xf8\xf6\xc6\xc7\x3b\x5a\x5b\xb6\x99\x2c\x56\x75\xd9\xbd\x0f\xd2\xf4\xcb\xae\x26\x77\x41\x21\xc9\x8c\x56\x91\x30\xd1\x79\xfe\x9f\x03\x5f\xc5\x81\xe1\xa4\xee\xde\xf4\xcc\xef\xff\xe7\x17\x8b\xae\x9d\x19\x2c\x1e\x63\xee\x1d\xe8\xa1\xb1\x76\x0f\xf5\x79\x03\xe0\xbb\x84\x88\x46\xa8\xf7\xf8\xa1\x0f\x0f\xef\x78\x7b\xf5\xa7\xcd\xc7\xdf\xb6\xd8\x1d\xe2\xcc\x2b\xaf\xa3\xa5\xe0\xb9\xa7\xb8\x44\xdf\x24\x10\xd0\x69\x59\x65\xe2\xd8\xdb\x7c\xb6\x79\xc0\xbe\x8f\x20\xab\x06\xce\xfe\xb7\xb3\x72\xe1\x2b\x39\x30\xed\xc2\xe9\xda\xd0\x90\x2f\xdd\xde\xd5\xfb\xce\xa1\xcd\xeb\x5f\x9d\x75\xfb\xcf\x6f\x3e\xf5\x71\x2f\xa5\x11\x6d\x5f\x5f\x37\x85\x3a\x9a\x8f\x34\xed\x7e\xe7\x89\xd3\x4d\x47\x5e\x55\x38\x2e\x35\x15\x34\x59\x7c\xf3\x5d\x54\x3e\x69\x0a\x49\x98\xea\xb4\xec\xd6\x3c\x7b\xff\xa0\x1b\x35\x3c\x83\xb2\x32\xab\x66\x44\x21\xd3\x56\x18\x22\x20\x59\x58\x21\xe0\xf4\xad\x1d\xf6\x67\x78\x63\xf9\x2b\x39\x10\x0c\xf8\x99\x21\x2c\xa9\x85\x57\x9e\x5b\xff\x9b\x19\x97\x5e\xbe\xa0\x66\xfc\xd8\xf2\xd6\x43\x0d\x27\x1a\x36\xbe\xb4\xb6\xe5\x78\xe3\xcb\x98\x15\x58\xd5\x62\xef\x07\x28\xec\x1d\xa0\x4d\x8f\xff\x02\x74\x49\x67\xa2\xcd\x7d\xee\x65\xd2\x30\x7d\x86\x77\x42\xb2\x3b\x19\x99\xf3\xac\x36\x53\xd9\x34\xae\x50\x34\x1a\xd5\x77\xe7\xce\xf9\x0a\x67\xd5\xaa\x55\xa3\x76\xc8\xe5\xb0\x55\x4f\x98\x30\x61\xf1\x59\xaf\x8c\xfe\xa9\x47\x6f\x6f\xef\xb9\x57\xa0\xba\xba\x9a\xe6\xcc\x99\x33\xba\x56\x2d\x49\xad\x90\xde\xad\x17\x5d\x74\xd1\x79\xbf\xb0\x3e\xdf\x03\x72\x5a\xc7\xff\x09\x30\x00\xe6\xc8\x06\xfc\x34\x43\x9b\x9a\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x7b\x77\xe3\x30\x14\x14\x00\x00")) - folderTimeCalOut48 = HexToBytes("folderTimeCalOut48", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x82\x12\x7d\xed\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x00\x57\x02\xf9\x87\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x12\x24\x49\x44\x41\x54\x78\xda\xd4\x5a\x09\x94\x54\xe5\x95\xbe\x6f\xa9\xaa\x57\x5b\x57\x77\x75\xf5\x4a\x6f\xd0\x1b\x34\x1d\xbb\xd9\x51\x40\xb6\x28\x12\x89\x4b\xc4\xb8\xa0\xa3\x0e\x6a\xce\x90\x1c\x1c\x13\x8d\x27\x67\x32\xc9\x64\x1b\x4d\x46\x46\x1d\x8e\x7a\x34\x44\x63\x72\x30\x62\x10\x95\x20\x20\x8b\x8d\x22\xa0\x34\xd0\x0d\x6d\x23\xbd\xef\xd5\x5d\xd5\x55\xdd\xb5\xbd\x7a\x5b\xbd\xf7\xe6\xfe\xaf\xaa\x08\xb2\x1c\x08\x0e\x9c\x33\x8f\xf3\x9d\xea\xaa\x7e\xf5\xfa\xbb\xf7\xff\xee\xf6\xff\x50\xba\xae\xc3\xff\xe7\x8b\xbd\xdc\x2f\x76\x8e\xc4\xa1\x77\x54\x04\x96\xa6\x80\x61\x28\x48\xfb\x41\x56\x54\xa0\x80\xb2\x53\x34\x95\x0d\x3a\x30\xe8\xa0\x71\x55\xd7\x43\x66\xbc\x07\xf0\x03\xe2\x30\x0d\xef\x75\x52\x61\x30\xc9\xe3\x30\xe8\x1d\x3e\xe7\xd9\x0c\xc3\xc0\x92\x25\x4b\x80\xe3\xb8\x2b\x67\xc0\x9b\x9f\x8e\xc0\xf3\x1f\x0c\x80\xcb\xca\x82\x15\x21\x4a\x2a\xe5\xb0\xb2\x77\x94\x14\x38\xee\x29\xcc\xe7\xae\xb1\x59\x99\x5c\x8a\x02\x3a\x2e\x68\x91\x11\xbf\x70\xac\xab\x3f\xf4\xd6\xd8\x38\xbf\x91\xd6\x55\x10\x35\x16\xea\x99\xcf\x21\x33\x78\x00\xde\xd9\xba\xe3\xbc\xcf\x1f\x18\x18\x80\xa2\xa2\xa2\x2b\x67\x80\x99\xa5\xc1\xc1\x31\x60\xb3\x30\xc0\xd0\x54\xee\xb4\xea\xac\x57\xaf\xad\x73\xdf\xea\xb4\x28\x90\xc9\x6a\x60\x46\xa2\x26\x86\x06\x3e\x01\x8e\x58\x45\x46\x61\x74\xb6\x67\xc5\xfe\xc3\x23\x77\x37\xb5\x8e\xac\xa1\x81\x19\xb0\xb2\x16\x34\xdc\x7a\xde\x67\x13\xcf\x53\x14\x75\x65\x25\x94\xbe\x12\xaa\x9e\x7b\x5d\x7d\xf6\xf6\xa5\xd3\x32\x66\x80\x10\x85\x5a\x0f\x07\x95\x85\x1e\xa0\x88\xa7\x05\x11\x4c\x26\x0b\x78\x03\x11\x38\xee\x0f\xc1\xb7\x16\xe4\xae\x70\xd8\x98\x8a\x86\xcf\xbd\xcb\x59\x4d\xec\x15\x45\xd9\x84\x8f\xc8\x46\x16\x32\x24\x60\xec\xaa\xc6\x00\xea\x1c\x12\x09\x1d\x6a\x26\x67\xae\x5f\x36\x3d\x63\x86\x4b\x13\x61\xe9\x8c\x52\x50\x64\x11\x68\xf4\xbc\xaa\xe2\x3d\xac\x19\x34\xbc\x2f\xd3\xc6\xc2\xa2\xd2\x0c\x38\x35\xa6\x00\x3d\x3b\x7f\x72\x78\x8c\xff\x43\x75\xd4\xba\x7d\xe1\x8a\xef\xad\x3a\x31\xb3\xdd\xd5\xfe\x51\xfb\x0e\x68\x80\x1f\x5c\x0e\x0f\xfa\x72\x0d\x20\x41\xcb\x71\xec\x8d\xcb\xe7\x78\xbe\x6b\x53\xe3\xb0\xb0\x3a\x17\xc8\xaa\xd3\x48\x5a\x14\x25\xd0\x34\xcd\xb8\x4f\x51\x90\x34\x6b\x02\x8b\xcd\x09\x73\x4a\x72\x60\x82\x1c\x81\xda\xc9\xde\x25\x0b\xee\xac\x7b\xf6\x9a\x29\xd3\xa7\x15\x65\x15\x4e\x82\x79\xf0\x00\x58\xa1\xe6\xaa\xae\x80\x9c\x50\xa1\xba\xd4\xf9\x48\x8e\x1d\x5f\x3d\x4e\x50\x13\x32\x50\x34\x6d\x64\x99\x48\x38\x02\x16\x8b\x05\xcc\x26\x33\xd0\x14\x0d\x22\xae\x4a\x34\x12\x85\xe1\xe8\x10\x08\x8e\x53\x40\x57\xee\x86\x97\x8e\xb7\xc1\x60\x57\x04\x4e\x98\x3a\x01\x3c\xe0\x28\x5f\x5e\xfe\xa3\xae\x2d\x5d\xab\xaf\xde\x0a\x00\x64\x55\x15\x3b\xae\xb5\xd2\x1a\x94\xe5\x66\x82\xc5\x6a\x07\x4d\xd5\x0c\xcf\x73\x16\x0e\x06\x07\x07\xc1\x61\x75\x40\xd8\x1f\x86\xa1\xfe\x21\x38\x15\xff\x02\x36\x0a\xcf\xc2\x76\x61\x03\x34\x7b\x1b\xa1\x87\xee\x84\xee\xbc\x4e\x58\x50\x36\x1f\x76\xde\xb6\x03\x0e\xbc\x7c\xe0\x6e\xcc\x3a\x75\x57\xcd\x00\x96\xa1\xcb\xb2\x9c\x4c\xbe\x05\x9f\x20\xf0\x51\x8c\x87\x04\x09\x0c\x48\x28\x09\x23\x8f\xef\xdf\xbf\x1f\x7e\xfc\xdb\x27\xe1\x97\xc7\x7f\x09\x2e\x77\x26\x1c\x6d\x3a\x02\xfb\x3a\xf6\x41\x53\x5f\x07\xb4\xf9\x7d\x50\x66\xab\x83\xd7\x17\xbd\x0d\x7b\xbf\xd3\x00\xcb\xf2\x6f\x82\xbc\xdc\x3c\xdb\xda\xb5\x6b\x9f\xb8\x6a\x12\xb2\xda\x6c\x26\x45\x13\x19\x06\x65\x43\xe1\x72\x04\x82\x01\x10\xe2\x02\x84\x43\x21\x43\xf7\xe3\xc1\x31\x68\x6c\x6a\x84\x46\x6b\x23\x7c\x78\x72\x07\x8c\xd9\x87\xc0\x9c\xc5\x40\x9d\x7d\x1a\xfc\x70\xe6\x5a\xb8\x6d\xd2\x9d\xc0\xd1\x1c\x7e\x47\x02\x89\x67\xc0\xea\x06\x58\xbd\x7a\xf5\xca\xf5\x78\x0d\x0d\x0d\x1d\xbe\x2c\x03\xd6\xad\x5b\x67\x14\x10\xbc\xae\x43\x48\x88\xa3\x17\xfa\xe2\x71\x7e\xe2\xc8\x82\xdb\xef\x0a\x89\xaa\x9e\x69\x42\xad\xdb\x31\xa5\x73\x66\x0e\xb2\xb3\xdc\xb8\x10\x34\x54\x95\x57\xc3\x0d\xc7\x6f\x84\x17\x7b\x5f\x84\x8d\xe2\x46\xa8\xf2\x54\xc2\xe3\x33\x7e\x08\xf7\x4d\xb9\x1f\x1c\x8c\x1d\x0b\x9f\x08\xbc\xce\x83\x4e\x61\xb0\xb3\x14\x88\x11\x06\xdc\xd9\x6e\xee\x89\x27\x9e\x78\xea\xb1\xc7\x1e\x5b\xa9\x5f\x6a\x8f\x43\xee\x4b\xa3\xaa\xaa\x2a\xfd\xf1\x9f\x10\xc4\x0b\x3f\x47\x64\x9e\xf7\x8b\x96\x7c\xea\xe1\xd7\x3b\x0e\x6d\x6e\xf5\xe9\x83\xde\x51\xdd\x3f\x3c\xa2\x87\xc7\xc2\x7a\xd0\x1f\xd4\x7d\x5e\x9f\x1e\xf4\x05\x75\x39\x26\xeb\xfb\x1b\xf7\xeb\xcf\xec\x7a\x46\x0f\x89\x21\xc2\x49\x17\x78\x41\x8f\xc5\x62\x7a\x34\x1a\x3d\x03\x11\x3d\xe2\x55\xf5\x84\xa2\xea\xe8\x40\xa5\xa6\xa6\xe6\xfa\xae\xae\xae\xaf\x70\xbb\x10\xbe\x12\x03\x4e\xa7\x13\x8c\xc2\x82\xf4\x10\x2b\x10\x22\x62\x23\xe2\xae\x73\x0c\x90\x7c\xfa\x81\x9d\xef\xbe\xe5\x97\x38\x68\x1b\x13\xc0\x69\xb3\x1a\x01\x6c\x38\x4e\x37\x0a\x05\x08\xb2\x00\xb5\x65\xb5\xf0\x50\xf5\x43\xe0\xb2\xb8\x40\x92\x30\xbd\x82\x76\xfa\xbe\x74\xb5\xd5\xc9\x3f\x93\x04\xa7\x8e\x77\x83\x77\xd8\xcb\x88\xa2\x68\x26\xbf\x93\x65\x19\x78\x9e\x37\x24\x49\x62\x2c\x0d\xf2\x5e\x25\x85\xe6\x02\x31\x40\x32\xc1\x38\xc2\x8f\xf8\x2d\x62\x33\xe2\xb1\x94\x41\x2f\x20\x8e\xa4\xf3\x10\x35\x7c\xe4\x8f\x47\x4f\xde\xf5\x2f\xce\x3a\xae\xba\x7d\x94\x87\x62\x1b\x05\x91\x58\x1c\x32\x5c\x99\x06\x39\x42\x8c\x43\xc3\x06\xbd\x03\xc0\x65\xa0\xcc\xd0\x41\xc4\x08\x3a\x95\x6e\xd3\xb5\x82\x58\xab\x32\x22\x38\x3c\x26\xf8\x6c\x4f\xcb\x91\xd9\xb3\x67\x1f\x47\xa2\x8b\xbc\x5e\xef\xb2\xe6\xe6\x66\xdf\xde\xbd\x7b\x5f\xc1\xe7\x09\x69\x83\x09\xf9\xec\xec\x6c\x78\xf2\xc9\x27\xcf\x6b\xc0\x9c\xb3\xb4\xdf\x85\x58\x9b\xfa\xfc\x27\x88\x21\xc4\x7f\x22\x46\xea\x2b\xb3\xc3\x85\x16\xfd\xc1\x86\x46\xff\x4e\x66\x4e\xbe\x2b\x14\x8f\x42\x79\x86\x05\x38\x96\x01\x3e\x1e\x23\x81\x0e\x9c\x89\x46\x6d\x7b\xa0\x6b\x70\x04\xa6\xd5\x66\x1a\x19\x2a\xbd\x02\xe9\x55\x20\xb4\x6c\x78\xaf\x10\x8f\x03\x1f\xe3\x7d\x3f\xc5\xab\xb4\xb4\x74\x86\xd9\x6c\xb6\xe5\xe6\xe6\x06\xf6\xec\xd9\x73\xd0\xef\xf7\x1f\x66\xd9\x24\x5d\xf2\xfd\xf4\xca\x9c\x2f\x8d\x96\x23\x3e\x3b\xeb\xb3\x2c\x44\x71\x32\xfd\x43\x51\xea\x3d\xe9\x83\xe0\x47\xb7\x95\x7e\x96\x4b\xcb\xb7\xbe\xb3\xab\xbb\xb3\x99\xe7\xe0\x98\x68\x86\x96\xb0\x0c\x3e\xd5\x04\x5e\x14\x60\x4b\x50\x80\x76\xca\x0d\x1f\xfb\x19\xe8\x19\x0a\x80\x15\x1b\xb5\xb4\xe7\xb1\x13\x07\x9d\x90\x91\x14\x68\xeb\xf3\x81\xd7\x17\x08\xdd\x73\xef\x3d\x13\xa7\x4e\x9d\xba\x1c\xc9\x67\xa2\x81\x09\x34\xcc\x5a\x5b\x5b\x6b\x54\x69\x93\xc9\xf4\x15\x10\xe3\xcf\x5e\x01\x4f\x4a\xff\x2d\x67\x7d\x7e\x1f\x62\x25\xe2\x51\x44\x5b\xfa\x43\x0d\x1b\x7b\x05\xb9\xac\xbd\xa5\xe2\xe3\xed\x9f\x0d\xce\xdb\xb4\xbd\x75\xad\x33\xcb\x7e\x67\x49\x51\x66\x65\x5e\x8e\x8b\x32\xb1\x3a\x84\xc2\x3c\x74\xb6\x75\xf1\x3b\x37\x6e\xd8\xd3\x3a\x3b\x57\xf9\xfd\xcb\xeb\x57\xb2\xb8\x42\x0a\xd6\x8b\xb8\xa4\xc2\x78\x54\xc0\x8c\xa4\xe0\x0a\x98\x21\xab\xb0\xd8\x96\x93\xe3\x76\x90\xd8\x43\xf2\x0a\x42\x43\x92\xd4\x94\x29\x53\x6a\x50\x46\x66\x94\x8e\x9c\x5e\x01\x22\x23\xb2\x82\x67\x1b\xf0\x8d\x54\xfa\xbc\x15\x71\x2f\xe2\xbf\x52\x9a\x7f\x0f\xb1\x00\x31\x78\xf6\x72\x11\x67\x4a\xd8\x56\x2c\xae\xcf\xf5\xd7\x96\x39\x7f\xda\xd8\x1e\x7c\xfa\xcb\x91\x58\xcd\xb6\xed\xdb\x0a\x8f\xec\xd9\x5c\x2a\x05\x87\xed\x66\x8a\xef\x5e\xb1\x7c\x89\xa9\xa6\x7e\xe6\xaa\xb6\xce\x6e\xf0\xe4\xe4\x82\x7f\x3c\x0e\xaa\xa6\x82\xd3\xce\x41\x7e\x4e\x96\xd1\xf4\xc5\x78\xc9\x1c\x08\x45\x6d\x9e\x4c\x67\x2c\x25\x31\xb2\xe2\x2a\x66\xc7\x22\x4c\x30\xc5\x82\x20\x74\x91\xf8\x21\x06\xa4\x57\x91\x3d\x8f\xfe\x67\x91\x79\x02\xf1\x09\x62\x0d\xe2\x9f\x53\xef\xf7\x23\x9e\x42\xfc\xec\x7c\x8d\x9d\x20\xab\xe0\xb0\x99\x60\xe9\xac\x09\x7c\xd7\x0b\xcf\x36\x7e\xfe\xc6\xef\x2c\x85\x13\x0a\xca\xbf\xfd\xf0\x9d\xf3\xaf\xbd\x61\xc5\x23\x39\x25\x95\x8b\x79\x5e\xa0\x07\xc7\x78\x30\x71\x3c\xb8\x9d\x56\x70\x60\xf1\xd0\x50\xc5\x92\x8c\x99\x05\x9d\x80\x11\x01\xa3\x21\x01\x7f\x65\x19\x33\x9b\x58\x49\xc3\x15\x40\x4f\xab\x18\x07\x19\x65\x65\x65\x35\x27\x4f\x9e\xec\x22\x31\x44\xa4\x73\x21\x09\x91\xf1\xe8\x75\x84\x2f\xf5\xfe\x55\xc4\x1d\x88\x77\x10\xaf\x20\xfe\x8c\xb8\x19\xf1\xc1\x39\xed\x35\x3e\x8c\xc1\xae\xb3\xa5\xe5\x04\x6c\xdb\xb2\xc5\xf3\xf8\x4f\x7e\xb6\xea\xa6\x95\xab\xee\xa7\x38\xe7\x0c\x09\x8b\x56\x06\xc7\x42\x5d\x69\x09\xb8\x50\x2a\x24\x3f\x51\x14\x03\x32\xca\x20\x81\x1a\x54\x51\x8a\x24\x9e\x54\x5d\x03\x51\xd1\x99\x7e\xdf\x78\xf6\xa4\x42\x77\xc4\x98\x3e\x31\x0e\x90\x2c\x3d\x79\xf2\xe4\x9a\xa3\x47\x8f\x6e\xc3\xbf\xa3\xff\x3d\x7b\x9d\xbb\x02\xc7\xcf\x7a\xff\xab\x94\x11\x24\x13\x35\x23\x7e\x9c\x32\x84\x68\x71\x37\x8b\x84\xd1\x21\x46\x5a\x94\x44\x11\x14\x49\x2c\x2c\xc8\xcf\xbf\xff\x0f\xef\xed\x5e\xad\xb3\x5c\xa5\x22\x4b\x90\xcd\x51\x50\x5c\x94\x0f\x6e\x87\xd5\x08\x5a\x42\x96\x40\x51\x53\xc4\x91\x4b\x22\x65\x80\x92\x30\x18\xc3\x50\x50\xc8\x76\x5a\x18\x5f\x76\x56\x46\x5c\x37\x24\xaf\x29\xd5\xd5\xd5\x25\xe8\xfd\x1c\xac\x0d\x24\xbd\x03\x16\x43\x43\x46\x17\xeb\x85\x88\x74\xfe\x1d\xf1\x3b\xc4\x73\xa9\x15\x7a\x00\xf1\x12\x91\x5b\x7f\x4f\xe7\x4b\xf1\xb8\x30\x16\xe7\xf9\xf2\xf1\x50\xf8\x51\xda\xea\xb8\x3f\xc1\xb2\x05\x26\x1c\xe0\x73\xec\x26\xc8\x9f\x90\x05\x19\x28\x2b\x9a\xe4\x79\xfc\x63\x09\xc2\x26\xe9\xd6\x24\x79\xec\xff\x12\x28\x1d\x05\xad\x20\x9b\x01\x12\x06\x76\xf2\x15\xa8\x2f\xfb\x03\x13\xa6\x99\xa8\xa0\x85\xb3\xe2\x57\xb5\x04\x4a\xc8\xe5\x76\xbb\x2b\xb0\x52\xfb\xd3\xe9\xf4\x52\x9b\x39\x12\xc4\xdf\x47\xfc\x07\xe2\x76\xc4\x5f\x11\xff\x6a\x32\xb1\xab\xfa\x3b\x5b\xdf\xbf\x65\xc9\x02\xbe\x7e\xd6\xdc\x39\x66\x67\x76\xe6\xb2\x9b\x57\xc0\xb4\x6b\x6a\x20\xc3\x62\x02\x9b\x99\x49\xcd\x0d\x5a\xb2\xe2\xea\xc9\xe2\x47\x76\x24\x8c\x15\x20\xa4\x91\xbc\x01\x25\x05\x8c\x23\x11\xe3\x81\x64\x98\xe1\xa8\x9c\x69\xeb\x1d\xf6\x54\x96\xe6\x47\x4d\x66\x8b\x86\xde\x4f\x54\x56\x56\x56\x61\x9b\x7e\x90\x18\x90\x36\xe2\x2b\x06\x90\xe2\x70\x81\xab\x03\xb1\x0a\xb1\xd0\xe9\x74\x7c\x27\x3b\x27\xef\xd7\x16\xce\xa6\x78\xf2\xf2\x66\x84\x82\x41\x8e\x78\xf1\xe6\x45\xf3\x61\x6e\xdd\x14\x0c\x64\x8b\x91\x5e\x25\x24\x48\x24\x43\x9d\xae\xb5\x29\xf2\xc4\xfb\x44\x2e\x8a\x7a\xda\x00\x49\x26\x5e\x4f\xae\x80\x24\x2b\xc0\x0b\x12\x44\xa2\x12\x34\x8f\xf3\xa5\x1c\x2d\x8f\x38\x32\x5c\x5e\x9b\xd5\x36\x8c\x71\x30\x01\xd3\xa9\x1d\x65\xc4\x13\x03\xce\x49\xa3\x2f\xbf\xfc\x32\x84\xb0\x1d\x3e\xf3\xea\xee\xf7\xc2\xfe\x03\x87\x70\x28\xe9\xa6\x67\xcd\x99\xc7\xdd\x76\xf7\x03\x25\xd6\xcc\xdc\x99\xe3\xa1\x10\x2d\x4b\x71\xb8\xa6\xaa\x04\x72\x30\x0d\x92\x96\x5a\x92\x64\xf4\x20\xf1\x38\x36\x59\xe8\x75\x42\x38\xe9\xfc\x64\x7f\x44\xa4\x93\x20\x39\x1c\xb5\x44\x88\x13\x23\x44\x03\x09\x03\xb1\xb8\x02\x21\xac\x0b\x3c\x2f\x22\x39\x0d\x02\x3c\x63\xff\xf0\xd3\x13\x9e\x6b\x26\x79\x9a\x2a\xab\xa7\x68\x15\x15\x15\x0e\x6c\x21\xca\xc2\xe1\x70\x2b\x89\xbb\x73\xb2\xd0\xa2\x45\x8b\xce\x71\x7d\x4b\x5b\x37\x64\x78\x0a\xe7\x56\x4c\xfe\xc6\xf3\xf9\xa5\xe5\x73\x78\x41\xc1\xe5\x97\xc1\xe1\xc2\xbc\x1d\x94\xc0\x6a\xe5\x30\x7f\xcb\x90\xde\xd9\x32\xe6\x62\x23\xcb\xfc\xdd\xfb\x7a\x4a\xf7\x64\x65\x34\x35\x19\xc0\x72\x22\x71\x5a\x36\x71\x51\x41\x8f\x0b\x18\x98\x12\xc6\x09\xe6\x78\x1c\x43\x47\xb0\x00\x8e\xc5\x64\x60\x12\x19\x55\x8e\xde\xfe\x8e\xcc\x2c\x77\x57\x49\x69\x99\x8e\xb1\x50\xd9\xd4\xd4\xd4\x4a\xd2\xe9\x25\xc5\xc0\x28\x36\x62\x05\x05\x85\xbf\xc9\x41\xf2\x91\x68\xdc\xe8\x3f\xc8\xf0\xd2\xd7\xd7\x03\x7e\x6f\x1f\x14\xe7\xbb\x20\xcb\x93\x6f\x8c\x93\x49\xa9\x24\x8d\xc0\x64\x97\xb2\x20\x45\x5c\x4b\xb6\x0d\x09\xbc\x8f\x18\x40\xf2\xbe\x28\x26\x20\x12\xc7\xb9\x80\x97\x0c\x59\xe1\x98\x07\x81\x90\x04\xde\x60\xcc\x90\x5a\x46\x06\x07\x8c\xc9\xc5\x05\xc6\x22\x75\x3d\xdd\x5d\xa1\xbc\xfc\x82\x20\xb6\xda\x13\x31\x9d\x12\xf6\xea\x25\x19\x30\x3c\x34\x00\x5d\x7d\x83\x07\x4a\xa6\x4c\x5f\x82\x7f\x13\xc2\x31\x1e\x86\xbd\x23\xe0\x1d\x1c\x00\xff\x68\x00\x7a\x7a\xfb\x21\x23\x7b\x02\x92\x4a\x18\xab\x40\x9d\x39\x35\x13\xf1\x68\x49\xef\x93\x57\x42\x92\x64\x23\x99\xc8\x05\x49\xf3\x82\x0c\x84\xb7\x8e\x7a\x1e\x17\x04\xe8\x1b\x8d\x61\x7b\x91\xc0\x26\x10\x1b\x42\x33\x0b\x24\x9b\x99\x4c\x0c\xe8\x96\xca\x89\xde\xe1\x26\x6f\x6f\x5f\xaf\x82\x2b\x40\x3c\x95\xff\xc5\x17\x5f\x0c\xc5\xb1\xf9\xbb\xe8\x4c\x4c\x63\x24\x9e\x38\xf2\xd9\x73\x03\x1d\x2d\xbd\x1a\x6b\x36\x2a\xae\x64\x64\x0d\x0d\x24\x95\x82\xf6\xee\x7e\x43\x0e\x82\x6c\x14\x21\x84\x66\xdc\x23\x18\xd2\xc0\x57\xec\x77\x04\x31\xf9\x9e\x34\x6d\x63\x11\x01\xfc\x58\x8d\x79\x94\x8d\x8e\x1e\x0f\xe3\xf7\x5a\x87\x23\x70\xca\xc7\x83\x86\x86\xb8\xb1\x15\xca\x70\xd9\xc1\xe1\xe0\xc0\x8e\x6d\x06\x4e\xae\xb8\xc2\x1e\x86\xc9\x2a\x9a\xd2\xd9\xd1\x91\x6f\xb3\xdb\x3d\x76\xbb\xbd\xbc\xbb\xbb\xfb\xd2\x24\x64\x78\x2b\x1e\x1f\x6f\xf8\xdb\xa6\x5f\x7f\xfb\x7b\xd5\x1b\x14\xec\xf5\x54\x96\xc3\xd6\xd0\x8a\x52\x31\x41\x67\xbf\x0f\xe7\xe0\x30\x92\xc1\x99\x52\x53\x53\xce\x3f\xa3\x5d\x86\x64\xae\x8f\xa3\xb7\x05\x92\xe0\xc9\x86\x29\x43\x43\x18\xe5\xd3\xe7\x8b\xc2\x18\x06\xae\xd9\x4c\x1b\xc4\x2d\xe8\x6d\xc3\xeb\x28\x10\x13\x3a\x0e\xed\x03\x86\x54\x78\xf2\x73\x71\x65\x4e\xa0\x65\x78\x12\xb6\xd5\xda\xa4\xf2\xf2\xe9\x28\xe5\xfd\xa4\x2a\x5f\xd4\x80\x13\x27\x4e\xc0\x9e\xbd\x1f\x91\x5d\x86\x37\xca\xeb\xe7\x3d\x9a\x5d\x7b\xe3\x6c\x9d\x41\xb2\x26\x6c\x1a\xd9\x30\x0c\x07\x47\x51\x52\x43\xd8\x49\x56\x80\x8a\xc6\x26\x27\xb2\xa4\x7c\x48\x5c\x08\x98\x12\x45\x91\xec\x19\x21\x09\x13\x0b\x21\x5c\x89\x81\x90\x08\x21\x34\x80\xc8\xc3\x9d\xe5\x40\xb9\xd0\x60\x62\x69\x30\xa7\xc8\xb3\x98\x61\xf0\x2d\x30\x46\xbb\xad\xe2\x73\x15\x94\x21\xce\x0d\x59\x13\x26\xf5\xf7\xf7\x07\xcb\xca\x26\x56\x60\x51\x73\x63\xbd\x08\x5e\xd4\x00\x32\xc2\xe1\x8d\x74\x5c\x50\x13\x7f\x7e\xf1\x99\xa7\x1f\x5f\x3f\xff\x5d\x99\xb6\xe1\x08\x88\xc0\x95\x40\x29\x43\x7b\x67\x0f\xd4\x7b\xca\x90\xa8\x62\xa4\x50\x15\x6b\x80\x80\xc1\x49\x88\x33\xe8\x6d\x1a\x59\x45\x50\x46\xc3\x01\x11\xa2\x28\x19\x0b\x16\xba\xac\x4c\x3b\x58\x2d\x8c\xe1\x75\x0b\x4b\x19\x9e\x67\x89\x01\x68\x28\x6d\xe4\x5e\x15\x34\x25\x61\xb4\xdd\x22\x3a\x41\xe0\xe3\x20\x6a\x9c\x23\x2e\xb2\x15\xac\x22\x8c\x5a\xc8\x43\xce\xd3\x4e\xc3\xf9\x9a\x34\xb2\x65\x4f\x86\xfb\x83\x07\x0f\x36\x2e\xdc\xb5\xb1\xc1\x3d\xf3\xee\xc5\x09\x1a\x07\x13\x84\x4e\x5b\xe0\xcb\x8e\x3e\xa8\x9d\x2e\x60\x80\x63\x1d\x88\x63\x7f\x1f\x47\x8f\x23\x19\x0a\x35\x10\xc5\xb4\x1b\xc0\x00\x95\xd0\x83\x1c\x36\x72\x6e\xb7\xd5\xd8\xd1\x26\x41\x7a\x9a\x3c\x9b\x24\xcf\x92\xe9\x8c\xa4\x5b\x4c\x08\xb2\x84\xc1\x8e\x75\x25\xce\x63\x7a\x8d\x46\xd1\x80\x18\x28\x71\x1e\x46\x47\x46\x13\x87\x76\xbd\xb7\x33\x18\x08\xf8\x19\x52\x91\xff\x81\xad\x20\xb2\x93\xec\xd8\xbc\x61\xdd\x9f\xd6\x4c\xfd\xe6\x7c\x89\x72\x98\x54\x34\x80\xe5\x1c\xd0\x89\xe3\xe2\xc8\xc0\x20\x0c\x86\xc8\x78\x88\x79\x9c\xc6\x91\x12\x03\x3a\x42\x9a\x1f\x94\x8d\xc3\x61\x81\x6c\xbb\x05\x6c\x56\x93\xe1\x75\xce\x9c\xf4\x3c\x36\x99\x86\x6c\x08\x79\x52\x3b\x74\x92\x5e\x53\xb5\x41\x10\x44\x24\x1e\xc3\x11\x33\x0a\x8a\xc0\x43\xa0\xb7\xdd\x7b\xec\xe3\x1d\xaf\x1e\xf9\x74\xdf\xef\x25\x59\xf6\x92\x11\xf4\x7c\xed\xf4\x85\x2e\x35\xb5\x43\xc1\x76\x74\xf5\x76\x1f\xdf\xb1\x61\x6f\xd6\x82\xef\xdf\xe4\xf3\x5a\x60\x2c\xa4\x40\x67\xab\x17\x7a\x3a\xba\x20\x6e\x9f\x08\x21\x0c\xd6\x04\x83\xde\x45\xb2\x0e\xa7\x0d\x6c\x76\xb2\x67\x84\xc4\x0d\xf2\x2c\x70\x68\x80\x19\x89\x5b\xd8\xa4\xee\x69\xca\x28\xd1\xa9\x6e\x94\x64\x2c\x39\x49\x1c\x3d\x2e\xa3\xc7\x03\x3d\xed\xbe\xa6\x7d\xdb\x37\x1c\x6e\xf8\x70\x43\x5c\x94\x7a\x27\xd7\x4c\x85\x3b\x56\xae\x84\x4d\x6f\x6e\x34\x6a\xd2\xa5\x1a\x40\x72\x6f\x1c\x41\xfa\x8c\xac\x9d\xef\xbc\xfe\xe1\xdd\x55\x4b\xae\x6f\x3e\x19\xb0\x89\x41\x1e\xe3\xc1\x89\xf3\xee\x08\x94\xd4\x55\x61\x4b\xad\x41\xa6\x0b\x89\x3b\x92\x29\xd0\x00\xce\x02\x1c\x97\x94\x0c\x09\x58\x33\xbe\x92\xa3\x29\x12\xe8\xa4\x36\x90\xe2\x26\x4a\x64\x0b\x25\x8e\xf5\x81\x07\x09\xf3\x7b\xb0\xaf\x23\xd8\xbc\x77\xdb\x1b\x87\x76\x6d\x7b\x25\x1a\xe3\xdb\x8b\x2b\x6a\x60\xfe\x8c\xf9\x70\xdd\xac\xe9\x90\xeb\x48\xa6\x77\xfd\x52\x62\xe0\x8c\x4b\x41\x90\x43\x08\xe7\x88\x7f\xac\xeb\xd4\xde\xd7\xf6\x15\x4f\x5c\xfd\xad\x21\x5d\x02\xbb\xd3\x04\x7d\xfe\x28\xcc\xf3\x98\x21\x82\x8f\x74\xb9\x2c\xc6\x8c\x6b\x4b\x79\x9e\x4b\x6b\xde\xc8\x36\xc9\x20\x25\x7f\x9c\x10\x27\x0d\x1c\x8f\x71\x13\x43\xf2\x64\xa6\x18\xeb\xeb\x8c\x34\xef\xde\xfa\xe6\xa7\xdb\xde\x59\x1f\x8e\xc6\x4e\x3a\x32\xdd\xb0\xe2\x81\x07\x61\xce\xd2\x5b\x50\x9e\x38\x85\x85\x07\xb0\xe7\x1a\x3f\x7d\x26\xf7\x8f\xee\x8d\x12\x19\x91\x53\x39\xc7\xa1\x7d\x1f\x6c\xbb\x67\xf6\xed\x73\x04\x28\xce\xa6\x45\x33\x44\xa3\x5e\xa0\x95\x08\xe4\xe5\x14\x20\x61\xca\x38\x37\xb3\x71\x84\x7c\xd2\xfb\x44\x2e\x2c\x95\xcc\xb0\x46\x2b\x81\x2d\x33\x8f\x84\x79\x12\xe0\x92\x04\xe3\x03\xbd\xc2\xf1\x0f\xdf\x7f\xeb\xc0\x07\x5b\xd6\x8f\x8e\x8e\x36\x15\x57\x4f\x85\x85\x0b\x97\xc1\xd4\x99\xf3\xc0\x99\xe1\x06\x09\x63\x41\x4d\x48\x60\x49\xd7\x9a\xcb\xdc\xdc\x25\x76\x47\x11\xfd\xe1\x98\x68\x6a\xdb\xf7\xfa\xd6\x99\xdf\x5d\xf7\x50\x47\x1f\x4a\x80\x95\x20\x10\x08\x40\x51\x5d\x39\xc4\xb1\xa7\xb7\xdb\x92\x9a\xb7\x60\xc0\x1a\x7d\x97\x4e\x48\x83\x41\x3c\x8e\x84\x09\x24\xd4\x70\x78\x78\x50\x6d\xd9\xfd\xb7\xcd\x9f\xbc\xfb\xd6\x73\xbe\x91\xe1\xcf\x2d\x76\x07\xdc\xf4\xe0\x1a\xb8\xfe\xd6\x7b\xb0\x80\xe1\xd8\x89\x72\x92\x30\x88\x93\xf3\x3d\xf5\x7f\xb2\x3b\xad\xa5\xa4\x64\x3a\xf0\xf1\x47\x7f\x9d\x71\x43\xe3\xf5\x25\x13\xe7\x95\x87\x7d\x2a\x8c\x8c\x47\xa1\xde\x86\x0d\x20\xb6\x1c\x76\x72\xf8\x47\x8e\x5f\x35\xd2\xf3\x23\x71\x7c\x25\x9e\xe6\x11\x72\x42\x81\x58\xc0\xa7\x7d\xd9\xb0\xe3\xfd\x4f\xb6\xfc\xe5\xf9\xc1\x81\xfe\x4f\xac\x4e\x17\xfc\xd3\xcf\xd7\x41\x41\xd9\x24\xc8\x9d\x50\x0a\xf1\x70\x18\xbb\x00\x01\x28\x4d\xbf\x22\xdb\xeb\x48\x09\x02\xb2\xaa\xb7\x7c\xb4\x69\xfd\x6b\xf7\x3e\xbd\xf8\x37\x6d\x4c\x01\x08\x41\x01\x18\x29\x8a\xd2\xc9\x46\xe2\x98\xcb\x51\x2a\xa4\x10\x0a\x48\x5a\x48\x11\xe7\x43\x01\xe8\x3c\xd8\xb0\x63\xff\x96\x37\x9f\xef\xeb\xe9\xde\x8d\xc4\xf5\xa5\xf7\x3d\x02\xf5\x8b\x6f\x82\xa2\x8a\xc9\x20\x61\xf6\x11\x11\x97\xba\x39\xfd\x75\x4e\x29\xc9\xfe\x51\xf0\x58\xf3\x89\xcd\xdf\x3c\xbc\xe5\xe6\xca\x85\x0f\x5c\xd7\x2d\x05\x01\x0b\x0c\x58\x0a\x5d\x10\xc1\x6c\x42\xb6\xd0\xe3\x44\xe3\x68\x84\x14\x1d\x83\xee\xc6\x4f\x3f\x3e\xb8\x75\xd3\xba\x9e\xce\x8e\x0f\x4c\x16\x4e\xbb\xe5\x07\x4f\xc1\xf4\x1b\x6e\x06\x97\x27\x07\x12\x44\x56\xe1\xd0\xe9\xb9\xe2\x8a\x1f\x70\x9c\x11\xd4\xfd\x9b\x5f\xfb\x9f\xff\xfe\xc5\x92\x5b\x67\x8e\xe5\x15\x98\x07\x87\x07\xa0\xc8\x96\x05\x43\xbe\x20\xea\x5d\x41\x8f\x86\x61\xb0\xe5\xf0\xa1\xa3\xbb\xb6\x3e\xd7\xd6\xda\xb2\xd5\x62\xb3\x4b\x33\x97\xdf\x06\x37\xa2\xce\xb3\xf2\xc8\x1c\x81\xb9\x1f\x2b\x2d\xc9\x4c\xe4\x8c\xcd\x18\x1c\xc8\xcf\xa7\x91\xea\x06\xce\xfc\xec\x8c\x58\xf8\x5a\x06\xd4\x4f\x9b\xae\x8f\x8e\xfa\xe5\xee\xbe\xc1\xed\x87\xdf\xdd\xf0\xf6\xec\x87\xfe\xed\xbe\x2f\x3f\x1f\x04\x19\xbd\xed\x1f\xea\x87\xf1\x9e\xd6\x63\xcd\xfb\xb6\xbf\x70\xaa\xf9\xd8\xdb\x2a\x45\x89\x75\x28\x93\xa5\xf7\x3d\x0c\xc5\x93\x6b\x41\x91\x65\x63\xc0\x21\x52\x61\xb0\xe5\x30\x48\xa5\x67\x50\x92\x66\xb5\x64\x53\x48\x7a\x2b\x1c\x22\xb0\x65\x21\x89\x80\x32\xb6\x70\xc8\xbf\xf4\x4e\xf5\xd7\x32\x60\x0c\x27\x33\x24\x42\x82\x5a\x78\xeb\x8f\x1b\x9e\x99\xb1\x78\xd9\xc2\xca\x49\x45\xc5\x9d\x87\x1b\xbe\x68\xd8\xb4\x71\x7d\x47\x4b\xd3\x5f\x70\x56\x88\x1a\x27\xfb\x16\x0b\x84\x7c\xc3\xb0\x79\xdd\x2f\x50\x2e\xc9\x13\x4d\xa0\x52\x79\xed\xcc\x2d\xbe\xd4\xeb\xe9\x73\x06\xd0\x53\xef\x53\xbd\x19\xc6\x16\x83\x8d\x41\x24\x12\x31\x76\xe7\x2e\x7a\x02\xb2\x66\xcd\x9a\x4b\x36\xc8\x69\xb7\x56\x94\x97\x97\x2f\xc5\x1f\xdd\x57\xe3\x7f\xaa\x90\x93\xd0\x8b\xae\x40\x45\x45\x05\xcc\x9d\x3b\xf7\xd2\x4a\xb5\xa2\x74\x62\xeb\xdd\x39\x6b\xd6\x2c\x48\x0f\xdd\x57\xea\x22\xe7\xd0\x04\xff\x2b\xc0\x00\x76\x87\xed\xaf\xbc\x7c\x7a\x1e\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\xcf\x5b\xf3\x6e\x82\x12\x00\x00")) - logOut20 = HexToBytes("logOut20", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x44\x04\xbb\xfb\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8d\x89\x1d\x0d\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0b\x12\x00\x00\x0b\x12\x01\xd2\xdd\x7e\xfc\x00\x00\x03\xf6\x49\x44\x41\x54\x38\x8d\x7d\x93\x5d\x88\x55\x65\x14\x86\x9f\xb5\xbe\xef\xec\x7d\xce\x3e\x33\xce\x94\x8e\x5a\x24\x11\xfd\xd3\x4d\x45\x90\x66\x50\x04\x85\x50\xe4\x4d\x44\x14\xdd\x45\x5d\x04\x41\x77\x11\x78\x55\x20\x15\x58\x5d\x46\x37\x41\xd8\x55\x20\x15\x44\x11\x1a\x94\xd0\x9f\x61\x91\x84\x19\x56\x34\xe3\x19\x67\xd4\xe3\x49\x8f\xe7\xec\x7d\xf6\xfe\xd6\xea\x62\x9c\xec\x07\x7b\xd7\xfd\xf3\xbe\x0b\xde\x57\x7e\x7c\xf5\x41\xaf\xab\x91\x2f\x0f\xaa\x7e\xb7\x1d\x3a\xe0\xee\xe6\xee\xe0\xb8\x83\xbb\x03\x98\x79\x6a\x67\xda\x3e\x33\x9a\x9c\x79\xe0\xb5\x6f\xae\x2f\x27\xf6\x87\x80\x38\x38\x7f\x53\x6c\x26\xa5\xe7\x5a\xcb\xbe\x9f\x4e\x7c\xf9\xca\x9e\xc3\x6f\x4d\x77\x42\x08\x2a\xb5\xb9\x8f\x81\x0a\x28\x45\x98\x54\xb5\xf7\x37\xad\x2b\x36\xec\x7a\xf4\xc6\x77\x14\x84\x8b\x28\x2a\x88\x24\xf7\x67\xb6\x5d\x73\xff\xd4\x9a\x22\xec\x78\xfb\xe0\x4e\x33\x1f\x0b\x98\xc3\xe8\x3c\xb0\x74\xe7\xe4\xa0\x4c\x68\x45\x99\x5f\xd9\xba\x69\xd4\xaf\x8f\xfa\x29\x3b\x8e\xa2\xf8\x85\x94\x5a\x7a\x64\xa2\xb9\xf4\x97\x4f\xdb\x53\x5b\x2f\xdf\xf6\xee\x73\x77\xbf\x3e\x37\xd3\xde\xe8\xa0\xaa\xe4\x22\x64\x22\x64\x40\x37\xd4\x6e\x8b\x6b\x7d\xf6\xd6\x97\xb6\xec\xe9\xce\x74\xd6\xff\x15\xcb\x57\x4e\x1c\xd7\x32\x05\xaa\xc6\x11\x4c\x17\x4f\x9c\xad\x6f\xdb\x98\xdf\xbc\xf9\xaa\x99\x87\x81\xa1\x20\xea\x8e\xbb\x48\x04\x06\xe3\xab\x5b\xd7\xbd\xb7\x79\xed\xc6\xe9\xd9\xd9\x39\x13\x0b\x04\xa0\x4d\x67\xf5\xbc\x43\x27\x16\x7e\x8e\x5c\x6a\x1a\x17\x32\x35\x9d\xef\x9d\xe6\xf8\xc9\x61\x04\x70\x77\x97\x20\x2d\x4f\xde\x9b\xbe\x65\x7a\xfb\xad\x2f\xde\xbe\xdb\x5a\x39\x59\x12\xbb\x77\xd7\x3d\x1f\xb9\x31\x89\x1a\x24\x68\xa0\xa5\x91\xc6\x1a\x62\x4a\x8e\xa9\xe3\xee\x58\x32\x54\xa1\x15\x15\x00\x51\x09\x96\x7c\x69\x66\xf3\xcc\x43\x77\xbc\xb0\xe5\x8d\xa9\x58\x64\x56\x27\xaf\xa5\x56\x9d\x96\xf5\xaa\x42\x54\x25\x0b\x91\xa2\x55\x10\x08\x44\x4b\x89\xe4\x06\xee\x98\x38\x29\x19\x2b\x45\x41\x53\xf2\xe1\xba\x7b\xd7\x3e\xb1\x75\xc7\xd6\x9d\xb1\x52\x3b\x3d\xea\xdb\x39\x1b\xaa\xb9\xd1\xd2\x68\x79\xc8\xc9\x63\x46\x1e\x72\x2c\x35\x28\x91\x68\x66\x94\x55\x89\xa8\x12\xda\x2d\xcc\xfe\x51\x2b\xb1\xca\xc7\xcd\xa4\x4e\x4b\xe5\x09\x1d\x56\x43\x2f\xb2\x0e\x9d\xd8\x26\xd7\x9c\x3c\x64\xe4\x31\x27\x0b\x19\x45\x6c\xe3\x2e\x68\xd3\x18\x48\x20\x25\xa3\x9e\xd4\x58\xd3\xe0\xd6\x00\x98\xaa\x74\xfb\x9f\xf5\x77\xef\x7b\xf6\xd3\x47\x46\xf5\x78\x34\x33\x35\xad\x1d\x6d\x7b\x1e\x72\x3a\x9d\xb6\x76\xbb\x85\x76\x8b\x8e\x4e\x15\x85\x4e\x75\xbb\x3a\x55\x14\xaa\xa9\x6e\xc0\x8d\x56\x0c\x0c\xc7\x0d\x29\x5b\x43\x76\xc9\xe5\xab\x75\x48\x12\x64\xc3\xf8\x87\xf2\xe3\x9f\x9f\x3f\xba\xdd\x46\xf4\xdb\xdd\x8e\xb4\x25\x4f\x76\xca\x97\xc6\xc7\xaa\xf9\x51\xaf\x5c\x38\x7b\x6c\xb4\xf0\xc7\xfc\xd9\x85\x53\xf3\x83\x85\x58\x9a\xe2\x8d\x31\x2b\x15\x67\xb2\x8d\x7c\xbf\x2c\x8c\x4d\xcf\x3f\x8c\x78\xf2\x5a\x82\xcc\x8d\x0f\x97\xfb\x7e\x7c\xee\xd0\xf6\xbb\x76\x6d\xfe\xbc\x73\xe9\x54\xf8\xe0\xc9\x0f\xb7\x8d\x7e\x1b\x7f\x27\x19\x85\x1b\xf6\xd7\x52\x46\xd6\xc2\xdc\xe9\x08\xcc\xa6\x1e\x37\x64\x19\x3e\x29\x57\x13\xae\x28\x79\x03\xac\x29\x8e\xd9\xc2\x9d\xef\xf7\x7a\x7b\xef\xc3\x34\x86\x15\x48\x23\x25\xe6\x17\x80\x61\x3c\x48\x21\x24\xa9\x3c\x28\x40\x3b\x8d\xc8\xaa\x3e\xff\x20\x0a\x82\x93\x52\x26\xd9\xdc\xc0\x07\x5f\x3c\xbb\xff\xf1\xe1\x30\x2d\xae\x8e\x04\xb9\xb0\xed\xd8\x56\x0f\xd6\x34\x3e\x11\x77\x01\x26\x8d\x21\xf2\x9f\xed\x3b\x60\x92\xbc\xd1\x9c\x4e\xbd\xd8\xfc\x42\xe3\x03\x01\xf9\xfb\xbb\x00\xe1\xd0\xe2\xb9\x03\x97\x15\xe1\xea\x0d\xdd\xb8\xa9\x4a\xde\x34\x75\x0a\x5f\xfd\x7e\xee\xe0\xef\x83\xc9\x27\x22\x04\x87\x09\x90\x80\x58\x27\xb7\x23\x4b\xa3\x03\xc7\x87\xf5\x11\x77\xd2\xbf\x5d\x01\xc2\xf1\xb3\xf5\xcf\x87\x96\xca\x7d\x5b\x36\x15\x8f\x64\xc2\x4c\x6d\xce\xb7\xc7\x46\x87\x7f\x3b\x3d\xf9\x5a\x84\x29\x87\x1c\xe8\x02\x4d\x32\x5f\x5e\x1e\xd6\x3f\x5d\x0c\x06\xa0\x51\x25\xef\x9d\xa9\x7f\xdd\xb5\x7f\xf9\x31\x37\x9f\x28\xa0\x22\x39\x30\x07\x5c\x01\xac\x01\x7a\xc0\xaf\x40\xa5\x42\xb8\x18\x0c\x40\x1b\xf3\x2a\x08\xf1\x60\x6f\xbc\xf7\xcd\x6f\x4e\x3d\x3d\xd3\x56\xa2\xd2\x05\xd6\x01\xf3\xc0\xfe\xf3\x40\x01\xb0\xff\x49\x07\xac\xb8\x39\x98\x0a\xf1\xc8\xc9\xea\xc0\x5c\x37\x5e\x3b\xac\x4d\x0f\x9f\xa8\x5e\x16\xe1\xa8\x83\x9d\x87\xf9\xff\x81\x56\xf5\x27\xad\x20\x2a\xb3\x8c\x41\x93\xf1\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x23\x04\x84\x7a\x44\x04\x00\x00")) - mainGlade = HexToBytes("mainGlade", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xec\x5c\xc1\x52\xe3\x38\x13\xbe\xf3\x14\xfe\x75\xfa\xb7\xb6\x42\x62\xd8\xd9\xda\xa9\x4a\x3c\xc5\x30\x03\xc5\x81\xda\x03\x4c\xed\x31\x25\xcb\x1d\x47\x1b\x45\xf2\x4a\x9d\x10\xde\x7e\xcb\x31\x0c\x99\x8d\xec\xd8\xb2\x81\x24\xa3\x9b\x4d\xd4\x6d\x7f\xad\xee\xaf\xbb\x65\x89\xe1\xa7\xd5\x5c\x04\x4b\xd0\x86\x2b\x39\x22\xe1\xe9\x80\x04\x20\x99\x4a\xb8\x4c\x47\xe4\xdb\xfd\x55\xef\x0f\xf2\x29\x3a\x19\xfe\xaf\xd7\x0b\xae\x41\x82\xa6\x08\x49\xf0\xc0\x71\x1a\xa4\x82\x26\x10\x9c\x9f\x86\x1f\x4f\x07\x41\xaf\x17\x9d\x0c\xb9\x44\xd0\x13\xca\x20\x3a\x09\x82\xa1\x86\x7f\x16\x5c\x83\x09\x04\x8f\x47\x24\xc5\xd9\xaf\xe4\xe5\x41\xe7\xa7\xe1\xef\xa4\xbf\x1e\xa7\xe2\xbf\x81\x61\xc0\x04\x35\x66\x44\xae\x71\xf6\x17\x97\x89\x7a\x20\x01\x4f\x46\xe4\x96\x72\xf9\x74\x9f\x0f\x0e\x82\x61\xa6\x55\x06\x1a\x1f\x03\x49\xe7\x30\x22\x8c\xca\xf1\x44\xb1\x85\x21\xd1\x15\x15\x06\x86\xfd\xe7\x01\xf6\xf1\x53\x58\x65\x54\x26\x24\xba\xd7\x8b\x9d\x83\x97\x95\x83\xd9\x94\x8b\xa4\xb8\xb6\xc1\xf8\xac\x56\x05\x86\x58\xad\x42\xf2\x3c\xce\xf2\x10\x6e\x78\x2c\xc0\xfe\x10\x17\xc8\x36\x99\x39\xd5\x29\x97\x63\x01\x13\x24\xd1\x59\x03\x09\xcd\xd3\x69\x43\x11\x54\x59\x33\x81\x58\x21\xaa\x79\x4d\x99\xca\x09\x6c\x3c\x89\x36\x01\xa5\x39\x48\xa4\xc8\x95\x24\xd1\x12\x34\x72\x46\x45\x1d\x41\x93\x51\xc6\x65\x5a\x06\xe4\x07\x7f\xb1\xfb\xcc\xd7\x25\x48\xfc\xee\x38\xf9\x5d\xac\x56\xf7\xb9\x3d\x37\xc4\x1c\x5c\xc8\xd5\x8d\x9c\x26\xc0\x0e\xd6\x0e\xf8\x66\x4e\x53\x28\xd0\xae\x2f\xf3\x78\xdf\xc6\xeb\x8c\xb9\x0d\x6e\x2b\x76\x2a\x78\x2a\x49\xc4\x20\xa7\xba\x46\x92\x75\xac\x66\x75\x2a\x54\x6c\x46\xa2\x14\x67\xbd\x39\x37\x86\xcb\xb4\xc7\x73\x4b\x95\xeb\x18\xf6\x0b\x33\xff\x67\x46\xfa\xdb\xfe\x67\x19\x38\xcc\x28\x9b\x71\x99\x56\xfb\xc0\x33\x98\x46\x8e\x33\xe1\x42\x34\x73\xd1\x4c\x19\x5e\x84\xe1\xc0\x2e\x32\xec\x6f\xbd\xee\x16\xce\x3a\x71\xb7\xc9\xd5\xe7\xfb\x14\x6c\x3b\x29\xd5\x95\x56\x5b\x11\x5f\x93\x08\xbf\x83\x8c\x6a\x8a\x4a\x17\x06\x36\xcf\xb7\xe7\xfb\x1a\xe3\xb5\x4c\xde\xc6\xec\x65\x11\x5a\x16\x7c\xce\x01\xe8\x16\x84\x4e\x81\x58\x12\x8c\x25\xc4\x53\xdf\x7b\xae\x35\x4f\x0a\xc7\x49\x35\x4f\x3e\xec\xab\xcf\x68\xf5\x30\x9e\xaa\xb9\x4a\x41\x82\xca\x35\xec\x7c\xb8\x15\x7f\x1d\x1b\x7c\x24\x36\xa9\x16\x76\x68\x6b\x8b\x56\xd9\xce\xa9\x60\xeb\x74\x26\xac\xf0\x95\x58\xcc\xa5\x83\x9e\xd2\x59\xb5\xcf\xec\xe5\x14\xd8\xec\xf3\x02\x51\xc9\x62\x82\xd7\x7f\x88\xd7\x7f\xb8\x45\x3e\x07\x52\xa6\x6b\xfb\x9d\x05\x8d\x41\x90\x00\x35\x95\x46\x50\xa4\xb1\x80\x11\x79\x04\x43\xa2\x5b\x95\xf0\x09\x67\x6b\x5e\xdf\x85\xc0\xa6\xf9\x81\x27\x38\x1d\xe7\xed\x1c\x18\x24\x51\x18\x7e\x70\xd1\xd2\xc8\x1f\x77\xf8\xa4\xab\x0a\x0d\x0c\xf8\x12\xcc\x38\x81\x09\x5d\x08\xac\xe9\xdd\xad\xb2\x44\xfb\x6c\xd1\x51\x98\xd9\x14\xac\x9e\xea\xd9\x81\x8b\x70\xa2\xe9\xc3\x98\xcb\x24\x77\x2d\xa5\xeb\xbe\x44\x59\xee\xdb\x9d\x03\x4b\x3d\x1f\x26\x38\xa6\x88\x94\x4d\x1d\x91\xa0\xca\xbe\x2b\x08\xeb\x40\xa8\x7c\x47\x6b\xc2\x7b\x0d\x8a\xb8\xec\x8c\x22\x2e\x35\x78\x7a\xf0\xf4\xe0\xe9\x61\x27\x3d\x9c\x1d\x0e\x3d\x5c\x74\x46\x0f\x17\x8c\x81\x31\x9e\x1c\x3c\x39\x78\x72\xa8\x22\x87\xc1\xe1\x90\xc3\xdd\x22\x4e\xb8\xee\x84\x1d\xee\x18\x95\x41\xa1\xcf\x53\x84\xa7\x88\xa3\xa6\x88\xf0\x27\x6a\x2f\x6e\x24\x13\x8b\x04\xbe\x74\x44\x13\x5f\xb8\x06\x86\x4a\x3f\x7a\x92\xf0\x24\xe1\x49\xe2\x80\xea\x88\x4d\x7e\x28\xae\x2f\xb2\x4c\x3c\x76\xd3\x5a\xe4\x9a\x8e\x27\x96\x5d\x35\xed\xde\x9f\x51\x53\x43\xd5\x7e\x8d\x63\xe4\x93\x7d\x0f\xe5\x57\x5d\x2f\xa8\x02\x5f\x0d\xbc\x1d\xe8\x16\xdc\x55\x01\xb6\x14\xa8\xfb\xc7\xb2\xd0\x7f\x2c\x3b\x9a\x8f\x65\xdb\x59\xe8\xcf\x05\x5e\x71\x91\x67\x91\x2e\xba\x58\xc0\x00\x55\x30\xc9\x15\xfa\x7c\xe4\xf3\x51\x67\xf5\xed\x72\xaf\x12\xda\xb1\x7d\x1f\xdb\x66\x85\x1b\xd9\x1d\x29\x5c\x03\x06\x13\xad\xe6\x6b\x5a\xf8\xbf\xf9\xc5\x13\x83\x27\x06\x4f\x0c\xef\xd0\xb4\xbe\x52\xa5\x3b\xd8\xab\x4a\xb7\xbb\x6d\x81\x4d\xf7\xbe\xb5\xdd\x15\x18\xbe\xed\xae\xc0\xb2\x3d\xa5\x67\x7e\x4f\xe9\x21\xee\x29\x3d\x7b\xcf\x3d\xa5\xbf\xed\xab\xcf\x2c\xdf\xfe\xac\xc1\xb2\xbe\x0b\x34\x68\xc9\xef\x90\xe2\xc2\xc4\xf4\x29\x5a\x5f\x6e\x0f\xa0\x37\x6f\x56\xee\xb4\x2c\x75\x4a\xc4\x0d\x52\x8d\x24\x0a\x07\x8e\xf2\x90\xcf\xa8\xb3\x74\xbd\x22\xab\x6d\x81\xd5\xe9\x9a\x48\xa3\x73\x0c\x65\x4a\xaa\x0f\x73\x55\xbe\x7b\xdb\x15\x95\x98\x1a\x10\x5c\xc2\xf8\x85\x22\x0b\x43\xee\x2a\x38\xfc\x6a\xe0\xce\xee\xf0\xeb\x8a\x63\x4d\xe2\x29\x6f\x0b\x73\x25\x8d\x17\xea\x3a\xa2\x31\xa7\x75\x3e\xa7\xf6\xaf\xec\xf0\x1b\xc8\xe4\x10\x69\xf4\x9d\x89\xac\x46\xfa\x79\xa5\x00\x3e\x3b\xaa\x00\xfe\x26\x13\xd5\x3a\x80\x73\x25\x3f\x6f\x00\xaf\x0b\x0a\x1f\xc2\x07\x14\xc2\xc7\xba\x4e\xf1\xe6\xad\xe6\x79\x17\xad\x66\xfb\x73\xd3\x4d\x8e\x0e\xb7\x39\x36\x1d\xba\x1e\x9b\xfe\x11\xe2\xc6\x8f\x2f\x3f\x0c\xfb\x1b\xff\xef\xe3\xdf\x00\x00\x00\xff\xff\xea\x54\x36\x71\x48\x44\x00\x00")) - signCancel20 = HexToBytes("signCancel20", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\xec\x04\x13\xfb\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8d\x89\x1d\x0d\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x04\x8e\x49\x44\x41\x54\x78\xda\x74\x93\x6f\x4c\x5b\x55\x14\xc0\xcf\xbb\xef\xf6\xb5\xef\xb5\xd2\xd2\xae\x50\xfe\x77\xcb\x5c\xc5\xb9\xcc\xb1\x2d\xc3\x09\x1a\x91\x25\x2e\x30\x65\x90\xf8\xc9\x04\x35\xf1\x4f\x4c\x60\x46\x89\xdf\xfc\xe2\x87\x45\xb3\xc4\x39\x86\xc8\x9c\x2e\xd1\x68\xa2\x2e\xab\x2e\x9b\x90\xc8\xcc\xd0\xb9\x4c\x90\x19\x97\x10\xd1\xe0\x16\x60\x38\x02\xa5\xa5\x7f\xdf\xeb\x6b\xdf\x7b\xd7\xf3\x1e\x2d\x61\x51\x6f\x73\x4e\xef\x3b\xf7\x9c\xdf\x3d\xf7\xdc\x73\xf9\xdd\x87\x0f\x80\x92\x4e\x83\x43\xb0\x03\x73\x89\xd0\x5d\x13\x78\xb5\x9a\xd0\x92\x05\x49\xbc\xe9\x74\x4a\xe0\xf8\x0f\xe1\x24\x07\x34\xd7\x55\x1c\x6c\x93\x5c\x6d\x53\x36\x3a\xee\x42\x9b\xdd\x29\x42\xff\x99\x53\x00\x5b\x0f\x34\x02\xd8\x38\x30\x47\x47\xb0\xb2\x77\xa9\xbd\x9d\xdd\x78\xe4\xd1\xa5\x2d\x00\xfb\xe0\x7f\xc6\xb6\x32\x4f\xf3\x2f\x7b\x1a\x22\x2b\x8f\xb7\xb2\x0e\x8e\x7b\xa9\x68\x3f\xf1\xc9\x69\xa0\xc4\x9c\xa1\x7e\xae\xf3\x50\xdf\xd0\x7d\x3b\x8f\xd9\x76\xec\x84\x32\x66\x94\x9d\xcd\x2a\xc3\xdd\x13\x13\xed\x53\x00\xd7\x36\xc2\xf6\xb6\x34\xb5\x7c\x51\xb3\x39\x1c\x74\x7a\xdc\xba\xcf\x0b\x1f\xaa\xea\x10\xf9\xf9\x1a\x1f\xd6\xb4\x41\x20\x1c\xf0\xd2\x96\x4a\x68\x4c\xa5\x7b\x4f\xd7\x85\xde\x15\x42\xf5\xa0\x66\x32\x90\x8f\xc7\xa1\x26\xb8\x59\xdc\x1f\x8b\x1e\xbe\xba\xb4\x74\x65\x19\x60\xc1\x84\xed\x7a\xf0\xfe\x96\x70\xeb\xc1\xaf\x03\x77\x22\xee\x94\x2c\x43\xee\xf6\x02\xd8\x1d\x22\xb4\x10\xbe\x6d\x2a\x1e\x8d\x04\x0f\xb5\x4d\xd2\x80\xaa\x75\xbe\xe5\x0e\x9c\x90\xaa\xeb\x20\x33\x3b\x07\x0c\x1d\x99\xaa\x42\xd6\x30\x20\x54\xff\x80\xf7\x8c\xac\x5c\x7c\xe6\xd6\x5f\xad\xaa\xc7\x29\x7c\x6c\x77\x86\xdd\xa3\x63\x25\xab\xc0\x80\x69\x1a\x30\x5d\x07\xd9\x60\x20\x3a\x5d\x70\xd4\xe7\x7f\x7f\x21\xab\x5d\xa1\x51\x81\x9f\xfe\x8c\xcf\x4d\x6e\x9f\x9f\xdf\x93\x53\xb2\xa0\xa5\x53\x00\x9a\x0e\x06\x06\xc8\x8c\x41\xd0\x5f\xee\x1d\x64\xc6\xa5\xbc\xae\x41\x85\x9c\x73\xc7\x20\x8f\x20\x84\xe1\x9a\x81\x9b\x72\xf8\x13\x41\x87\xb3\x44\xeb\xaf\xb2\xd3\x19\x4a\x08\x99\x1e\x88\x45\xba\xe0\xb7\xab\xe1\x37\xfd\xc1\xdd\xd9\x2c\x42\x73\x39\x2b\x80\x61\x40\x1a\xff\x6b\x6d\x76\x2f\x23\x14\x56\x70\x43\x0b\x86\x76\xbd\x90\xe1\x26\x87\x1d\xde\x4b\x46\xfa\xdf\x89\xac\x1c\x39\x8e\x35\xa4\x84\xc3\x6b\x89\xc9\xf3\x03\x8a\xd6\x65\x70\x10\xee\x13\x4a\x1b\x64\x3c\xb2\x96\xcf\xaf\x43\x0d\x0c\x34\x10\xa4\xa3\xcd\x04\x99\xdf\xa8\xa0\x9c\x52\xf8\x40\x57\x4e\xbe\x1d\x8b\x1f\xc1\x24\x81\x62\xb6\xd4\xba\x3a\x24\x43\x5c\x99\x1b\xe4\x63\x5d\xba\xc7\x38\xf7\x82\x4a\x1a\x12\x26\x14\x83\x75\xcd\x84\xe8\x16\x18\xcc\xda\x99\x1a\x95\xdf\x46\xe1\x53\x07\x1d\x38\x16\x4f\xf6\x82\x8e\x06\x0e\xac\x35\x7a\x57\x83\x45\x33\xb3\xa7\x08\xd7\x96\xa6\xc2\x77\x9d\x09\x79\x47\xb6\x00\xb0\x06\xb7\x06\x32\xc3\xec\xa8\x3f\x27\xec\xcb\xa1\xd5\x64\x8f\x59\xef\x8d\xe3\x6e\x20\x06\x55\x19\x5c\xdd\xd6\x1c\xf3\xc5\x98\x01\x5a\x61\xd7\xf5\xb4\x0a\x43\x46\xa9\x65\xa4\x31\xc4\x60\xdf\x9f\x00\xe3\x1b\x11\x56\x5f\x17\xd3\xa8\xf6\xdd\xd3\xf4\x06\x75\x8c\x54\xa5\x95\xca\x15\x04\x24\xb0\x25\x92\x78\xd4\x04\x33\x85\xad\x4b\x14\xed\xee\x5c\xae\xee\x75\x97\x6b\xb8\x9e\xd2\x87\xfe\x0d\x44\x5d\xe5\x75\x35\xf5\x10\xfb\x79\x35\x96\x28\xbd\x89\xb5\x4b\xe2\x2e\x71\x4b\x00\x21\x6b\x12\x47\x98\x29\x09\xb4\xcf\xa1\xcf\x72\x26\xe3\x7d\x59\x92\x2e\x6c\xe3\xf9\xc6\x62\x52\x24\x8f\x0e\x15\x1e\xd7\xc3\x2f\x72\xc2\xf9\x64\x2c\xe1\xbd\x85\x37\x68\xc1\x8a\xc1\x98\xa1\x1b\xbf\x4b\x71\x9e\x62\x1b\xec\x18\x3c\x87\xbe\x0b\xe9\x8c\xaf\xdb\xe1\xf8\xb6\x9a\x92\x46\xec\x0b\xa0\x92\x6e\xec\x7f\x2c\x99\xbb\xb8\xac\xa8\x1e\xf3\x98\x7c\xa1\x5c\x6c\xad\xa4\x70\x2f\x4e\x26\x3d\xe2\x47\x8a\x40\x43\x7b\x97\x12\xcd\x33\x68\xd3\x0b\x6b\x60\xc1\x75\xf0\xc8\xb2\xf7\x09\x42\x46\xbd\xaa\xbe\x8b\x6a\x3c\xb1\x45\x89\xa1\x55\xe3\x6e\x29\xb3\x27\x0b\xb9\x9b\x01\x21\x94\x29\xa7\xfd\x64\x38\xa5\xf4\x82\x47\xaa\x61\x01\xf7\x37\xdb\x17\xe3\x0d\xd3\x1b\xa0\x66\x33\x79\x10\x1c\x21\xec\x7a\xd6\xc6\xaf\x12\x0d\xe0\x87\x61\x9f\xb3\x2b\xea\x71\x46\xca\x0a\xc5\x37\x8f\x56\x85\x32\xe3\xb4\x0f\x84\xd5\x7c\x2f\xe4\x31\x3c\x92\xba\x3d\xa2\x1b\x9d\x37\x02\xee\x5f\x6b\x0b\x37\x6d\xd6\x77\x13\x8a\xea\xb0\x5d\x1e\xa1\xdc\x93\x59\x02\x51\xc2\xe3\x36\xf9\xa5\xe4\x8f\xe7\x44\xfa\x74\xac\xd4\xb9\xe8\x45\x07\x3f\xda\x66\x25\xfb\xf1\x0b\xd9\x7c\x8f\x05\x2b\x8e\xe5\xe4\xdc\xa8\x6e\x3c\xf5\x7b\xb9\x7b\xbc\x1c\x7d\x4c\x5f\x55\x14\xbe\xff\x8a\x41\x47\x4e\xd1\x93\xe6\x4b\x21\x56\xe2\xd8\x06\x5a\x4c\x1e\xbb\x24\x09\xaf\x71\x92\x90\x55\x28\x3f\x3c\xc6\xd8\x51\xca\xe1\x83\x10\x68\x60\x5d\x6c\x7c\xc0\xb6\x2a\xa7\x7f\x62\xac\x6f\xb1\x44\xbc\x23\x52\xfe\x8f\x51\xc6\x9e\x57\xd5\x7c\xb2\xd8\x7d\xd4\xba\x01\x07\x05\x9b\xc7\x65\xc3\x5c\x26\x2e\xfb\x4b\x9e\xe5\x34\xfd\x6f\x33\x01\xc2\x71\xc6\x7a\x6b\xad\x5d\x93\xa9\x5c\xf8\x1a\x62\xd7\x45\xe1\x15\x5a\x22\x26\xf3\x06\x93\xf9\xb8\xcc\x69\x39\xcd\x2a\xfe\x3f\x02\x0c\x00\xea\xf3\x69\xad\x1c\x97\x70\x95\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x16\x81\xa5\x9b\xec\x04\x00\x00")) - signSelect20 = HexToBytes("signSelect20", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x97\x03\x68\xfc\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x14\x00\x00\x00\x14\x08\x06\x00\x00\x00\x8d\x89\x1d\x0d\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\x79\x71\xc9\x65\x3c\x00\x00\x03\x39\x49\x44\x41\x54\x78\xda\xcc\x55\x4d\x68\x54\x57\x18\x3d\xf7\xdd\x37\xef\xcd\x5f\x32\x93\xc4\x99\x8c\x13\x27\xda\xc4\x9f\x1a\x7f\xc0\x92\x94\xd4\x45\x17\x45\xa5\x54\xd3\x62\x2d\xf8\x03\x2a\x8a\x14\x4a\x11\xda\x95\xe2\x42\x53\xdd\xd8\x76\x27\x52\x4a\x4b\x85\x96\x2e\x5c\x14\x14\x5a\xbb\x50\x29\x34\x95\xd6\xc4\x96\x26\x11\x75\x82\x98\x71\x92\x19\x67\x92\x38\x6f\x66\x32\x6f\xde\xff\xbb\xcf\x6b\xba\x28\x4a\xa5\x46\x5c\xf8\x2d\x2f\x7c\x87\xf3\x9d\x7b\xce\xf7\x11\xcf\xf3\xf0\x3c\x4b\xc0\x73\xae\x17\x1f\x50\x3c\x7b\xe1\x1c\x3c\xcb\x01\xdc\xf9\x6b\xc9\x78\x8f\xcb\x5b\xa3\x6d\x62\x4c\x57\xdc\xfb\x8c\x81\x83\x2c\x89\x00\xe4\x19\xe9\x10\x84\x97\x6f\xa3\x47\xde\xfd\x36\x52\x68\x5e\x8b\xcd\x73\x4f\xd2\xaa\x36\x38\x13\x25\xb0\x9a\x31\x2f\xa1\x5e\xde\x14\xde\xde\xb5\x35\x7c\xb4\x1c\x72\xbb\x6e\x8d\x6b\x48\x9a\x18\xbe\x79\xaa\xde\x4b\x69\x3c\x02\x27\x5f\x05\x64\xcf\xbf\xe6\xed\xe0\xae\x5a\xc1\xc9\x3a\x26\x9e\x88\xde\xf3\xc6\xca\xde\xbe\x63\xcd\xdf\x04\xd6\x7b\x87\xae\xe5\xd4\xd8\xe8\xb0\x0a\x35\x63\x83\xd9\x42\xa2\xb9\x45\xd0\xa9\x1b\xf6\xe1\xf5\x8d\xab\xde\xe9\xff\x6a\xd3\xf7\xef\x7d\xfc\xd2\x07\xe3\x13\xf7\xb4\xec\x9f\xc6\xc0\xe3\x40\x89\xce\x50\xea\xd0\x67\x07\x3e\xef\xd9\xdf\x79\xfa\xc7\xec\xb5\x65\xbf\x0d\x2a\xa8\x66\x6d\x60\x1a\xa0\x65\x02\x9f\xc5\x80\x06\xb1\x87\x6c\x38\x19\xbb\x70\xe4\xe0\xd6\xb7\xda\x82\x6b\xa1\xd9\x75\x5c\x4a\x9f\xaf\xf5\x6f\xf8\x63\x8d\x36\x8d\xec\x43\x20\x1a\xa0\xf2\x2b\xdb\x42\x1f\xbe\xb6\x27\x79\x78\xdc\xa0\xb1\x8b\x57\xd2\xb0\x8a\x5c\xfb\x2a\x01\x29\x03\x21\x0a\xb4\xb6\x53\x08\x44\x1e\x2a\x0e\x7a\x27\xc4\xf6\xb6\x78\x6f\x53\xa0\x1d\xc5\x4a\x0e\x8a\x39\x89\x96\x44\xa0\xa1\xf7\x40\xb4\xff\x97\x4f\x2b\xfb\x96\xac\x0f\xf6\xad\xdb\xd9\xf0\x89\x95\xf2\xad\x3b\x3b\x5a\xc4\xf4\xd8\x2c\xa0\xf0\x1f\xe4\x8c\xfc\x9c\x5c\x3c\x29\x20\x14\x95\x0a\x4a\x5a\x3c\x39\x33\x64\x7c\xc9\x74\xd3\xa2\x99\x9c\x4f\xe9\xe8\x31\xb6\x08\xe1\x1a\xb9\x5b\x1d\x43\xae\x5c\x04\x4d\xc8\x5d\x8b\x56\xcb\x1b\x53\x5b\x42\x87\x6f\x38\x6c\xe1\xd0\xdf\x55\xa8\xb7\x34\xa0\xc0\x7d\xc6\xc1\x62\x51\x60\x61\x87\x64\x5a\x8a\xff\x8b\xc9\x4b\xee\xde\xd9\x9b\xf5\xcb\x9e\xe3\xb8\x73\x13\x19\x34\x3c\x52\x52\xab\xdd\xc9\x6e\x6d\x79\xa6\x34\x83\x3b\x25\x13\x77\xab\x0e\x9d\x92\xc9\xe2\xbf\x32\x1a\x0a\x37\x54\x78\xb7\x6d\x08\x5c\xab\xa8\x8f\x60\x51\xa7\x08\x49\x08\xfc\x9c\x1f\x20\xbb\xef\x0f\x6a\x67\x5c\xcd\xaa\x3d\xe2\x24\xdf\x8a\x24\x3c\xdb\x79\xb5\xef\x68\xf0\x57\x2d\x69\xf9\xd3\x79\x1d\x53\x25\x17\xc6\x0c\x77\xec\x84\x03\x92\x77\x11\xe4\x53\xc6\x53\x14\x92\x24\x5d\x9f\x19\x16\x8e\x2b\xa3\xfa\x0f\x70\xec\xff\x74\x01\x15\x5b\x1b\x61\xe7\x6b\x79\x75\x56\x48\xd1\x0e\xd6\x9d\xce\x98\xdc\x97\x1c\xec\xb6\x03\x79\x8a\x21\xd1\x4a\x10\x6f\xf7\x97\xd4\xac\x7c\x7c\xf2\xa2\xfd\xbe\x96\xad\x8f\x80\x47\xe2\x49\xc5\x7d\xd8\x08\x56\x56\x51\xcb\x39\xa3\x91\x98\xb4\xc3\xac\x18\x0d\xd6\x98\x8d\x05\xa2\x87\xe4\x52\x1f\x63\x75\xff\x99\xc9\xcb\xde\xee\xca\x75\xf5\x27\x1e\x51\xfb\xff\x3c\x3f\x07\xe8\xcd\xea\xf0\x54\xbd\x6a\xe8\x01\xb7\x29\x6a\xbf\xd9\x28\x7b\x08\x85\xfd\x03\xc5\xab\xc2\x9e\xe9\x2b\xda\x69\x57\x35\x2b\x4f\xbd\x1c\xfe\x49\x39\x83\x10\x0d\x42\x57\xbc\xdf\xad\xa2\x34\x46\x98\x38\x30\x35\xe2\x7c\x64\x55\x74\x6d\xfe\xf1\xee\x68\x02\xf2\x9c\x00\xe5\xca\xb7\x84\x23\x60\x68\x86\xcb\x2a\x50\xd4\x0a\x2c\xcc\x7b\x05\x91\x53\xdf\x7d\x8d\xb9\xb6\x87\xa7\x80\x90\x7f\x37\xcf\x33\x5e\x86\x07\x02\x0c\x00\xee\x16\x74\xc5\xfb\x9f\x1c\x59\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x0b\x8b\x1e\xce\x97\x03\x00\x00")) +import ( + "embed" + "log" +) + +//go:embed assets/glade +//go:embed assets/images +var embeddedFiles embed.FS + +// This functionality does not require explicit encoding of the files, at each +// compilation, the files are inserted into the resulting binary. Thus, updating +// assets is only required when new files are added to be embedded in order to +// create and declare the variables to which the files are linked. +// assetsDeclarationsUseEmbedded: Use native Go 'embed' package to include files +// content at runtime. +func assetsDeclarationsUseEmbedded(embedded ...bool) { + mainGlade = readEmbedFile("assets/glade/main.glade") + apply32 = readEmbedFile("assets/images/Apply-32.png") + counterclockwiseArrow20 = readEmbedFile("assets/images/Counterclockwise-arrow-20.png") + filestamper300x29 = readEmbedFile("assets/images/FileStamper-300x29.png") + filestamper500x48 = readEmbedFile("assets/images/FileStamper-500x48.png") + folderTime48 = readEmbedFile("assets/images/Folder-time-48.png") + folderTimeCalIn48 = readEmbedFile("assets/images/Folder-time-cal-in-48.png") + folderTimeCalOut48 = readEmbedFile("assets/images/Folder-time-cal-out-48.png") + logOut20 = readEmbedFile("assets/images/Log-Out-20.png") + signCancel20 = readEmbedFile("assets/images/Sign-cancel-20.png") + signSelect20 = readEmbedFile("assets/images/Sign-Select-20.png") +} + +// readEmbedFile: read 'embed' file system and return []byte data. +func readEmbedFile(filename string) (out []byte) { + var err error + out, err = embeddedFiles.ReadFile(filename) + if err != nil { + log.Printf("Unable to read embedded file: %s, %v\n", filename, err) } + return } diff --git a/gohFunc.go b/gohFunc.go index a87c652..363cd23 100644 --- a/gohFunc.go +++ b/gohFunc.go @@ -1,8 +1,11 @@ // gohFunc.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: https://opensource.org/licenses/mit-license.php */ diff --git a/gohImages.go b/gohImages.go index 2149a78..1acc7bd 100644 --- a/gohImages.go +++ b/gohImages.go @@ -1,23 +1,28 @@ // gohImages.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: https://opensource.org/licenses/mit-license.php */ package main -/************************************************************/ -/* Images declarations, used to initialize objects with it */ -/* The functions: setImage, setWinIcon and setButtonImage */ -/* accept both kind of variables: filename or []byte */ -/* content in case of using embedded binary data. The */ -/* variables names are the same. You can use function */ -/* "func assetsDeclarationsUseEmbedded(bool)" */ -/* to toggle between filenames and embedded binary. */ -/****************************************************/ +/**********************************************************/ +/* This section preserve user modifications on update. */ +/* Images declarations, used to initialize objects with */ +/* The SetPict() func, accept both kind of variables: */ +/* filename or []byte content in case of using */ +/* embedded binary data. The variables names are the */ +/* same. "assetsDeclarationsUseEmbedded(bool)" func */ +/* could be used to toggle between filenames and */ +/* embedded binary type. See SetPict() */ +/* declaration to learn more on how to use it. */ +/************************************************/ func assignImages() { setButtonImage(mainObjects.ButtonApply, apply32) setButtonImage(mainObjects.ButtonExit, logOut20) @@ -28,8 +33,13 @@ func assignImages() { setWinIcon(mainObjects.MainWindow, folderTime48) } -// Assets var declarations, this step permit to make a "bridge" between the differents -// types used: (string or []byte) and to simply switch from one to another. +/**********************************************************/ +/* This section is rewritten on assets update. */ +/* Assets var declarations, this step permit to make a */ +/* bridge between the differents types used, string or */ +/* []byte, and to simply switch from one to another. */ +/*****************************************************/ +var mainGlade interface{} // assets/glade/main.glade var apply32 interface{} // assets/images/Apply-32.png var counterclockwiseArrow20 interface{} // assets/images/Counterclockwise-arrow-20.png var filestamper300x29 interface{} // assets/images/FileStamper-300x29.png @@ -38,6 +48,5 @@ var folderTime48 interface{} // assets/images/Folder-time-48.png var folderTimeCalIn48 interface{} // assets/images/Folder-time-cal-in-48.png var folderTimeCalOut48 interface{} // assets/images/Folder-time-cal-out-48.png var logOut20 interface{} // assets/images/Log-Out-20.png -var mainGlade interface{} // assets/glade/main.glade var signCancel20 interface{} // assets/images/Sign-cancel-20.png var signSelect20 interface{} // assets/images/Sign-Select-20.png diff --git a/gohObjects.go b/gohObjects.go index cc8efe6..bde1f5f 100644 --- a/gohObjects.go +++ b/gohObjects.go @@ -1,8 +1,11 @@ // gohObjects.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: https://opensource.org/licenses/mit-license.php */ diff --git a/gohOptions.go b/gohOptions.go index f4d87a1..b7a6232 100644 --- a/gohOptions.go +++ b/gohOptions.go @@ -1,8 +1,11 @@ // gohOptions.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: https://opensource.org/licenses/mit-license.php */ @@ -15,39 +18,39 @@ import ( "io/ioutil" "os/exec" - gi "github.com/hfmrow/fileStamper/gtk3Import" + gidg "github.com/hfmrow/gtk3Import/dialog" + gimc "github.com/hfmrow/gtk3Import/misc" ) // App infos -var Name = "fileStamper" -var Vers = "v1.0" +var Name = "file-stamper" +var Vers = "v1.1" var Descr = "This software allow you to clone timestamp between files" -var Creat = "H.F.M" -var YearCreat = "2019" +var Creat = "hfmrow" +var YearCreat = "2019-21" var LicenseShort = "This program comes with absolutely no warranty.\nSee the The MIT License (MIT) for details:\nhttps://opensource.org/licenses/mit-license.php" var LicenseAbrv = "License (MIT)" -var Repository = "github.com/fileStamper" +var Repository = "github.com/hfmrow/file-stamper" // Vars declarations var absoluteRealPath, optFilename = getAbsRealPath() var mainOptions *MainOpt var err error var tempDir string +var doTempDir bool var currentOutFilesList []string var currentInFilesList []string // Translations var devMode bool -var translate = new(MainTranslate) -var sts map[string]string var nl = "\n" var execCmd *exec.Cmd -var statusbar = new(gi.StatusBar) +var statusbar = new(gimc.StatusBar) type MainOpt struct { /* Public, will be saved and restored */ - About *gi.AboutInfos + About *gidg.AboutInfos MainWinWidth int MainWinHeight int @@ -67,7 +70,7 @@ type MainOpt struct { // Main options initialisation func (opt *MainOpt) Init() { /* Aboutbox initialisation */ - opt.About = new(gi.AboutInfos) + opt.About = new(gidg.AboutInfos) opt.LanguageFilename = "assets/lang/eng.lang" @@ -113,6 +116,9 @@ func (opt *MainOpt) Write() (err error) { var jsonData []byte var out bytes.Buffer opt.UpdateOptions() + + opt.About.DlgBoxStruct = nil // remove dialog object before saving + if jsonData, err = json.Marshal(&opt); err == nil { if err = json.Indent(&out, jsonData, "", "\t"); err == nil { err = ioutil.WriteFile(optFilename, out.Bytes(), 0644) diff --git a/gohSignals.go b/gohSignals.go index 35ed380..4bde051 100644 --- a/gohSignals.go +++ b/gohSignals.go @@ -1,8 +1,11 @@ // gohSignals.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: https://opensource.org/licenses/mit-license.php */ diff --git a/gohStartGtk.go b/gohStartGtk.go index caa4d61..b79e091 100644 --- a/gohStartGtk.go +++ b/gohStartGtk.go @@ -1,8 +1,11 @@ // gohStartGtk.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: https://opensource.org/licenses/mit-license.php */ @@ -23,9 +26,11 @@ func mainStartGtk(winTitle string, width, height int, center bool) { mainObjects = new(MainControlsObj) gtk.Init(nil) if newBuilder(mainGlade) == nil { - // Init tempDir and Remove tempDirectory on exit - tempDir = tempMake(Name) - defer os.RemoveAll(tempDir) + // Init tempDir and Remove it on quit if requested. + if doTempDir { + tempDir = tempMake(Name) + defer os.RemoveAll(tempDir) + } // Parse Gtk objects gladeObjParser() // Objects Signals initialisations diff --git a/gtk3Import/LICENSE b/gtk3Import/LICENSE deleted file mode 100644 index b203cf3..0000000 --- a/gtk3Import/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ - SearchEngine v1.8 ©2018 H.F.M - - This program comes with absolutely no warranty. See the The MIT License (MIT) for details: - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - associated documentation files (the "Software"), to dealin the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT - OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/gtk3Import/aboutDialog.go b/gtk3Import/aboutDialog.go deleted file mode 100644 index ad18662..0000000 --- a/gtk3Import/aboutDialog.go +++ /dev/null @@ -1,279 +0,0 @@ -// aboutDialog.go - -// Source file auto-generated on Thu, 03 Feb 2019 00:34:15 using Gotk3ObjHandler v1.0 ©2019 H.F.M - -package gtk3Import - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "log" - "reflect" - "regexp" - - "github.com/gotk3/gotk3/glib" - "github.com/gotk3/gotk3/gtk" -) - -// Control over all used objects from glade. -var aboutDlgControlObj *aboutDlgControlsObj - -// Assets var declarations -var aboutboxGlade interface{} // gtk3Import/aboutBox.glade - -/******************************/ -/* Main structure Declaration */ -/******************************/ - -type aboutDlgControlsObj struct { - mainUiBuilder *gtk.Builder - AboutboxButtonOk *gtk.Button - AboutboxLabelAppName *gtk.Label - AboutboxLabelDescription *gtk.Label - AboutboxLabelLicense *gtk.Label - AboutboxLabelRepolink *gtk.Label - AboutboxLabelTxtDescription *gtk.Label - AboutboxLabelTxtSourceRepo *gtk.Label - AboutboxLabelVersion *gtk.Label - AboutboxLabelYearCreator *gtk.Label - AboutboxWindow *gtk.Window - AboutTopImage *gtk.Image -} - -/* -* Aboutbox implementation - */ -type AboutInfos struct { - titleBox string - AppName string - AppVers string - AppCreats string - YearCreat string - LicenseAbrv string - LicenseShort string - Repository string - Description string - imageTop interface{} - imageOkButton interface{} - AboutDialogBox *gtk.Window - ready bool - initialised bool -} - -func (ab *AboutInfos) InitFillInfos( - TitleBox, - AppName, - AppVers, - AppCreat, - YearCreat, - LicenseAbrv, - LicenseShort, - Repository, - Description string, - topImage, - okBtnIcon interface{}) { - ab.titleBox = TitleBox - ab.AppName = AppName - ab.AppVers = AppVers - ab.AppCreats = AppCreat - ab.YearCreat = "©" + YearCreat - ab.LicenseAbrv = LicenseAbrv - ab.LicenseShort = LicenseShort - ab.Repository = Repository - ab.Description = Description - ab.imageTop = topImage - ab.imageOkButton = okBtnIcon - ab.ready = true -} - -// Display label with lower size fonts -func markupLabel(label *gtk.Label, text string) { - pm := PangoMarkup{} - pm.Init(text) - mtype := [][]string{{"fsz", "small"}, {"fgc", pm.Colors.Brown}} - pm.AddTypes(mtype...) - label.SetMarkup(pm.Markup()) -} - -// Display label with lower size fonts -func markupLabels(appName, repo, License string) (outAppName, outRepo, outLicense string) { - pm := PangoMarkup{} - pm.Init(appName) - mtype := [][]string{{"fsz", "x-large"}, {"bld"}, {"fgc", pm.Colors.Brown}} - pm.AddTypes(mtype...) - outAppName = pm.Markup() - - pm.Init(repo) - mtype = [][]string{{"url", "https://" + repo}} - pm.AddTypes(mtype...) - outRepo = pm.Markup() - - outLicense = License // Search for http adress to be treated as clickable link - reg := regexp.MustCompile(`(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?`) - indexes := reg.FindAllIndex([]byte(License), 1) - - if len(indexes) != 0 { - pm.Init(License) - pm.AddPosition([]int{indexes[0][0], indexes[0][1]}) - mtype = [][]string{{"url", reg.FindString(License)}} - pm.AddTypes(mtype...) - outLicense = pm.MarkupAtPos() - } - return outAppName, outRepo, outLicense -} - -func (infos *AboutInfos) Show() { - if infos.ready && !infos.initialised { - aboutDlgStart(infos.titleBox, 100, 100, true) - infos.AboutDialogBox = aboutDlgControlObj.AboutboxWindow - // aboutDlgControlObj.AboutboxWindow.SetResizable(false) - - name, repo, lic := markupLabels(infos.AppName, infos.Repository, infos.LicenseShort) - aboutDlgControlObj.AboutboxLabelAppName.SetMarkup("\n" + name) - aboutDlgControlObj.AboutboxLabelVersion.SetLabel(infos.AppVers + "\n") - aboutDlgControlObj.AboutboxLabelYearCreator.SetLabel(infos.YearCreat + " " + infos.AppCreats + "\n") - aboutDlgControlObj.AboutboxLabelDescription.SetLabel(infos.Description + "\n") - aboutDlgControlObj.AboutboxLabelDescription.SetProperty("wrap", true) - aboutDlgControlObj.AboutboxLabelRepolink.SetMarkup(repo + "\n") - aboutDlgControlObj.AboutboxLabelLicense.SetMarkup("\n" + lic + "\n") - /* Image/Icons assignation functions */ - SetImage(aboutDlgControlObj.AboutTopImage, infos.imageTop) - SetButtonImage(aboutDlgControlObj.AboutboxButtonOk, infos.imageOkButton) - infos.initialised = true - } - if infos.initialised { - infos.AboutDialogBox.Show() - } -} - -func (infos *AboutInfos) Hide() { - hideAboutDialogWindow() -} - -/******************************/ -/* Gtk3 Window Initialisation */ -/******************************/ -func aboutDlgStart(winTitle string, width, height int, center bool) { - // initMainGladeGuiVar: initialise embedded content. - initMainGladeGuiVar() - // Assign main ctrl objects - aboutDlgControlObj = new(aboutDlgControlsObj) - // buil interface - if newBuilder(aboutboxGlade) == nil { - // Parse Gtk objects - gladeObjParser() - // Objects Signals initialisations - signalsPropHandler() - // Set Window Properties - if center { - aboutDlgControlObj.AboutboxWindow.SetPosition(gtk.WIN_POS_CENTER) - } - aboutDlgControlObj.AboutboxWindow.SetTitle(winTitle) - aboutDlgControlObj.AboutboxWindow.SetSizeRequest(width, height) - } else { - log.Fatal("Builder initialisation error.") - } -} - -/***************************/ -/* Signals Implementations */ -/***************************/ -func signalsPropHandler() { - aboutDlgControlObj.AboutboxButtonOk.Connect("clicked", hideAboutDialogWindow) - aboutDlgControlObj.AboutboxWindow.Connect("delete-event", hideAboutDialogWindow) -} - -/***************************/ -/* Controls Initialisation */ -/***************************/ - -func gladeObjParser() { - aboutDlgControlObj.AboutboxButtonOk = loadObject("AboutboxButtonOk").(*gtk.Button) - aboutDlgControlObj.AboutboxLabelAppName = loadObject("AboutboxLabelAppName").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelDescription = loadObject("AboutboxLabelDescription").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelLicense = loadObject("AboutboxLabelLicense").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelRepolink = loadObject("AboutboxLabelRepolink").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelTxtDescription = loadObject("AboutboxLabelTxtDescription").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelTxtSourceRepo = loadObject("AboutboxLabelTxtSourceRepo").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelVersion = loadObject("AboutboxLabelVersion").(*gtk.Label) - aboutDlgControlObj.AboutboxLabelYearCreator = loadObject("AboutboxLabelYearCreator").(*gtk.Label) - aboutDlgControlObj.AboutboxWindow = loadObject("AboutboxWindow").(*gtk.Window) - aboutDlgControlObj.AboutTopImage = loadObject("AboutTopImage").(*gtk.Image) -} - -/*******************************************************/ -/* Functions declarations, used to initialize objects */ -/*****************************************************/ -// newBuilder: initialise builder with glade xml string -func newBuilder(varPath interface{}) (err error) { - if aboutDlgControlObj.mainUiBuilder, err = gtk.BuilderNew(); err == nil { - if Gtk3Interface, err := getBytesFromVarAsset(varPath); err == nil { - err = aboutDlgControlObj.mainUiBuilder.AddFromString(string(Gtk3Interface)) - } - } - return err -} - -// loadObject: Load GtkObject to be transtyped ... -func loadObject(name string) (newObj glib.IObject) { - var err error - newObj, err = aboutDlgControlObj.mainUiBuilder.GetObject(name) - if err != nil { - log.Panic(err) - } - return newObj -} - -// WindowDestroy is the triggered handler when closing/destroying the gui window. -func WindowDestroy() { - // Bye ... - gtk.MainQuit() -} - -// Signal handler delete_event (hidding window) -func hideAboutDialogWindow() bool { - if aboutDlgControlObj.AboutboxWindow.GetVisible() { - aboutDlgControlObj.AboutboxWindow.Hide() - } - return true -} - -// getBytesFromVarAsset: Get []byte representation from file or asset, depending on type -func getBytesFromVarAsset(varPath interface{}) (outBytes []byte, err error) { - // outBytes = new([]byte) - var rBytes []byte - switch reflect.TypeOf(varPath).String() { - case "string": - rBytes, err = ioutil.ReadFile(varPath.(string)) - case "[]uint8": - rBytes = varPath.([]byte) - } - return rBytes, err -} - -// HexToBytes: Convert Gzip Hex to []byte used for embedded binary in source code -func HexToBytes(varPath string, gzipData []byte) (outByte []byte) { - r, err := gzip.NewReader(bytes.NewBuffer(gzipData)) - if err == nil { - var bBuffer bytes.Buffer - _, err = io.Copy(&bBuffer, r) - if err == nil { - err = r.Close() - if err == nil { - return bBuffer.Bytes() - } - } - } - if err != nil { - fmt.Printf("An error occurred while reading: %s\n%v\n", varPath, err.Error()) - } - return outByte -} - -// initMainGladeGuiVar: initialise embedded content. -func initMainGladeGuiVar() { - aboutboxGlade = HexToBytes("aboutboxGlade", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\xec\x9a\x6d\x8f\x9b\x46\x10\xc7\xdf\xdf\xa7\xd8\xee\xab\x56\x95\xed\xb3\xaf\x49\xd3\xca\x26\x4a\x5b\x25\x3a\x29\x69\xa4\x9e\xdb\xaa\x52\x24\x6b\x81\x31\x4c\x58\x76\xc9\xee\xe0\x87\x7e\xfa\x08\x63\xeb\xcc\x05\x9f\x81\xcb\x45\x70\xe2\x9d\xbd\xcc\x1f\x66\x66\x7f\x33\x3c\xec\x4e\x5f\x6e\x62\xc9\x56\x60\x2c\x6a\x35\xe3\xe3\xe1\x25\x67\xa0\x3c\xed\xa3\x0a\x66\xfc\xef\xf9\xeb\xc1\x0b\xfe\xd2\xb9\x98\x7e\x37\x18\xb0\x37\xa0\xc0\x08\x02\x9f\xad\x91\x42\x16\x48\xe1\x03\xbb\x1a\x4e\x26\xc3\x31\x1b\x0c\x9c\x8b\x29\x2a\x02\xb3\x14\x1e\x38\x17\x8c\x4d\x0d\x7c\x4a\xd1\x80\x65\x12\xdd\x19\x0f\x28\xfa\x91\xdf\x5e\xe8\x6a\x38\x7e\xce\x47\x3b\x3b\xed\x7e\x04\x8f\x98\x27\x85\xb5\x33\xfe\x86\xa2\x7f\x51\xf9\x7a\xcd\x19\xfa\x33\xfe\xca\xd5\x29\xb9\x7a\xb3\x1f\xcb\x04\x8c\x4d\x13\xa3\x13\x30\xb4\x65\x4a\xc4\x30\xe3\x2b\xb4\xe8\x4a\xe0\xce\xdc\xa4\x30\x1d\x1d\x8e\x96\x1b\x7b\x42\x2d\x96\xda\x4b\x6d\x35\xf3\x10\x36\x89\x50\x7e\x35\xe3\x55\x1d\xe3\x58\xfb\x42\x56\x33\x5d\xef\xa2\x5f\x24\xda\x22\xa1\x56\xdc\xf1\x20\x4b\xf5\x39\x19\x6d\x13\x58\x84\xa8\x88\x3b\x3e\x0a\xa9\x83\x73\x02\x1b\x61\xb2\x20\x61\x23\x57\x98\xbd\xb0\xd4\x3d\x2f\x44\xe9\xe7\xbf\xb3\x93\x48\xe1\x41\xa8\xa5\x0f\x66\xb4\x37\x18\x1d\x59\xdc\xb1\xfe\x62\xba\x7f\xd3\x9b\x7c\xae\x5d\xbd\x19\xf3\x83\x5d\xcd\x59\x3e\x33\xd3\xaf\x85\xb4\x95\x34\xda\x20\x28\x12\x79\x96\x57\x60\x08\x3d\x21\x4b\x85\x85\xa8\xca\x23\xbb\x8e\x45\x00\x47\x1c\xcf\x75\x92\x0f\x1d\xcb\x1a\x04\xda\x34\xd8\x52\xbe\x85\xc4\xe0\x24\x51\x27\x5d\x6c\xa4\xb2\xa4\xbd\x88\x3b\x01\x45\x83\x18\xad\x45\x15\x0c\x30\xcb\x47\xb9\x7e\x3a\xca\x13\x5a\x18\x4b\x84\x17\xa1\x0a\xee\xbf\xce\x7d\x55\x78\x4a\xb3\x44\x29\xeb\x29\x6e\xab\xf1\xf2\x54\x00\x5f\x78\x5b\x28\x8c\xaa\x18\x1d\x17\xc8\xa4\x4d\xec\x54\x2e\x96\xf2\x48\xcb\xa3\x7d\x2b\x5c\x90\xc5\xe6\xbf\x1b\x7a\x95\x24\x7f\x8a\xf8\x6e\xed\x34\xce\xc1\x43\xf2\x50\xa6\x95\xb9\xdb\x64\x84\xb2\x52\x90\x70\x25\xcc\xf8\x16\x2c\x77\xf6\x8e\xd7\x39\xd9\xc7\xd4\x12\x2e\xb7\xe7\xea\xab\xbc\x46\x4e\xd7\xc9\x7d\xb5\x52\x3b\xe0\xf3\x05\xd3\xa8\x68\x4e\x14\x4e\x69\xf1\x7c\x0d\xac\xfe\xc9\x9f\x48\xba\x87\xd5\xde\xf1\x1e\xab\x22\x56\xe3\x76\x60\xf5\x1f\x08\xf3\xbb\x01\x41\xda\x74\x0f\xad\xcc\x79\x36\x62\x7b\xff\x7b\xc2\x8a\x84\x4d\xbe\x2d\x61\x37\x90\x08\xb3\xe3\x68\x47\x99\x3d\xfc\x1d\xb7\x95\xab\x58\x98\x00\xd5\x42\xc2\x92\xb8\xf3\xac\x81\xd2\x60\x10\x36\x94\x92\x4e\x9a\x09\x5d\x4d\xa4\xe3\x7b\xb5\x1d\x46\xf6\xaa\x1d\x4d\x71\xbe\xa1\x3f\xc0\x7a\x06\x13\xea\xe4\x2d\xf7\xc8\xf9\x5f\xfb\xae\x58\x44\xec\xa7\x76\x20\xf6\x54\xf8\x62\x04\x1b\x7a\x14\xc6\x4a\xbe\x2e\x19\x91\x9c\x4b\x41\x87\xc9\x7c\xd6\x9a\xe6\x77\xa3\x53\xe3\xc1\x5f\x90\xe8\xee\xb1\x99\xfb\xce\x0c\xec\x12\xab\xcd\xb6\xef\x80\x77\x38\x7b\xde\x0e\xce\x32\xbc\x24\xaa\xa8\x7b\x88\x65\x9e\xb3\xcc\xf5\x9e\xac\x22\x59\x3f\xb7\xe3\x8d\x63\xd2\xbf\x71\xf4\x6f\x1c\x15\x91\x7d\xd1\x8e\x66\xf8\x16\x3d\x50\xb6\x83\x1f\x8d\x3f\xa8\x79\x88\x96\x25\x46\x07\x46\xc4\xcc\xd3\x31\xd8\x7c\xd9\x55\xb8\x56\xcb\x94\x40\x6e\x99\xd2\x6c\x2d\x8c\x11\x8a\xb6\xc3\x0f\xea\x06\x80\x51\x08\x6c\x1e\x02\x7b\x77\x3d\x67\xfb\xd8\xd9\xf7\xef\xae\xe7\x3f\xb0\xa5\x36\xcc\x07\x12\x28\xed\xf0\x1b\x3d\x57\x82\x94\x98\x58\xfc\x1f\xb8\x13\xa3\xef\xcb\xa7\xf9\x78\xf9\x4b\x3b\x9a\xf3\x55\xdf\x9c\xfb\xe6\x5c\xf5\x1b\xf9\x57\x59\x7b\xe9\xce\xfa\xec\xf8\x91\xd7\x67\x53\x22\xad\x8a\x77\x9f\x7c\xec\x7d\x74\x66\xb9\xf6\xf4\x0d\xe0\x7d\x54\x35\xce\x35\xfa\x14\x2e\x0c\x7c\x4a\xc1\x52\x36\xb9\x97\x95\x57\xf1\x1f\xb8\x58\x5c\x47\x66\xc0\x03\x5c\x81\x5d\xf8\xb0\x14\xa9\xa4\x7a\xea\xc3\x2e\x05\x50\x7e\xdd\x2d\x0a\x35\x24\x85\x56\x35\xa9\xa9\xda\xb7\xa9\xba\xb2\x5d\x8b\xaa\x2b\x3a\xb4\xa7\xc9\x63\xed\x9c\xa8\xb5\x0d\xe0\x21\xa5\x39\x69\x5a\x9a\xc5\x18\x8f\x0e\xde\x1e\x98\x8e\x8e\x36\xa4\x7d\x0e\x00\x00\xff\xff\x82\x40\x8d\xbe\xe9\x26\x00\x00")) -} diff --git a/gtk3Import/msgDlg.go b/gtk3Import/msgDlg.go deleted file mode 100644 index cb1fe9f..0000000 --- a/gtk3Import/msgDlg.go +++ /dev/null @@ -1,175 +0,0 @@ -// msgDlg.go - -/* -* ©2018 H.F.M. MIT license -* Handle gtk3 Dialogs. -* -* Message, Question/Response dialogs, file/dir dialogs, Notifications. - */ - -package gtk3Import - -import ( - "fmt" - "log" - "os" - "path/filepath" - "regexp" - - "github.com/gotk3/gotk3/gdk" - "github.com/gotk3/gotk3/glib" - "github.com/gotk3/gotk3/gtk" -) - -// Notify: Display a notify message at the top right of screen. -func Notify(title, text string) { - const appID = "h.f.m" - app, _ := gtk.ApplicationNew(appID, glib.APPLICATION_FLAGS_NONE) - //Shows an application as soon as the app starts - app.Connect("activate", func() { - notif := glib.NotificationNew(title) - notif.SetBody(text) - app.SendNotification(appID, notif) - }) - app.Run(nil) - app.Quit() -} - -var FileChooserAction = map[string]gtk.FileChooserAction{ - "create-folder": gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER, - "open": gtk.FILE_CHOOSER_ACTION_OPEN, - "save": gtk.FILE_CHOOSER_ACTION_SAVE, - "select-folder": gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, -} - -// FileChooser: Display a file chooser dialog. -// "open", "save", "create-folder", "select-folder" as dlgType. -// Set title "" permit auto choice from dialog type. -// options are 1-keepAbove and 2-enablePreviewImages -func FileChooser(window *gtk.Window, dlgType, title, filename string, options ...bool) (outFilename string, result bool, err error) { - var firstBtn, scndBtn string - var kpAbove, preview bool // fileNotExist bool - - switch len(options) { - case 1: - kpAbove = options[0] - case 2: - kpAbove = options[0] - preview = options[1] - } - - firstBtn = "Cancel" - scndBtn = "Ok" - - if len(title) == 0 { - switch dlgType { - case "create-folder": - title = "Create folder" - case "open": - title = "Select file to open" - case "save": - title = "Select file to save" - case "select-folder": - title = "Select directory" - } - } - fileChooser, err := gtk.FileChooserDialogNewWith2Buttons(title, - window, FileChooserAction[dlgType], - firstBtn, gtk.RESPONSE_CANCEL, - scndBtn, gtk.RESPONSE_ACCEPT) - if err != nil { - return outFilename, result, err - } - - if preview { - if previewImage, err := gtk.ImageNew(); err == nil { - previewImage.Show() - var pixbuf *gdk.Pixbuf - fileChooser.SetPreviewWidget(previewImage) - fileChooser.Connect("update-preview", func(fc *gtk.FileChooserDialog) { - if _, err = os.Stat(fc.GetFilename()); !os.IsNotExist(err) { - if pixbuf, err = gdk.PixbufNewFromFile(fc.GetFilename()); err == nil { - fileChooser.SetPreviewWidgetActive(true) - if pixbuf.GetWidth() > 640 || pixbuf.GetHeight() > 480 { - if pixbuf, err = gdk.PixbufNewFromFileAtScale(fc.GetFilename(), 200, 200, true); err != nil { - fmt.Printf("Image '%s' cannot be loaded, got error: %s", fc.GetFilename(), err.Error()) - } - } - previewImage.SetFromPixbuf(pixbuf) - } else { - fileChooser.SetPreviewWidgetActive(false) - } - } - }) - } - } - - if dlgType == "save" { - fileChooser.SetCurrentName(filepath.Base(filename)) - } - fileChooser.SetCurrentFolder(filepath.Dir(filename)) - fileChooser.SetDoOverwriteConfirmation(true) - fileChooser.SetModal(true) - fileChooser.SetSkipPagerHint(true) - fileChooser.SetSkipTaskbarHint(true) - fileChooser.SetKeepAbove(kpAbove) - - switch int(fileChooser.Run()) { - case -3: - result = true - outFilename = fileChooser.GetFilename() - } - - fileChooser.Destroy() - return outFilename, result, err -} - -var dialogType = map[string]gtk.MessageType{ - "info": gtk.MESSAGE_INFO, "inf": gtk.MESSAGE_INFO, - "warning": gtk.MESSAGE_WARNING, "wrn": gtk.MESSAGE_WARNING, - "question": gtk.MESSAGE_QUESTION, "qst": gtk.MESSAGE_QUESTION, - "error": gtk.MESSAGE_ERROR, "err": gtk.MESSAGE_ERROR, - "other": gtk.MESSAGE_OTHER, "oth": gtk.MESSAGE_OTHER, -} - -// DlgMessage: Display message dialog whit multiples buttons, text inside accet markup format, -// return get <0 for cross closed or >-1 correspondig to buttons order representation. -// "info", "warning", "question", "error", "other" as dlgType. -// iconFileName: "" = No image -func DlgMessage(window *gtk.Window, dlgType, title, text string, iconFileName interface{}, buttons ...string) (value int) { - // Build dialog - msgDialog := gtk.MessageDialogNew(window, - gtk.DIALOG_MODAL, - dialogType[dlgType], - gtk.BUTTONS_NONE, - "") - - box, err := msgDialog.GetContentArea() - if err == nil { - setBoxImage(box, iconFileName) - } - - msgDialog.SetSkipTaskbarHint(true) - msgDialog.SetKeepAbove(true) - // Check for link to ake it clickable - reg := regexp.MustCompile(`(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?`) - if reg.MatchString(text) { - msgDialog.SetProperty("use-markup", true) - } - msgDialog.SetProperty("text", text) - msgDialog.SetTitle(title) - // Add button(s) - for idx, btn := range buttons { - button, err := msgDialog.AddButton(btn, gtk.ResponseType(idx)) - if err != nil { - log.Fatal(btn+" button could not be created: ", err) - } - parent, _ := button.GetParent() - parent.SetHAlign(gtk.ALIGN_END) - button.SetSizeRequest(100, 1) - button.SetBorderWidth(2) - } - result := msgDialog.Run() - msgDialog.Destroy() - return int(result) -} diff --git a/gtk3Import/pangoMarkupBinder.go b/gtk3Import/pangoMarkupBinder.go deleted file mode 100644 index f248906..0000000 --- a/gtk3Import/pangoMarkupBinder.go +++ /dev/null @@ -1,218 +0,0 @@ -// PangoMarkupBinder.go - -/* -* ©2019 H.F.M. MIT license -* Handle Pango markup functions. - -* This is a pango markup binder to gotk3 pango library ... -* I have made it to make more simple markup handling when i'm working on gtk objects. -* It can be used in treeview, dialog, label, ... Each object where you ca.n set "markup" content - */ - -package gtk3Import - -import ( - "bytes" - "fmt" - "sort" - "strings" -) - -var pangoEscapeChar = [][]string{{"<", "<", string([]byte{0x15})}, {"&", "&", string([]byte{0x16})}} - -var markupType = map[string][]string{ - "bold": {"", ""}, "bld": {"", ""}, // Bold - "big": {"", ""}, // Makes font relatively larger, equivalent to - "small": {"", ""}, "sml": {"", ""}, // Makes font relatively smaller, equivalent to - "italic": {"", ""}, "ita": {"", ""}, // Italic - "subscript": {"", ""}, "sub": {"", ""}, // Subscript - "supscript": {"", ""}, "sup": {"", ""}, // Superscript - "monospace": {"", ""}, "msp": {"", ""}, // Monospace font - - "font_family": {``, ``}, - "ffy": {``, ``}, // A font family name - - /* A font description string, such as "Sans Italic 12". See pango_font_description_from_string() for a description of the format of the - string representation. Note that any other span attributes will override this description. - So if you have "Sans Italic" and also a style="normal" attribute, you will get Sans normal, not italic.*/ - "font": {``, ``}, - "fnt": {``, ``}, - - /* Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' - or one of the relative sizes 'smaller' or 'larger'. If you want to specify a absolute size, it's usually easier to take advantage of - the ability to specify a partial font description using 'font'; you can use font='12.5' rather than size='12800'.*/ - "font_size": {``, ``}, - "fsz": {``, ``}, - - "strike": {"", ""}, "stk": {"", ""}, // Strikethrough - "strikethrough_color": {``, ``}, // 'true' or 'false' whether to strike through the text - "stc": {``, ``}, // An RGB color specification such as '#00FF00' or a color name such as 'blue'. - - "underline": {"", ""}, "und": {"", ""}, // Underline - "underline_color": {``, ``}, // One of 'none', 'single', 'double', 'low', 'error' - "udc": {``, ``}, // An RGB color specification such as '#00FF00' or a color name such as 'red'. - - "foreground": {``, ``}, "fgc": {``, ``}, // An RGB color specification such as '#00FF00' or a color name such as 'red'. - "background": {``, ``}, "bgc": {``, ``}, // An RGB color specification such as '#00FF00' or a color name such as 'red'. - "fgalpha": {``, ``}, "fga": {``, ``}, // An alpha value for the background color, either a plain integer between 1 and 65536 or a percentage value like '50%'. - "bgalpha": {``, ``}, "bga": {``, ``}, // An alpha value for the background color, either a plain integer between 1 and 65536 or a percentage value like '50%'. - - "url": {``, ``}, // Url clickable 1st arg: adress - - /* - Doesn't work on my system with std fonts/size ... - */ - "font_style": {``, ``}, // font_style: One of 'normal', 'oblique', 'italic'. N.b: 'oblique' seems to be the same as 'italic' - "fst": {``, ``}, // font_style: One of 'normal', 'oblique', 'italic'. So, look really useless ... - - "font_variant": {``, ``}, - "fvt": {``, ``}, // One of 'normal' or 'smallcaps' - - "font_stretch": {``, ``}, - "fsh": {``, ``}, // One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded' - - "font_weight": {``, ``}, - "wgt": {``, ``}, // One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight -} - -type PangoColor struct { - Black string - Brown string - White string - Red string - Green string - Blue string - Magenta string - Purple string - Turquoise string - Violet string - Lightblue string - Lightgray string - Lightgreen string - Lightturquoise string - Lightred string - Lightyellow string -} - -func (pc *PangoColor) Init() { - // Colors initialisation - pc.Black = "#000000" - pc.Brown = "#7C2020" - pc.White = "#FFFFFF" - pc.Red = "#FF2222" - pc.Green = "#22BB22" - pc.Blue = "#0044FF" - pc.Magenta = "#D72D6C" - pc.Purple = "#8B0037" - pc.Turquoise = "#009187" - pc.Violet = "#7F00FF" - pc.Lightturquoise = "#80FFE7" - pc.Lightblue = "#ADD8E6" - pc.Lightgray = "#E4DDDD" - pc.Lightgreen = "#87FF87" - pc.Lightred = "#FF6666" - pc.Lightyellow = "#FFFF6F" -} - -type PangoMarkup struct { - InString string - OutString string - markPositions [][]int - markTypes [][]string - Colors PangoColor -} - -func (pm *PangoMarkup) Init(inString string) { - pm.Colors.Init() - // Object initialisation/cleaning - pm.InString = inString - pm.markPositions = [][]int{} - pm.markTypes = [][]string{} - pm.OutString = "" -} - -// Add multiples positions, (where markup is applied) -func (pm *PangoMarkup) AddPosition(pos ...[]int) { - pm.markPositions = append(pm.markPositions, pos...) -} - -// Add multiples markup types, (the style applied at given positions) -func (pm *PangoMarkup) AddTypes(mType ...[]string) { - pm.markTypes = append(pm.markTypes, mType...) -} - -// Apply multiples pango markups to the whole text. -func (pm *PangoMarkup) Markup() string { - pm.prepare() - text := pm.InString - for _, mType := range pm.markTypes { - text = markup(text, mType...) - } - pm.OutString = text - pm.finalize() - return pm.OutString -} - -// Apply multiples pango markups to text at specified positions given into 2d slices. -func (pm *PangoMarkup) MarkupAtPos() string { - var eol = [][]byte{{0x0D, 0x0A}, {0x0D}, {0x0A}} - var actEol string - var multiMarks []string - pm.prepare() - // Sorting slice to get positions from the last to the first, (preserve positions in string) - sort.SliceStable(pm.markPositions, func(i, j int) bool { - return pm.markPositions[i][0] > pm.markPositions[j][0] - }) - pm.OutString = pm.InString - - for _, pos := range pm.markPositions { - prefix := pm.OutString[:pos[0]] - toMark := pm.OutString[pos[0]:pos[1]] - suffix := pm.OutString[pos[1]:] - - multiMarks = []string{toMark} - for idx, val := range eol { - if bytes.Contains([]byte(toMark), val) { - actEol = string(eol[idx]) - multiMarks = strings.Split(toMark, actEol) - } - } - for idx, _ := range multiMarks { - for _, mType := range pm.markTypes { - multiMarks[idx] = markup(multiMarks[idx], mType...) - } - } - pm.OutString = prefix + strings.Join(multiMarks, actEol) + suffix - } - pm.finalize() - return pm.OutString -} - -// Prepare string with special characters to be marked ("<", "&") -func (pm *PangoMarkup) prepare() { - pm.InString = strings.Replace(pm.InString, pangoEscapeChar[1][0], pangoEscapeChar[1][2], -1) - pm.InString = strings.Replace(pm.InString, pangoEscapeChar[0][0], pangoEscapeChar[0][2], -1) -} - -// Escape special characters after marking ("<", "&") -func (pm *PangoMarkup) finalize() { - pm.OutString = strings.Replace(pm.OutString, pangoEscapeChar[1][2], pangoEscapeChar[1][1], -1) - pm.OutString = strings.Replace(pm.OutString, pangoEscapeChar[0][2], pangoEscapeChar[0][1], -1) -} - -// Apply pango markup format to text. They can be combined. -func markup(text string, mType ...string) string { - switch len(mType) { - case 1: - // i.e: markup("display", "sub") - return fmt.Sprint(markupType[mType[0]][0], text, markupType[mType[0]][1]) - case 2: - // i.e: markup("display", "stc", "red") - return fmt.Sprint(markupType[mType[0]][0], mType[1], markupType[mType[0]][1], text, markupType[mType[0]][2]) - case 3: - // i.e: markup("display", "stc", "double", "red") - return fmt.Sprint(markupType[mType[0]][0], mType[1], markupType[mType[0]][1], mType[2], markupType[mType[0]][2], text, markupType[mType[0]][3]) - default: - return fmt.Sprint("Markup type error: ", mType) - } -} diff --git a/gtk3Import/pixbuffByte.go b/gtk3Import/pixbuffByte.go deleted file mode 100644 index 9798253..0000000 --- a/gtk3Import/pixbuffByte.go +++ /dev/null @@ -1,195 +0,0 @@ -// pixbuffByte.go - -// Source file auto-generated on Thu, 21 Feb 2019 00:54:07 using Gotk3ObjHandler v1.0 ©2019 H.F.M - -/* - ©2019 H.F.M - - This program comes with absolutely no warranty. See the The MIT License (MIT) for details: - https://opensource.org/licenses/mit-license.php -*/ - -package gtk3Import - -import ( - "errors" - "fmt" - "reflect" - - "github.com/gotk3/gotk3/gdk" - "github.com/gotk3/gotk3/gtk" -) - -/************************************************/ -/* Images functions, used to initialize objects */ -/* from embedded assets or local files */ -/************************************************/ - -// setBoxImage: Set Image to GtkBox objects -func setBoxImage(object *gtk.Box, varPath interface{}, size ...int) { - var image *gtk.Image - var err error - inPixbuf, err := getPixBuff(varPath, size...) - if err == nil { - image, err = gtk.ImageNewFromPixbuf(inPixbuf) - if err == nil { - image.Show() - object.Add(image) - return - } - } - if len(varPath.(string)) != 0 { - fmt.Printf("setBoxImage: An error occurred on image: %s\n%v\n", varPath.(string), err.Error()) - } -} - -// setWinIcon: Set Icon to GtkWindow objects -func SetWinIcon(object *gtk.Window, varPath interface{}, size ...int) { - inPixbuf, err := getPixBuff(varPath, size...) - if err == nil { - object.SetIcon(inPixbuf) - } else { - if len(varPath.(string)) != 0 { - fmt.Printf("SetWinIcon: An error occurred on image: %s\n%v\n", varPath, err.Error()) - } - } -} - -// setImage: Set Image to GtkImage objects -func SetImage(object *gtk.Image, varPath interface{}, size ...int) { - inPixbuf, err := getPixBuff(varPath, size...) - if err == nil { - object.SetFromPixbuf(inPixbuf) - return - } else { - if len(varPath.(string)) != 0 { - fmt.Printf("SetImage: An error occurred on image: %s\n%v\n", varPath, err.Error()) - } - } - object.Hide() -} - -// setButtonImage: Set Icon to GtkButton objects -func SetButtonImage(object *gtk.Button, varPath interface{}, size ...int) { - inPixbuf, err := getPixBuff(varPath, size...) - if err == nil { - image, err := gtk.ImageNewFromPixbuf(inPixbuf) - if err == nil { - object.SetImage(image) - object.SetAlwaysShowImage(true) - return - } - } - if err != nil { - if len(varPath.(string)) != 0 { - fmt.Printf("SetButtonImage: An error occurred on image: %s\n%v\n", varPath, err.Error()) - } - } -} - -// setToggleButtonImage: Set Icon to GtkToggleButton objects -func SetToggleButtonImage(object *gtk.ToggleButton, varPath interface{}, size ...int) { - var err error - if inPixbuf, err := getPixBuff(varPath, size...); err == nil { - if image, err := gtk.ImageNewFromPixbuf(inPixbuf); err == nil { - object.SetImage(image) - object.SetAlwaysShowImage(true) - return - } - } - if err != nil { - if len(varPath.(string)) != 0 { - fmt.Printf("An error occurred on image: %s\n%v\n", varPath, err.Error()) - } - } -} - -// getPixBuff: Get gtk.Pixbuff image representation from file or []byte, depending on type -// size: resize height keeping porportions. 0 = no change -func getPixBuff(varPath interface{}, size ...int) (outPixbuf *gdk.Pixbuf, err error) { - sze := 0 - if len(size) != 0 { - sze = size[0] - } - switch reflect.TypeOf(varPath).String() { - case "string": - outPixbuf, err = gdk.PixbufNewFromFile(varPath.(string)) - case "[]uint8": - pbLoader, err := gdk.PixbufLoaderNew() - if err == nil { - outPixbuf, err = pbLoader.WriteAndReturnPixbuf(varPath.([]byte)) - } - } - if err == nil && sze != 0 { - newWidth, wenHeight := NormalizeSize(outPixbuf.GetWidth(), outPixbuf.GetHeight(), sze, 2) - outPixbuf, err = outPixbuf.ScaleSimple(newWidth, wenHeight, gdk.INTERP_BILINEAR) - } - return outPixbuf, err -} - -// NormalizeSize: compute new size with kept proportions based on defined format. -// format: 0 percent, 1 reducing width, 2 reducing height -func NormalizeSize(oldWidth, oldHeight, newValue, format int) (outWidth, outHeight int) { - switch format { - case 0: // percent - outWidth = int((float64(oldWidth) * float64(newValue)) / 100) - outHeight = int((float64(oldHeight) * float64(newValue)) / 100) - case 1: // Width - outWidth = newValue - outHeight = int(float64(oldHeight) * (float64(newValue) / float64(oldWidth))) - case 2: // Height - outWidth = int(float64(oldWidth) * (float64(newValue) / float64(oldHeight))) - outHeight = newValue - } - return outWidth, outHeight -} - -// ResizeImage: Get Resized gtk.Pixbuff image representation from file or []byte, depending on type -// interp: 0 GDK_INTERP_NEAREST, 1 GDK_INTERP_TILES, 2 GDK_INTERP_BILINEAR (default), 3 GDK_INTERP_HYPER. -func ResizeImage(varPath interface{}, width, height int, interp ...int) (outPixbuf *gdk.Pixbuf, err error) { - interpolation := gdk.INTERP_BILINEAR - if len(interp) != 0 { - switch interp[0] { - case 0: - interpolation = gdk.INTERP_NEAREST - case 1: - interpolation = gdk.INTERP_TILES - case 3: - interpolation = gdk.INTERP_HYPER - } - } - pBuffImage, err := getPixBuff(varPath) - if err == nil { - if width != pBuffImage.GetWidth() || height != pBuffImage.GetHeight() { - return pBuffImage.ScaleSimple(width, height, interpolation) - } - } - return pBuffImage, err -} - -// RotateImage: Rotate by 90,180,270 degres and get gtk.Pixbuff image representation from file or []byte, depending on type -func RotateImage(varPath interface{}, angle gdk.PixbufRotation) (outPixbuf *gdk.Pixbuf, err error) { - pBuffImage, err := getPixBuff(varPath) - if err == nil { - switch angle { - case 90: - return pBuffImage.RotateSimple(gdk.PIXBUF_ROTATE_COUNTERCLOCKWISE) - case 180: - return pBuffImage.RotateSimple(gdk.PIXBUF_ROTATE_UPSIDEDOWN) - case 270: - return pBuffImage.RotateSimple(gdk.PIXBUF_ROTATE_CLOCKWISE) - default: - return nil, errors.New("Rotation options not allowed: " + fmt.Sprintf("%d", angle)) - } - } - return nil, err -} - -// FlipImage: Get Flipped gtk.Pixbuff image representation from file or []byte, depending on type -func FlipImage(varPath interface{}, horizontal bool) (outPixbuf *gdk.Pixbuf, err error) { - pBuffImage, err := getPixBuff(varPath) - if err == nil { - return pBuffImage.Flip(horizontal) - } - return pBuffImage, err -} diff --git a/gtk3Import/statusBar.go b/gtk3Import/statusBar.go deleted file mode 100644 index d0dd444..0000000 --- a/gtk3Import/statusBar.go +++ /dev/null @@ -1,102 +0,0 @@ -// statusBar.go - -/* -* ©2019 H.F.M. MIT license -* Handle Statusbar messages. - */ - -package gtk3Import - -import ( - "strconv" - "strings" - - "github.com/gotk3/gotk3/gtk" -) - -type StatusBar struct { - Messages []string /* Each row contain associated strings refere to contextId number */ - statusbar *gtk.Statusbar - contextId uint - Prefix []string -} - -/* Add: add new element and return his own position. */ -func (bar *StatusBar) Add(prefix, inString string) (position int) { - bar.Prefix = append(bar.Prefix, prefix) - bar.Messages = append(bar.Messages, prefix+" "+inString) - bar.Disp() - return len(bar.Messages) - 1 -} - -/* Add: set element at desired position. */ -func (bar *StatusBar) Set(inString string, pos int) { - if pos > len(bar.Messages)-1 || pos < 0 { - inString = "Statusbar error: Invalid range to setting this message -> " + inString - pos = len(bar.Messages) - 1 - } - bar.Messages[pos] = inString - bar.Disp() -} - -/* Del: remove element at defined position and get the new length of elements. */ -func (bar *StatusBar) Del(pos int) (newLength int) { - copy(bar.Messages[pos:], bar.Messages[pos+1:]) - bar.Messages = bar.Messages[:cap(bar.Messages)-2] - copy(bar.Prefix[pos:], bar.Prefix[pos+1:]) - bar.Prefix = bar.Prefix[:cap(bar.Prefix)-2] - bar.Disp() - return len(bar.Messages) -} - -/* CleanAll: remove all elements (set to empty string) from the messages list. */ -func (bar *StatusBar) CleanAll() { - for idx, _ := range bar.Messages { - bar.Messages[idx] = "" - } -} - -/* Disp: display content of stored elements into statusbar */ -func (bar *StatusBar) Disp() { - var dispMessages []string - for idxMessage, message := range bar.Messages { - if len(message) != 0 { - dispMessages = append(dispMessages, bar.Prefix[idxMessage]+" "+message) - } - } - bar.statusbar.Push(bar.contextId, strings.Join(dispMessages, " | ")) -} - -/* Init: Initialise structure to handle elements to be displayed. */ -func (bar *StatusBar) Init(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) { - var stack int - if len(stackId) == 0 { - stack = 0 - } else { - stack = stackId[0] - } - bar.statusbar = originStatusbar - bar.contextId = bar.statusbar.GetContextId(strconv.Itoa(stack)) /* get contextId of stack */ - bar.Messages = make([]string, len(prefix)) - for _, pre := range prefix { - bar.Prefix = append(bar.Prefix, pre) - } -} - -/* Init: Initialise structure to handle elements to be displayed. */ -func StatusBarNew(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) *StatusBar { - bar := new(StatusBar) - var stack int - if len(stackId) == 0 { - stack = 0 - } else { - stack = stackId[0] - } - bar.statusbar = originStatusbar - bar.contextId = bar.statusbar.GetContextId(strconv.Itoa(stack)) /* get contextId of stack */ - bar.Messages = make([]string, len(prefix)) - for _, pre := range prefix { - bar.Prefix = append(bar.Prefix, pre) - } - return bar -} diff --git a/gtk3Import/tools.go b/gtk3Import/tools.go deleted file mode 100644 index 7712780..0000000 --- a/gtk3Import/tools.go +++ /dev/null @@ -1,85 +0,0 @@ -// tools.go - -/// +build ignore - -/* - ©2019 H.F.M. MIT license -*/ - -package gtk3Import - -import ( - "fmt" - "regexp" - - "github.com/gotk3/gotk3/gtk" -) - -// SpinbuttonSetValues: Configure spin button -func SpinbuttonSetValues(sb *gtk.SpinButton, min, max, value int, step ...int) (err error) { - incStep := 1 - if len(step) != 0 { - incStep = step[0] - } - if ad, err := gtk.AdjustmentNew(float64(value), float64(min), float64(max), float64(incStep), 0, 0); err == nil { - sb.Configure(ad, 1, 0) - } - return err -} - -// MarkupHttpClickable: -func MarkupHttpClickable(inString string) (outString string) { - pm := PangoMarkup{} - outString = inString // Search for http adress to be treated as clickable link - reg := regexp.MustCompile(`(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?`) - indexes := reg.FindAllIndex([]byte(inString), 1) - - if len(indexes) != 0 { - pm.Init(inString) - pm.AddPosition([]int{indexes[0][0], indexes[0][1]}) - mtype := [][]string{{"url", reg.FindString(inString)}} - pm.AddTypes(mtype...) - outString = pm.MarkupAtPos() - } - return outString -} - -// TruncateString: Reduce string length for display (prefix is separator like: "...", option=0 -> put separator at the begening -// of output string. Option=1 -> center, is where separation is placed. option=2 -> line feed, trunc the whole string using LF -// without shorting it. Max, is max char length of the output string. -func TruncateString(inString, prefix string, max, option int) string { - var center, cutAt bool - var outText string - switch option { - case 1: - center = true - cutAt = false - max = max - len(prefix) - case 2: - center = false - cutAt = true - default: - center = false - cutAt = false - max = max - len(prefix) - } - length := len(inString) - if length > max { - if cutAt { - for count := 0; count < length; count = count + max { - if count+max < length { - outText += fmt.Sprintln(inString[count : count+max]) - } else { - outText += fmt.Sprintln(inString[count:length]) - } - } - return outText - } else if center { - midLength := max / 2 - inString = inString[:midLength] + prefix + inString[length-midLength-1:] - } else { - inString = prefix + inString[length-max:] - } - } - return inString -} diff --git a/main.go b/main.go index 123ecc4..21f0a63 100644 --- a/main.go +++ b/main.go @@ -1,26 +1,13 @@ // main.go -// Source file auto-generated on Sun, 14 Jul 2019 13:07:22 using Gotk3ObjHandler v1.3 ©2019 H.F.M - /* - fileStamper v1.0 ©2019 H.F.M + Source file auto-generated on Fri, 02 Apr 2021 15:44:30 using Gotk3 Objects Handler v1.7.5 ©2018-21 hfmrow + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + Copyright ©2019-21 hfmrow - file-stamper v1.1 github.com/hfmrow/file-stamper This program comes with absolutely no warranty. See the The MIT License (MIT) for details: - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and - associated documentation files (the "Software"), to dealin the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT - NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT - OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + https://opensource.org/licenses/mit-license.php */ package main @@ -28,12 +15,16 @@ package main import ( "fmt" - gi "github.com/hfmrow/fileStamper/gtk3Import" + gimc "github.com/hfmrow/gtk3Import/misc" ) func main() { + /* Be or not to be ... in dev mode ... */ devMode = true + /* Build directory for tempDir */ + doTempDir = false + /* Set to true when you choose using embedded assets functionality */ assetsDeclarationsUseEmbedded(!devMode) @@ -47,8 +38,22 @@ func main() { fmt.Printf("%s\n%v\n", "Options file not found or error on parsing.", err) } + /* Init gtk display */ + mainStartGtk(fmt.Sprintf("%s %s %s %s %s", + Name, + Vers, + "©"+YearCreat, + Creat, + LicenseAbrv), + mainOptions.MainWinWidth, + mainOptions.MainWinHeight, true) +} + +func mainApplication() { + /* Init AboutBox */ mainOptions.About.InitFillInfos( + mainObjects.MainWindow, "About "+Name, Name, Vers, @@ -61,19 +66,6 @@ func main() { filestamper300x29, signSelect20) - /* Init gtk display */ - mainStartGtk(fmt.Sprintf("%s %s %s %s %s", - Name, - Vers, - "©"+YearCreat, - Creat, - LicenseAbrv), - mainOptions.MainWinWidth, - mainOptions.MainWinHeight, true) -} - -func mainApplication() { - /* Translate init. */ translate = MainTranslateNew(absoluteRealPath+mainOptions.LanguageFilename, devMode) sts = translate.Sentences @@ -82,7 +74,7 @@ func mainApplication() { mainOptions.UpdateObjects() /* Statusbar init. */ - statusbar = gi.StatusBarNew(mainObjects.Statusbar, []string{sts["sbInFiles"], sts["sbOutFiles"], sts["sbStatus"]}) + statusbar = gimc.StatusBarStructureNew(mainObjects.Statusbar, []string{sts["sbInFiles"], sts["sbOutFiles"], sts["sbStatus"]}) /* init dnd */ initDropSets() // diff --git a/translate.go b/translate.go index 59ea589..88a56ee 100644 --- a/translate.go +++ b/translate.go @@ -1,12 +1,12 @@ // translate.go -// File generated on Sun, 10 Mar 2019 03:38:32 using Gotk3ObjectsTranslate v1.0 2019 H.F.M +// File generated on Fri, 02 Apr 2021 16:00:44 using Gotk3 Objects Translate v1.5 2019-20 H.F.M /* * This program comes with absolutely no warranty. * See the The MIT License (MIT) for details: * https://opensource.org/licenses/mit-license.php - */ +*/ package main @@ -15,8 +15,7 @@ import ( "encoding/json" "fmt" "io/ioutil" - "os" - "path/filepath" + "strings" "github.com/gotk3/gotk3/gtk" ) @@ -34,34 +33,41 @@ func (trans *MainTranslate) initGtkObjectsText() { trans.setTextToGtkObjects(&mainObjects.CheckbuttonMtime.Widget, "CheckbuttonMtime") trans.setTextToGtkObjects(&mainObjects.CheckbuttonSubdir.Widget, "CheckbuttonSubdir") trans.setTextToGtkObjects(&mainObjects.ImageMainTop.Widget, "ImageMainTop") + trans.setTextToGtkObjects(&mainObjects.Statusbar.Widget, "Statusbar") } - -// sentences: some sentences/words used in the application. -var sentences = map[string]string{ - `savef`: `Save file`, - `outRst`: `Output files, reseted`, - `outLoaded`: `Output files, stored`, - `openf`: `Open file`, - `fileModified`: `Files was modified`, - `sbInFiles`: `In files:`, - `inRst`: `Input files, reseted`, - `ok`: `Ok`, - `sbStatus`: `Status:`, - `retry`: `Retry`, - `sbOutFiles`: `Out files:`, - `allow`: `Allow`, - `yes`: `Yes`, - `deny`: `Deny`, - `inLoaded`: `Input files, stored`, - `cancel`: `Cancel`, +// Translations structure declaration. To be used in main application. +var translate = new(MainTranslate) + +// sts: some sentences/words used in the application. Mostly used in Development mode. +// You must add there all sentences used in your application. Or not ... +// They'll be added to language file each time application started +// when "devMode" is set at true. +var sts = map[string]string{ + `inLoaded`: `Input files, stored`, + `outLoaded`: `Output files, stored`, + `retry`: `Retry`, + `no`: `No`, + `ok`: `Ok`, + `inRst`: `Input files, reseted`, + `sbOutFiles`: `Out files:`, + `fileRestored`: `Files was restored`, + `savef`: `Save file`, + `sbStatus`: `Status:`, + `openf`: `Open file`, + `outRst`: `Output files, reseted`, + `fileModified`: `Files was modified`, + `cancel`: `Cancel`, + `deny`: `Deny`, + `noToUndo`: `Nothing to undo`, `errChgTimestamp`: `An error occurred on changing timestamp`, - `errUndo`: `An error occurred on undo timestamp`, - `fileRestored`: `Files was restored`, - `no`: `No`, - `noToDo`: `Nothing to do`, - `noToUndo`: `Nothing to undo`, + `errUndo`: `An error occurred on undo timestamp`, + `yes`: `Yes`, + `allow`: `Allow`, + `sbInFiles`: `In files:`, + `noToDo`: `Nothing to do`, } + // Translations structure with methods type MainTranslate struct { // Public @@ -76,15 +82,15 @@ type MainTranslate struct { } // MainTranslateNew: Initialise new translation structure and assign language file content to GtkObjects. -// devModeActive, indicate that the new sentences must be added to original language file +// devModeActive, indicate that the new sentences must be added to previous language file. func MainTranslateNew(filename string, devModeActive ...bool) (mt *MainTranslate) { + var err error mt = new(MainTranslate) - if _, err := os.Stat(filename); err == nil { - mt.read(filename) + if err = mt.read(filename); err == nil { mt.initGtkObjectsText() if len(devModeActive) != 0 { if devModeActive[0] { - mt.Sentences = sentences + mt.Sentences = sts err := mt.write(filename) if err != nil { fmt.Printf("%s\n%s\n", "Cannot write actual sentences to language file.", err.Error()) @@ -92,9 +98,9 @@ func MainTranslateNew(filename string, devModeActive ...bool) (mt *MainTranslate } } } else { - fmt.Printf("%s\n%s\n", "Error loading language file !", err.Error()) + fmt.Printf("%s\n%s\n", "Error loading language file !\nNot an error when you just creating from glade Xml or GOH project file.", err.Error()) } - return mt + return } // readFile: language file. @@ -102,11 +108,10 @@ func (trans *MainTranslate) read(filename string) (err error) { var textFileBytes []byte if textFileBytes, err = ioutil.ReadFile(filename); err == nil { if err = json.Unmarshal(textFileBytes, &trans); err == nil { - trans.ProgInfos.GladeXmlFilenameRel, _ = filepath.Rel(filepath.Dir(filename), trans.ProgInfos.GladeXmlFilename) trans.objectsLoaded = true } } - return err + return } // Write json datas to file @@ -118,70 +123,94 @@ func (trans *MainTranslate) write(filename string) (err error) { err = ioutil.WriteFile(filename, out.Bytes(), 0644) } } - return err + return } type parsingFlags struct { - SkipLowerCase bool - SkipEmptyLabel bool - DoBackup bool + SkipLowerCase, + SkipEmptyLabel, + SkipEmptyName, + DoBackup bool } type progInfo struct { - Name string - Version string - Creat string - MainObjStructName string - GladeXmlFilename string - GladeXmlFilenameRel string + Name, + Version, + Creat, + MainObjStructName, + GladeXmlFilename, + TranslateFilename, + ProjectRootDir, + GohProjFile string } type language struct { - LangNameLong string - LangNameShrt string - Author string - Date string - Updated string + LangNameLong, + LangNameShrt, + Author, + Date, + Updated string Contributors []string } type object struct { - Class string - Id string - Label string - Tooltip string - Text string - Uri string - Markup bool + Class, + Id, + Label, + Tooltip, + Text, + Uri, Comment string + LabelMarkup, + LabelWrap, + TooltipMarkup bool + Idx int } // Define available property within objects type propObject struct { - Class string - Label bool - Tooltip bool - Markup bool - Text bool - Uri bool + Class string + Label, + LabelMarkup, + LabelWrap, + Tooltip, + TooltipMarkup, + Text, + Uri bool } -// Property that exists for GObject ... (Used for Class) +// Property that exists for Gtk3 Object ... (Used for Class capability) var propPerObjects = []propObject{ - {Class: "GtkButton", Label: true, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkToggleButton", Label: true, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkLabel", Label: true, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkSpinButton", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkEntry", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkCheckButton", Label: true, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkProgressBar", Label: false, Tooltip: true, Markup: true, Text: true, Uri: false}, - {Class: "GtkSearchBar", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkImage", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkRadioButton", Label: true, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkComboBoxText", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkComboBox", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}, - {Class: "GtkLinkButton", Label: true, Tooltip: true, Markup: true, Text: false, Uri: true}, - {Class: "GtkSwitch", Label: false, Tooltip: true, Markup: true, Text: false, Uri: false}} + {Class: "GtkButton", Label: true, Tooltip: true, TooltipMarkup: true}, + {Class: "GtkMenuButton", Label: true, Tooltip: true, TooltipMarkup: true}, + + // {Class: "GtkToolButton", Label: true, Tooltip: true, TooltipMarkup: true}, // Deprecated since 3.10 + // {Class: "GtkImageMenuItem", Label: true, Tooltip: true, TooltipMarkup: true}, // Deprecated since 3.10 + + {Class: "GtkMenuItem", Label: true, Tooltip: true, TooltipMarkup: true}, + {Class: "GtkCheckMenuItem", Label: true, Tooltip: true, TooltipMarkup: true}, + {Class: "GtkRadioMenuItem", Label: true, Tooltip: true, TooltipMarkup: true}, + + {Class: "GtkToggleButton", Label: true, Tooltip: true, TooltipMarkup: true}, + {Class: "GtkLabel", Label: true, LabelMarkup: true, Tooltip: true, TooltipMarkup: true, LabelWrap: true}, + {Class: "GtkSpinButton", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkEntry", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkCheckButton", Label: true, Tooltip: true, TooltipMarkup: true}, + {Class: "GtkProgressBar", Tooltip: true, TooltipMarkup: true, Text: true}, + {Class: "GtkSearchBar", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkImage", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkRadioButton", Label: true, LabelMarkup: false, Tooltip: true, TooltipMarkup: true}, + {Class: "GtkComboBoxText", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkComboBox", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkLinkButton", Label: true, Tooltip: true, TooltipMarkup: true, Uri: true}, + {Class: "GtkSwitch", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkTreeView", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkFileChooserButton", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkTextView", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkSourceView", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkStatusbar", Tooltip: true, TooltipMarkup: true}, + {Class: "GtkScrolledWindow", Tooltip: true, TooltipMarkup: true}, +} // setTextToGtkObjects: read translations from structure and set them to object. // like this: setTextToGtkObjects(&mainObjects.TransLabelHint.Widget, "TransLabelHint") @@ -192,12 +221,19 @@ func (trans *MainTranslate) setTextToGtkObjects(obj *gtk.Widget, objectId string if currObject.Class == props.Class { if props.Label { obj.SetProperty("label", currObject.Label) + if props.LabelMarkup { + obj.SetProperty("use-markup", currObject.LabelMarkup) + obj.SetProperty("label", strings.ReplaceAll(currObject.Label, "&", "&")) + } + } + if props.LabelWrap { + obj.SetProperty("wrap", currObject.LabelWrap) } - if props.Tooltip && !props.Markup { + if props.Tooltip && !currObject.TooltipMarkup { obj.SetProperty("tooltip_text", currObject.Tooltip) } - if props.Tooltip && props.Markup { - obj.SetProperty("tooltip_markup", currObject.Tooltip) + if props.Tooltip && currObject.TooltipMarkup { + obj.SetProperty("tooltip_markup", strings.ReplaceAll(currObject.Tooltip, "&", "&")) } if props.Text { obj.SetProperty("text", currObject.Text) @@ -205,8 +241,10 @@ func (trans *MainTranslate) setTextToGtkObjects(obj *gtk.Widget, objectId string if props.Uri { obj.SetProperty("uri", currObject.Uri) } + break } } + break } } } diff --git a/vendor/github.com/gotk3/gotk3/cairo/antialias.go b/vendor/github.com/gotk3/gotk3/cairo/antialias.go new file mode 100644 index 0000000..9e41879 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/antialias.go @@ -0,0 +1,27 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// Antialias is a representation of Cairo's cairo_antialias_t. +type Antialias int + +const ( + ANTIALIAS_DEFAULT Antialias = C.CAIRO_ANTIALIAS_DEFAULT + ANTIALIAS_NONE Antialias = C.CAIRO_ANTIALIAS_NONE + ANTIALIAS_GRAY Antialias = C.CAIRO_ANTIALIAS_GRAY + ANTIALIAS_SUBPIXEL Antialias = C.CAIRO_ANTIALIAS_SUBPIXEL + ANTIALIAS_FAST Antialias = C.CAIRO_ANTIALIAS_FAST // (since 1.12) + ANTIALIAS_GOOD Antialias = C.CAIRO_ANTIALIAS_GOOD // (since 1.12) + ANTIALIAS_BEST Antialias = C.CAIRO_ANTIALIAS_BEST // (since 1.12) +) + +func marshalAntialias(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Antialias(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/cairo.go b/vendor/github.com/gotk3/gotk3/cairo/cairo.go new file mode 100644 index 0000000..ba014bd --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/cairo.go @@ -0,0 +1,65 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// Package cairo implements Go bindings for Cairo. Supports version 1.10 and +// later. +package cairo + +// #cgo pkg-config: cairo cairo-gobject gobject-2.0 +// #include +// #include +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.cairo_gobject_antialias_get_type()), marshalAntialias}, + {glib.Type(C.cairo_gobject_content_get_type()), marshalContent}, + {glib.Type(C.cairo_gobject_fill_rule_get_type()), marshalFillRule}, + {glib.Type(C.cairo_gobject_line_cap_get_type()), marshalLineCap}, + {glib.Type(C.cairo_gobject_line_join_get_type()), marshalLineJoin}, + {glib.Type(C.cairo_gobject_operator_get_type()), marshalOperator}, + {glib.Type(C.cairo_gobject_status_get_type()), marshalStatus}, + {glib.Type(C.cairo_gobject_surface_type_get_type()), marshalSurfaceType}, + + // Boxed + {glib.Type(C.cairo_gobject_context_get_type()), marshalContext}, + {glib.Type(C.cairo_gobject_surface_get_type()), marshalSurface}, + } + glib.RegisterGValueMarshalers(tm) +} + +// Constants + +// Content is a representation of Cairo's cairo_content_t. +type Content int + +const ( + CONTENT_COLOR Content = C.CAIRO_CONTENT_COLOR + CONTENT_ALPHA Content = C.CAIRO_CONTENT_ALPHA + CONTENT_COLOR_ALPHA Content = C.CAIRO_CONTENT_COLOR_ALPHA +) + +func marshalContent(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Content(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/canvas.go b/vendor/github.com/gotk3/gotk3/cairo/canvas.go new file mode 100644 index 0000000..2887c65 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/canvas.go @@ -0,0 +1,423 @@ +package cairo + +// #include +// #include +// #include +import "C" + +import ( + "reflect" + "runtime" + "unsafe" +) + +// Context is a representation of Cairo's cairo_t. +type Context struct { + context *C.cairo_t +} + +// native returns a pointer to the underlying cairo_t. +func (v *Context) native() *C.cairo_t { + if v == nil { + return nil + } + return v.context +} + +func (v *Context) GetCContext() *C.cairo_t { + return v.native() +} + +// Native returns a pointer to the underlying cairo_t. +func (v *Context) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalContext(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + context := (*C.cairo_t)(unsafe.Pointer(c)) + return wrapContext(context), nil +} + +func wrapContext(context *C.cairo_t) *Context { + return &Context{context} +} + +func WrapContext(p uintptr) *Context { + context := (*C.cairo_t)(unsafe.Pointer(p)) + return wrapContext(context) +} + +// Closes the context. The context must not be used afterwards. +func (v *Context) Close() { + v.destroy() +} + +// Create is a wrapper around cairo_create(). +func Create(target *Surface) *Context { + c := C.cairo_create(target.native()) + ctx := wrapContext(c) + runtime.SetFinalizer(ctx, (*Context).destroy) + return ctx +} + +// reference is a wrapper around cairo_reference(). +func (v *Context) reference() { + v.context = C.cairo_reference(v.native()) +} + +// destroy is a wrapper around cairo_destroy(). +func (v *Context) destroy() { + if v.context != nil { + C.cairo_destroy(v.native()) + v.context = nil + } +} + +// Status is a wrapper around cairo_status(). +func (v *Context) Status() Status { + c := C.cairo_status(v.native()) + return Status(c) +} + +// Save is a wrapper around cairo_save(). +func (v *Context) Save() { + C.cairo_save(v.native()) +} + +// Restore is a wrapper around cairo_restore(). +func (v *Context) Restore() { + C.cairo_restore(v.native()) +} + +// GetTarget is a wrapper around cairo_get_target(). +func (v *Context) GetTarget() *Surface { + c := C.cairo_get_target(v.native()) + s := wrapSurface(c) + s.reference() + runtime.SetFinalizer(s, (*Surface).destroy) + return s +} + +// PushGroup is a wrapper around cairo_push_group(). +func (v *Context) PushGroup() { + C.cairo_push_group(v.native()) +} + +// PushGroupWithContent is a wrapper around cairo_push_group_with_content(). +func (v *Context) PushGroupWithContent(content Content) { + C.cairo_push_group_with_content(v.native(), C.cairo_content_t(content)) +} + +// TODO(jrick) PopGroup (depends on Pattern) +// cairo_pop_group + +// PopGroupToSource is a wrapper around cairo_pop_group_to_source(). +func (v *Context) PopGroupToSource() { + C.cairo_pop_group_to_source(v.native()) +} + +// GetGroupTarget is a wrapper around cairo_get_group_target(). +func (v *Context) GetGroupTarget() *Surface { + c := C.cairo_get_group_target(v.native()) + s := wrapSurface(c) + s.reference() + runtime.SetFinalizer(s, (*Surface).destroy) + return s +} + +// SetSource is a wrapper around cairo_set_source(). +func (v *Context) SetSource(p *Pattern) { + C.cairo_set_source(v.native(), p.native()) +} + +// SetSourceRGB is a wrapper around cairo_set_source_rgb(). +func (v *Context) SetSourceRGB(red, green, blue float64) { + C.cairo_set_source_rgb(v.native(), C.double(red), C.double(green), + C.double(blue)) +} + +// SetSourceRGBA is a wrapper around cairo_set_source_rgba(). +func (v *Context) SetSourceRGBA(red, green, blue, alpha float64) { + C.cairo_set_source_rgba(v.native(), C.double(red), C.double(green), + C.double(blue), C.double(alpha)) +} + +// TODO(jrick) SetSource (depends on Pattern) +// cairo_set_source + +// SetSourceSurface is a wrapper around cairo_set_source_surface(). +func (v *Context) SetSourceSurface(surface *Surface, x, y float64) { + C.cairo_set_source_surface(v.native(), surface.native(), C.double(x), + C.double(y)) +} + +// TODO(jrick) GetSource (depends on Pattern) +// cairo_get_source + +// SetAntialias is a wrapper around cairo_set_antialias(). +func (v *Context) SetAntialias(antialias Antialias) { + C.cairo_set_antialias(v.native(), C.cairo_antialias_t(antialias)) +} + +// GetAntialias is a wrapper around cairo_get_antialias(). +func (v *Context) GetAntialias() Antialias { + c := C.cairo_get_antialias(v.native()) + return Antialias(c) +} + +// SetDash is a wrapper around cairo_set_dash(). +func (v *Context) SetDash(dashes []float64, offset float64) { + header := (*reflect.SliceHeader)(unsafe.Pointer(&dashes)) + cdashes := (*C.double)(unsafe.Pointer(header.Data)) + C.cairo_set_dash(v.native(), cdashes, C.int(header.Len), + C.double(offset)) +} + +// GetDashCount is a wrapper around cairo_get_dash_count(). +func (v *Context) GetDashCount() int { + c := C.cairo_get_dash_count(v.native()) + return int(c) +} + +// GetDash is a wrapper around cairo_get_dash(). +func (v *Context) GetDash() (dashes []float64, offset float64) { + dashCount := v.GetDashCount() + cdashes := (*C.double)(C.calloc(8, C.size_t(dashCount))) + var coffset C.double + C.cairo_get_dash(v.native(), cdashes, &coffset) + header := (*reflect.SliceHeader)((unsafe.Pointer(&dashes))) + header.Data = uintptr(unsafe.Pointer(cdashes)) + header.Len = dashCount + header.Cap = dashCount + return dashes, float64(coffset) +} + +// SetFillRule is a wrapper around cairo_set_fill_rule(). +func (v *Context) SetFillRule(fillRule FillRule) { + C.cairo_set_fill_rule(v.native(), C.cairo_fill_rule_t(fillRule)) +} + +// GetFillRule is a wrapper around cairo_get_fill_rule(). +func (v *Context) GetFillRule() FillRule { + c := C.cairo_get_fill_rule(v.native()) + return FillRule(c) +} + +// SetLineCap is a wrapper around cairo_set_line_cap(). +func (v *Context) SetLineCap(lineCap LineCap) { + C.cairo_set_line_cap(v.native(), C.cairo_line_cap_t(lineCap)) +} + +// GetLineCap is a wrapper around cairo_get_line_cap(). +func (v *Context) GetLineCap() LineCap { + c := C.cairo_get_line_cap(v.native()) + return LineCap(c) +} + +// SetLineJoin is a wrapper around cairo_set_line_join(). +func (v *Context) SetLineJoin(lineJoin LineJoin) { + C.cairo_set_line_join(v.native(), C.cairo_line_join_t(lineJoin)) +} + +// GetLineJoin is a wrapper around cairo_get_line_join(). +func (v *Context) GetLineJoin() LineJoin { + c := C.cairo_get_line_join(v.native()) + return LineJoin(c) +} + +// SetLineWidth is a wrapper around cairo_set_line_width(). +func (v *Context) SetLineWidth(width float64) { + C.cairo_set_line_width(v.native(), C.double(width)) +} + +// GetLineWidth is a wrapper cairo_get_line_width(). +func (v *Context) GetLineWidth() float64 { + c := C.cairo_get_line_width(v.native()) + return float64(c) +} + +// SetMiterLimit is a wrapper around cairo_set_miter_limit(). +func (v *Context) SetMiterLimit(limit float64) { + C.cairo_set_miter_limit(v.native(), C.double(limit)) +} + +// GetMiterLimit is a wrapper around cairo_get_miter_limit(). +func (v *Context) GetMiterLimit() float64 { + c := C.cairo_get_miter_limit(v.native()) + return float64(c) +} + +// SetOperator is a wrapper around cairo_set_operator(). +func (v *Context) SetOperator(op Operator) { + C.cairo_set_operator(v.native(), C.cairo_operator_t(op)) +} + +// GetOperator is a wrapper around cairo_get_operator(). +func (v *Context) GetOperator() Operator { + c := C.cairo_get_operator(v.native()) + return Operator(c) +} + +// SetTolerance is a wrapper around cairo_set_tolerance(). +func (v *Context) SetTolerance(tolerance float64) { + C.cairo_set_tolerance(v.native(), C.double(tolerance)) +} + +// GetTolerance is a wrapper around cairo_get_tolerance(). +func (v *Context) GetTolerance() float64 { + c := C.cairo_get_tolerance(v.native()) + return float64(c) +} + +// Clip is a wrapper around cairo_clip(). +func (v *Context) Clip() { + C.cairo_clip(v.native()) +} + +// ClipPreserve is a wrapper around cairo_clip_preserve(). +func (v *Context) ClipPreserve() { + C.cairo_clip_preserve(v.native()) +} + +// ClipExtents is a wrapper around cairo_clip_extents(). +func (v *Context) ClipExtents() (x1, y1, x2, y2 float64) { + var cx1, cy1, cx2, cy2 C.double + C.cairo_clip_extents(v.native(), &cx1, &cy1, &cx2, &cy2) + return float64(cx1), float64(cy1), float64(cx2), float64(cy2) +} + +// InClip is a wrapper around cairo_in_clip(). +func (v *Context) InClip(x, y float64) bool { + c := C.cairo_in_clip(v.native(), C.double(x), C.double(y)) + return gobool(c) +} + +// ResetClip is a wrapper around cairo_reset_clip(). +func (v *Context) ResetClip() { + C.cairo_reset_clip(v.native()) +} + +// Rectangle is a wrapper around cairo_rectangle(). +func (v *Context) Rectangle(x, y, w, h float64) { + C.cairo_rectangle(v.native(), C.double(x), C.double(y), C.double(w), C.double(h)) +} + +// Arc is a wrapper around cairo_arc(). +func (v *Context) Arc(xc, yc, radius, angle1, angle2 float64) { + C.cairo_arc(v.native(), C.double(xc), C.double(yc), C.double(radius), C.double(angle1), C.double(angle2)) +} + +// ArcNegative is a wrapper around cairo_arc_negative(). +func (v *Context) ArcNegative(xc, yc, radius, angle1, angle2 float64) { + C.cairo_arc_negative(v.native(), C.double(xc), C.double(yc), C.double(radius), C.double(angle1), C.double(angle2)) +} + +// LineTo is a wrapper around cairo_line_to(). +func (v *Context) LineTo(x, y float64) { + C.cairo_line_to(v.native(), C.double(x), C.double(y)) +} + +// CurveTo is a wrapper around cairo_curve_to(). +func (v *Context) CurveTo(x1, y1, x2, y2, x3, y3 float64) { + C.cairo_curve_to(v.native(), C.double(x1), C.double(y1), C.double(x2), C.double(y2), C.double(x3), C.double(y3)) +} + +// MoveTo is a wrapper around cairo_move_to(). +func (v *Context) MoveTo(x, y float64) { + C.cairo_move_to(v.native(), C.double(x), C.double(y)) +} + +// TODO(jrick) CopyClipRectangleList (depends on RectangleList) +// cairo_copy_clip_rectangle_list + +// Fill is a wrapper around cairo_fill(). +func (v *Context) Fill() { + C.cairo_fill(v.native()) +} + +// ClosePath is a wrapper around cairo_close_path(). +func (v *Context) ClosePath() { + C.cairo_close_path(v.native()) +} + +// NewPath is a wrapper around cairo_new_path(). +func (v *Context) NewPath() { + C.cairo_new_path(v.native()) +} + +// GetCurrentPoint is a wrapper around cairo_get_current_point(). +func (v *Context) GetCurrentPoint() (x, y float64) { + C.cairo_get_current_point(v.native(), (*C.double)(&x), (*C.double)(&y)) + return +} + +// FillPreserve is a wrapper around cairo_fill_preserve(). +func (v *Context) FillPreserve() { + C.cairo_fill_preserve(v.native()) +} + +// FillExtents is a wrapper around cairo_fill_extents(). +func (v *Context) FillExtents() (x1, y1, x2, y2 float64) { + var cx1, cy1, cx2, cy2 C.double + C.cairo_fill_extents(v.native(), &cx1, &cy1, &cx2, &cy2) + return float64(cx1), float64(cy1), float64(cx2), float64(cy2) +} + +// InFill is a wrapper around cairo_in_fill(). +func (v *Context) InFill(x, y float64) bool { + c := C.cairo_in_fill(v.native(), C.double(x), C.double(y)) + return gobool(c) +} + +// TODO(jrick) Mask (depends on Pattern) +// cairo_mask_surface + +// MaskSurface is a wrapper around cairo_mask_surface(). +func (v *Context) MaskSurface(surface *Surface, surfaceX, surfaceY float64) { + C.cairo_mask_surface(v.native(), surface.native(), C.double(surfaceX), + C.double(surfaceY)) +} + +// Paint is a wrapper around cairo_paint(). +func (v *Context) Paint() { + C.cairo_paint(v.native()) +} + +// PaintWithAlpha is a wrapper around cairo_paint_with_alpha(). +func (v *Context) PaintWithAlpha(alpha float64) { + C.cairo_paint_with_alpha(v.native(), C.double(alpha)) +} + +// Stroke is a wrapper around cairo_stroke(). +func (v *Context) Stroke() { + C.cairo_stroke(v.native()) +} + +// StrokePreserve is a wrapper around cairo_stroke_preserve(). +func (v *Context) StrokePreserve() { + C.cairo_stroke_preserve(v.native()) +} + +// StrokeExtents is a wrapper around cairo_stroke_extents(). +func (v *Context) StrokeExtents() (x1, y1, x2, y2 float64) { + var cx1, cy1, cx2, cy2 C.double + C.cairo_stroke_extents(v.native(), &cx1, &cy1, &cx2, &cy2) + return float64(cx1), float64(cy1), float64(cx2), float64(cy2) +} + +// InStroke is a wrapper around cairo_in_stroke(). +func (v *Context) InStroke(x, y float64) bool { + c := C.cairo_in_stroke(v.native(), C.double(x), C.double(y)) + return gobool(c) +} + +// CopyPage is a wrapper around cairo_copy_page(). +func (v *Context) CopyPage() { + C.cairo_copy_page(v.native()) +} + +// ShowPage is a wrapper around cairo_show_page(). +func (v *Context) ShowPage() { + C.cairo_show_page(v.native()) +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/errors.go b/vendor/github.com/gotk3/gotk3/cairo/errors.go new file mode 100644 index 0000000..1e48a8a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/errors.go @@ -0,0 +1,7 @@ +package cairo + +type ErrorStatus Status + +func (e ErrorStatus) Error() string { + return StatusToString(Status(e)) +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/fillrule.go b/vendor/github.com/gotk3/gotk3/cairo/fillrule.go new file mode 100644 index 0000000..c0e3ba4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/fillrule.go @@ -0,0 +1,22 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// FillRule is a representation of Cairo's cairo_fill_rule_t. +type FillRule int + +const ( + FILL_RULE_WINDING FillRule = C.CAIRO_FILL_RULE_WINDING + FILL_RULE_EVEN_ODD FillRule = C.CAIRO_FILL_RULE_EVEN_ODD +) + +func marshalFillRule(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return FillRule(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/format.go b/vendor/github.com/gotk3/gotk3/cairo/format.go new file mode 100644 index 0000000..a1be678 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/format.go @@ -0,0 +1,33 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// Format is a representation of Cairo's cairo_format_t. +type Format int + +const ( + FORMAT_INVALID Format = C.CAIRO_FORMAT_INVALID + FORMAT_ARGB32 Format = C.CAIRO_FORMAT_ARGB32 + FORMAT_RGB24 Format = C.CAIRO_FORMAT_RGB24 + FORMAT_A8 Format = C.CAIRO_FORMAT_A8 + FORMAT_A1 Format = C.CAIRO_FORMAT_A1 + FORMAT_RGB16_565 Format = C.CAIRO_FORMAT_RGB16_565 + FORMAT_RGB30 Format = C.CAIRO_FORMAT_RGB30 +) + +func marshalFormat(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Format(c), nil +} + +// FormatStrideForWidth is a wrapper for cairo_format_stride_for_width(). +func FormatStrideForWidth(format Format, width int) int { + c := C.cairo_format_stride_for_width(C.cairo_format_t(format), C.int(width)) + return int(c) +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/linecap.go b/vendor/github.com/gotk3/gotk3/cairo/linecap.go new file mode 100644 index 0000000..553465a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/linecap.go @@ -0,0 +1,23 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// LineCap is a representation of Cairo's cairo_line_cap_t. +type LineCap int + +const ( + LINE_CAP_BUTT LineCap = C.CAIRO_LINE_CAP_BUTT + LINE_CAP_ROUND LineCap = C.CAIRO_LINE_CAP_ROUND + LINE_CAP_SQUARE LineCap = C.CAIRO_LINE_CAP_SQUARE +) + +func marshalLineCap(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return LineCap(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/linejoin.go b/vendor/github.com/gotk3/gotk3/cairo/linejoin.go new file mode 100644 index 0000000..3a05920 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/linejoin.go @@ -0,0 +1,23 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// LineJoin is a representation of Cairo's cairo_line_join_t. +type LineJoin int + +const ( + LINE_JOIN_MITER LineJoin = C.CAIRO_LINE_JOIN_MITER + LINE_JOIN_ROUND LineJoin = C.CAIRO_LINE_JOIN_ROUND + LINE_JOIN_BEVEL LineJoin = C.CAIRO_LINE_JOIN_BEVEL +) + +func marshalLineJoin(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return LineJoin(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/matrix.go b/vendor/github.com/gotk3/gotk3/cairo/matrix.go new file mode 100644 index 0000000..a934df6 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/matrix.go @@ -0,0 +1,98 @@ +package cairo + +// #include +// #include +// #include +import "C" + +import ( + "unsafe" +) + +// Matrix struct +type Matrix struct { + Xx, Yx float64 + Xy, Yy float64 + X0, Y0 float64 +} + +// NewMatrix creates a new identiy matrix +func NewMatrix(xx, yx, xy, yy, x0, y0 float64) *Matrix { + return &Matrix{ + Xx: xx, + Yx: yx, + Xy: xy, + Yy: yy, + X0: x0, + Y0: y0, + } +} + +// Native returns native c pointer to a matrix +func (m *Matrix) native() *C.cairo_matrix_t { + return (*C.cairo_matrix_t)(unsafe.Pointer(m)) +} + +// Native returns native c pointer to a matrix +func (m *Matrix) Native() uintptr { + return uintptr(unsafe.Pointer(m.native())) +} + +// InitIdentity initializes this matrix to identity matrix +func (m *Matrix) InitIdentity() { + C.cairo_matrix_init_identity(m.native()) +} + +// InitTranslate initializes a matrix with the given translation +func (m *Matrix) InitTranslate(tx, ty float64) { + C.cairo_matrix_init_translate(m.native(), C.double(tx), C.double(ty)) +} + +// InitScale initializes a matrix with the give scale +func (m *Matrix) InitScale(sx, sy float64) { + C.cairo_matrix_init_scale(m.native(), C.double(sx), C.double(sy)) +} + +// InitRotate initializes a matrix with the given rotation +func (m *Matrix) InitRotate(radians float64) { + C.cairo_matrix_init_rotate(m.native(), C.double(radians)) +} + +// Translate translates a matrix by the given amount +func (m *Matrix) Translate(tx, ty float64) { + C.cairo_matrix_translate(m.native(), C.double(tx), C.double(ty)) +} + +// Scale scales the matrix by the given amounts +func (m *Matrix) Scale(sx, sy float64) { + C.cairo_matrix_scale(m.native(), C.double(sx), C.double(sy)) +} + +// Rotate rotates the matrix by the given amount +func (m *Matrix) Rotate(radians float64) { + C.cairo_matrix_rotate(m.native(), C.double(radians)) +} + +// Invert inverts the matrix +func (m *Matrix) Invert() { + C.cairo_matrix_invert(m.native()) +} + +// Multiply multiplies the matrix by another matrix +func (m *Matrix) Multiply(a, b Matrix) { + C.cairo_matrix_multiply(m.native(), a.native(), b.native()) +} + +// TransformDistance ... +func (m *Matrix) TransformDistance(dx, dy float64) (float64, float64) { + C.cairo_matrix_transform_distance(m.native(), + (*C.double)(unsafe.Pointer(&dx)), (*C.double)(unsafe.Pointer(&dy))) + return dx, dy +} + +// TransformPoint ... +func (m *Matrix) TransformPoint(x, y float64) (float64, float64) { + C.cairo_matrix_transform_point(m.native(), + (*C.double)(unsafe.Pointer(&x)), (*C.double)(unsafe.Pointer(&y))) + return x, y +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/mimetype.go b/vendor/github.com/gotk3/gotk3/cairo/mimetype.go new file mode 100644 index 0000000..406273e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/mimetype.go @@ -0,0 +1,13 @@ +package cairo + +// MimeType is a representation of Cairo's CAIRO_MIME_TYPE_* +// preprocessor constants. +type MimeType string + +const ( + MIME_TYPE_JP2 MimeType = "image/jp2" + MIME_TYPE_JPEG MimeType = "image/jpeg" + MIME_TYPE_PNG MimeType = "image/png" + MIME_TYPE_URI MimeType = "image/x-uri" + MIME_TYPE_UNIQUE_ID MimeType = "application/x-cairo.uuid" +) diff --git a/vendor/github.com/gotk3/gotk3/cairo/operator.go b/vendor/github.com/gotk3/gotk3/cairo/operator.go new file mode 100644 index 0000000..b71cbf4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/operator.go @@ -0,0 +1,49 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// Operator is a representation of Cairo's cairo_operator_t. +type Operator int + +const ( + OPERATOR_CLEAR Operator = C.CAIRO_OPERATOR_CLEAR + OPERATOR_SOURCE Operator = C.CAIRO_OPERATOR_SOURCE + OPERATOR_OVER Operator = C.CAIRO_OPERATOR_OVER + OPERATOR_IN Operator = C.CAIRO_OPERATOR_IN + OPERATOR_OUT Operator = C.CAIRO_OPERATOR_OUT + OPERATOR_ATOP Operator = C.CAIRO_OPERATOR_ATOP + OPERATOR_DEST Operator = C.CAIRO_OPERATOR_DEST + OPERATOR_DEST_OVER Operator = C.CAIRO_OPERATOR_DEST_OVER + OPERATOR_DEST_IN Operator = C.CAIRO_OPERATOR_DEST_IN + OPERATOR_DEST_OUT Operator = C.CAIRO_OPERATOR_DEST_OUT + OPERATOR_DEST_ATOP Operator = C.CAIRO_OPERATOR_DEST_ATOP + OPERATOR_XOR Operator = C.CAIRO_OPERATOR_XOR + OPERATOR_ADD Operator = C.CAIRO_OPERATOR_ADD + OPERATOR_SATURATE Operator = C.CAIRO_OPERATOR_SATURATE + OPERATOR_MULTIPLY Operator = C.CAIRO_OPERATOR_MULTIPLY + OPERATOR_SCREEN Operator = C.CAIRO_OPERATOR_SCREEN + OPERATOR_OVERLAY Operator = C.CAIRO_OPERATOR_OVERLAY + OPERATOR_DARKEN Operator = C.CAIRO_OPERATOR_DARKEN + OPERATOR_LIGHTEN Operator = C.CAIRO_OPERATOR_LIGHTEN + OPERATOR_COLOR_DODGE Operator = C.CAIRO_OPERATOR_COLOR_DODGE + OPERATOR_COLOR_BURN Operator = C.CAIRO_OPERATOR_COLOR_BURN + OPERATOR_HARD_LIGHT Operator = C.CAIRO_OPERATOR_HARD_LIGHT + OPERATOR_SOFT_LIGHT Operator = C.CAIRO_OPERATOR_SOFT_LIGHT + OPERATOR_DIFFERENCE Operator = C.CAIRO_OPERATOR_DIFFERENCE + OPERATOR_EXCLUSION Operator = C.CAIRO_OPERATOR_EXCLUSION + OPERATOR_HSL_HUE Operator = C.CAIRO_OPERATOR_HSL_HUE + OPERATOR_HSL_SATURATION Operator = C.CAIRO_OPERATOR_HSL_SATURATION + OPERATOR_HSL_COLOR Operator = C.CAIRO_OPERATOR_HSL_COLOR + OPERATOR_HSL_LUMINOSITY Operator = C.CAIRO_OPERATOR_HSL_LUMINOSITY +) + +func marshalOperator(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Operator(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/pattern.go b/vendor/github.com/gotk3/gotk3/cairo/pattern.go new file mode 100644 index 0000000..229567c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/pattern.go @@ -0,0 +1,112 @@ +package cairo + +// #include +// #include +// #include +import "C" + +import ( + "runtime" + "unsafe" +) + +//--------------------------------------------[ cairo_pattern_t == Pattern ]-- + +// Pattern is a representation of Cairo's cairo_pattern_t. +type Pattern struct { + pattern *C.cairo_pattern_t +} + +// NewPatternFromRGB is a wrapper around cairo_pattern_create_rgb(). +func NewPatternFromRGB(red, green, blue float64) (*Pattern, error) { + c := C.cairo_pattern_create_rgb(C.double(red), C.double(green), C.double(blue)) + return newPatternFromNative(c) +} + +// NewPatternFromRGBA is a wrapper around cairo_pattern_create_rgba(). +func NewPatternFromRGBA(red, green, blue, alpha float64) (*Pattern, error) { + c := C.cairo_pattern_create_rgba(C.double(red), C.double(green), C.double(blue), C.double(alpha)) + return newPatternFromNative(c) +} + +// NewPatternForSurface is a wrapper around cairo_pattern_create_for_surface(). +func NewPatternForSurface(s *Surface) (*Pattern, error) { + c := C.cairo_pattern_create_for_surface(s.native()) + return newPatternFromNative(c) +} + +// NewPatternLinear is a wrapper around cairo_pattern_create_linear(). +func NewPatternLinear(x0, y0, x1, y1 float64) (*Pattern, error) { + c := C.cairo_pattern_create_linear(C.double(x0), C.double(y0), C.double(x1), C.double(y1)) + return newPatternFromNative(c) +} + +// NewPatternRadial is a wrapper around cairo_pattern_create_radial(). +func NewPatternRadial(x0, y0, r0, x1, y1, r1 float64) (*Pattern, error) { + c := C.cairo_pattern_create_radial(C.double(x0), C.double(y0), C.double(r0), + C.double(x1), C.double(y1), C.double(r1)) + return newPatternFromNative(c) +} + +func newPatternFromNative(patternNative *C.cairo_pattern_t) (*Pattern, error) { + ptr := wrapPattern(patternNative) + e := ptr.Status().ToError() + if e != nil { + return nil, e + } + runtime.SetFinalizer(ptr, (*Pattern).destroy) + return ptr, nil +} + +// native returns a pointer to the underlying cairo_pattern_t. +func (v *Pattern) native() *C.cairo_pattern_t { + if v == nil { + return nil + } + return v.pattern +} + +// Native returns a pointer to the underlying cairo_pattern_t. +func (v *Pattern) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalPattern(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + pattern := (*C.cairo_pattern_t)(unsafe.Pointer(c)) + return wrapPattern(pattern), nil +} + +func wrapPattern(pattern *C.cairo_pattern_t) *Pattern { + return &Pattern{pattern} +} + +// reference is a wrapper around cairo_pattern_reference(). +func (v *Pattern) reference() { + v.pattern = C.cairo_pattern_reference(v.native()) +} + +// destroy is a wrapper around cairo_pattern_destroy(). +func (v *Pattern) destroy() { + C.cairo_pattern_destroy(v.native()) +} + +// Status is a wrapper around cairo_pattern_status(). +func (v *Pattern) Status() Status { + c := C.cairo_pattern_status(v.native()) + return Status(c) +} + +// AddColorStopRGB is a wrapper around cairo_pattern_add_color_stop_rgb(). +func (v *Pattern) AddColorStopRGB(offset, red, green, blue float64) error { + C.cairo_pattern_add_color_stop_rgb(v.native(), C.double(offset), + C.double(red), C.double(green), C.double(blue)) + return v.Status().ToError() +} + +// AddColorStopRGBA is a wrapper around cairo_pattern_add_color_stop_rgba(). +func (v *Pattern) AddColorStopRGBA(offset, red, green, blue, alpha float64) error { + C.cairo_pattern_add_color_stop_rgba(v.native(), C.double(offset), + C.double(red), C.double(green), C.double(blue), C.double(alpha)) + return v.Status().ToError() +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/region.go b/vendor/github.com/gotk3/gotk3/cairo/region.go new file mode 100644 index 0000000..d3e36d0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/region.go @@ -0,0 +1,381 @@ +// region.go + +package cairo + +// #include +// #include +import "C" + +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.cairo_gobject_region_overlap_get_type()), marshalRegionOverlap}, + + // Boxed + {glib.Type(C.cairo_gobject_region_get_type()), marshalRegion}, + } + glib.RegisterGValueMarshalers(tm) +} + +// RegionOverlap is a representation of Cairo's cairo_region_overlap_t. +type RegionOverlap int + +const ( + REGION_OVERLAP_IN RegionOverlap = C.CAIRO_REGION_OVERLAP_IN + REGION_OVERLAP_OUT RegionOverlap = C.CAIRO_REGION_OVERLAP_OUT + REGION_OVERLAP_PART RegionOverlap = C.CAIRO_REGION_OVERLAP_PART +) + +func marshalRegionOverlap(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return RegionOverlap(c), nil +} + +/* + * Rectangle + */ + +// Rectangle is a representation of Cairo's cairo_rectangle_int_t. +type Rectangle struct { + X, Y int + Width, Height int +} + +// commodity function to ceate Rectangle cairo object. +func RectangleNew(x, y, width, height int) *Rectangle { + r := new(Rectangle) + r.X = x + r.Y = y + r.Width = width + r.Height = height + return r +} + +func (v *Rectangle) native() *C.cairo_rectangle_int_t { + r := new(C.cairo_rectangle_int_t) + r.x = C.int(v.X) + r.y = C.int(v.Y) + r.width = C.int(v.Width) + r.height = C.int(v.Height) + return r +} + +func toRectangle(cr *C.cairo_rectangle_int_t) *Rectangle { + return &Rectangle{ + X: int(cr.x), Y: int(cr.y), + Width: int(cr.width), Height: int(cr.height)} +} + +/* + * Region + */ + +// Region is a representation of Cairo's cairo_region_t. +type Region struct { + region *C.cairo_region_t +} + +// native returns a pointer to the underlying cairo_region_t. +func (v *Region) native() *C.cairo_region_t { + if v == nil { + return nil + } + return v.region +} + +// Native returns a pointer to the underlying cairo_region_t. +func (v *Region) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalRegion(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + region := (*C.cairo_region_t)(unsafe.Pointer(c)) + return wrapRegion(region), nil +} + +func wrapRegion(region *C.cairo_region_t) *Region { + return &Region{region} +} + +// newRegionFromNative that handle finalizer. +func newRegionFromNative(regionNative *C.cairo_region_t) (*Region, error) { + ptr := wrapRegion(regionNative) + e := ptr.Status().ToError() + if e != nil { + return nil, e + } + runtime.SetFinalizer(ptr, (*Region).destroy) + return ptr, nil +} + +// RegionCreate is a wrapper around cairo_region_create(). +func RegionCreate() (*Region, error) { + + return newRegionFromNative(C.cairo_region_create()) +} + +// CreateRectangle is a wrapper around cairo_region_create_rectangle(). +func (v *Region) CreateRectangle(rectangle *Rectangle) (*Region, error) { + + return newRegionFromNative(C.cairo_region_create_rectangle( + rectangle.native())) +} + +// CreateRectangles is a wrapper around cairo_region_create_rectangles(). +func (v *Region) CreateRectangles(rectangles ...*Rectangle) (*Region, error) { + + length := len(rectangles) + + cRectangles := make([]C.cairo_rectangle_int_t, length) + + for i := 0; i < length; i++ { + cRectangles[i] = *rectangles[i].native() + } + + pRect := &cRectangles[0] + + return newRegionFromNative( + C.cairo_region_create_rectangles( + pRect, + C.int(length))) +} + +// Copy is a wrapper around cairo_region_copy(). +func (v *Region) Copy() (*Region, error) { + + return newRegionFromNative(C.cairo_region_copy(v.native())) +} + +// reference is a wrapper around cairo_region_reference(). +func (v *Region) reference() { + v.region = C.cairo_region_reference(v.native()) +} + +// destroy is a wrapper around cairo_region_destroy(). +func (v *Region) destroy() { + C.cairo_region_destroy(v.native()) +} + +// Status is a wrapper around cairo_region_status(). +func (v *Region) Status() Status { + c := C.cairo_region_status(v.native()) + return Status(c) +} + +// GetExtents is a wrapper around cairo_region_get_extents(). +func (v *Region) GetExtents(extents *Rectangle) { + + C.cairo_region_get_extents(v.native(), extents.native()) +} + +// NumRectangles is a wrapper around cairo_region_num_rectangles(). +func (v *Region) NumRectangles() int { + + return int(C.cairo_region_num_rectangles(v.native())) +} + +// GetRectangle is a wrapper around cairo_region_get_rectangle(). +func (v *Region) GetRectangle(nth int) *Rectangle { + + cr := new(C.cairo_rectangle_int_t) + C.cairo_region_get_rectangle(v.native(), C.int(nth), cr) + + return toRectangle(cr) +} + +// IsEmpty is a wrapper around cairo_region_is_empty(). +func (v *Region) IsEmpty() bool { + + return gobool(C.cairo_region_is_empty(v.native())) +} + +// ContainsPoint is a wrapper around cairo_region_contains_point(). +func (v *Region) ContainsPoint(x, y int) bool { + + return gobool(C.cairo_region_contains_point( + v.native(), C.int(x), C.int(y))) +} + +// ContainsRectangle is a wrapper around cairo_region_contains_rectangle(). +func (v *Region) ContainsRectangle(rectangle *Rectangle) RegionOverlap { + + return RegionOverlap( + C.cairo_region_contains_rectangle( + v.native(), rectangle.native())) +} + +// Equal is a wrapper around cairo_region_equal(). +func (v *Region) Equal(region *Region) bool { + + return gobool(C.cairo_region_equal(v.native(), region.native())) +} + +// Translate is a wrapper around cairo_region_translate(). +func (v *Region) Translate(dx, dy int) { + + C.cairo_region_translate(v.native(), C.int(dx), C.int(dy)) +} + +// Intersect is a wrapper around cairo_region_intersect(). +// Note: contrary to the original statement, the source +// 'Region' remains preserved. +func (v *Region) Intersect(other *Region) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_intersect( + dst.native(), + other.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// IntersectRectangle is a wrapper around cairo_region_intersect_rectangle(). +// Note: contrary to the original statement, the source 'Region' remains preserved. +func (v *Region) IntersectRectangle(rectangle *Rectangle) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_intersect_rectangle( + dst.native(), + rectangle.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// Substract is a wrapper around cairo_region_subtract(). +// Note: contrary to the original statement, the source +// 'Region' remains preserved. +func (v *Region) Substract(other *Region) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_subtract( + dst.native(), + other.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// SubstractRectangle is a wrapper around cairo_region_subtract_rectangle(). +// Note: contrary to the original statement, the source 'Region' remains preserved. +func (v *Region) SubstractRectangle(rectangle *Rectangle) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_subtract_rectangle( + dst.native(), + rectangle.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// Union is a wrapper around cairo_region_union(). +// Note: contrary to the original statement, the source +// 'Region' remains preserved. +func (v *Region) Union(other *Region) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_union( + dst.native(), + other.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// UnionRectangle is a wrapper around cairo_region_union_rectangle(). +// Note: contrary to the original statement, the source 'Region' remains preserved. +func (v *Region) UnionRectangle(rectangle *Rectangle) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_union_rectangle( + dst.native(), + rectangle.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// Xor is a wrapper around cairo_region_xor(). +// Note: contrary to the original statement, the source +// 'Region' remains preserved. +func (v *Region) Xor(other *Region) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_xor( + dst.native(), + other.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} + +// XorRectangle is a wrapper around cairo_region_xor_rectangle(). +// Note: contrary to the original statement, the source 'Region' remains preserved. +func (v *Region) XorRectangle(rectangle *Rectangle) (*Region, error) { + + dst, err := v.Copy() + if err != nil { + return nil, err + } + err = Status( + C.cairo_region_xor_rectangle( + dst.native(), + rectangle.native())).ToError() + if err != nil { + return nil, err + } + + return dst, nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/status.go b/vendor/github.com/gotk3/gotk3/cairo/status.go new file mode 100644 index 0000000..64b00c3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/status.go @@ -0,0 +1,124 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "errors" + "strings" + "unsafe" +) + +// Status is a representation of Cairo's cairo_status_t. +type Status int + +const ( + STATUS_SUCCESS Status = C.CAIRO_STATUS_SUCCESS + STATUS_NO_MEMORY Status = C.CAIRO_STATUS_NO_MEMORY + STATUS_INVALID_RESTORE Status = C.CAIRO_STATUS_INVALID_RESTORE + STATUS_INVALID_POP_GROUP Status = C.CAIRO_STATUS_INVALID_POP_GROUP + STATUS_NO_CURRENT_POINT Status = C.CAIRO_STATUS_NO_CURRENT_POINT + STATUS_INVALID_MATRIX Status = C.CAIRO_STATUS_INVALID_MATRIX + STATUS_INVALID_STATUS Status = C.CAIRO_STATUS_INVALID_STATUS + STATUS_NULL_POINTER Status = C.CAIRO_STATUS_NULL_POINTER + STATUS_INVALID_STRING Status = C.CAIRO_STATUS_INVALID_STRING + STATUS_INVALID_PATH_DATA Status = C.CAIRO_STATUS_INVALID_PATH_DATA + STATUS_READ_ERROR Status = C.CAIRO_STATUS_READ_ERROR + STATUS_WRITE_ERROR Status = C.CAIRO_STATUS_WRITE_ERROR + STATUS_SURFACE_FINISHED Status = C.CAIRO_STATUS_SURFACE_FINISHED + STATUS_SURFACE_TYPE_MISMATCH Status = C.CAIRO_STATUS_SURFACE_TYPE_MISMATCH + STATUS_PATTERN_TYPE_MISMATCH Status = C.CAIRO_STATUS_PATTERN_TYPE_MISMATCH + STATUS_INVALID_CONTENT Status = C.CAIRO_STATUS_INVALID_CONTENT + STATUS_INVALID_FORMAT Status = C.CAIRO_STATUS_INVALID_FORMAT + STATUS_INVALID_VISUAL Status = C.CAIRO_STATUS_INVALID_VISUAL + STATUS_FILE_NOT_FOUND Status = C.CAIRO_STATUS_FILE_NOT_FOUND + STATUS_INVALID_DASH Status = C.CAIRO_STATUS_INVALID_DASH + STATUS_INVALID_DSC_COMMENT Status = C.CAIRO_STATUS_INVALID_DSC_COMMENT + STATUS_INVALID_INDEX Status = C.CAIRO_STATUS_INVALID_INDEX + STATUS_CLIP_NOT_REPRESENTABLE Status = C.CAIRO_STATUS_CLIP_NOT_REPRESENTABLE + STATUS_TEMP_FILE_ERROR Status = C.CAIRO_STATUS_TEMP_FILE_ERROR + STATUS_INVALID_STRIDE Status = C.CAIRO_STATUS_INVALID_STRIDE + STATUS_FONT_TYPE_MISMATCH Status = C.CAIRO_STATUS_FONT_TYPE_MISMATCH + STATUS_USER_FONT_IMMUTABLE Status = C.CAIRO_STATUS_USER_FONT_IMMUTABLE + STATUS_USER_FONT_ERROR Status = C.CAIRO_STATUS_USER_FONT_ERROR + STATUS_NEGATIVE_COUNT Status = C.CAIRO_STATUS_NEGATIVE_COUNT + STATUS_INVALID_CLUSTERS Status = C.CAIRO_STATUS_INVALID_CLUSTERS + STATUS_INVALID_SLANT Status = C.CAIRO_STATUS_INVALID_SLANT + STATUS_INVALID_WEIGHT Status = C.CAIRO_STATUS_INVALID_WEIGHT + STATUS_INVALID_SIZE Status = C.CAIRO_STATUS_INVALID_SIZE + STATUS_USER_FONT_NOT_IMPLEMENTED Status = C.CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED + STATUS_DEVICE_TYPE_MISMATCH Status = C.CAIRO_STATUS_DEVICE_TYPE_MISMATCH + STATUS_DEVICE_ERROR Status = C.CAIRO_STATUS_DEVICE_ERROR + // STATUS_INVALID_MESH_CONSTRUCTION Status = C.CAIRO_STATUS_INVALID_MESH_CONSTRUCTION (since 1.12) + // STATUS_DEVICE_FINISHED Status = C.CAIRO_STATUS_DEVICE_FINISHED (since 1.12) +) + +var key_Status = map[Status]string{ + + STATUS_SUCCESS: "CAIRO_STATUS_SUCCESS", + STATUS_NO_MEMORY: "CAIRO_STATUS_NO_MEMORY", + STATUS_INVALID_RESTORE: "CAIRO_STATUS_INVALID_RESTORE", + STATUS_INVALID_POP_GROUP: "CAIRO_STATUS_INVALID_POP_GROUP", + STATUS_NO_CURRENT_POINT: "CAIRO_STATUS_NO_CURRENT_POINT", + STATUS_INVALID_MATRIX: "CAIRO_STATUS_INVALID_MATRIX", + STATUS_INVALID_STATUS: "CAIRO_STATUS_INVALID_STATUS", + STATUS_NULL_POINTER: "CAIRO_STATUS_NULL_POINTER", + STATUS_INVALID_STRING: "CAIRO_STATUS_INVALID_STRING", + STATUS_INVALID_PATH_DATA: "CAIRO_STATUS_INVALID_PATH_DATA", + STATUS_READ_ERROR: "CAIRO_STATUS_READ_ERROR", + STATUS_WRITE_ERROR: "CAIRO_STATUS_WRITE_ERROR", + STATUS_SURFACE_FINISHED: "CAIRO_STATUS_SURFACE_FINISHED", + STATUS_SURFACE_TYPE_MISMATCH: "CAIRO_STATUS_SURFACE_TYPE_MISMATCH", + STATUS_PATTERN_TYPE_MISMATCH: "CAIRO_STATUS_PATTERN_TYPE_MISMATCH", + STATUS_INVALID_CONTENT: "CAIRO_STATUS_INVALID_CONTENT", + STATUS_INVALID_FORMAT: "CAIRO_STATUS_INVALID_FORMAT", + STATUS_INVALID_VISUAL: "CAIRO_STATUS_INVALID_VISUAL", + STATUS_FILE_NOT_FOUND: "CAIRO_STATUS_FILE_NOT_FOUND", + STATUS_INVALID_DASH: "CAIRO_STATUS_INVALID_DASH", + STATUS_INVALID_DSC_COMMENT: "CAIRO_STATUS_INVALID_DSC_COMMENT", + STATUS_INVALID_INDEX: "CAIRO_STATUS_INVALID_INDEX", + STATUS_CLIP_NOT_REPRESENTABLE: "CAIRO_STATUS_CLIP_NOT_REPRESENTABLE", + STATUS_TEMP_FILE_ERROR: "CAIRO_STATUS_TEMP_FILE_ERROR", + STATUS_INVALID_STRIDE: "CAIRO_STATUS_INVALID_STRIDE", + STATUS_FONT_TYPE_MISMATCH: "CAIRO_STATUS_FONT_TYPE_MISMATCH", + STATUS_USER_FONT_IMMUTABLE: "CAIRO_STATUS_USER_FONT_IMMUTABLE", + STATUS_USER_FONT_ERROR: "CAIRO_STATUS_USER_FONT_ERROR", + STATUS_NEGATIVE_COUNT: "CAIRO_STATUS_NEGATIVE_COUNT", + STATUS_INVALID_CLUSTERS: "CAIRO_STATUS_INVALID_CLUSTERS", + STATUS_INVALID_SLANT: "CAIRO_STATUS_INVALID_SLANT", + STATUS_INVALID_WEIGHT: "CAIRO_STATUS_INVALID_WEIGHT", + STATUS_INVALID_SIZE: "CAIRO_STATUS_INVALID_SIZE", + STATUS_USER_FONT_NOT_IMPLEMENTED: "CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED", + STATUS_DEVICE_TYPE_MISMATCH: "CAIRO_STATUS_DEVICE_TYPE_MISMATCH", + STATUS_DEVICE_ERROR: "CAIRO_STATUS_DEVICE_ERROR", +} + +func StatusToString(status Status) string { + s, ok := key_Status[status] + if !ok { + s = "CAIRO_STATUS_UNDEFINED" + } + return s +} + +func marshalStatus(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Status(c), nil +} + +// String returns a readable status messsage usable in texts. +func (s Status) String() string { + str := StatusToString(s) + str = strings.Replace(str, "CAIRO_STATUS_", "", 1) + str = strings.Replace(str, "_", " ", 0) + return strings.ToLower(str) +} + +// ToError returns the error for the status. Returns nil if success. +func (s Status) ToError() error { + if s == STATUS_SUCCESS { + return nil + } + return errors.New(s.String()) +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/surface.go b/vendor/github.com/gotk3/gotk3/cairo/surface.go new file mode 100644 index 0000000..6137529 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/surface.go @@ -0,0 +1,300 @@ +package cairo + +// #include +// #include +// #include +// #include +import "C" + +import ( + "runtime" + "unsafe" +) + +/* + * cairo_surface_t + */ + +// Surface is a representation of Cairo's cairo_surface_t. +type Surface struct { + surface *C.cairo_surface_t +} + +func NewSurfaceFromPNG(fileName string) (*Surface, error) { + + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + + surfaceNative := C.cairo_image_surface_create_from_png(cstr) + + status := Status(C.cairo_surface_status(surfaceNative)) + if status != STATUS_SUCCESS { + return nil, ErrorStatus(status) + } + + return &Surface{surfaceNative}, nil +} + +// CreateImageSurfaceForData is a wrapper around cairo_image_surface_create_for_data(). +func CreateImageSurfaceForData(data []byte, format Format, width, height, stride int) (*Surface, error) { + surfaceNative := C.cairo_image_surface_create_for_data((*C.uchar)(unsafe.Pointer(&data[0])), + C.cairo_format_t(format), C.int(width), C.int(height), C.int(stride)) + + status := Status(C.cairo_surface_status(surfaceNative)) + if status != STATUS_SUCCESS { + return nil, ErrorStatus(status) + } + + s := wrapSurface(surfaceNative) + + runtime.SetFinalizer(s, (*Surface).destroy) + + return s, nil +} + +// CreateImageSurface is a wrapper around cairo_image_surface_create(). +func CreateImageSurface(format Format, width, height int) *Surface { + c := C.cairo_image_surface_create(C.cairo_format_t(format), + C.int(width), C.int(height)) + s := wrapSurface(c) + runtime.SetFinalizer(s, (*Surface).destroy) + return s +} + +/// Create a new PDF surface. +func CreatePDFSurface(fileName string, width float64, height float64) (*Surface, error) { + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + + surfaceNative := C.cairo_pdf_surface_create(cstr, C.double(width), C.double(height)) + + status := Status(C.cairo_surface_status(surfaceNative)) + if status != STATUS_SUCCESS { + return nil, ErrorStatus(status) + } + + s := wrapSurface(surfaceNative) + + runtime.SetFinalizer(s, (*Surface).destroy) + + return s, nil +} + +// native returns a pointer to the underlying cairo_surface_t. +func (v *Surface) native() *C.cairo_surface_t { + if v == nil { + return nil + } + return v.surface +} + +// Native returns a pointer to the underlying cairo_surface_t. +func (v *Surface) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Surface) GetCSurface() *C.cairo_surface_t { + return v.native() +} + +func marshalSurface(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return WrapSurface(uintptr(c)), nil +} + +func wrapSurface(surface *C.cairo_surface_t) *Surface { + return &Surface{surface} +} + +// NewSurface creates a gotk3 cairo Surface from a pointer to a +// C cairo_surface_t. This is primarily designed for use with other +// gotk3 packages and should be avoided by applications. +func NewSurface(s uintptr, needsRef bool) *Surface { + surface := WrapSurface(s) + if needsRef { + surface.reference() + } + runtime.SetFinalizer(surface, (*Surface).destroy) + return surface +} + +func WrapSurface(s uintptr) *Surface { + ptr := (*C.cairo_surface_t)(unsafe.Pointer(s)) + return wrapSurface(ptr) +} + +// Closes the surface. The surface must not be used afterwards. +func (v *Surface) Close() { + v.destroy() +} + +// CreateSimilar is a wrapper around cairo_surface_create_similar(). +func (v *Surface) CreateSimilar(content Content, width, height int) *Surface { + c := C.cairo_surface_create_similar(v.native(), + C.cairo_content_t(content), C.int(width), C.int(height)) + s := wrapSurface(c) + runtime.SetFinalizer(s, (*Surface).destroy) + return s +} + +// TODO cairo_surface_create_similar_image (since 1.12) + +// CreateForRectangle is a wrapper around cairo_surface_create_for_rectangle(). +func (v *Surface) CreateForRectangle(x, y, width, height float64) *Surface { + c := C.cairo_surface_create_for_rectangle(v.native(), C.double(x), + C.double(y), C.double(width), C.double(height)) + s := wrapSurface(c) + runtime.SetFinalizer(s, (*Surface).destroy) + return s +} + +// reference is a wrapper around cairo_surface_reference(). +func (v *Surface) reference() { + v.surface = C.cairo_surface_reference(v.native()) +} + +// destroy is a wrapper around cairo_surface_destroy(). +func (v *Surface) destroy() { + if v.surface != nil { + C.cairo_surface_destroy(v.native()) + v.surface = nil + } +} + +// Status is a wrapper around cairo_surface_status(). +func (v *Surface) Status() Status { + c := C.cairo_surface_status(v.native()) + return Status(c) +} + +// Flush is a wrapper around cairo_surface_flush(). +func (v *Surface) Flush() { + C.cairo_surface_flush(v.native()) +} + +// TODO(jrick) GetDevice (requires Device bindings) +// cairo_surface_get_device + +// TODO(jrick) GetFontOptions (require FontOptions bindings) +// cairo_surface_get_font_options + +// TODO(jrick) GetContent (requires Content bindings) +// cairo_surface_get_content + +// MarkDirty is a wrapper around cairo_surface_mark_dirty(). +func (v *Surface) MarkDirty() { + C.cairo_surface_mark_dirty(v.native()) +} + +// MarkDirtyRectangle is a wrapper around cairo_surface_mark_dirty_rectangle(). +func (v *Surface) MarkDirtyRectangle(x, y, width, height int) { + C.cairo_surface_mark_dirty_rectangle(v.native(), C.int(x), C.int(y), + C.int(width), C.int(height)) +} + +// SetDeviceOffset is a wrapper around cairo_surface_set_device_offset(). +func (v *Surface) SetDeviceOffset(x, y float64) { + C.cairo_surface_set_device_offset(v.native(), C.double(x), C.double(y)) +} + +// GetDeviceOffset is a wrapper around cairo_surface_get_device_offset(). +func (v *Surface) GetDeviceOffset() (x, y float64) { + var xOffset, yOffset C.double + C.cairo_surface_get_device_offset(v.native(), &xOffset, &yOffset) + return float64(xOffset), float64(yOffset) +} + +// SetFallbackResolution is a wrapper around +// cairo_surface_set_fallback_resolution(). +func (v *Surface) SetFallbackResolution(xPPI, yPPI float64) { + C.cairo_surface_set_fallback_resolution(v.native(), C.double(xPPI), + C.double(yPPI)) +} + +// GetFallbackResolution is a wrapper around cairo_surface_get_fallback_resolution(). +func (v *Surface) GetFallbackResolution() (xPPI, yPPI float64) { + var x, y C.double + C.cairo_surface_get_fallback_resolution(v.native(), &x, &y) + return float64(x), float64(y) +} + +// GetType is a wrapper around cairo_surface_get_type(). +func (v *Surface) GetType() SurfaceType { + c := C.cairo_surface_get_type(v.native()) + return SurfaceType(c) +} + +// TODO(jrick) SetUserData (depends on UserDataKey and DestroyFunc) +// cairo_surface_set_user_data + +// TODO(jrick) GetUserData (depends on UserDataKey) +// cairo_surface_get_user_data + +// CopyPage is a wrapper around cairo_surface_copy_page(). +func (v *Surface) CopyPage() { + C.cairo_surface_copy_page(v.native()) +} + +// ShowPage is a wrapper around cairo_surface_show_page(). +func (v *Surface) ShowPage() { + C.cairo_surface_show_page(v.native()) +} + +// HasShowTextGlyphs is a wrapper around cairo_surface_has_show_text_glyphs(). +func (v *Surface) HasShowTextGlyphs() bool { + c := C.cairo_surface_has_show_text_glyphs(v.native()) + return gobool(c) +} + +// TODO(jrick) SetMimeData (depends on DestroyFunc) +// cairo_surface_set_mime_data + +// GetMimeData is a wrapper around cairo_surface_get_mime_data(). The +// returned mimetype data is returned as a Go byte slice. +func (v *Surface) GetMimeData(mimeType MimeType) []byte { + cstr := C.CString(string(mimeType)) + defer C.free(unsafe.Pointer(cstr)) + var data *C.uchar + var length C.ulong + C.cairo_surface_get_mime_data(v.native(), cstr, &data, &length) + return C.GoBytes(unsafe.Pointer(data), C.int(length)) +} + +// WriteToPNG is a wrapper around cairo_surface_write_png(). It writes the Cairo +// surface to the given file in PNG format. +func (v *Surface) WriteToPNG(fileName string) error { + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + + status := Status(C.cairo_surface_write_to_png(v.surface, cstr)) + + if status != STATUS_SUCCESS { + return ErrorStatus(status) + } + + return nil +} + +// TODO(jrick) SupportsMimeType (since 1.12) +// cairo_surface_supports_mime_type + +// TODO(jrick) MapToImage (since 1.12) +// cairo_surface_map_to_image + +// TODO(jrick) UnmapImage (since 1.12) +// cairo_surface_unmap_image + +// GetHeight is a wrapper around cairo_image_surface_get_height(). +func (v *Surface) GetHeight() int { + return int(C.cairo_image_surface_get_height(v.surface)) +} + +// GetWidth is a wrapper around cairo_image_surface_get_width(). +func (v *Surface) GetWidth() int { + return int(C.cairo_image_surface_get_width(v.surface)) +} + +// GetData is a wrapper around cairo_image_surface_get_data(). +func (v *Surface) GetData() unsafe.Pointer { + return unsafe.Pointer(C.cairo_image_surface_get_data(v.surface)) +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/surfacetype.go b/vendor/github.com/gotk3/gotk3/cairo/surfacetype.go new file mode 100644 index 0000000..a1421eb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/surfacetype.go @@ -0,0 +1,45 @@ +package cairo + +// #include +// #include +// #include +import "C" +import ( + "unsafe" +) + +// SurfaceType is a representation of Cairo's cairo_surface_type_t. +type SurfaceType int + +const ( + SURFACE_TYPE_IMAGE SurfaceType = C.CAIRO_SURFACE_TYPE_IMAGE + SURFACE_TYPE_PDF SurfaceType = C.CAIRO_SURFACE_TYPE_PDF + SURFACE_TYPE_PS SurfaceType = C.CAIRO_SURFACE_TYPE_PS + SURFACE_TYPE_XLIB SurfaceType = C.CAIRO_SURFACE_TYPE_XLIB + SURFACE_TYPE_XCB SurfaceType = C.CAIRO_SURFACE_TYPE_XCB + SURFACE_TYPE_GLITZ SurfaceType = C.CAIRO_SURFACE_TYPE_GLITZ + SURFACE_TYPE_QUARTZ SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ + SURFACE_TYPE_WIN32 SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32 + SURFACE_TYPE_BEOS SurfaceType = C.CAIRO_SURFACE_TYPE_BEOS + SURFACE_TYPE_DIRECTFB SurfaceType = C.CAIRO_SURFACE_TYPE_DIRECTFB + SURFACE_TYPE_SVG SurfaceType = C.CAIRO_SURFACE_TYPE_SVG + SURFACE_TYPE_OS2 SurfaceType = C.CAIRO_SURFACE_TYPE_OS2 + SURFACE_TYPE_WIN32_PRINTING SurfaceType = C.CAIRO_SURFACE_TYPE_WIN32_PRINTING + SURFACE_TYPE_QUARTZ_IMAGE SurfaceType = C.CAIRO_SURFACE_TYPE_QUARTZ_IMAGE + SURFACE_TYPE_SCRIPT SurfaceType = C.CAIRO_SURFACE_TYPE_SCRIPT + SURFACE_TYPE_QT SurfaceType = C.CAIRO_SURFACE_TYPE_QT + SURFACE_TYPE_RECORDING SurfaceType = C.CAIRO_SURFACE_TYPE_RECORDING + SURFACE_TYPE_VG SurfaceType = C.CAIRO_SURFACE_TYPE_VG + SURFACE_TYPE_GL SurfaceType = C.CAIRO_SURFACE_TYPE_GL + SURFACE_TYPE_DRM SurfaceType = C.CAIRO_SURFACE_TYPE_DRM + SURFACE_TYPE_TEE SurfaceType = C.CAIRO_SURFACE_TYPE_TEE + SURFACE_TYPE_XML SurfaceType = C.CAIRO_SURFACE_TYPE_XML + SURFACE_TYPE_SKIA SurfaceType = C.CAIRO_SURFACE_TYPE_SKIA + SURFACE_TYPE_SUBSURFACE SurfaceType = C.CAIRO_SURFACE_TYPE_SUBSURFACE + // SURFACE_TYPE_COGL SurfaceType = C.CAIRO_SURFACE_TYPE_COGL (since 1.12) +) + +func marshalSurfaceType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SurfaceType(c), nil +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/text.go b/vendor/github.com/gotk3/gotk3/cairo/text.go new file mode 100644 index 0000000..ab0e201 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/text.go @@ -0,0 +1,125 @@ +package cairo + +// #include +// #include +// #include +import "C" + +import ( + "unsafe" +) + +// FontSlant is a representation of Cairo's cairo_font_slant_t +type FontSlant int + +const ( + FONT_SLANT_NORMAL FontSlant = C.CAIRO_FONT_SLANT_NORMAL + FONT_SLANT_ITALIC FontSlant = C.CAIRO_FONT_SLANT_ITALIC + FONT_SLANT_OBLIQUE FontSlant = C.CAIRO_FONT_SLANT_OBLIQUE +) + +// FontWeight is a representation of Cairo's cairo_font_weight_t +type FontWeight int + +const ( + FONT_WEIGHT_NORMAL FontWeight = C.CAIRO_FONT_WEIGHT_NORMAL + FONT_WEIGHT_BOLD FontWeight = C.CAIRO_FONT_WEIGHT_BOLD +) + +func (v *Context) SelectFontFace(family string, slant FontSlant, weight FontWeight) { + cstr := C.CString(family) + defer C.free(unsafe.Pointer(cstr)) + C.cairo_select_font_face(v.native(), (*C.char)(cstr), C.cairo_font_slant_t(slant), C.cairo_font_weight_t(weight)) +} + +func (v *Context) SetFontSize(size float64) { + C.cairo_set_font_size(v.native(), C.double(size)) +} + +// TODO: cairo_set_font_matrix + +// TODO: cairo_get_font_matrix + +// TODO: cairo_set_font_options + +// TODO: cairo_get_font_options + +// TODO: cairo_set_font_face + +// TODO: cairo_get_font_face + +// TODO: cairo_set_scaled_font + +// TODO: cairo_get_scaled_font + +func (v *Context) ShowText(utf8 string) { + cstr := C.CString(utf8) + defer C.free(unsafe.Pointer(cstr)) + C.cairo_show_text(v.native(), (*C.char)(cstr)) +} + +// TODO: cairo_show_glyphs + +// TODO: cairo_show_text_glyphs + +type FontExtents struct { + Ascent float64 + Descent float64 + Height float64 + MaxXAdvance float64 + MaxYAdvance float64 +} + +func (v *Context) FontExtents() FontExtents { + var extents C.cairo_font_extents_t + C.cairo_font_extents(v.native(), &extents) + return FontExtents{ + Ascent: float64(extents.ascent), + Descent: float64(extents.descent), + Height: float64(extents.height), + MaxXAdvance: float64(extents.max_x_advance), + MaxYAdvance: float64(extents.max_y_advance), + } +} + +type TextExtents struct { + XBearing float64 + YBearing float64 + Width float64 + Height float64 + XAdvance float64 + YAdvance float64 +} + +func (v *Context) TextExtents(utf8 string) TextExtents { + cstr := C.CString(utf8) + defer C.free(unsafe.Pointer(cstr)) + var extents C.cairo_text_extents_t + C.cairo_text_extents(v.native(), (*C.char)(cstr), &extents) + return TextExtents{ + XBearing: float64(extents.x_bearing), + YBearing: float64(extents.y_bearing), + Width: float64(extents.width), + Height: float64(extents.height), + XAdvance: float64(extents.x_advance), + YAdvance: float64(extents.y_advance), + } +} + +// TODO: cairo_glyph_extents + +// TODO: cairo_toy_font_face_create + +// TODO: cairo_toy_font_face_get_family + +// TODO: cairo_toy_font_face_get_slant + +// TODO: cairo_toy_font_face_get_weight + +// TODO: cairo_glyph_allocate + +// TODO: cairo_glyph_free + +// TODO: cairo_text_cluster_allocate + +// TODO: cairo_text_cluster_free diff --git a/vendor/github.com/gotk3/gotk3/cairo/translations.go b/vendor/github.com/gotk3/gotk3/cairo/translations.go new file mode 100644 index 0000000..bfe5ad8 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/translations.go @@ -0,0 +1,78 @@ +package cairo + +// #include +// #include +// #include +import "C" + +// Translate is a wrapper around cairo_translate. +func (v *Context) Translate(tx, ty float64) { + C.cairo_translate(v.native(), C.double(tx), C.double(ty)) +} + +// Scale is a wrapper around cairo_scale. +func (v *Context) Scale(sx, sy float64) { + C.cairo_scale(v.native(), C.double(sx), C.double(sy)) +} + +// Rotate is a wrapper around cairo_rotate. +func (v *Context) Rotate(angle float64) { + C.cairo_rotate(v.native(), C.double(angle)) +} + +// Transform is a wrapper around cairo_transform. +func (v *Context) Transform(matrix *Matrix) { + C.cairo_transform(v.native(), matrix.native()) +} + +// SetMatrix is a wrapper around cairo_set_matrix. +func (v *Context) SetMatrix(matrix *Matrix) { + C.cairo_set_matrix(v.native(), matrix.native()) +} + +// GetMatrix is a wrapper around cairo_get_matrix. +func (v *Context) GetMatrix() *Matrix { + var matrix C.cairo_matrix_t + C.cairo_get_matrix(v.native(), &matrix) + return &Matrix{ + Xx: float64(matrix.xx), + Yx: float64(matrix.yx), + Xy: float64(matrix.xy), + Yy: float64(matrix.yy), + X0: float64(matrix.x0), + Y0: float64(matrix.y0), + } +} + +// IdentityMatrix is a wrapper around cairo_identity_matrix(). +// +// Resets the current transformation matrix (CTM) by setting it equal to the +// identity matrix. That is, the user-space and device-space axes will be +// aligned and one user-space unit will transform to one device-space unit. +func (v *Context) IdentityMatrix() { + C.cairo_identity_matrix(v.native()) +} + +// UserToDevice is a wrapper around cairo_user_to_device. +func (v *Context) UserToDevice(x, y float64) (float64, float64) { + C.cairo_user_to_device(v.native(), (*C.double)(&x), (*C.double)(&y)) + return x, y +} + +// UserToDeviceDistance is a wrapper around cairo_user_to_device_distance. +func (v *Context) UserToDeviceDistance(dx, dy float64) (float64, float64) { + C.cairo_user_to_device_distance(v.native(), (*C.double)(&dx), (*C.double)(&dy)) + return dx, dy +} + +// DeviceToUser is a wrapper around cairo_device_to_user. +func (v *Context) DeviceToUser(x, y float64) (float64, float64) { + C.cairo_device_to_user(v.native(), (*C.double)(&x), (*C.double)(&y)) + return x, y +} + +// DeviceToUserDistance is a wrapper around cairo_device_to_user_distance. +func (v *Context) DeviceToUserDistance(x, y float64) (float64, float64) { + C.cairo_device_to_user_distance(v.native(), (*C.double)(&x), (*C.double)(&y)) + return x, y +} diff --git a/vendor/github.com/gotk3/gotk3/cairo/util.go b/vendor/github.com/gotk3/gotk3/cairo/util.go new file mode 100644 index 0000000..39adda7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/cairo/util.go @@ -0,0 +1,20 @@ +package cairo + +// #include +// #include +// #include +import "C" + +func cairobool(b bool) C.cairo_bool_t { + if b { + return C.cairo_bool_t(1) + } + return C.cairo_bool_t(0) +} + +func gobool(b C.cairo_bool_t) bool { + if b != 0 { + return true + } + return false +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk.go b/vendor/github.com/gotk3/gotk3/gdk/gdk.go new file mode 100644 index 0000000..e9382ae --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk.go @@ -0,0 +1,2464 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// Go bindings for GDK 3. Supports version 3.6 and later. +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +import "C" +import ( + "errors" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gdk_drag_action_get_type()), marshalDragAction}, + {glib.Type(C.gdk_colorspace_get_type()), marshalColorspace}, + {glib.Type(C.gdk_event_type_get_type()), marshalEventType}, + {glib.Type(C.gdk_interp_type_get_type()), marshalInterpType}, + {glib.Type(C.gdk_modifier_type_get_type()), marshalModifierType}, + {glib.Type(C.gdk_event_mask_get_type()), marshalEventMask}, + {glib.Type(C.gdk_gravity_get_type()), marshalGravity}, + {glib.Type(C.gdk_visual_type_get_type()), marshalVisualType}, + + // Objects/Interfaces + {glib.Type(C.gdk_device_get_type()), marshalDevice}, + {glib.Type(C.gdk_display_manager_get_type()), marshalDisplayManager}, + {glib.Type(C.gdk_cursor_get_type()), marshalCursor}, + {glib.Type(C.gdk_device_manager_get_type()), marshalDeviceManager}, + {glib.Type(C.gdk_display_get_type()), marshalDisplay}, + {glib.Type(C.gdk_drag_context_get_type()), marshalDragContext}, + {glib.Type(C.gdk_rgba_get_type()), marshalRGBA}, + {glib.Type(C.gdk_screen_get_type()), marshalScreen}, + {glib.Type(C.gdk_visual_get_type()), marshalVisual}, + {glib.Type(C.gdk_window_get_type()), marshalWindow}, + + // Boxed + {glib.Type(C.gdk_event_get_type()), marshalEvent}, + } + glib.RegisterGValueMarshalers(tm) +} + +/* + * Type conversions + */ + +func gbool(b bool) C.gboolean { + if b { + return C.gboolean(1) + } + return C.gboolean(0) +} +func gobool(b C.gboolean) bool { + if b != 0 { + return true + } + return false +} + +/* + * Unexported vars + */ + +var nilPtrErr = errors.New("cgo returned unexpected nil pointer") + +/* + * Constants + */ + +// VisualType is a representation of GDK's GdkVisualType. +type VisualType int + +const ( + VISUAL_STATIC_GRAY VisualType = C.GDK_VISUAL_STATIC_GRAY + VISUAL_GRAYSCALE VisualType = C.GDK_VISUAL_GRAYSCALE + VISUAL_STATIC_COLOR VisualType = C.GDK_VISUAL_STATIC_COLOR + ISUAL_PSEUDO_COLOR VisualType = C.GDK_VISUAL_PSEUDO_COLOR + VISUAL_TRUE_COLOR VisualType = C.GDK_VISUAL_TRUE_COLOR + VISUAL_DIRECT_COLOR VisualType = C.GDK_VISUAL_DIRECT_COLOR +) + +func marshalVisualType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return VisualType(c), nil +} + +// DragAction is a representation of GDK's GdkDragAction. +type DragAction int + +const ( + ACTION_DEFAULT DragAction = C.GDK_ACTION_DEFAULT + ACTION_COPY DragAction = C.GDK_ACTION_COPY + ACTION_MOVE DragAction = C.GDK_ACTION_MOVE + ACTION_LINK DragAction = C.GDK_ACTION_LINK + ACTION_PRIVATE DragAction = C.GDK_ACTION_PRIVATE + ACTION_ASK DragAction = C.GDK_ACTION_ASK +) + +func marshalDragAction(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return DragAction(c), nil +} + +// Colorspace is a representation of GDK's GdkColorspace. +type Colorspace int + +const ( + COLORSPACE_RGB Colorspace = C.GDK_COLORSPACE_RGB +) + +func marshalColorspace(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Colorspace(c), nil +} + +// InterpType is a representation of GDK's GdkInterpType. +type InterpType int + +const ( + INTERP_NEAREST InterpType = C.GDK_INTERP_NEAREST + INTERP_TILES InterpType = C.GDK_INTERP_TILES + INTERP_BILINEAR InterpType = C.GDK_INTERP_BILINEAR + INTERP_HYPER InterpType = C.GDK_INTERP_HYPER +) + +func marshalInterpType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return InterpType(c), nil +} + +// ModifierType is a representation of GDK's GdkModifierType. +type ModifierType uint + +const ( + SHIFT_MASK ModifierType = C.GDK_SHIFT_MASK + LOCK_MASK = C.GDK_LOCK_MASK + CONTROL_MASK = C.GDK_CONTROL_MASK + MOD1_MASK = C.GDK_MOD1_MASK + MOD2_MASK = C.GDK_MOD2_MASK + MOD3_MASK = C.GDK_MOD3_MASK + MOD4_MASK = C.GDK_MOD4_MASK + MOD5_MASK = C.GDK_MOD5_MASK + BUTTON1_MASK = C.GDK_BUTTON1_MASK + BUTTON2_MASK = C.GDK_BUTTON2_MASK + BUTTON3_MASK = C.GDK_BUTTON3_MASK + BUTTON4_MASK = C.GDK_BUTTON4_MASK + BUTTON5_MASK = C.GDK_BUTTON5_MASK + SUPER_MASK = C.GDK_SUPER_MASK + HYPER_MASK = C.GDK_HYPER_MASK + META_MASK = C.GDK_META_MASK + RELEASE_MASK = C.GDK_RELEASE_MASK + MODIFIER_MASK = C.GDK_MODIFIER_MASK +) + +func marshalModifierType(p uintptr) (interface{}, error) { + c := C.g_value_get_flags((*C.GValue)(unsafe.Pointer(p))) + return ModifierType(c), nil +} + +// Selections +const ( + SELECTION_PRIMARY Atom = 1 + SELECTION_SECONDARY Atom = 2 + SELECTION_CLIPBOARD Atom = 69 + TARGET_BITMAP Atom = 5 + TARGET_COLORMAP Atom = 7 + TARGET_DRAWABLE Atom = 17 + TARGET_PIXMAP Atom = 20 + TARGET_STRING Atom = 31 + SELECTION_TYPE_ATOM Atom = 4 + SELECTION_TYPE_BITMAP Atom = 5 + SELECTION_TYPE_COLORMAP Atom = 7 + SELECTION_TYPE_DRAWABLE Atom = 17 + SELECTION_TYPE_INTEGER Atom = 19 + SELECTION_TYPE_PIXMAP Atom = 20 + SELECTION_TYPE_WINDOW Atom = 33 + SELECTION_TYPE_STRING Atom = 31 +) + +// added by terrak +// EventMask is a representation of GDK's GdkEventMask. +type EventMask int + +const ( + EXPOSURE_MASK EventMask = C.GDK_EXPOSURE_MASK + POINTER_MOTION_MASK EventMask = C.GDK_POINTER_MOTION_MASK + POINTER_MOTION_HINT_MASK EventMask = C.GDK_POINTER_MOTION_HINT_MASK + BUTTON_MOTION_MASK EventMask = C.GDK_BUTTON_MOTION_MASK + BUTTON1_MOTION_MASK EventMask = C.GDK_BUTTON1_MOTION_MASK + BUTTON2_MOTION_MASK EventMask = C.GDK_BUTTON2_MOTION_MASK + BUTTON3_MOTION_MASK EventMask = C.GDK_BUTTON3_MOTION_MASK + BUTTON_PRESS_MASK EventMask = C.GDK_BUTTON_PRESS_MASK + BUTTON_RELEASE_MASK EventMask = C.GDK_BUTTON_RELEASE_MASK + KEY_PRESS_MASK EventMask = C.GDK_KEY_PRESS_MASK + KEY_RELEASE_MASK EventMask = C.GDK_KEY_RELEASE_MASK + ENTER_NOTIFY_MASK EventMask = C.GDK_ENTER_NOTIFY_MASK + LEAVE_NOTIFY_MASK EventMask = C.GDK_LEAVE_NOTIFY_MASK + FOCUS_CHANGE_MASK EventMask = C.GDK_FOCUS_CHANGE_MASK + STRUCTURE_MASK EventMask = C.GDK_STRUCTURE_MASK + PROPERTY_CHANGE_MASK EventMask = C.GDK_PROPERTY_CHANGE_MASK + VISIBILITY_NOTIFY_MASK EventMask = C.GDK_VISIBILITY_NOTIFY_MASK + PROXIMITY_IN_MASK EventMask = C.GDK_PROXIMITY_IN_MASK + PROXIMITY_OUT_MASK EventMask = C.GDK_PROXIMITY_OUT_MASK + SUBSTRUCTURE_MASK EventMask = C.GDK_SUBSTRUCTURE_MASK + SCROLL_MASK EventMask = C.GDK_SCROLL_MASK + TOUCH_MASK EventMask = C.GDK_TOUCH_MASK + SMOOTH_SCROLL_MASK EventMask = C.GDK_SMOOTH_SCROLL_MASK + ALL_EVENTS_MASK EventMask = C.GDK_ALL_EVENTS_MASK +) + +func marshalEventMask(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return EventMask(c), nil +} + +// added by lazyshot +// ScrollDirection is a representation of GDK's GdkScrollDirection +type ScrollDirection int + +const ( + SCROLL_UP ScrollDirection = C.GDK_SCROLL_UP + SCROLL_DOWN ScrollDirection = C.GDK_SCROLL_DOWN + SCROLL_LEFT ScrollDirection = C.GDK_SCROLL_LEFT + SCROLL_RIGHT ScrollDirection = C.GDK_SCROLL_RIGHT + SCROLL_SMOOTH ScrollDirection = C.GDK_SCROLL_SMOOTH +) + +// WindowEdge is a representation of GDK's GdkWindowEdge +type WindowEdge int + +const ( + WINDOW_EDGE_NORTH_WEST WindowEdge = C.GDK_WINDOW_EDGE_NORTH_WEST + WINDOW_EDGE_NORTH WindowEdge = C.GDK_WINDOW_EDGE_NORTH + WINDOW_EDGE_NORTH_EAST WindowEdge = C.GDK_WINDOW_EDGE_NORTH_EAST + WINDOW_EDGE_WEST WindowEdge = C.GDK_WINDOW_EDGE_WEST + WINDOW_EDGE_EAST WindowEdge = C.GDK_WINDOW_EDGE_EAST + WINDOW_EDGE_SOUTH_WEST WindowEdge = C.GDK_WINDOW_EDGE_SOUTH_WEST + WINDOW_EDGE_SOUTH WindowEdge = C.GDK_WINDOW_EDGE_SOUTH + WINDOW_EDGE_SOUTH_EAST WindowEdge = C.GDK_WINDOW_EDGE_SOUTH_EAST +) + +// WindowState is a representation of GDK's GdkWindowState +type WindowState int + +const ( + WINDOW_STATE_WITHDRAWN WindowState = C.GDK_WINDOW_STATE_WITHDRAWN + WINDOW_STATE_ICONIFIED WindowState = C.GDK_WINDOW_STATE_ICONIFIED + WINDOW_STATE_MAXIMIZED WindowState = C.GDK_WINDOW_STATE_MAXIMIZED + WINDOW_STATE_STICKY WindowState = C.GDK_WINDOW_STATE_STICKY + WINDOW_STATE_FULLSCREEN WindowState = C.GDK_WINDOW_STATE_FULLSCREEN + WINDOW_STATE_ABOVE WindowState = C.GDK_WINDOW_STATE_ABOVE + WINDOW_STATE_BELOW WindowState = C.GDK_WINDOW_STATE_BELOW + WINDOW_STATE_FOCUSED WindowState = C.GDK_WINDOW_STATE_FOCUSED + WINDOW_STATE_TILED WindowState = C.GDK_WINDOW_STATE_TILED +) + +// WindowTypeHint is a representation of GDK's GdkWindowTypeHint +type WindowTypeHint int + +const ( + WINDOW_TYPE_HINT_NORMAL WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_NORMAL + WINDOW_TYPE_HINT_DIALOG WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_DIALOG + WINDOW_TYPE_HINT_MENU WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_MENU + WINDOW_TYPE_HINT_TOOLBAR WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_TOOLBAR + WINDOW_TYPE_HINT_SPLASHSCREEN WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_SPLASHSCREEN + WINDOW_TYPE_HINT_UTILITY WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_UTILITY + WINDOW_TYPE_HINT_DOCK WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_DOCK + WINDOW_TYPE_HINT_DESKTOP WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_DESKTOP + WINDOW_TYPE_HINT_DROPDOWN_MENU WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU + WINDOW_TYPE_HINT_POPUP_MENU WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_POPUP_MENU + WINDOW_TYPE_HINT_TOOLTIP WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_TOOLTIP + WINDOW_TYPE_HINT_NOTIFICATION WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_NOTIFICATION + WINDOW_TYPE_HINT_COMBO WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_COMBO + WINDOW_TYPE_HINT_DND WindowTypeHint = C.GDK_WINDOW_TYPE_HINT_DND +) + +// WindowHints is a representation of GDK's GdkWindowHints +type WindowHints int + +const ( + HINT_POS WindowHints = C.GDK_HINT_POS + HINT_MIN_SIZE WindowHints = C.GDK_HINT_MIN_SIZE + HINT_MAX_SIZE WindowHints = C.GDK_HINT_MAX_SIZE + HINT_BASE_SIZE WindowHints = C.GDK_HINT_BASE_SIZE + HINT_ASPECT WindowHints = C.GDK_HINT_ASPECT + HINT_RESIZE_INC WindowHints = C.GDK_HINT_RESIZE_INC + HINT_WIN_GRAVITY WindowHints = C.GDK_HINT_WIN_GRAVITY + HINT_USER_POS WindowHints = C.GDK_HINT_USER_POS + HINT_USER_SIZE WindowHints = C.GDK_HINT_USER_SIZE +) + +// CURRENT_TIME is a representation of GDK_CURRENT_TIME + +const CURRENT_TIME = C.GDK_CURRENT_TIME + +// GrabStatus is a representation of GdkGrabStatus + +type GrabStatus int + +const ( + GRAB_SUCCESS GrabStatus = C.GDK_GRAB_SUCCESS + GRAB_ALREADY_GRABBED GrabStatus = C.GDK_GRAB_ALREADY_GRABBED + GRAB_INVALID_TIME GrabStatus = C.GDK_GRAB_INVALID_TIME + GRAB_NOT_VIEWABLE GrabStatus = C.GDK_GRAB_NOT_VIEWABLE + GRAB_FROZEN GrabStatus = C.GDK_GRAB_FROZEN +) + +// GrabOwnership is a representation of GdkGrabOwnership + +type GrabOwnership int + +const ( + OWNERSHIP_NONE GrabOwnership = C.GDK_OWNERSHIP_NONE + OWNERSHIP_WINDOW GrabOwnership = C.GDK_OWNERSHIP_WINDOW + OWNERSHIP_APPLICATION GrabOwnership = C.GDK_OWNERSHIP_APPLICATION +) + +// TODO: +// GdkInputSource +// GdkInputMode +// GdkAxisUse +// GdkAxisFlags +// GdkDeviceToolType + +// DeviceType is a representation of GdkDeviceType + +type DeviceType int + +const ( + DEVICE_TYPE_MASTER DeviceType = C.GDK_DEVICE_TYPE_MASTER + DEVICE_TYPE_SLAVE DeviceType = C.GDK_DEVICE_TYPE_SLAVE + DEVICE_TYPE_FLOATING DeviceType = C.GDK_DEVICE_TYPE_FLOATING +) + +// TODO: +// GdkColorspace +// GdkVisualType +// GdkTimeCoord + +// EventPropagation constants + +const ( + GDK_EVENT_PROPAGATE bool = C.GDK_EVENT_PROPAGATE != 0 + GDK_EVENT_STOP bool = C.GDK_EVENT_STOP != 0 +) + +// Button constants +type Button uint + +const ( + BUTTON_PRIMARY Button = C.GDK_BUTTON_PRIMARY + BUTTON_MIDDLE Button = C.GDK_BUTTON_MIDDLE + BUTTON_SECONDARY Button = C.GDK_BUTTON_SECONDARY +) + +// CrossingMode is a representation of GDK's GdkCrossingMode. + +type CrossingMode int + +const ( + CROSSING_NORMAL CrossingMode = C.GDK_CROSSING_NORMAL + CROSSING_GRAB CrossingMode = C.GDK_CROSSING_GRAB + CROSSING_UNGRAB CrossingMode = C.GDK_CROSSING_UNGRAB + CROSSING_GTK_GRAB CrossingMode = C.GDK_CROSSING_GTK_GRAB + CROSSING_GTK_UNGRAB CrossingMode = C.GDK_CROSSING_GTK_UNGRAB + CROSSING_STATE_CHANGED CrossingMode = C.GDK_CROSSING_STATE_CHANGED + CROSSING_TOUCH_BEGIN CrossingMode = C.GDK_CROSSING_TOUCH_BEGIN + CROSSING_TOUCH_END CrossingMode = C.GDK_CROSSING_TOUCH_END + CROSSING_DEVICE_SWITCH CrossingMode = C.GDK_CROSSING_DEVICE_SWITCH +) + +// NotifyType is a representation of GDK's GdkNotifyType. + +type NotifyType int + +const ( + NOTIFY_ANCESTOR NotifyType = C.GDK_NOTIFY_ANCESTOR + NOTIFY_VIRTUAL NotifyType = C.GDK_NOTIFY_VIRTUAL + NOTIFY_INFERIOR NotifyType = C.GDK_NOTIFY_INFERIOR + NOTIFY_NONLINEAR NotifyType = C.GDK_NOTIFY_NONLINEAR + NOTIFY_NONLINEAR_VIRTUAL NotifyType = C.GDK_NOTIFY_NONLINEAR_VIRTUAL + NOTIFY_UNKNOWN NotifyType = C.GDK_NOTIFY_UNKNOWN +) + +// EventType is a representation of GDK's GdkEventType. +// Do not confuse these event types with the signals that GTK+ widgets emit +type EventType int + +func marshalEventType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return EventType(c), nil +} + +const ( + EVENT_NOTHING EventType = C.GDK_NOTHING + EVENT_DELETE EventType = C.GDK_DELETE + EVENT_DESTROY EventType = C.GDK_DESTROY + EVENT_EXPOSE EventType = C.GDK_EXPOSE + EVENT_MOTION_NOTIFY EventType = C.GDK_MOTION_NOTIFY + EVENT_BUTTON_PRESS EventType = C.GDK_BUTTON_PRESS + EVENT_2BUTTON_PRESS EventType = C.GDK_2BUTTON_PRESS + EVENT_DOUBLE_BUTTON_PRESS EventType = C.GDK_DOUBLE_BUTTON_PRESS + EVENT_3BUTTON_PRESS EventType = C.GDK_3BUTTON_PRESS + EVENT_TRIPLE_BUTTON_PRESS EventType = C.GDK_TRIPLE_BUTTON_PRESS + EVENT_BUTTON_RELEASE EventType = C.GDK_BUTTON_RELEASE + EVENT_KEY_PRESS EventType = C.GDK_KEY_PRESS + EVENT_KEY_RELEASE EventType = C.GDK_KEY_RELEASE + EVENT_ENTER_NOTIFY EventType = C.GDK_ENTER_NOTIFY + EVENT_LEAVE_NOTIFY EventType = C.GDK_LEAVE_NOTIFY + EVENT_FOCUS_CHANGE EventType = C.GDK_FOCUS_CHANGE + EVENT_CONFIGURE EventType = C.GDK_CONFIGURE + EVENT_MAP EventType = C.GDK_MAP + EVENT_UNMAP EventType = C.GDK_UNMAP + EVENT_PROPERTY_NOTIFY EventType = C.GDK_PROPERTY_NOTIFY + EVENT_SELECTION_CLEAR EventType = C.GDK_SELECTION_CLEAR + EVENT_SELECTION_REQUEST EventType = C.GDK_SELECTION_REQUEST + EVENT_SELECTION_NOTIFY EventType = C.GDK_SELECTION_NOTIFY + EVENT_PROXIMITY_IN EventType = C.GDK_PROXIMITY_IN + EVENT_PROXIMITY_OUT EventType = C.GDK_PROXIMITY_OUT + EVENT_DRAG_ENTER EventType = C.GDK_DRAG_ENTER + EVENT_DRAG_LEAVE EventType = C.GDK_DRAG_LEAVE + EVENT_DRAG_MOTION EventType = C.GDK_DRAG_MOTION + EVENT_DRAG_STATUS EventType = C.GDK_DRAG_STATUS + EVENT_DROP_START EventType = C.GDK_DROP_START + EVENT_DROP_FINISHED EventType = C.GDK_DROP_FINISHED + EVENT_CLIENT_EVENT EventType = C.GDK_CLIENT_EVENT + EVENT_VISIBILITY_NOTIFY EventType = C.GDK_VISIBILITY_NOTIFY + EVENT_SCROLL EventType = C.GDK_SCROLL + EVENT_WINDOW_STATE EventType = C.GDK_WINDOW_STATE + EVENT_SETTING EventType = C.GDK_SETTING + EVENT_OWNER_CHANGE EventType = C.GDK_OWNER_CHANGE + EVENT_GRAB_BROKEN EventType = C.GDK_GRAB_BROKEN + EVENT_DAMAGE EventType = C.GDK_DAMAGE + EVENT_TOUCH_BEGIN EventType = C.GDK_TOUCH_BEGIN + EVENT_TOUCH_UPDATE EventType = C.GDK_TOUCH_UPDATE + EVENT_TOUCH_END EventType = C.GDK_TOUCH_END + EVENT_TOUCH_CANCEL EventType = C.GDK_TOUCH_CANCEL + EVENT_LAST EventType = C.GDK_EVENT_LAST +) + +/* + * General + */ + +// TODO: +// gdk_init(). +// gdk_init_check(). +// gdk_parse_args(). +// gdk_get_display_arg_name(). +// gdk_notify_startup_complete(). +// gdk_notify_startup_complete_with_id(). +// gdk_get_program_class(). +// gdk_set_program_class(). +// gdk_get_display(). deprecated since version 3.8 +// gdk_flush(). deprecated +// gdk_screen_width(). deprecated since version 3.22 +// gdk_screen_height(). deprecated since version 3.22 +// gdk_screen_width_mm(). deprecated since version 3.22 +// gdk_screen_height_mm(). deprecated since version 3.22 +// gdk_set_double_click_time(). deprecated +// gdk_beep(). deprecated +// gdk_error_trap_push(). deprecated +// gdk_error_trap_pop(). deprecated +// gdk_error_trap_pop_ignored(). deprecated + +// SetAllowedBackends is a wrapper around gdk_set_allowed_backends +func SetAllowedBackends(backends string) { + cstr := C.CString(backends) + defer C.free(unsafe.Pointer(cstr)) + C.gdk_set_allowed_backends((*C.gchar)(cstr)) +} + +/* + * GdkAtom + */ + +// Atom is a representation of GDK's GdkAtom. +type Atom uintptr + +// native returns the underlying GdkAtom. +func (v Atom) native() C.GdkAtom { + return C.toGdkAtom(unsafe.Pointer(uintptr(v))) +} + +func (v Atom) Name() string { + c := C.gdk_atom_name(v.native()) + defer C.g_free(C.gpointer(c)) + return C.GoString((*C.char)(c)) +} + +// GdkAtomIntern is a wrapper around gdk_atom_intern +func GdkAtomIntern(atomName string, onlyIfExists bool) Atom { + cstr := C.CString(atomName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_atom_intern((*C.gchar)(cstr), gbool(onlyIfExists)) + return Atom(uintptr(unsafe.Pointer(c))) +} + +/* + * GdkDevice + */ + +// Device is a representation of GDK's GdkDevice. +type Device struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkDevice. +func (v *Device) native() *C.GdkDevice { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkDevice(p) +} + +// Native returns a pointer to the underlying GdkDevice. +func (v *Device) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalDevice(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Device{obj}, nil +} + +func toDevice(d *C.GdkDevice) (*Device, error) { + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(d))} + return &Device{obj}, nil +} + +func (v *Device) GetPosition(screen **Screen, x, y *int) error { + cs := (**C.GdkScreen)(unsafe.Pointer(uintptr(0))) + if screen != nil { + var cval *C.GdkScreen + cs = &cval + } + + cx := (*C.gint)(unsafe.Pointer(uintptr(0))) + if x != nil { + var cval C.gint + cx = &cval + } + + cy := (*C.gint)(unsafe.Pointer(uintptr(0))) + if y != nil { + var cval C.gint + cy = &cval + } + C.gdk_device_get_position(v.native(), cs, cx, cy) + + if cs != (**C.GdkScreen)(unsafe.Pointer(uintptr(0))) { + ms, err := toScreen(*cs) + if err != nil { + return err + } + *screen = ms + } + if cx != (*C.gint)(unsafe.Pointer(uintptr(0))) { + *x = int(*cx) + } + if cy != (*C.gint)(unsafe.Pointer(uintptr(0))) { + *y = int(*cy) + } + return nil +} + +// TODO: +// gdk_device_get_name(). +// gdk_device_get_source(). +// gdk_device_set_mode(). +// gdk_device_get_mode(). +// gdk_device_set_key(). +// gdk_device_get_key(). +// gdk_device_set_axis_use(). +// gdk_device_get_axis_use(). +// gdk_device_get_associated_device(). +// gdk_device_list_slave_devices(). +// gdk_device_get_device_type(). +// gdk_device_get_display(). +// gdk_device_get_has_cursor(). +// gdk_device_get_n_axes(). +// gdk_device_get_n_keys(). +// gdk_device_warp(). +// gdk_device_get_state(). +// gdk_device_get_window_at_position(). +// gdk_device_get_window_at_position_double(). +// gdk_device_get_history(). +// gdk_device_free_history(). +// gdk_device_get_axis(). +// gdk_device_list_axes(). +// gdk_device_get_axis_value(). + +/* + * GdkCursor + */ + +// Cursor is a representation of GdkCursor. +type Cursor struct { + *glib.Object +} + +// CursorNewFromName is a wrapper around gdk_cursor_new_from_name(). +func CursorNewFromName(display *Display, name string) (*Cursor, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_cursor_new_from_name(display.native(), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + + return &Cursor{glib.Take(unsafe.Pointer(c))}, nil +} + +// native returns a pointer to the underlying GdkCursor. +func (v *Cursor) native() *C.GdkCursor { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkCursor(p) +} + +// Native returns a pointer to the underlying GdkCursor. +func (v *Cursor) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalCursor(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Cursor{obj}, nil +} + +/* + * GdkDeviceManager + */ + +// DeviceManager is a representation of GDK's GdkDeviceManager. +type DeviceManager struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkDeviceManager. +func (v *DeviceManager) native() *C.GdkDeviceManager { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkDeviceManager(p) +} + +// Native returns a pointer to the underlying GdkDeviceManager. +func (v *DeviceManager) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalDeviceManager(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &DeviceManager{obj}, nil +} + +// GetDisplay() is a wrapper around gdk_device_manager_get_display(). +func (v *DeviceManager) GetDisplay() (*Display, error) { + c := C.gdk_device_manager_get_display(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Display{glib.Take(unsafe.Pointer(c))}, nil +} + +/* + * GdkDisplay + */ + +// Display is a representation of GDK's GdkDisplay. +type Display struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkDisplay. +func (v *Display) native() *C.GdkDisplay { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkDisplay(p) +} + +// Native returns a pointer to the underlying GdkDisplay. +func (v *Display) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalDisplay(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Display{obj}, nil +} + +func toDisplay(s *C.GdkDisplay) (*Display, error) { + if s == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(s))} + return &Display{obj}, nil +} + +// DisplayOpen is a wrapper around gdk_display_open(). +func DisplayOpen(displayName string) (*Display, error) { + cstr := C.CString(displayName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_display_open((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + + return &Display{glib.Take(unsafe.Pointer(c))}, nil +} + +// DisplayGetDefault is a wrapper around gdk_display_get_default(). +func DisplayGetDefault() (*Display, error) { + c := C.gdk_display_get_default() + if c == nil { + return nil, nilPtrErr + } + + return &Display{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetName is a wrapper around gdk_display_get_name(). +func (v *Display) GetName() (string, error) { + c := C.gdk_display_get_name(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// GetDefaultScreen is a wrapper around gdk_display_get_default_screen(). +func (v *Display) GetDefaultScreen() (*Screen, error) { + c := C.gdk_display_get_default_screen(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Screen{glib.Take(unsafe.Pointer(c))}, nil +} + +// DeviceIsGrabbed is a wrapper around gdk_display_device_is_grabbed(). +func (v *Display) DeviceIsGrabbed(device *Device) bool { + c := C.gdk_display_device_is_grabbed(v.native(), device.native()) + return gobool(c) +} + +// Beep is a wrapper around gdk_display_beep(). +func (v *Display) Beep() { + C.gdk_display_beep(v.native()) +} + +// Sync is a wrapper around gdk_display_sync(). +func (v *Display) Sync() { + C.gdk_display_sync(v.native()) +} + +// Flush is a wrapper around gdk_display_flush(). +func (v *Display) Flush() { + C.gdk_display_flush(v.native()) +} + +// Close is a wrapper around gdk_display_close(). +func (v *Display) Close() { + C.gdk_display_close(v.native()) +} + +// IsClosed is a wrapper around gdk_display_is_closed(). +func (v *Display) IsClosed() bool { + c := C.gdk_display_is_closed(v.native()) + return gobool(c) +} + +// GetEvent is a wrapper around gdk_display_get_event(). +func (v *Display) GetEvent() (*Event, error) { + c := C.gdk_display_get_event(v.native()) + if c == nil { + return nil, nilPtrErr + } + + //The finalizer is not on the glib.Object but on the event. + e := &Event{c} + runtime.SetFinalizer(e, (*Event).free) + return e, nil +} + +// PeekEvent is a wrapper around gdk_display_peek_event(). +func (v *Display) PeekEvent() (*Event, error) { + c := C.gdk_display_peek_event(v.native()) + if c == nil { + return nil, nilPtrErr + } + + //The finalizer is not on the glib.Object but on the event. + e := &Event{c} + runtime.SetFinalizer(e, (*Event).free) + return e, nil +} + +// PutEvent is a wrapper around gdk_display_put_event(). +func (v *Display) PutEvent(event *Event) { + C.gdk_display_put_event(v.native(), event.native()) +} + +// HasPending is a wrapper around gdk_display_has_pending(). +func (v *Display) HasPending() bool { + c := C.gdk_display_has_pending(v.native()) + return gobool(c) +} + +// SetDoubleClickTime is a wrapper around gdk_display_set_double_click_time(). +func (v *Display) SetDoubleClickTime(msec uint) { + C.gdk_display_set_double_click_time(v.native(), C.guint(msec)) +} + +// SetDoubleClickDistance is a wrapper around gdk_display_set_double_click_distance(). +func (v *Display) SetDoubleClickDistance(distance uint) { + C.gdk_display_set_double_click_distance(v.native(), C.guint(distance)) +} + +// SupportsColorCursor is a wrapper around gdk_display_supports_cursor_color(). +func (v *Display) SupportsColorCursor() bool { + c := C.gdk_display_supports_cursor_color(v.native()) + return gobool(c) +} + +// SupportsCursorAlpha is a wrapper around gdk_display_supports_cursor_alpha(). +func (v *Display) SupportsCursorAlpha() bool { + c := C.gdk_display_supports_cursor_alpha(v.native()) + return gobool(c) +} + +// GetDefaultCursorSize is a wrapper around gdk_display_get_default_cursor_size(). +func (v *Display) GetDefaultCursorSize() uint { + c := C.gdk_display_get_default_cursor_size(v.native()) + return uint(c) +} + +// GetMaximalCursorSize is a wrapper around gdk_display_get_maximal_cursor_size(). +func (v *Display) GetMaximalCursorSize() (width, height uint) { + var w, h C.guint + C.gdk_display_get_maximal_cursor_size(v.native(), &w, &h) + return uint(w), uint(h) +} + +// GetDefaultGroup is a wrapper around gdk_display_get_default_group(). +func (v *Display) GetDefaultGroup() (*Window, error) { + c := C.gdk_display_get_default_group(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Window{glib.Take(unsafe.Pointer(c))}, nil +} + +// SupportsSelectionNotification is a wrapper around gdk_display_supports_selection_notification(). +func (v *Display) SupportsSelectionNotification() bool { + c := C.gdk_display_supports_selection_notification(v.native()) + return gobool(c) +} + +// RequestSelectionNotification is a wrapper around gdk_display_request_selection_notification(). +func (v *Display) RequestSelectionNotification(selection Atom) bool { + c := C.gdk_display_request_selection_notification(v.native(), + selection.native()) + return gobool(c) +} + +// SupportsClipboardPersistence is a wrapper around gdk_display_supports_clipboard_persistence(). +func (v *Display) SupportsClipboardPersistence() bool { + c := C.gdk_display_supports_clipboard_persistence(v.native()) + return gobool(c) +} + +// TODO: +// gdk_display_store_clipboard(). +// func (v *Display) StoreClipboard(clipboardWindow *Window, time uint32, targets ...Atom) { +// panic("Not implemented") +// } + +// SupportsShapes is a wrapper around gdk_display_supports_shapes(). +func (v *Display) SupportsShapes() bool { + c := C.gdk_display_supports_shapes(v.native()) + return gobool(c) +} + +// SupportsInputShapes is a wrapper around gdk_display_supports_input_shapes(). +func (v *Display) SupportsInputShapes() bool { + c := C.gdk_display_supports_input_shapes(v.native()) + return gobool(c) +} + +// TODO: +// gdk_display_get_app_launch_context(). +// func (v *Display) GetAppLaunchContext() { +// panic("Not implemented") +// } + +// NotifyStartupComplete is a wrapper around gdk_display_notify_startup_complete(). +func (v *Display) NotifyStartupComplete(startupID string) { + cstr := C.CString(startupID) + defer C.free(unsafe.Pointer(cstr)) + C.gdk_display_notify_startup_complete(v.native(), (*C.gchar)(cstr)) +} + +/* + * GdkDisplayManager + */ +// DisplayManager is a representation of GDK's GdkDisplayManager. +type DisplayManager struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkDisplayManager. +func (v *DisplayManager) native() *C.GdkDisplayManager { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkDisplayManager(p) +} + +// Native returns a pointer to the underlying GdkDisplayManager. +func (v *DisplayManager) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalDisplayManager(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &DisplayManager{obj}, nil +} + +func wrapDisplayManager(obj *glib.Object) *DisplayManager { + if obj == nil { + return nil + } + return &DisplayManager{obj} +} + +// DisplayManagerGet is a wrapper around gdk_display_manager_get(). +func DisplayManagerGet() (*DisplayManager, error) { + c := C.gdk_display_manager_get() + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &DisplayManager{obj}, nil +} + +// GetDefaultDisplay is a wrapper around gdk_display_manager_get_default_display(). +func (v *DisplayManager) GetDefaultDisplay() (*Display, error) { + c := C.gdk_display_manager_get_default_display(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Display{obj}, nil +} + +// SetDefaultDisplay is a wrapper around gdk_display_manager_set_default_display(). +func (v *DisplayManager) SetDefaultDisplay(display *Display) { + C.gdk_display_manager_set_default_display(v.native(), display.native()) +} + +// ListDisplays is a wrapper around gdk_display_manager_list_displays(). +func (v *DisplayManager) ListDisplays() *[]Display { + + clist := C.gdk_display_manager_list_displays(v.native()) + if clist == nil { + return nil + } + dlist := glib.WrapSList(uintptr(unsafe.Pointer(clist))) + defer dlist.Free() + + var displays = make([]Display, 0, dlist.Length()) + for ; dlist.DataRaw() != nil; dlist = dlist.Next() { + d := (*C.GdkDisplay)(dlist.DataRaw()) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(d))} + displays = append(displays, Display{obj}) + } + return &displays +} + +// OpenDisplay is a representation of gdk_display_manager_open_display(). +func (v *DisplayManager) OpenDisplay(name string) (*Display, error) { + cstr := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gdk_display_manager_open_display(v.native(), cstr) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Display{obj}, nil +} + +/* + * GdkKeymap + */ + +type Keymap struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkKeymap. +func (v *Keymap) native() *C.GdkKeymap { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkKeymap(p) +} + +// Native returns a pointer to the underlying GdkKeymap. +func (v *Keymap) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalKeymap(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Keymap{obj}, nil +} + +func wrapKeymap(obj *glib.Object) *Keymap { + return &Keymap{obj} +} + +// GetKeymap is a wrapper around gdk_keymap_get_for_display(). +func (v *Display) GetKeymap() (*Keymap, error) { + c := C.gdk_keymap_get_for_display(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Keymap{obj}, nil +} + +// TranslateKeyboardState is a wrapper around gdk_keymap_translate_keyboard_state(). +func (v *Keymap) TranslateKeyboardState(hardwareKeycode uint, state ModifierType, group int) (bool, *uint, *int, *int, *ModifierType) { + + var cKeyval C.guint + var keyval *uint + var cEffectiveGroup, cLevel C.gint + var effectiveGroup, level *int + var cConsumedModifiers C.GdkModifierType + var consumedModifiers *ModifierType + + c := C.gdk_keymap_translate_keyboard_state( + v.native(), + C.guint(hardwareKeycode), + C.GdkModifierType(state), + C.gint(group), + &cKeyval, + &cEffectiveGroup, + &cLevel, + &cConsumedModifiers, + ) + + if &cKeyval == nil { + keyval = nil + } else { + *keyval = uint(cKeyval) + } + if &cEffectiveGroup == nil { + effectiveGroup = nil + } else { + *effectiveGroup = int(cEffectiveGroup) + } + if &cLevel == nil { + level = nil + } else { + *level = int(cLevel) + } + if &cConsumedModifiers == nil { + consumedModifiers = nil + } else { + *consumedModifiers = ModifierType(cConsumedModifiers) + } + + return gobool(c), keyval, effectiveGroup, level, consumedModifiers +} + +// HaveBidiLayouts is a wrapper around gdk_keymap_have_bidi_layouts(). +func (v *Keymap) HaveBidiLayouts() bool { + return gobool(C.gdk_keymap_have_bidi_layouts(v.native())) +} + +// GetCapsLockState is a wrapper around gdk_keymap_get_caps_lock_state(). +func (v *Keymap) GetCapsLockState() bool { + return gobool(C.gdk_keymap_get_caps_lock_state(v.native())) +} + +// GetNumLockState is a wrapper around gdk_keymap_get_num_lock_state(). +func (v *Keymap) GetNumLockState() bool { + return gobool(C.gdk_keymap_get_num_lock_state(v.native())) +} + +// GetModifierState is a wrapper around gdk_keymap_get_modifier_state(). +func (v *Keymap) GetModifierState() uint { + return uint(C.gdk_keymap_get_modifier_state(v.native())) +} + +// TODO: +// gdk_keymap_get_default(). deprecated since 3.22 +// gdk_keymap_get_direction(). +// gdk_keymap_add_virtual_modifiers(). +// gdk_keymap_map_virtual_modifiers(). +// gdk_keymap_get_modifier_mask(). + +/* + * GdkKeymapKey + */ + +// TODO: +// gdk_keymap_lookup_key(). +// gdk_keymap_get_entries_for_keyval(). +// gdk_keymap_get_entries_for_keycode(). + +/* + * GDK Keyval + */ + +// TODO: +// gdk_keyval_name(). + +// KeyvalFromName() is a wrapper around gdk_keyval_from_name(). +func KeyvalFromName(keyvalName string) uint { + str := (*C.gchar)(C.CString(keyvalName)) + defer C.free(unsafe.Pointer(str)) + return uint(C.gdk_keyval_from_name(str)) +} + +// KeyvalConvertCase is a wrapper around gdk_keyval_convert_case(). +func KeyvalConvertCase(v uint) (lower, upper uint) { + var l, u C.guint + l = 0 + u = 0 + C.gdk_keyval_convert_case(C.guint(v), &l, &u) + return uint(l), uint(u) +} + +// KeyvalIsLower is a wrapper around gdk_keyval_is_lower(). +func KeyvalIsLower(v uint) bool { + return gobool(C.gdk_keyval_is_lower(C.guint(v))) +} + +// KeyvalIsUpper is a wrapper around gdk_keyval_is_upper(). +func KeyvalIsUpper(v uint) bool { + return gobool(C.gdk_keyval_is_upper(C.guint(v))) +} + +// KeyvalToLower is a wrapper around gdk_keyval_to_lower(). +func KeyvalToLower(v uint) uint { + return uint(C.gdk_keyval_to_lower(C.guint(v))) +} + +// KeyvalToUpper is a wrapper around gdk_keyval_to_upper(). +func KeyvalToUpper(v uint) uint { + return uint(C.gdk_keyval_to_upper(C.guint(v))) +} + +// KeyvalToUnicode is a wrapper around gdk_keyval_to_unicode(). +func KeyvalToUnicode(v uint) rune { + return rune(C.gdk_keyval_to_unicode(C.guint(v))) +} + +// UnicodeToKeyval is a wrapper around gdk_unicode_to_keyval(). +func UnicodeToKeyval(v rune) uint { + return uint(C.gdk_unicode_to_keyval(C.guint32(v))) +} + +/* + * GdkDragContext + */ + +// DragContext is a representation of GDK's GdkDragContext. +type DragContext struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkDragContext. +func (v *DragContext) native() *C.GdkDragContext { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkDragContext(p) +} + +// Native returns a pointer to the underlying GdkDragContext. +func (v *DragContext) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalDragContext(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &DragContext{obj}, nil +} + +func (v *DragContext) ListTargets() *glib.List { + clist := C.gdk_drag_context_list_targets(v.native()) + if clist == nil { + return nil + } + return glib.WrapList(uintptr(unsafe.Pointer(clist))) +} + +/* + * GdkEvent + */ + +// Event is a representation of GDK's GdkEvent. +type Event struct { + GdkEvent *C.GdkEvent +} + +// native returns a pointer to the underlying GdkEvent. +func (v *Event) native() *C.GdkEvent { + if v == nil { + return nil + } + return v.GdkEvent +} + +// Native returns a pointer to the underlying GdkEvent. +func (v *Event) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalEvent(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return &Event{(*C.GdkEvent)(unsafe.Pointer(c))}, nil +} + +func (v *Event) free() { + C.gdk_event_free(v.native()) +} + +/* + * GdkEventButton + */ + +// EventButton is a representation of GDK's GdkEventButton. +type EventButton struct { + *Event +} + +func EventButtonNew() *EventButton { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventButton{})) + ev := Event{ee} + return &EventButton{&ev} +} + +// EventButtonNewFromEvent returns an EventButton from an Event. +// +// Using widget.Connect() for a key related signal such as +// "button-press-event" results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventButton. EventButtonNewFromEvent provides a means of creating +// an EventKey from the Event. +func EventButtonNewFromEvent(event *Event) *EventButton { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventButton{&ev} +} + +// Native returns a pointer to the underlying GdkEventButton. +func (v *EventButton) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventButton) native() *C.GdkEventButton { + return (*C.GdkEventButton)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventButton) X() float64 { + c := v.native().x + return float64(c) +} + +func (v *EventButton) Y() float64 { + c := v.native().y + return float64(c) +} + +// XRoot returns the x coordinate of the pointer relative to the root of the screen. +func (v *EventButton) XRoot() float64 { + c := v.native().x_root + return float64(c) +} + +// YRoot returns the y coordinate of the pointer relative to the root of the screen. +func (v *EventButton) YRoot() float64 { + c := v.native().y_root + return float64(c) +} + +func (v *EventButton) Button() Button { + c := v.native().button + return Button(c) +} + +func (v *EventButton) State() uint { + c := v.native().state + return uint(c) +} + +// Time returns the time of the event in milliseconds. +func (v *EventButton) Time() uint32 { + c := v.native().time + return uint32(c) +} + +func (v *EventButton) Type() EventType { + c := v.native()._type + return EventType(c) +} + +func (v *EventButton) MotionVal() (float64, float64) { + x := v.native().x + y := v.native().y + return float64(x), float64(y) +} + +func (v *EventButton) MotionValRoot() (float64, float64) { + x := v.native().x_root + y := v.native().y_root + return float64(x), float64(y) +} + +/* + * GdkEventKey + */ + +// EventKey is a representation of GDK's GdkEventKey. +type EventKey struct { + *Event +} + +func EventKeyNew() *EventKey { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventKey{})) + ev := Event{ee} + return &EventKey{&ev} +} + +// EventKeyNewFromEvent returns an EventKey from an Event. +// +// Using widget.Connect() for a key related signal such as +// "key-press-event" results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventKey. EventKeyNewFromEvent provides a means of creating +// an EventKey from the Event. +func EventKeyNewFromEvent(event *Event) *EventKey { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventKey{&ev} +} + +// Native returns a pointer to the underlying GdkEventKey. +func (v *EventKey) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventKey) native() *C.GdkEventKey { + return (*C.GdkEventKey)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventKey) KeyVal() uint { + c := v.native().keyval + return uint(c) +} + +func (v *EventKey) HardwareKeyCode() uint16 { + c := v.native().hardware_keycode + return uint16(c) +} + +func (v *EventKey) Type() EventType { + c := v.native()._type + return EventType(c) +} + +func (v *EventKey) State() uint { + c := v.native().state + return uint(c) +} + +/* + * GdkEventMotion + */ + +type EventMotion struct { + *Event +} + +func EventMotionNew() *EventMotion { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventMotion{})) + ev := Event{ee} + return &EventMotion{&ev} +} + +// EventMotionNewFromEvent returns an EventMotion from an Event. +// +// Using widget.Connect() for a key related signal such as +// "button-press-event" results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventMotion. EventMotionNewFromEvent provides a means of creating +// an EventKey from the Event. +func EventMotionNewFromEvent(event *Event) *EventMotion { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventMotion{&ev} +} + +// Native returns a pointer to the underlying GdkEventMotion. +func (v *EventMotion) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventMotion) native() *C.GdkEventMotion { + return (*C.GdkEventMotion)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventMotion) MotionVal() (float64, float64) { + x := v.native().x + y := v.native().y + return float64(x), float64(y) +} + +func (v *EventMotion) MotionValRoot() (float64, float64) { + x := v.native().x_root + y := v.native().y_root + return float64(x), float64(y) +} + +// Time returns the time of the event in milliseconds. +func (v *EventMotion) Time() uint32 { + c := v.native().time + return uint32(c) +} + +func (v *EventMotion) Type() EventType { + c := v.native()._type + return EventType(c) +} + +// A bit-mask representing the state of the modifier keys (e.g. Control, Shift +// and Alt) and the pointer buttons. See gdk.ModifierType constants. +func (v *EventMotion) State() ModifierType { + c := v.native().state + return ModifierType(c) +} + +/* + * GdkEventCrossing + */ + +// EventCrossing is a representation of GDK's GdkEventCrossing. +type EventCrossing struct { + *Event +} + +func EventCrossingNew() *EventCrossing { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventCrossing{})) + ev := Event{ee} + return &EventCrossing{&ev} +} + +// EventCrossingNewFromEvent returns an EventCrossing from an Event. +// +// Using widget.Connect() for a key related signal such as +// "enter-notify-event" results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventCrossing. EventCrossingNewFromEvent provides a means of creating +// an EventCrossing from the Event. +func EventCrossingNewFromEvent(event *Event) *EventCrossing { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventCrossing{&ev} +} + +// Native returns a pointer to the underlying GdkEventCrossing. +func (v *EventCrossing) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventCrossing) native() *C.GdkEventCrossing { + return (*C.GdkEventCrossing)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventCrossing) X() float64 { + c := v.native().x + return float64(c) +} + +func (v *EventCrossing) Y() float64 { + c := v.native().y + return float64(c) +} + +// XRoot returns the x coordinate of the pointer relative to the root of the screen. +func (v *EventCrossing) XRoot() float64 { + c := v.native().x_root + return float64(c) +} + +// YRoot returns the y coordinate of the pointer relative to the root of the screen. +func (v *EventCrossing) YRoot() float64 { + c := v.native().y_root + return float64(c) +} + +func (v *EventCrossing) State() uint { + c := v.native().state + return uint(c) +} + +// Time returns the time of the event in milliseconds. +func (v *EventCrossing) Time() uint32 { + c := v.native().time + return uint32(c) +} + +func (v *EventCrossing) Type() EventType { + c := v.native()._type + return EventType(c) +} + +func (v *EventCrossing) MotionVal() (float64, float64) { + x := v.native().x + y := v.native().y + return float64(x), float64(y) +} + +func (v *EventCrossing) MotionValRoot() (float64, float64) { + x := v.native().x_root + y := v.native().y_root + return float64(x), float64(y) +} + +func (v *EventCrossing) Mode() CrossingMode { + c := v.native().mode + return CrossingMode(c) +} + +func (v *EventCrossing) Detail() NotifyType { + c := v.native().detail + return NotifyType(c) +} + +func (v *EventCrossing) Focus() bool { + c := v.native().focus + return gobool(c) +} + +/* + * GdkEventScroll + */ + +// EventScroll is a representation of GDK's GdkEventScroll. +type EventScroll struct { + *Event +} + +func EventScrollNew() *EventScroll { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventScroll{})) + ev := Event{ee} + return &EventScroll{&ev} +} + +// EventScrollNewFromEvent returns an EventScroll from an Event. +// +// Using widget.Connect() for a key related signal such as +// "button-press-event" results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventScroll. EventScrollNewFromEvent provides a means of creating +// an EventKey from the Event. +func EventScrollNewFromEvent(event *Event) *EventScroll { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventScroll{&ev} +} + +// Native returns a pointer to the underlying GdkEventScroll. +func (v *EventScroll) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventScroll) native() *C.GdkEventScroll { + return (*C.GdkEventScroll)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventScroll) DeltaX() float64 { + return float64(v.native().delta_x) +} + +func (v *EventScroll) DeltaY() float64 { + return float64(v.native().delta_y) +} + +func (v *EventScroll) X() float64 { + return float64(v.native().x) +} + +func (v *EventScroll) Y() float64 { + return float64(v.native().y) +} + +func (v *EventScroll) Type() EventType { + c := v.native()._type + return EventType(c) +} + +func (v *EventScroll) Direction() ScrollDirection { + c := v.native().direction + return ScrollDirection(c) +} + +// A bit-mask representing the state of the modifier keys (e.g. Control, Shift +// and Alt) and the pointer buttons. See gdk.ModifierType constants. +func (v *EventScroll) State() ModifierType { + c := v.native().state + return ModifierType(c) +} + +/* + * GdkEventWindowState + */ + +// EventWindowState is a representation of GDK's GdkEventWindowState. +type EventWindowState struct { + *Event +} + +func EventWindowStateNew() *EventWindowState { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventWindowState{})) + ev := Event{ee} + return &EventWindowState{&ev} +} + +// EventWindowStateNewFromEvent returns an EventWindowState from an Event. +// +// Using widget.Connect() for the +// "window-state-event" signal results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventWindowState. EventWindowStateNewFromEvent provides a means of creating +// an EventWindowState from the Event. +func EventWindowStateNewFromEvent(event *Event) *EventWindowState { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventWindowState{&ev} +} + +// Native returns a pointer to the underlying GdkEventWindowState. +func (v *EventWindowState) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventWindowState) native() *C.GdkEventWindowState { + return (*C.GdkEventWindowState)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventWindowState) Type() EventType { + c := v.native()._type + return EventType(c) +} + +func (v *EventWindowState) ChangedMask() WindowState { + c := v.native().changed_mask + return WindowState(c) +} + +func (v *EventWindowState) NewWindowState() WindowState { + c := v.native().new_window_state + return WindowState(c) +} + +/* + * GdkEventConfigure + */ + +// EventConfigure is a representation of GDK's GdkEventConfigure. +type EventConfigure struct { + *Event +} + +func EventConfigureNew() *EventConfigure { + ee := (*C.GdkEvent)(unsafe.Pointer(&C.GdkEventConfigure{})) + ev := Event{ee} + return &EventConfigure{&ev} +} + +// EventConfigureNewFromEvent returns an EventConfigure from an Event. +// +// Using widget.Connect() for the +// "configure-event" signal results in a *Event being passed as +// the callback's second argument. The argument is actually a +// *EventConfigure. EventConfigureNewFromEvent provides a means of creating +// an EventConfigure from the Event. +func EventConfigureNewFromEvent(event *Event) *EventConfigure { + ee := (*C.GdkEvent)(unsafe.Pointer(event.native())) + ev := Event{ee} + return &EventConfigure{&ev} +} + +// Native returns a pointer to the underlying GdkEventConfigure. +func (v *EventConfigure) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EventConfigure) native() *C.GdkEventConfigure { + return (*C.GdkEventConfigure)(unsafe.Pointer(v.Event.native())) +} + +func (v *EventConfigure) Type() EventType { + c := v.native()._type + return EventType(c) +} + +func (v *EventConfigure) X() int { + c := v.native().x + return int(c) +} + +func (v *EventConfigure) Y() int { + c := v.native().y + return int(c) +} + +func (v *EventConfigure) Width() int { + c := v.native().width + return int(c) +} + +func (v *EventConfigure) Height() int { + c := v.native().height + return int(c) +} + +/* + * GdkGravity + */ + +type Gravity int + +const ( + GDK_GRAVITY_NORTH_WEST = C.GDK_GRAVITY_NORTH_WEST + GDK_GRAVITY_NORTH = C.GDK_GRAVITY_NORTH + GDK_GRAVITY_NORTH_EAST = C.GDK_GRAVITY_NORTH_EAST + GDK_GRAVITY_WEST = C.GDK_GRAVITY_WEST + GDK_GRAVITY_CENTER = C.GDK_GRAVITY_CENTER + GDK_GRAVITY_EAST = C.GDK_GRAVITY_EAST + GDK_GRAVITY_SOUTH_WEST = C.GDK_GRAVITY_SOUTH_WEST + GDK_GRAVITY_SOUTH = C.GDK_GRAVITY_SOUTH + GDK_GRAVITY_SOUTH_EAST = C.GDK_GRAVITY_SOUTH_EAST + GDK_GRAVITY_STATIC = C.GDK_GRAVITY_STATIC +) + +func marshalGravity(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Gravity(c), nil +} + +/* + * GdkRGBA + */ +// To create a GdkRGBA you have to use NewRGBA function. +type RGBA struct { + rgba *C.GdkRGBA +} + +func marshalRGBA(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return WrapRGBA(unsafe.Pointer(c)), nil +} + +func WrapRGBA(p unsafe.Pointer) *RGBA { + return wrapRGBA((*C.GdkRGBA)(p)) +} + +func wrapRGBA(cRgba *C.GdkRGBA) *RGBA { + if cRgba == nil { + return nil + } + return &RGBA{cRgba} +} + +func NewRGBA(values ...float64) *RGBA { + cRgba := new(C.GdkRGBA) + for i, value := range values { + switch i { + case 0: + cRgba.red = C.gdouble(value) + case 1: + cRgba.green = C.gdouble(value) + case 2: + cRgba.blue = C.gdouble(value) + case 3: + cRgba.alpha = C.gdouble(value) + } + } + return wrapRGBA(cRgba) +} + +func (c *RGBA) Floats() []float64 { + return []float64{ + float64(c.rgba.red), + float64(c.rgba.green), + float64(c.rgba.blue), + float64(c.rgba.alpha)} +} + +func (c *RGBA) Native() uintptr { + return uintptr(unsafe.Pointer(c.rgba)) +} + +// SetColors sets all colors values in the RGBA. +func (c *RGBA) SetColors(r, g, b, a float64) { + c.rgba.red = C.gdouble(r) + c.rgba.green = C.gdouble(g) + c.rgba.blue = C.gdouble(b) + c.rgba.alpha = C.gdouble(a) +} + +/* + * The following methods (Get/Set) are made for + * more convenient use of the GdkRGBA object + */ +// GetRed get red value from the RGBA. +func (c *RGBA) GetRed() float64 { + return float64(c.rgba.red) +} + +// GetGreen get green value from the RGBA. +func (c *RGBA) GetGreen() float64 { + return float64(c.rgba.green) +} + +// GetBlue get blue value from the RGBA. +func (c *RGBA) GetBlue() float64 { + return float64(c.rgba.blue) +} + +// GetAlpha get alpha value from the RGBA. +func (c *RGBA) GetAlpha() float64 { + return float64(c.rgba.alpha) +} + +// SetRed set red value in the RGBA. +func (c *RGBA) SetRed(red float64) { + c.rgba.red = C.gdouble(red) +} + +// SetGreen set green value in the RGBA. +func (c *RGBA) SetGreen(green float64) { + c.rgba.green = C.gdouble(green) +} + +// SetBlue set blue value in the RGBA. +func (c *RGBA) SetBlue(blue float64) { + c.rgba.blue = C.gdouble(blue) +} + +// SetAlpha set alpha value in the RGBA. +func (c *RGBA) SetAlpha(alpha float64) { + c.rgba.alpha = C.gdouble(alpha) +} + +// Parse is a representation of gdk_rgba_parse(). +func (c *RGBA) Parse(spec string) bool { + cstr := (*C.gchar)(C.CString(spec)) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.gdk_rgba_parse(c.rgba, cstr)) +} + +// String is a representation of gdk_rgba_to_string(). +func (c *RGBA) String() string { + return C.GoString((*C.char)(C.gdk_rgba_to_string(c.rgba))) +} + +// free is a representation of gdk_rgba_free(). +func (c *RGBA) free() { + C.gdk_rgba_free(c.rgba) +} + +// Copy is a representation of gdk_rgba_copy(). +func (c *RGBA) Copy() (*RGBA, error) { + cRgba := C.gdk_rgba_copy(c.rgba) + + if c == nil { + return nil, nilPtrErr + } + obj := wrapRGBA(cRgba) + + runtime.SetFinalizer(obj, (*RGBA).free) + return obj, nil +} + +// Equal is a representation of gdk_rgba_equal(). +func (c *RGBA) Equal(rgba *RGBA) bool { + return gobool(C.gdk_rgba_equal( + C.gconstpointer(c.rgba), + C.gconstpointer(rgba.rgba))) +} + +// Hash is a representation of gdk_rgba_hash(). +func (c *RGBA) Hash() uint { + return uint(C.gdk_rgba_hash(C.gconstpointer(c.rgba))) +} + +/* + * GdkPoint + */ + +// Point is a representation of GDK's GdkPoint type. +type Point struct { + GdkPoint C.GdkPoint +} + +func WrapPoint(p uintptr) *Point { + return wrapPoint((*C.GdkPoint)(unsafe.Pointer(p))) +} + +func wrapPoint(obj *C.GdkPoint) *Point { + if obj == nil { + return nil + } + return &Point{*obj} +} + +// Native() returns a pointer to the underlying GdkPoint. +func (v *Point) native() *C.GdkPoint { + return &v.GdkPoint +} + +// PointNew helper function to create a GdkPoint +func PointNew(x, y int) *Point { + var p C.GdkPoint + p.x = C.gint(x) + p.y = C.gint(y) + return &Point{p} +} + +// GetPointInt helper function to get GdkPoint values +func (v *Point) GetPointInt() (x, y int) { + return int(v.native().x), int(v.native().y) +} + +// SetPointInt helper function to set GdkPoint values +func (v *Point) SetPointInt(x, y int) { + v.native().x = C.gint(x) + v.native().y = C.gint(y) +} + +// GetX returns x field of the underlying GdkPoint. +func (v *Point) GetX() int { + return int(v.native().x) +} + +// SetX sets x field of the underlying GdkPoint. +func (v *Point) SetX(x int) { + v.native().x = C.gint(x) +} + +// GetY returns y field of the underlying GdkPoint. +func (v *Point) GetY() int { + return int(v.native().y) +} + +// SetY sets y field of the underlying GdkPoint. +func (v *Point) SetY(y int) { + v.native().y = C.gint(y) +} + +/* + * GdkRectangle + */ + +// Rectangle is a representation of GDK's GdkRectangle type. +type Rectangle struct { + GdkRectangle C.GdkRectangle +} + +func WrapRectangle(p uintptr) *Rectangle { + return wrapRectangle((*C.GdkRectangle)(unsafe.Pointer(p))) +} + +func wrapRectangle(obj *C.GdkRectangle) *Rectangle { + if obj == nil { + return nil + } + return &Rectangle{*obj} +} + +// Native() returns a pointer to the underlying GdkRectangle. +func (r *Rectangle) native() *C.GdkRectangle { + return &r.GdkRectangle +} + +// RectangleIntersect is a wrapper around gdk_rectangle_intersect(). +func (v *Rectangle) RectangleIntersect(rect *Rectangle) (*Rectangle, bool) { + r := new(C.GdkRectangle) + c := C.gdk_rectangle_intersect(v.native(), rect.native(), r) + return wrapRectangle(r), gobool(c) +} + +// RectangleUnion is a wrapper around gdk_rectangle_union(). +func (v *Rectangle) RectangleUnion(rect *Rectangle) *Rectangle { + r := new(C.GdkRectangle) + C.gdk_rectangle_union(v.native(), rect.native(), r) + return wrapRectangle(r) +} + +// RectangleNew helper function to create a GdkRectanlge +func RectangleNew(x, y, width, height int) *Rectangle { + var r C.GdkRectangle + r.x = C.int(x) + r.y = C.int(y) + r.width = C.int(width) + r.height = C.int(height) + return &Rectangle{r} +} + +// SetRectangleInt helper function to set GdkRectanlge values +func (v *Rectangle) SetRectangleInt(x, y, width, height int) { + v.native().x = C.int(x) + v.native().y = C.int(y) + v.native().width = C.int(width) + v.native().height = C.int(height) +} + +// GetRectangleInt helper function to get GdkRectanlge values +func (v *Rectangle) GetRectangleInt() (x, y, width, height int) { + return int(v.native().x), + int(v.native().y), + int(v.native().width), + int(v.native().height) +} + +// GetX returns x field of the underlying GdkRectangle. +func (r *Rectangle) GetX() int { + return int(r.native().x) +} + +// SetX sets x field of the underlying GdkRectangle. +func (r *Rectangle) SetX(x int) { + r.native().x = C.int(x) +} + +// GetY returns y field of the underlying GdkRectangle. +func (r *Rectangle) GetY() int { + return int(r.native().y) +} + +// SetY sets y field of the underlying GdkRectangle. +func (r *Rectangle) SetY(y int) { + r.native().y = C.int(y) +} + +// GetWidth returns width field of the underlying GdkRectangle. +func (r *Rectangle) GetWidth() int { + return int(r.native().width) +} + +// SetWidth sets width field of the underlying GdkRectangle. +func (r *Rectangle) SetWidth(width int) { + r.native().width = C.int(width) +} + +// GetHeight returns height field of the underlying GdkRectangle. +func (r *Rectangle) GetHeight() int { + return int(r.native().height) +} + +// SetHeight sets height field of the underlying GdkRectangle. +func (r *Rectangle) SetHeight(height int) { + r.native().height = C.int(height) +} + +/* + * GdkGeometry + */ + +type Geometry struct { + GdkGeometry C.GdkGeometry +} + +func WrapGeometry(p uintptr) *Geometry { + return wrapGeometry((*C.GdkGeometry)(unsafe.Pointer(p))) +} + +func wrapGeometry(obj *C.GdkGeometry) *Geometry { + if obj == nil { + return nil + } + return &Geometry{*obj} +} + +// native returns a pointer to the underlying GdkGeometry. +func (r *Geometry) native() *C.GdkGeometry { + return &r.GdkGeometry +} + +// GetMinWidth returns min_width field of the underlying GdkGeometry. +func (r *Geometry) GetMinWidth() int { + return int(r.native().min_width) +} + +// SetMinWidth sets min_width field of the underlying GdkGeometry. +func (r *Geometry) SetMinWidth(minWidth int) { + r.native().min_width = C.gint(minWidth) +} + +// GetMinHeight returns min_height field of the underlying GdkGeometry. +func (r *Geometry) GetMinHeight() int { + return int(r.native().min_height) +} + +// SetMinHeight sets min_height field of the underlying GdkGeometry. +func (r *Geometry) SetMinHeight(minHeight int) { + r.native().min_height = C.gint(minHeight) +} + +// GetMaxWidth returns max_width field of the underlying GdkGeometry. +func (r *Geometry) GetMaxWidth() int { + return int(r.native().max_width) +} + +// SetMaxWidth sets max_width field of the underlying GdkGeometry. +func (r *Geometry) SetMaxWidth(maxWidth int) { + r.native().max_width = C.gint(maxWidth) +} + +// GetMaxHeight returns max_height field of the underlying GdkGeometry. +func (r *Geometry) GetMaxHeight() int { + return int(r.native().max_height) +} + +// SetMaxHeight sets max_height field of the underlying GdkGeometry. +func (r *Geometry) SetMaxHeight(maxHeight int) { + r.native().max_height = C.gint(maxHeight) +} + +// GetBaseWidth returns base_width field of the underlying GdkGeometry. +func (r *Geometry) GetBaseWidth() int { + return int(r.native().base_width) +} + +// SetBaseWidth sets base_width field of the underlying GdkGeometry. +func (r *Geometry) SetBaseWidth(baseWidth int) { + r.native().base_width = C.gint(baseWidth) +} + +// GetBaseHeight returns base_height field of the underlying GdkGeometry. +func (r *Geometry) GetBaseHeight() int { + return int(r.native().base_height) +} + +// SetBaseHeight sets base_height field of the underlying GdkGeometry. +func (r *Geometry) SetBaseHeight(baseHeight int) { + r.native().base_height = C.gint(baseHeight) +} + +// GetWidthInc returns width_inc field of the underlying GdkGeometry. +func (r *Geometry) GetWidthInc() int { + return int(r.native().width_inc) +} + +// SetWidthInc sets width_inc field of the underlying GdkGeometry. +func (r *Geometry) SetWidthInc(widthInc int) { + r.native().width_inc = C.gint(widthInc) +} + +// GetHeightInc returns height_inc field of the underlying GdkGeometry. +func (r *Geometry) GetHeightInc() int { + return int(r.native().height_inc) +} + +// SetHeightInc sets height_inc field of the underlying GdkGeometry. +func (r *Geometry) SetHeightInc(heightInc int) { + r.native().height_inc = C.gint(heightInc) +} + +// GetMinAspect returns min_aspect field of the underlying GdkGeometry. +func (r *Geometry) GetMinAspect() float64 { + return float64(r.native().min_aspect) +} + +// SetMinAspect sets min_aspect field of the underlying GdkGeometry. +func (r *Geometry) SetMinAspect(minAspect float64) { + r.native().min_aspect = C.gdouble(minAspect) +} + +// GetMaxAspect returns max_aspect field of the underlying GdkGeometry. +func (r *Geometry) GetMaxAspect() float64 { + return float64(r.native().max_aspect) +} + +// SetMaxAspect sets max_aspect field of the underlying GdkGeometry. +func (r *Geometry) SetMaxAspect(maxAspect float64) { + r.native().max_aspect = C.gdouble(maxAspect) +} + +// GetWinGravity returns win_gravity field of the underlying GdkGeometry. +func (r *Geometry) GetWinGravity() Gravity { + return Gravity(r.native().win_gravity) +} + +// SetWinGravity sets win_gravity field of the underlying GdkGeometry. +func (r *Geometry) SetWinGravity(winGravity Gravity) { + r.native().win_gravity = C.GdkGravity(winGravity) +} + +/* + * GdkVisual + */ + +// Visual is a representation of GDK's GdkVisual. +type Visual struct { + *glib.Object +} + +func (v *Visual) native() *C.GdkVisual { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkVisual(p) +} + +func (v *Visual) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalVisual(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Visual{obj}, nil +} + +// GetBluePixelDetails is a wrapper around gdk_visual_get_blue_pixel_details(). +func (v *Visual) GetBluePixelDetails() (*uint32, *int, *int) { + var ( + m *uint32 = nil + s, p *int = nil, nil + mask C.guint32 + shift, precision C.gint + ) + C.gdk_visual_get_blue_pixel_details(v.native(), &mask, &shift, &precision) + if &mask != nil { + m = new(uint32) + *m = uint32(mask) + } + if &shift != nil { + s = new(int) + *s = int(shift) + } + if &precision != nil { + p = new(int) + *p = int(precision) + } + return m, s, p +} + +// GetDepth is a wrapper around gdk_visual_get_depth(). +func (v *Visual) GetDepth() int { + return int(C.gdk_visual_get_depth(v.native())) +} + +// GetGreenPixelDetails is a wrapper around gdk_visual_get_green_pixel_details(). +func (v *Visual) GetGreenPixelDetails() (*uint32, *int, *int) { + var ( + m *uint32 = nil + s, p *int = nil, nil + mask C.guint32 + shift, precision C.gint + ) + C.gdk_visual_get_green_pixel_details(v.native(), &mask, &shift, &precision) + if &mask != nil { + m = new(uint32) + *m = uint32(mask) + } + if &shift != nil { + s = new(int) + *s = int(shift) + } + if &precision != nil { + p = new(int) + *p = int(precision) + } + return m, s, p +} + +// GetRedPixelDetails is a wrapper around gdk_visual_get_red_pixel_details(). +func (v *Visual) GetRedPixelDetails() (*uint32, *int, *int) { + var ( + m *uint32 = nil + s, p *int = nil, nil + mask C.guint32 + shift, precision C.gint + ) + C.gdk_visual_get_red_pixel_details(v.native(), &mask, &shift, &precision) + if &mask != nil { + m = new(uint32) + *m = uint32(mask) + } + if &shift != nil { + s = new(int) + *s = int(shift) + } + if &precision != nil { + p = new(int) + *p = int(precision) + } + return m, s, p +} + +// GetVisualType is a wrapper around gdk_visual_get_visual_type(). +func (v *Visual) GetVisualType() VisualType { + return VisualType(C.gdk_visual_get_visual_type(v.native())) +} + +// GetScreen is a wrapper around gdk_visual_get_screen(). +func (v *Visual) GetScreen() (*Screen, error) { + return toScreen(C.gdk_visual_get_screen(v.native())) +} + +/* + * GdkWindow + */ + +// Window is a representation of GDK's GdkWindow. +type Window struct { + *glib.Object +} + +// SetCursor is a wrapper around gdk_window_set_cursor(). +func (v *Window) SetCursor(cursor *Cursor) { + C.gdk_window_set_cursor(v.native(), cursor.native()) +} + +// native returns a pointer to the underlying GdkWindow. +func (v *Window) native() *C.GdkWindow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkWindow(p) +} + +// Native returns a pointer to the underlying GdkWindow. +func (v *Window) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +// WindowGetWidth is a wrapper around gdk_window_get_width() +func (v *Window) WindowGetWidth() (width int) { + return int(C.gdk_window_get_width(v.native())) +} + +// WindowGetHeight is a wrapper around gdk_window_get_height() +func (v *Window) WindowGetHeight() (height int) { + return int(C.gdk_window_get_height(v.native())) +} + +// CreateSimilarSurface is a wrapper around gdk_window_create_similar_surface(). +func (v *Window) CreateSimilarSurface(content cairo.Content, w, h int) (*cairo.Surface, error) { + surface := C.gdk_window_create_similar_surface(v.native(), C.cairo_content_t(content), C.gint(w), C.gint(h)) + + status := cairo.Status(C.cairo_surface_status(surface)) + if status != cairo.STATUS_SUCCESS { + return nil, cairo.ErrorStatus(status) + } + + return cairo.NewSurface(uintptr(unsafe.Pointer(surface)), false), nil +} + +//PixbufGetFromWindow is a wrapper around gdk_pixbuf_get_from_window() +func (v *Window) PixbufGetFromWindow(x, y, w, h int) (*Pixbuf, error) { + c := C.gdk_pixbuf_get_from_window(v.native(), C.gint(x), C.gint(y), C.gint(w), C.gint(h)) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// GetDevicePosition is a wrapper around gdk_window_get_device_position() +func (v *Window) GetDevicePosition(d *Device) (*Window, int, int, ModifierType) { + var x C.gint + var y C.gint + var mt C.GdkModifierType + underneathWindow := C.gdk_window_get_device_position(v.native(), d.native(), &x, &y, &mt) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(underneathWindow))} + rw := &Window{obj} + runtime.SetFinalizer(rw, func(_ interface{}) { obj.Unref() }) + return rw, int(x), int(y), ModifierType(mt) +} + +func PixbufGetFromSurface(surface *cairo.Surface, src_x, src_y, width, height int) (*Pixbuf, error) { + c := C.gdk_pixbuf_get_from_surface((*C.cairo_surface_t)(unsafe.Pointer(surface.Native())), C.gint(src_x), C.gint(src_y), C.gint(width), C.gint(height)) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +func marshalWindow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Window{obj}, nil +} + +func toWindow(s *C.GdkWindow) (*Window, error) { + if s == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(s))} + return &Window{obj}, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk.go.h b/vendor/github.com/gotk3/gotk3/gdk/gdk.go.h new file mode 100644 index 0000000..cfa1a34 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk.go.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +// Type Casting +static GdkAtom toGdkAtom(void *p) { return ((GdkAtom)p); } + +static GdkDevice *toGdkDevice(void *p) { return (GDK_DEVICE(p)); } + +static GdkCursor *toGdkCursor(void *p) { return (GDK_CURSOR(p)); } + +static GdkDeviceManager *toGdkDeviceManager(void *p) { + return (GDK_DEVICE_MANAGER(p)); +} + +static GdkDisplay *toGdkDisplay(void *p) { return (GDK_DISPLAY(p)); } + +static GdkDisplayManager *toGdkDisplayManager(void *p) { return (GDK_DISPLAY_MANAGER(p)); } + +static GdkKeymap *toGdkKeymap(void *p) { return (GDK_KEYMAP(p)); } + +static GdkDragContext *toGdkDragContext(void *p) { + return (GDK_DRAG_CONTEXT(p)); +} + +static GdkScreen *toGdkScreen(void *p) { return (GDK_SCREEN(p)); } + +static GdkVisual *toGdkVisual(void *p) { return (GDK_VISUAL(p)); } + +static GdkWindow *toGdkWindow(void *p) { return (GDK_WINDOW(p)); } + +static inline gchar **next_gcharptr(gchar **s) { return (s + 1); } diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_10.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_10.go new file mode 100644 index 0000000..a969098 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_10.go @@ -0,0 +1,33 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrappers for symbols deprecated beginning with GTK 3.10, +// and should only be included in a build targeted intended to target GTK +// 3.8 or earlier. To target an earlier build build, use the build tag +// gtk_MAJOR_MINOR. For example, to target GTK 3.8, run +// 'go build -tags gtk_3_8'. +// +build gtk_3_6 gtk_3_8 gtk_deprecated + +package gdk + +// #include +import "C" + +// GetNScreens is a wrapper around gdk_display_get_n_screens(). +func (v *Display) GetNScreens() int { + c := C.gdk_display_get_n_screens(v.native()) + return int(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go new file mode 100644 index 0000000..091d015 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_16.go @@ -0,0 +1,12 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_deprecated + +package gdk + +// #include +import "C" + +// SupportsComposite() is a wrapper around gdk_display_supports_composite(). +func (v *Display) SupportsComposite() bool { + c := C.gdk_display_supports_composite(v.native()) + return gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_20.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_20.go new file mode 100644 index 0000000..07fc74a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_20.go @@ -0,0 +1,79 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_deprecated + +package gdk + +// #include +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// Grab() is a wrapper around gdk_device_grab(). +func (v *Device) Grab(w *Window, ownership GrabOwnership, owner_events bool, event_mask EventMask, cursor *Cursor, time uint32) GrabStatus { + ret := C.gdk_device_grab( + v.native(), + w.native(), + C.GdkGrabOwnership(ownership), + gbool(owner_events), + C.GdkEventMask(event_mask), + cursor.native(), + C.guint32(time), + ) + return GrabStatus(ret) +} + +// GetClientPointer() is a wrapper around gdk_device_manager_get_client_pointer(). +func (v *DeviceManager) GetClientPointer() (*Device, error) { + c := C.gdk_device_manager_get_client_pointer(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Device{glib.Take(unsafe.Pointer(c))}, nil +} + +// ListDevices() is a wrapper around gdk_device_manager_list_devices(). +func (v *DeviceManager) ListDevices(tp DeviceType) *glib.List { + clist := C.gdk_device_manager_list_devices(v.native(), C.GdkDeviceType(tp)) + if clist == nil { + return nil + } + + //TODO: WrapList should set the finalizer + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return &Device{&glib.Object{glib.ToGObject(ptr)}} + }) + runtime.SetFinalizer(glist, func(glist *glib.List) { + glist.Free() + }) + return glist +} + +// Ungrab() is a wrapper around gdk_device_ungrab(). +func (v *Device) Ungrab(time uint32) { + C.gdk_device_ungrab(v.native(), C.guint32(time)) +} + +// GetDeviceManager() is a wrapper around gdk_display_get_device_manager(). +func (v *Display) GetDeviceManager() (*DeviceManager, error) { + c := C.gdk_display_get_device_manager(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &DeviceManager{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetScreen() is a wrapper around gdk_display_get_screen(). +func (v *Display) GetScreen(screenNum int) (*Screen, error) { + c := C.gdk_display_get_screen(v.native(), C.gint(screenNum)) + if c == nil { + return nil, nilPtrErr + } + + return &Screen{glib.Take(unsafe.Pointer(c))}, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_22.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_22.go new file mode 100644 index 0000000..fabcaf6 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_deprecated_since_3_22.go @@ -0,0 +1,113 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_3_20 gtk_deprecated + +package gdk + +// #include +import "C" + +/* + * Constants + */ + +// TODO: +// GdkByteOrder + +/* + * GdkScreen + */ + +// GetActiveWindow is a wrapper around gdk_screen_get_active_window(). +func (v *Screen) GetActiveWindow() (*Window, error) { + return toWindow(C.gdk_screen_get_active_window(v.native())) +} + +// GetHeight is a wrapper around gdk_screen_get_height(). +func (v *Screen) GetHeight() int { + c := C.gdk_screen_get_height(v.native()) + return int(c) +} + +// GetHeightMM is a wrapper around gdk_screen_get_height_mm(). +func (v *Screen) GetHeightMM() int { + return int(C.gdk_screen_get_height_mm(v.native())) +} + +// GetMonitorAtPoint is a wrapper around gdk_screen_get_monitor_at_point(). +func (v *Screen) GetMonitorAtPoint(x, y int) int { + return int(C.gdk_screen_get_monitor_at_point(v.native(), C.gint(x), C.gint(y))) +} + +// GetMonitorAtWindow is a wrapper around gdk_screen_get_monitor_at_window(). +func (v *Screen) GetMonitorAtWindow(w *Window) int { + return int(C.gdk_screen_get_monitor_at_window(v.native(), w.native())) +} + +// GetMonitorHeightMM is a wrapper around gdk_screen_get_monitor_height_mm(). +func (v *Screen) GetMonitorHeightMM(m int) int { + return int(C.gdk_screen_get_monitor_height_mm(v.native(), C.gint(m))) +} + +// GetMonitorPlugName is a wrapper around gdk_screen_get_monitor_plug_name(). +func (v *Screen) GetMonitorPlugName(m int) (string, error) { + return toString(C.gdk_screen_get_monitor_plug_name(v.native(), C.gint(m))) +} + +// GetMonitorScaleFactor is a wrapper around gdk_screen_get_monitor_scale_factor(). +func (v *Screen) GetMonitorScaleFactor(m int) int { + return int(C.gdk_screen_get_monitor_scale_factor(v.native(), C.gint(m))) +} + +// GetMonitorWidthMM is a wrapper around gdk_screen_get_monitor_width_mm(). +func (v *Screen) GetMonitorWidthMM(m int) int { + return int(C.gdk_screen_get_monitor_width_mm(v.native(), C.gint(m))) +} + +// GetNMonitors is a wrapper around gdk_screen_get_n_monitors(). +func (v *Screen) GetNMonitors() int { + return int(C.gdk_screen_get_n_monitors(v.native())) +} + +// GetNumber is a wrapper around gdk_screen_get_number(). +func (v *Screen) GetNumber() int { + return int(C.gdk_screen_get_number(v.native())) +} + +// GetPrimaryMonitor is a wrapper around gdk_screen_get_primary_monitor(). +func (v *Screen) GetPrimaryMonitor() int { + return int(C.gdk_screen_get_primary_monitor(v.native())) +} + +// GetWidth is a wrapper around gdk_screen_get_width(). +func (v *Screen) GetWidth() int { + c := C.gdk_screen_get_width(v.native()) + return int(c) +} + +// GetWidthMM is a wrapper around gdk_screen_get_width_mm(). +func (v *Screen) GetWidthMM() int { + return int(C.gdk_screen_get_width_mm(v.native())) +} + +// MakeDisplayName is a wrapper around gdk_screen_make_display_name(). +func (v *Screen) MakeDisplayName() (string, error) { + return toString(C.gdk_screen_make_display_name(v.native())) +} + +/* + * GdkVisuals + */ + +// TODO: +// gdk_query_depths(). +// gdk_query_visual_types(). +// gdk_list_visuals(). +// gdk_visual_get_bits_per_rgb(). +// gdk_visual_get_byte_order(). +// gdk_visual_get_colormap_size(). +// gdk_visual_get_best_depth(). +// gdk_visual_get_best_type(). +// gdk_visual_get_system(). +// gdk_visual_get_best(). +// gdk_visual_get_best_with_depth(). +// gdk_visual_get_best_with_type(). +// gdk_visual_get_best_with_both(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_10.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_10.go new file mode 100644 index 0000000..f941b0a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_10.go @@ -0,0 +1,50 @@ +// +build !gtk_3_6,!gtk_3_8 +// Supports building with gtk 3.10+ + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/cairo" +) + +// TODO: +// gdk_device_get_position_double(). + +// GetScaleFactor is a wrapper around gdk_window_get_scale_factor(). +func (v *Window) GetScaleFactor() int { + return int(C.gdk_window_get_scale_factor(v.native())) +} + +// CreateSimilarImageSurface is a wrapper around gdk_window_create_similar_image_surface(). +func (v *Window) CreateSimilarImageSurface(format cairo.Format, w, h, scale int) (*cairo.Surface, error) { + surface := C.gdk_window_create_similar_image_surface(v.native(), C.cairo_format_t(format), C.gint(w), C.gint(h), C.gint(scale)) + + status := cairo.Status(C.cairo_surface_status(surface)) + if status != cairo.STATUS_SUCCESS { + return nil, cairo.ErrorStatus(status) + } + + return cairo.NewSurface(uintptr(unsafe.Pointer(surface)), false), nil +} + +// CairoSurfaceCreateFromPixbuf is a wrapper around gdk_cairo_surface_create_from_pixbuf(). +func CairoSurfaceCreateFromPixbuf(pixbuf *Pixbuf, scale int, window *Window) (*cairo.Surface, error) { + v := C.gdk_cairo_surface_create_from_pixbuf(pixbuf.native(), C.gint(scale), window.native()) + + status := cairo.Status(C.cairo_surface_status(v)) + if status != cairo.STATUS_SUCCESS { + return nil, cairo.ErrorStatus(status) + } + + surface := cairo.WrapSurface(uintptr(unsafe.Pointer(v))) + runtime.SetFinalizer(surface, (*cairo.Surface).Close) + + return surface, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_12.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_12.go new file mode 100644 index 0000000..d828f26 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_12.go @@ -0,0 +1,7 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 +// Supports building with gtk 3.12+ + +package gdk + +// TODO: +// gdk_device_get_last_event_window(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_16.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_16.go new file mode 100644 index 0000000..b53e166 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_16.go @@ -0,0 +1,197 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 +// Supports building with gtk 3.16+ + +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gdk + +// #include +// #include "gdk_since_3_16.go.h" +import "C" +import ( + "errors" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + + tm := []glib.TypeMarshaler{ + {glib.Type(C.gdk_gl_context_get_type()), marshalGLContext}, + } + + glib.RegisterGValueMarshalers(tm) +} + +/* + * Constants + */ + +const ( + GRAB_FAILED GrabStatus = C.GDK_GRAB_FAILED +) + +/* + * GdkDevice + */ + +// TODO: +// gdk_device_get_vendor_id(). +// gdk_device_get_product_id(). + +/* + * GdkGLContext + */ + +// GLContext is a representation of GDK's GdkGLContext. +type GLContext struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkGLContext. +func (v *GLContext) native() *C.GdkGLContext { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkGLContext(p) +} + +// Native returns a pointer to the underlying GdkGLContext. +func (v *GLContext) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalGLContext(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &GLContext{obj}, nil +} + +// GetDisplay is a wrapper around gdk_gl_context_get_display(). +func (v *GLContext) GetDisplay() (*Display, error) { + c := C.gdk_gl_context_get_display(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Display{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetWindow is a wrapper around gdk_gl_context_get_window(). +func (v *GLContext) GetSurface() (*Window, error) { + c := C.gdk_gl_context_get_window(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Window{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetSharedContext is a wrapper around gdk_gl_context_get_shared_context(). +func (v *GLContext) GetSharedContext() (*GLContext, error) { + c := C.gdk_gl_context_get_shared_context(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &GLContext{glib.Take(unsafe.Pointer(c))}, nil +} + +// MajorVersion is a representation of OpenGL major version. +type MajorVersion int + +// MinorVersion is a representation of OpenGL minor version. +type MinorVersion int + +// GetVersion is a wrapper around gdk_gl_context_get_version(). +func (v *GLContext) GetVersion() (MajorVersion, MinorVersion) { + var major, minor int + C.gdk_gl_context_get_version(v.native(), + (*C.int)(unsafe.Pointer(&major)), (*C.int)(unsafe.Pointer(&minor))) + + return MajorVersion(major), MinorVersion(minor) +} + +// GetRequiredVersion is a wrapper around gdk_gl_context_get_required_version(). +func (v *GLContext) GetRequiredVersion() (MajorVersion, MinorVersion) { + var major, minor int + C.gdk_gl_context_get_required_version(v.native(), + (*C.int)(unsafe.Pointer(&major)), (*C.int)(unsafe.Pointer(&minor))) + + return MajorVersion(major), MinorVersion(minor) +} + +// SetRequiredVersion is a wrapper around gdk_gl_context_set_required_version(). +func (v *GLContext) SetRequiredVersion(major, minor int) { + C.gdk_gl_context_set_required_version(v.native(), (C.int)(major), (C.int)(minor)) +} + +// GetDebugEnabled is a wrapper around gdk_gl_context_get_debug_enabled(). +func (v *GLContext) GetDebugEnabled() bool { + return gobool(C.gdk_gl_context_get_debug_enabled(v.native())) +} + +// SetDebugEnabled is a wrapper around gdk_gl_context_set_debug_enabled(). +func (v *GLContext) SetDebugEnabled(enabled bool) { + C.gdk_gl_context_set_debug_enabled(v.native(), gbool(enabled)) +} + +// GetForwardCompatible is a wrapper around gdk_gl_context_get_forward_compatible(). +func (v *GLContext) GetForwardCompatible() bool { + return gobool(C.gdk_gl_context_get_forward_compatible(v.native())) +} + +// SetForwardCompatible is a wrapper around gdk_gl_context_set_forward_compatible(). +func (v *GLContext) SetForwardCompatible(compatible bool) { + C.gdk_gl_context_set_forward_compatible(v.native(), gbool(compatible)) +} + +// Realize is a wrapper around gdk_gl_context_realize(). +func (v *GLContext) Realize() (bool, error) { + var err *C.GError + r := gobool(C.gdk_gl_context_realize(v.native(), &err)) + if !r { + defer C.g_error_free(err) + return r, errors.New(C.GoString((*C.char)(err.message))) + } + + return r, nil +} + +// MakeCurrent is a wrapper around gdk_gl_context_make_current(). +func (v *GLContext) MakeCurrent() { + C.gdk_gl_context_make_current(v.native()) +} + +// GetCurrent is a wrapper around gdk_gl_context_get_current(). +func GetCurrent() (*GLContext, error) { + c := C.gdk_gl_context_get_current() + if c == nil { + return nil, nilPtrErr + } + + return &GLContext{glib.Take(unsafe.Pointer(c))}, nil +} + +// ClearCurrent is a wrapper around gdk_gl_context_clear_current(). +func ClearCurrent() { + C.gdk_gl_context_clear_current() +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_16.go.h b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_16.go.h new file mode 100644 index 0000000..03add62 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_16.go.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +// Type Casting +static GdkGLContext *toGdkGLContext(void *p) { return (GDK_GL_CONTEXT(p)); } \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_18.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_18.go new file mode 100644 index 0000000..b26ebf2 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_18.go @@ -0,0 +1,32 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16 +// Supports building with gtk 3.18+ + +package gdk + +// #include +import "C" + +/* + * GdkKeymap + */ + +// GetScrollLockState is a wrapper around gdk_keymap_get_scroll_lock_state(). +func (v *Keymap) GetScrollLockState() bool { + return gobool(C.gdk_keymap_get_scroll_lock_state(v.native())) +} + +/* + * GdkWindow + */ + +// SetPassThrough is a wrapper around gdk_window_set_pass_through(). +func (v *Window) SetPassThrough(passThrough bool) { + C.gdk_window_set_pass_through(v.native(), gbool(passThrough)) +} + +// GetPassThrough is a wrapper around gdk_window_get_pass_through(). +func (v *Window) GetPassThrough() bool { + return gobool(C.gdk_window_get_pass_through(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_20.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_20.go new file mode 100644 index 0000000..15fc6d9 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_20.go @@ -0,0 +1,89 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18 +// Supports building with gtk 3.20+ + +package gdk + +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// #include +// #include "gdk_since_3_20.go.h" +import "C" + +/* + * GdkGLContext + */ + +// IsLegacy is a wrapper around gdk_gl_context_is_legacy(). +func (v *GLContext) IsLegacy() bool { + return gobool(C.gdk_gl_context_is_legacy(v.native())) +} + +/* + * GdkDisplay + */ + +func (v *Display) GetDefaultSeat() (*Seat, error) { + return toSeat(C.gdk_display_get_default_seat(v.native())) +} + +// gdk_display_list_seats(). + +/* + * GdkDevice + */ + +// TODO: +// gdk_device_get_axes(). +// gdk_device_get_seat(). + +/* + * GdkSeat + */ + +type Seat struct { + *glib.Object +} + +func (v *Seat) native() *C.GdkSeat { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkSeat(p) +} + +// Native returns a pointer to the underlying GdkCursor. +func (v *Seat) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSeat(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Seat{obj}, nil +} + +func toSeat(s *C.GdkSeat) (*Seat, error) { + if s == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(s))} + return &Seat{obj}, nil +} + +func (v *Seat) GetPointer() (*Device, error) { + return toDevice(C.gdk_seat_get_pointer(v.native())) +} + +/* + * GdkRectangle + */ + +// RectangleEqual is a wrapper around gdk_rectangle_equal(). +func (v *Rectangle) RectangleEqual(rect *Rectangle) bool { + return gobool(C.gdk_rectangle_equal(v.native(), rect.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_20.go.h b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_20.go.h new file mode 100644 index 0000000..8475e5f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_20.go.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +//#include + +static GdkSeat *toGdkSeat(void *p) { return ((GdkSeat *)p); } \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_22.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_22.go new file mode 100644 index 0000000..f07e963 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_22.go @@ -0,0 +1,248 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18,!gtk_3_20 +// Supports building with gtk 3.22+ + +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +package gdk + +// #include +// #include "gdk_since_3_22.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + + tm := []glib.TypeMarshaler{ + {glib.Type(C.gdk_subpixel_layout_get_type()), marshalSubpixelLayout}, + } + + glib.RegisterGValueMarshalers(tm) +} + +/* + * Constants + */ + +// TODO: +// GdkSeatCapabilities + +// SubpixelLayout is a representation of GDK's GdkSubpixelLayout. +type SubpixelLayout int + +const ( + SUBPIXEL_LAYOUT_UNKNOWN SubpixelLayout = C.GDK_SUBPIXEL_LAYOUT_UNKNOWN + SUBPIXEL_LAYOUT_NONE SubpixelLayout = C.GDK_SUBPIXEL_LAYOUT_NONE + SUBPIXEL_LAYOUT_HORIZONTAL_RGB SubpixelLayout = C.GDK_SUBPIXEL_LAYOUT_HORIZONTAL_RGB + SUBPIXEL_LAYOUT_HORIZONTAL_BGR SubpixelLayout = C.GDK_SUBPIXEL_LAYOUT_HORIZONTAL_BGR + SUBPIXEL_LAYOUT_VERTICAL_RGB SubpixelLayout = C.GDK_SUBPIXEL_LAYOUT_VERTICAL_RGB + SUBPIXEL_LAYOUT_VERTICAL_BGR SubpixelLayout = C.GDK_SUBPIXEL_LAYOUT_VERTICAL_BGR +) + +func marshalSubpixelLayout(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SubpixelLayout(c), nil +} + +/* + * GdkDisplay + */ + +// GetNMonitors is a wrapper around gdk_display_get_n_monitors(). +func (v *Display) GetNMonitors() int { + c := C.gdk_display_get_n_monitors(v.native()) + return int(c) +} + +// GetPrimaryMonitor is a wrapper around gdk_display_get_primary_monitor(). +func (v *Display) GetPrimaryMonitor() (*Monitor, error) { + c := C.gdk_display_get_primary_monitor(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Monitor{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetMonitor is a wrapper around gdk_display_get_monitor(). +func (v *Display) GetMonitor(num int) (*Monitor, error) { + c := C.gdk_display_get_monitor(v.native(), C.int(num)) + if c == nil { + return nil, nilPtrErr + } + return &Monitor{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetMonitorAtWindow is a wrapper around gdk_display_get_monitor_at_window(). +func (v *Display) GetMonitorAtWindow(w *Window) (*Monitor, error) { + c := C.gdk_display_get_monitor_at_window(v.native(), w.native()) + if c == nil { + return nil, nilPtrErr + } + return &Monitor{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetMonitorAtPoint is a wrapper around gdk_display_get_monitor_at_point(). +func (v *Display) GetMonitorAtPoint(x int, y int) (*Monitor, error) { + c := C.gdk_display_get_monitor_at_point(v.native(), C.int(x), C.int(y)) + if c == nil { + return nil, nilPtrErr + } + return &Monitor{glib.Take(unsafe.Pointer(c))}, nil +} + +/* + * GdkSeat + */ + +// TODO: +// GdkSeatGrabPrepareFunc +// gdk_seat_get_display(). +// gdk_seat_grab(). +// gdk_seat_ungrab(). +// gdk_seat_get_capabilities(). +// gdk_seat_get_pointer(). +// gdk_seat_get_keyboard(). +// gdk_seat_get_slaves(). + +/* + * GdkMonitor + */ + +// Monitor is a representation of GDK's GdkMonitor. +type Monitor struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkMonitor. +func (v *Monitor) native() *C.GdkMonitor { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkMonitor(p) +} + +// Native returns a pointer to the underlying GdkMonitor. +func (v *Monitor) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalMonitor(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Monitor{obj}, nil +} + +func toMonitor(s *C.GdkMonitor) (*Monitor, error) { + if s == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(s))} + return &Monitor{obj}, nil +} + +// GetDisplay is a wrapper around gdk_monitor_get_display(). +func (v *Monitor) GetDisplay() (*Display, error) { + return toDisplay(C.gdk_monitor_get_display(v.native())) +} + +// GetGeometry is a wrapper around gdk_monitor_get_geometry(). +func (v *Monitor) GetGeometry() *Rectangle { + var rect C.GdkRectangle + + C.gdk_monitor_get_geometry(v.native(), &rect) + + return wrapRectangle(&rect) +} + +// GetWorkarea is a wrapper around gdk_monitor_get_workarea(). +func (v *Monitor) GetWorkarea() *Rectangle { + var rect C.GdkRectangle + + C.gdk_monitor_get_workarea(v.native(), &rect) + + return wrapRectangle(&rect) +} + +// GetWidthMM is a wrapper around gdk_monitor_get_width_mm(). +func (v *Monitor) GetWidthMM() int { + return int(C.gdk_monitor_get_width_mm(v.native())) +} + +// GetHeightMM is a wrapper around gdk_monitor_get_height_mm(). +func (v *Monitor) GetHeightMM() int { + return int(C.gdk_monitor_get_height_mm(v.native())) +} + +// GetManufacturer is a wrapper around gdk_monitor_get_manufacturer(). +func (v *Monitor) GetManufacturer() string { + // transfer none: don't free data after the code is done. + return C.GoString(C.gdk_monitor_get_manufacturer(v.native())) +} + +// GetModel is a wrapper around gdk_monitor_get_model(). +func (v *Monitor) GetModel() string { + // transfer none: don't free data after the code is done. + return C.GoString(C.gdk_monitor_get_model(v.native())) +} + +// GetScaleFactor is a wrapper around gdk_monitor_get_scale_factor(). +func (v *Monitor) GetScaleFactor() int { + return int(C.gdk_monitor_get_scale_factor(v.native())) +} + +// GetRefreshRate is a wrapper around gdk_monitor_get_refresh_rate(). +func (v *Monitor) GetRefreshRate() int { + return int(C.gdk_monitor_get_refresh_rate(v.native())) +} + +// GetSubpixelLayout is a wrapper around gdk_monitor_get_subpixel_layout(). +func (v *Monitor) GetSubpixelLayout() SubpixelLayout { + return SubpixelLayout(C.gdk_monitor_get_subpixel_layout(v.native())) +} + +// IsPrimary is a wrapper around gdk_monitor_is_primary(). +func (v *Monitor) IsPrimary() bool { + return gobool(C.gdk_monitor_is_primary(v.native())) +} + +/* + * GdkDevice + */ + +// TODO: +// gdk_device_get_axes(). +// gdk_device_tool_get_serial(). +// gdk_device_tool_get_tool_type(). + +/* + * GdkGLContext + */ + +// GetUseES is a wrapper around gdk_gl_context_get_use_es(). +func (v *GLContext) GetUseES() bool { + return gobool(C.gdk_gl_context_get_use_es(v.native())) +} + +// SetUseES is a wrapper around gdk_gl_context_set_use_es(). +func (v *GLContext) SetUseES(es int) { + C.gdk_gl_context_set_use_es(v.native(), (C.int)(es)) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_22.go.h b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_22.go.h new file mode 100644 index 0000000..c065b67 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_22.go.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +//#include + +// Type Casting +static GdkMonitor *toGdkMonitor(void *p) { return (GDK_MONITOR(p)); } diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_8.go b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_8.go new file mode 100644 index 0000000..0cfa802 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_8.go @@ -0,0 +1,231 @@ +// +build !gtk_3_6 +// Supports building with gtk 3.8+ + +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gdk + +// #include +// #include "gdk_since_3_8.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gdk_frame_clock_phase_get_type()), marshalClockPhase}, + + // Objects/Interfaces + {glib.Type(C.gdk_frame_clock_get_type()), marshalFrameClock}, + {glib.Type(C.gdk_frame_timings_get_type()), marshalFrameTimings}, + } + + glib.RegisterGValueMarshalers(tm) +} + +// ClockPhase is a representation of GDK's GdkFrameClockPhase. +type ClockPhase int + +const ( + PHASE_NONE ClockPhase = C.GDK_FRAME_CLOCK_PHASE_NONE + PHASE_FLUSH_EVENTS ClockPhase = C.GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS + PHASE_BEFORE_PAINT ClockPhase = C.GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT + PHASE_UPDATE ClockPhase = C.GDK_FRAME_CLOCK_PHASE_UPDATE + PHASE_LAYOUT ClockPhase = C.GDK_FRAME_CLOCK_PHASE_LAYOUT + PHASE_PAINT ClockPhase = C.GDK_FRAME_CLOCK_PHASE_PAINT + PHASE_RESUME_EVENTS ClockPhase = C.GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS + PHASE_AFTER_PAINT ClockPhase = C.GDK_FRAME_CLOCK_PHASE_AFTER_PAINT +) + +func marshalClockPhase(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ClockPhase(c), nil +} + +/* + * GdkFrameClock + */ + +// FrameClock is a representation of GDK's GdkFrameClock. +type FrameClock struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkFrameClock. +func (v *FrameClock) native() *C.GdkFrameClock { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkFrameClock(p) +} + +// Native returns a pointer to the underlying GdkFrameClock. +func (v *FrameClock) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalFrameClock(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return WrapFrameClock(unsafe.Pointer(c)), nil +} + +func WrapFrameClock(ptr unsafe.Pointer) *FrameClock { + obj := &glib.Object{glib.ToGObject(ptr)} + return &FrameClock{obj} +} + +// BeginUpdating is a wrapper around gdk_frame_clock_begin_updating(). +func (v *FrameClock) BeginUpdating() { + C.gdk_frame_clock_begin_updating(v.native()) +} + +// EndUpdating is a wrapper around gdk_frame_clock_end_updating(). +func (v *FrameClock) EndUpdating() { + C.gdk_frame_clock_end_updating(v.native()) +} + +// GetFrameTime is a wrapper around gdk_frame_clock_get_frame_time(). +func (v *FrameClock) GetFrameTime() int64 { + return int64(C.gdk_frame_clock_get_frame_time(v.native())) +} + +// GetFrameCounter is a wrapper around gdk_frame_clock_get_frame_counter(). +func (v *FrameClock) GetFrameCounter() int64 { + return int64(C.gdk_frame_clock_get_frame_counter(v.native())) +} + +// GetHistoryStart is a wrapper around gdk_frame_clock_get_history_start(). +func (v *FrameClock) GetHistoryStart() int64 { + return int64(C.gdk_frame_clock_get_history_start(v.native())) +} + +// GetTimings is a wrapper around gdk_frame_clock_get_timings(). +func (v *FrameClock) GetTimings(frameCounter int64) (*FrameTimings, error) { + c := C.gdk_frame_clock_get_timings(v.native(), C.gint64(frameCounter)) + if c == nil { + return nil, nilPtrErr + } + return wrapFrameTimings(unsafe.Pointer(c)), nil +} + +// GetCurrentTimings is a wrapper around dk_frame_clock_get_current_timings(). +func (v *FrameClock) GetCurrentTimings() (*FrameTimings, error) { + c := C.gdk_frame_clock_get_current_timings(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapFrameTimings(unsafe.Pointer(c)), nil +} + +// GetRefreshInfo is a wrapper around gdk_frame_clock_get_refresh_info(). +func (v *FrameClock) GetRefreshInfo(baseTime int64) (int64, int64) { + var cr, cp (*C.gint64) + defer C.free(unsafe.Pointer(cr)) + defer C.free(unsafe.Pointer(cp)) + b := C.gint64(baseTime) + + C.gdk_frame_clock_get_refresh_info(v.native(), b, cr, cp) + r, p := int64(*cr), int64(*cp) + return r, p +} + +// RequestPhase is a wrapper around gdk_frame_clock_request_phase(). +func (v *FrameClock) RequestPhase(phase ClockPhase) { + C.gdk_frame_clock_request_phase(v.native(), C.GdkFrameClockPhase(phase)) +} + +/* + * GdkFrameTimings + */ + +// FrameTimings is a representation of GDK's GdkFrameTimings. +type FrameTimings struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkFrameTimings. +func (v *FrameTimings) native() *C.GdkFrameTimings { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkFrameTimings(p) +} + +// Native returns a pointer to the underlying GdkFrameTimings. +func (v *FrameTimings) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func wrapFrameTimings(ptr unsafe.Pointer) *FrameTimings { + obj := &glib.Object{glib.ToGObject(ptr)} + return &FrameTimings{obj} +} + +func marshalFrameTimings(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapFrameTimings(unsafe.Pointer(c)), nil +} + +// Ref is a wrapper around gdk_frame_timings_ref(). +func (v *FrameTimings) Ref() { + c := C.gdk_frame_timings_ref(v.native()) + v = wrapFrameTimings(unsafe.Pointer(c)) +} + +// Unref is a wrapper around gdk_frame_timings_unref(). +func (v *FrameTimings) Unref() { + C.gdk_frame_timings_unref(v.native()) +} + +// GetFrameCounter is a wrapper around gdk_frame_timings_get_frame_counter(). +func (v *FrameTimings) GetFrameCounter() int64 { + return int64(C.gdk_frame_timings_get_frame_counter(v.native())) +} + +// GetComplete is a wrapper around gdk_frame_timings_get_complete(). +func (v *FrameTimings) GetComplete() bool { + return gobool(C.gdk_frame_timings_get_complete(v.native())) +} + +// GetFrameTime is a wrapper around gdk_frame_timings_get_frame_time(). +func (v *FrameTimings) GetFrameTime() int64 { + return int64(C.gdk_frame_timings_get_frame_time(v.native())) +} + +// GetPresentationTime is a wrapper around gdk_frame_timings_get_presentation_time(). +func (v *FrameTimings) GetPresentationTime() int64 { + return int64(C.gdk_frame_timings_get_presentation_time(v.native())) +} + +// GetRefreshInterval is a wrapper around gdk_frame_timings_get_refresh_interval(). +func (v *FrameTimings) GetRefreshInterval() int64 { + return int64(C.gdk_frame_timings_get_refresh_interval(v.native())) +} + +// GetPredictedPresentationTime is a wrapper around gdk_frame_timings_get_predicted_presentation_time(). +func (v *FrameTimings) GetPredictedPresentationTime() int64 { + return int64(C.gdk_frame_timings_get_predicted_presentation_time(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_8.go.h b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_8.go.h new file mode 100644 index 0000000..3417821 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/gdk_since_3_8.go.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include + +// Type Casting +static GdkFrameClock *toGdkFrameClock(void *p) { return (GDK_FRAME_CLOCK(p)); } + +static GdkFrameTimings *toGdkFrameTimings(void *p) { + return ((GdkFrameTimings *)p); +} \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/gdk/keys.go b/vendor/github.com/gotk3/gotk3/gdk/keys.go new file mode 100644 index 0000000..bd4536e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/keys.go @@ -0,0 +1,2278 @@ +package gdk + +// #include +// #include "gdk.go.h" +import "C" + +const ( + KEY_VoidSymbol = uint(C.GDK_KEY_VoidSymbol) + KEY_BackSpace = uint(C.GDK_KEY_BackSpace) + KEY_Tab = uint(C.GDK_KEY_Tab) + KEY_Linefeed = uint(C.GDK_KEY_Linefeed) + KEY_Clear = uint(C.GDK_KEY_Clear) + KEY_Return = uint(C.GDK_KEY_Return) + KEY_Pause = uint(C.GDK_KEY_Pause) + KEY_Scroll_Lock = uint(C.GDK_KEY_Scroll_Lock) + KEY_Sys_Req = uint(C.GDK_KEY_Sys_Req) + KEY_Escape = uint(C.GDK_KEY_Escape) + KEY_Delete = uint(C.GDK_KEY_Delete) + KEY_Multi_key = uint(C.GDK_KEY_Multi_key) + KEY_Codeinput = uint(C.GDK_KEY_Codeinput) + KEY_SingleCandidate = uint(C.GDK_KEY_SingleCandidate) + KEY_MultipleCandidate = uint(C.GDK_KEY_MultipleCandidate) + KEY_PreviousCandidate = uint(C.GDK_KEY_PreviousCandidate) + KEY_Kanji = uint(C.GDK_KEY_Kanji) + KEY_Muhenkan = uint(C.GDK_KEY_Muhenkan) + KEY_Henkan_Mode = uint(C.GDK_KEY_Henkan_Mode) + KEY_Henkan = uint(C.GDK_KEY_Henkan) + KEY_Romaji = uint(C.GDK_KEY_Romaji) + KEY_Hiragana = uint(C.GDK_KEY_Hiragana) + KEY_Katakana = uint(C.GDK_KEY_Katakana) + KEY_Hiragana_Katakana = uint(C.GDK_KEY_Hiragana_Katakana) + KEY_Zenkaku = uint(C.GDK_KEY_Zenkaku) + KEY_Hankaku = uint(C.GDK_KEY_Hankaku) + KEY_Zenkaku_Hankaku = uint(C.GDK_KEY_Zenkaku_Hankaku) + KEY_Touroku = uint(C.GDK_KEY_Touroku) + KEY_Massyo = uint(C.GDK_KEY_Massyo) + KEY_Kana_Lock = uint(C.GDK_KEY_Kana_Lock) + KEY_Kana_Shift = uint(C.GDK_KEY_Kana_Shift) + KEY_Eisu_Shift = uint(C.GDK_KEY_Eisu_Shift) + KEY_Eisu_toggle = uint(C.GDK_KEY_Eisu_toggle) + KEY_Kanji_Bangou = uint(C.GDK_KEY_Kanji_Bangou) + KEY_Zen_Koho = uint(C.GDK_KEY_Zen_Koho) + KEY_Mae_Koho = uint(C.GDK_KEY_Mae_Koho) + KEY_Home = uint(C.GDK_KEY_Home) + KEY_Left = uint(C.GDK_KEY_Left) + KEY_Up = uint(C.GDK_KEY_Up) + KEY_Right = uint(C.GDK_KEY_Right) + KEY_Down = uint(C.GDK_KEY_Down) + KEY_Prior = uint(C.GDK_KEY_Prior) + KEY_Page_Up = uint(C.GDK_KEY_Page_Up) + KEY_Next = uint(C.GDK_KEY_Next) + KEY_Page_Down = uint(C.GDK_KEY_Page_Down) + KEY_End = uint(C.GDK_KEY_End) + KEY_Begin = uint(C.GDK_KEY_Begin) + KEY_Select = uint(C.GDK_KEY_Select) + KEY_Print = uint(C.GDK_KEY_Print) + KEY_Execute = uint(C.GDK_KEY_Execute) + KEY_Insert = uint(C.GDK_KEY_Insert) + KEY_Undo = uint(C.GDK_KEY_Undo) + KEY_Redo = uint(C.GDK_KEY_Redo) + KEY_Menu = uint(C.GDK_KEY_Menu) + KEY_Find = uint(C.GDK_KEY_Find) + KEY_Cancel = uint(C.GDK_KEY_Cancel) + KEY_Help = uint(C.GDK_KEY_Help) + KEY_Break = uint(C.GDK_KEY_Break) + KEY_Mode_switch = uint(C.GDK_KEY_Mode_switch) + KEY_script_switch = uint(C.GDK_KEY_script_switch) + KEY_Num_Lock = uint(C.GDK_KEY_Num_Lock) + KEY_KP_Space = uint(C.GDK_KEY_KP_Space) + KEY_KP_Tab = uint(C.GDK_KEY_KP_Tab) + KEY_KP_Enter = uint(C.GDK_KEY_KP_Enter) + KEY_KP_F1 = uint(C.GDK_KEY_KP_F1) + KEY_KP_F2 = uint(C.GDK_KEY_KP_F2) + KEY_KP_F3 = uint(C.GDK_KEY_KP_F3) + KEY_KP_F4 = uint(C.GDK_KEY_KP_F4) + KEY_KP_Home = uint(C.GDK_KEY_KP_Home) + KEY_KP_Left = uint(C.GDK_KEY_KP_Left) + KEY_KP_Up = uint(C.GDK_KEY_KP_Up) + KEY_KP_Right = uint(C.GDK_KEY_KP_Right) + KEY_KP_Down = uint(C.GDK_KEY_KP_Down) + KEY_KP_Prior = uint(C.GDK_KEY_KP_Prior) + KEY_KP_Page_Up = uint(C.GDK_KEY_KP_Page_Up) + KEY_KP_Next = uint(C.GDK_KEY_KP_Next) + KEY_KP_Page_Down = uint(C.GDK_KEY_KP_Page_Down) + KEY_KP_End = uint(C.GDK_KEY_KP_End) + KEY_KP_Begin = uint(C.GDK_KEY_KP_Begin) + KEY_KP_Insert = uint(C.GDK_KEY_KP_Insert) + KEY_KP_Delete = uint(C.GDK_KEY_KP_Delete) + KEY_KP_Equal = uint(C.GDK_KEY_KP_Equal) + KEY_KP_Multiply = uint(C.GDK_KEY_KP_Multiply) + KEY_KP_Add = uint(C.GDK_KEY_KP_Add) + KEY_KP_Separator = uint(C.GDK_KEY_KP_Separator) + KEY_KP_Subtract = uint(C.GDK_KEY_KP_Subtract) + KEY_KP_Decimal = uint(C.GDK_KEY_KP_Decimal) + KEY_KP_Divide = uint(C.GDK_KEY_KP_Divide) + KEY_KP_0 = uint(C.GDK_KEY_KP_0) + KEY_KP_1 = uint(C.GDK_KEY_KP_1) + KEY_KP_2 = uint(C.GDK_KEY_KP_2) + KEY_KP_3 = uint(C.GDK_KEY_KP_3) + KEY_KP_4 = uint(C.GDK_KEY_KP_4) + KEY_KP_5 = uint(C.GDK_KEY_KP_5) + KEY_KP_6 = uint(C.GDK_KEY_KP_6) + KEY_KP_7 = uint(C.GDK_KEY_KP_7) + KEY_KP_8 = uint(C.GDK_KEY_KP_8) + KEY_KP_9 = uint(C.GDK_KEY_KP_9) + KEY_F1 = uint(C.GDK_KEY_F1) + KEY_F2 = uint(C.GDK_KEY_F2) + KEY_F3 = uint(C.GDK_KEY_F3) + KEY_F4 = uint(C.GDK_KEY_F4) + KEY_F5 = uint(C.GDK_KEY_F5) + KEY_F6 = uint(C.GDK_KEY_F6) + KEY_F7 = uint(C.GDK_KEY_F7) + KEY_F8 = uint(C.GDK_KEY_F8) + KEY_F9 = uint(C.GDK_KEY_F9) + KEY_F10 = uint(C.GDK_KEY_F10) + KEY_F11 = uint(C.GDK_KEY_F11) + KEY_L1 = uint(C.GDK_KEY_L1) + KEY_F12 = uint(C.GDK_KEY_F12) + KEY_L2 = uint(C.GDK_KEY_L2) + KEY_F13 = uint(C.GDK_KEY_F13) + KEY_L3 = uint(C.GDK_KEY_L3) + KEY_F14 = uint(C.GDK_KEY_F14) + KEY_L4 = uint(C.GDK_KEY_L4) + KEY_F15 = uint(C.GDK_KEY_F15) + KEY_L5 = uint(C.GDK_KEY_L5) + KEY_F16 = uint(C.GDK_KEY_F16) + KEY_L6 = uint(C.GDK_KEY_L6) + KEY_F17 = uint(C.GDK_KEY_F17) + KEY_L7 = uint(C.GDK_KEY_L7) + KEY_F18 = uint(C.GDK_KEY_F18) + KEY_L8 = uint(C.GDK_KEY_L8) + KEY_F19 = uint(C.GDK_KEY_F19) + KEY_L9 = uint(C.GDK_KEY_L9) + KEY_F20 = uint(C.GDK_KEY_F20) + KEY_L10 = uint(C.GDK_KEY_L10) + KEY_F21 = uint(C.GDK_KEY_F21) + KEY_R1 = uint(C.GDK_KEY_R1) + KEY_F22 = uint(C.GDK_KEY_F22) + KEY_R2 = uint(C.GDK_KEY_R2) + KEY_F23 = uint(C.GDK_KEY_F23) + KEY_R3 = uint(C.GDK_KEY_R3) + KEY_F24 = uint(C.GDK_KEY_F24) + KEY_R4 = uint(C.GDK_KEY_R4) + KEY_F25 = uint(C.GDK_KEY_F25) + KEY_R5 = uint(C.GDK_KEY_R5) + KEY_F26 = uint(C.GDK_KEY_F26) + KEY_R6 = uint(C.GDK_KEY_R6) + KEY_F27 = uint(C.GDK_KEY_F27) + KEY_R7 = uint(C.GDK_KEY_R7) + KEY_F28 = uint(C.GDK_KEY_F28) + KEY_R8 = uint(C.GDK_KEY_R8) + KEY_F29 = uint(C.GDK_KEY_F29) + KEY_R9 = uint(C.GDK_KEY_R9) + KEY_F30 = uint(C.GDK_KEY_F30) + KEY_R10 = uint(C.GDK_KEY_R10) + KEY_F31 = uint(C.GDK_KEY_F31) + KEY_R11 = uint(C.GDK_KEY_R11) + KEY_F32 = uint(C.GDK_KEY_F32) + KEY_R12 = uint(C.GDK_KEY_R12) + KEY_F33 = uint(C.GDK_KEY_F33) + KEY_R13 = uint(C.GDK_KEY_R13) + KEY_F34 = uint(C.GDK_KEY_F34) + KEY_R14 = uint(C.GDK_KEY_R14) + KEY_F35 = uint(C.GDK_KEY_F35) + KEY_R15 = uint(C.GDK_KEY_R15) + KEY_Shift_L = uint(C.GDK_KEY_Shift_L) + KEY_Shift_R = uint(C.GDK_KEY_Shift_R) + KEY_Control_L = uint(C.GDK_KEY_Control_L) + KEY_Control_R = uint(C.GDK_KEY_Control_R) + KEY_Caps_Lock = uint(C.GDK_KEY_Caps_Lock) + KEY_Shift_Lock = uint(C.GDK_KEY_Shift_Lock) + KEY_Meta_L = uint(C.GDK_KEY_Meta_L) + KEY_Meta_R = uint(C.GDK_KEY_Meta_R) + KEY_Alt_L = uint(C.GDK_KEY_Alt_L) + KEY_Alt_R = uint(C.GDK_KEY_Alt_R) + KEY_Super_L = uint(C.GDK_KEY_Super_L) + KEY_Super_R = uint(C.GDK_KEY_Super_R) + KEY_Hyper_L = uint(C.GDK_KEY_Hyper_L) + KEY_Hyper_R = uint(C.GDK_KEY_Hyper_R) + KEY_ISO_Lock = uint(C.GDK_KEY_ISO_Lock) + KEY_ISO_Level2_Latch = uint(C.GDK_KEY_ISO_Level2_Latch) + KEY_ISO_Level3_Shift = uint(C.GDK_KEY_ISO_Level3_Shift) + KEY_ISO_Level3_Latch = uint(C.GDK_KEY_ISO_Level3_Latch) + KEY_ISO_Level3_Lock = uint(C.GDK_KEY_ISO_Level3_Lock) + KEY_ISO_Level5_Shift = uint(C.GDK_KEY_ISO_Level5_Shift) + KEY_ISO_Level5_Latch = uint(C.GDK_KEY_ISO_Level5_Latch) + KEY_ISO_Level5_Lock = uint(C.GDK_KEY_ISO_Level5_Lock) + KEY_ISO_Group_Shift = uint(C.GDK_KEY_ISO_Group_Shift) + KEY_ISO_Group_Latch = uint(C.GDK_KEY_ISO_Group_Latch) + KEY_ISO_Group_Lock = uint(C.GDK_KEY_ISO_Group_Lock) + KEY_ISO_Next_Group = uint(C.GDK_KEY_ISO_Next_Group) + KEY_ISO_Next_Group_Lock = uint(C.GDK_KEY_ISO_Next_Group_Lock) + KEY_ISO_Prev_Group = uint(C.GDK_KEY_ISO_Prev_Group) + KEY_ISO_Prev_Group_Lock = uint(C.GDK_KEY_ISO_Prev_Group_Lock) + KEY_ISO_First_Group = uint(C.GDK_KEY_ISO_First_Group) + KEY_ISO_First_Group_Lock = uint(C.GDK_KEY_ISO_First_Group_Lock) + KEY_ISO_Last_Group = uint(C.GDK_KEY_ISO_Last_Group) + KEY_ISO_Last_Group_Lock = uint(C.GDK_KEY_ISO_Last_Group_Lock) + KEY_ISO_Left_Tab = uint(C.GDK_KEY_ISO_Left_Tab) + KEY_ISO_Move_Line_Up = uint(C.GDK_KEY_ISO_Move_Line_Up) + KEY_ISO_Move_Line_Down = uint(C.GDK_KEY_ISO_Move_Line_Down) + KEY_ISO_Partial_Line_Up = uint(C.GDK_KEY_ISO_Partial_Line_Up) + KEY_ISO_Partial_Line_Down = uint(C.GDK_KEY_ISO_Partial_Line_Down) + KEY_ISO_Partial_Space_Left = uint(C.GDK_KEY_ISO_Partial_Space_Left) + KEY_ISO_Partial_Space_Right = uint(C.GDK_KEY_ISO_Partial_Space_Right) + KEY_ISO_Set_Margin_Left = uint(C.GDK_KEY_ISO_Set_Margin_Left) + KEY_ISO_Set_Margin_Right = uint(C.GDK_KEY_ISO_Set_Margin_Right) + KEY_ISO_Release_Margin_Left = uint(C.GDK_KEY_ISO_Release_Margin_Left) + KEY_ISO_Release_Margin_Right = uint(C.GDK_KEY_ISO_Release_Margin_Right) + KEY_ISO_Release_Both_Margins = uint(C.GDK_KEY_ISO_Release_Both_Margins) + KEY_ISO_Fast_Cursor_Left = uint(C.GDK_KEY_ISO_Fast_Cursor_Left) + KEY_ISO_Fast_Cursor_Right = uint(C.GDK_KEY_ISO_Fast_Cursor_Right) + KEY_ISO_Fast_Cursor_Up = uint(C.GDK_KEY_ISO_Fast_Cursor_Up) + KEY_ISO_Fast_Cursor_Down = uint(C.GDK_KEY_ISO_Fast_Cursor_Down) + KEY_ISO_Continuous_Underline = uint(C.GDK_KEY_ISO_Continuous_Underline) + KEY_ISO_Discontinuous_Underline = uint(C.GDK_KEY_ISO_Discontinuous_Underline) + KEY_ISO_Emphasize = uint(C.GDK_KEY_ISO_Emphasize) + KEY_ISO_Center_Object = uint(C.GDK_KEY_ISO_Center_Object) + KEY_ISO_Enter = uint(C.GDK_KEY_ISO_Enter) + KEY_dead_grave = uint(C.GDK_KEY_dead_grave) + KEY_dead_acute = uint(C.GDK_KEY_dead_acute) + KEY_dead_circumflex = uint(C.GDK_KEY_dead_circumflex) + KEY_dead_tilde = uint(C.GDK_KEY_dead_tilde) + KEY_dead_perispomeni = uint(C.GDK_KEY_dead_perispomeni) + KEY_dead_macron = uint(C.GDK_KEY_dead_macron) + KEY_dead_breve = uint(C.GDK_KEY_dead_breve) + KEY_dead_abovedot = uint(C.GDK_KEY_dead_abovedot) + KEY_dead_diaeresis = uint(C.GDK_KEY_dead_diaeresis) + KEY_dead_abovering = uint(C.GDK_KEY_dead_abovering) + KEY_dead_doubleacute = uint(C.GDK_KEY_dead_doubleacute) + KEY_dead_caron = uint(C.GDK_KEY_dead_caron) + KEY_dead_cedilla = uint(C.GDK_KEY_dead_cedilla) + KEY_dead_ogonek = uint(C.GDK_KEY_dead_ogonek) + KEY_dead_iota = uint(C.GDK_KEY_dead_iota) + KEY_dead_voiced_sound = uint(C.GDK_KEY_dead_voiced_sound) + KEY_dead_semivoiced_sound = uint(C.GDK_KEY_dead_semivoiced_sound) + KEY_dead_belowdot = uint(C.GDK_KEY_dead_belowdot) + KEY_dead_hook = uint(C.GDK_KEY_dead_hook) + KEY_dead_horn = uint(C.GDK_KEY_dead_horn) + KEY_dead_stroke = uint(C.GDK_KEY_dead_stroke) + KEY_dead_abovecomma = uint(C.GDK_KEY_dead_abovecomma) + KEY_dead_psili = uint(C.GDK_KEY_dead_psili) + KEY_dead_abovereversedcomma = uint(C.GDK_KEY_dead_abovereversedcomma) + KEY_dead_dasia = uint(C.GDK_KEY_dead_dasia) + KEY_dead_doublegrave = uint(C.GDK_KEY_dead_doublegrave) + KEY_dead_belowring = uint(C.GDK_KEY_dead_belowring) + KEY_dead_belowmacron = uint(C.GDK_KEY_dead_belowmacron) + KEY_dead_belowcircumflex = uint(C.GDK_KEY_dead_belowcircumflex) + KEY_dead_belowtilde = uint(C.GDK_KEY_dead_belowtilde) + KEY_dead_belowbreve = uint(C.GDK_KEY_dead_belowbreve) + KEY_dead_belowdiaeresis = uint(C.GDK_KEY_dead_belowdiaeresis) + KEY_dead_invertedbreve = uint(C.GDK_KEY_dead_invertedbreve) + KEY_dead_belowcomma = uint(C.GDK_KEY_dead_belowcomma) + KEY_dead_currency = uint(C.GDK_KEY_dead_currency) + KEY_dead_a = uint(C.GDK_KEY_dead_a) + KEY_dead_A = uint(C.GDK_KEY_dead_A) + KEY_dead_e = uint(C.GDK_KEY_dead_e) + KEY_dead_E = uint(C.GDK_KEY_dead_E) + KEY_dead_i = uint(C.GDK_KEY_dead_i) + KEY_dead_I = uint(C.GDK_KEY_dead_I) + KEY_dead_o = uint(C.GDK_KEY_dead_o) + KEY_dead_O = uint(C.GDK_KEY_dead_O) + KEY_dead_u = uint(C.GDK_KEY_dead_u) + KEY_dead_U = uint(C.GDK_KEY_dead_U) + KEY_dead_small_schwa = uint(C.GDK_KEY_dead_small_schwa) + KEY_dead_capital_schwa = uint(C.GDK_KEY_dead_capital_schwa) + KEY_dead_greek = uint(C.GDK_KEY_dead_greek) + KEY_First_Virtual_Screen = uint(C.GDK_KEY_First_Virtual_Screen) + KEY_Prev_Virtual_Screen = uint(C.GDK_KEY_Prev_Virtual_Screen) + KEY_Next_Virtual_Screen = uint(C.GDK_KEY_Next_Virtual_Screen) + KEY_Last_Virtual_Screen = uint(C.GDK_KEY_Last_Virtual_Screen) + KEY_Terminate_Server = uint(C.GDK_KEY_Terminate_Server) + KEY_AccessX_Enable = uint(C.GDK_KEY_AccessX_Enable) + KEY_AccessX_Feedback_Enable = uint(C.GDK_KEY_AccessX_Feedback_Enable) + KEY_RepeatKeys_Enable = uint(C.GDK_KEY_RepeatKeys_Enable) + KEY_SlowKeys_Enable = uint(C.GDK_KEY_SlowKeys_Enable) + KEY_BounceKeys_Enable = uint(C.GDK_KEY_BounceKeys_Enable) + KEY_StickyKeys_Enable = uint(C.GDK_KEY_StickyKeys_Enable) + KEY_MouseKeys_Enable = uint(C.GDK_KEY_MouseKeys_Enable) + KEY_MouseKeys_Accel_Enable = uint(C.GDK_KEY_MouseKeys_Accel_Enable) + KEY_Overlay1_Enable = uint(C.GDK_KEY_Overlay1_Enable) + KEY_Overlay2_Enable = uint(C.GDK_KEY_Overlay2_Enable) + KEY_AudibleBell_Enable = uint(C.GDK_KEY_AudibleBell_Enable) + KEY_Pointer_Left = uint(C.GDK_KEY_Pointer_Left) + KEY_Pointer_Right = uint(C.GDK_KEY_Pointer_Right) + KEY_Pointer_Up = uint(C.GDK_KEY_Pointer_Up) + KEY_Pointer_Down = uint(C.GDK_KEY_Pointer_Down) + KEY_Pointer_UpLeft = uint(C.GDK_KEY_Pointer_UpLeft) + KEY_Pointer_UpRight = uint(C.GDK_KEY_Pointer_UpRight) + KEY_Pointer_DownLeft = uint(C.GDK_KEY_Pointer_DownLeft) + KEY_Pointer_DownRight = uint(C.GDK_KEY_Pointer_DownRight) + KEY_Pointer_Button_Dflt = uint(C.GDK_KEY_Pointer_Button_Dflt) + KEY_Pointer_Button1 = uint(C.GDK_KEY_Pointer_Button1) + KEY_Pointer_Button2 = uint(C.GDK_KEY_Pointer_Button2) + KEY_Pointer_Button3 = uint(C.GDK_KEY_Pointer_Button3) + KEY_Pointer_Button4 = uint(C.GDK_KEY_Pointer_Button4) + KEY_Pointer_Button5 = uint(C.GDK_KEY_Pointer_Button5) + KEY_Pointer_DblClick_Dflt = uint(C.GDK_KEY_Pointer_DblClick_Dflt) + KEY_Pointer_DblClick1 = uint(C.GDK_KEY_Pointer_DblClick1) + KEY_Pointer_DblClick2 = uint(C.GDK_KEY_Pointer_DblClick2) + KEY_Pointer_DblClick3 = uint(C.GDK_KEY_Pointer_DblClick3) + KEY_Pointer_DblClick4 = uint(C.GDK_KEY_Pointer_DblClick4) + KEY_Pointer_DblClick5 = uint(C.GDK_KEY_Pointer_DblClick5) + KEY_Pointer_Drag_Dflt = uint(C.GDK_KEY_Pointer_Drag_Dflt) + KEY_Pointer_Drag1 = uint(C.GDK_KEY_Pointer_Drag1) + KEY_Pointer_Drag2 = uint(C.GDK_KEY_Pointer_Drag2) + KEY_Pointer_Drag3 = uint(C.GDK_KEY_Pointer_Drag3) + KEY_Pointer_Drag4 = uint(C.GDK_KEY_Pointer_Drag4) + KEY_Pointer_Drag5 = uint(C.GDK_KEY_Pointer_Drag5) + KEY_Pointer_EnableKeys = uint(C.GDK_KEY_Pointer_EnableKeys) + KEY_Pointer_Accelerate = uint(C.GDK_KEY_Pointer_Accelerate) + KEY_Pointer_DfltBtnNext = uint(C.GDK_KEY_Pointer_DfltBtnNext) + KEY_Pointer_DfltBtnPrev = uint(C.GDK_KEY_Pointer_DfltBtnPrev) + KEY_ch = uint(C.GDK_KEY_ch) + KEY_Ch = uint(C.GDK_KEY_Ch) + KEY_CH = uint(C.GDK_KEY_CH) + KEY_c_h = uint(C.GDK_KEY_c_h) + KEY_C_h = uint(C.GDK_KEY_C_h) + KEY_C_H = uint(C.GDK_KEY_C_H) + KEY_3270_Duplicate = uint(C.GDK_KEY_3270_Duplicate) + KEY_3270_FieldMark = uint(C.GDK_KEY_3270_FieldMark) + KEY_3270_Right2 = uint(C.GDK_KEY_3270_Right2) + KEY_3270_Left2 = uint(C.GDK_KEY_3270_Left2) + KEY_3270_BackTab = uint(C.GDK_KEY_3270_BackTab) + KEY_3270_EraseEOF = uint(C.GDK_KEY_3270_EraseEOF) + KEY_3270_EraseInput = uint(C.GDK_KEY_3270_EraseInput) + KEY_3270_Reset = uint(C.GDK_KEY_3270_Reset) + KEY_3270_Quit = uint(C.GDK_KEY_3270_Quit) + KEY_3270_PA1 = uint(C.GDK_KEY_3270_PA1) + KEY_3270_PA2 = uint(C.GDK_KEY_3270_PA2) + KEY_3270_PA3 = uint(C.GDK_KEY_3270_PA3) + KEY_3270_Test = uint(C.GDK_KEY_3270_Test) + KEY_3270_Attn = uint(C.GDK_KEY_3270_Attn) + KEY_3270_CursorBlink = uint(C.GDK_KEY_3270_CursorBlink) + KEY_3270_AltCursor = uint(C.GDK_KEY_3270_AltCursor) + KEY_3270_KeyClick = uint(C.GDK_KEY_3270_KeyClick) + KEY_3270_Jump = uint(C.GDK_KEY_3270_Jump) + KEY_3270_Ident = uint(C.GDK_KEY_3270_Ident) + KEY_3270_Rule = uint(C.GDK_KEY_3270_Rule) + KEY_3270_Copy = uint(C.GDK_KEY_3270_Copy) + KEY_3270_Play = uint(C.GDK_KEY_3270_Play) + KEY_3270_Setup = uint(C.GDK_KEY_3270_Setup) + KEY_3270_Record = uint(C.GDK_KEY_3270_Record) + KEY_3270_ChangeScreen = uint(C.GDK_KEY_3270_ChangeScreen) + KEY_3270_DeleteWord = uint(C.GDK_KEY_3270_DeleteWord) + KEY_3270_ExSelect = uint(C.GDK_KEY_3270_ExSelect) + KEY_3270_CursorSelect = uint(C.GDK_KEY_3270_CursorSelect) + KEY_3270_PrintScreen = uint(C.GDK_KEY_3270_PrintScreen) + KEY_3270_Enter = uint(C.GDK_KEY_3270_Enter) + KEY_space = uint(C.GDK_KEY_space) + KEY_exclam = uint(C.GDK_KEY_exclam) + KEY_quotedbl = uint(C.GDK_KEY_quotedbl) + KEY_numbersign = uint(C.GDK_KEY_numbersign) + KEY_dollar = uint(C.GDK_KEY_dollar) + KEY_percent = uint(C.GDK_KEY_percent) + KEY_ampersand = uint(C.GDK_KEY_ampersand) + KEY_apostrophe = uint(C.GDK_KEY_apostrophe) + KEY_quoteright = uint(C.GDK_KEY_quoteright) + KEY_parenleft = uint(C.GDK_KEY_parenleft) + KEY_parenright = uint(C.GDK_KEY_parenright) + KEY_asterisk = uint(C.GDK_KEY_asterisk) + KEY_plus = uint(C.GDK_KEY_plus) + KEY_comma = uint(C.GDK_KEY_comma) + KEY_minus = uint(C.GDK_KEY_minus) + KEY_period = uint(C.GDK_KEY_period) + KEY_slash = uint(C.GDK_KEY_slash) + KEY_0 = uint(C.GDK_KEY_0) + KEY_1 = uint(C.GDK_KEY_1) + KEY_2 = uint(C.GDK_KEY_2) + KEY_3 = uint(C.GDK_KEY_3) + KEY_4 = uint(C.GDK_KEY_4) + KEY_5 = uint(C.GDK_KEY_5) + KEY_6 = uint(C.GDK_KEY_6) + KEY_7 = uint(C.GDK_KEY_7) + KEY_8 = uint(C.GDK_KEY_8) + KEY_9 = uint(C.GDK_KEY_9) + KEY_colon = uint(C.GDK_KEY_colon) + KEY_semicolon = uint(C.GDK_KEY_semicolon) + KEY_less = uint(C.GDK_KEY_less) + KEY_equal = uint(C.GDK_KEY_equal) + KEY_greater = uint(C.GDK_KEY_greater) + KEY_question = uint(C.GDK_KEY_question) + KEY_at = uint(C.GDK_KEY_at) + KEY_A = uint(C.GDK_KEY_A) + KEY_B = uint(C.GDK_KEY_B) + KEY_C = uint(C.GDK_KEY_C) + KEY_D = uint(C.GDK_KEY_D) + KEY_E = uint(C.GDK_KEY_E) + KEY_F = uint(C.GDK_KEY_F) + KEY_G = uint(C.GDK_KEY_G) + KEY_H = uint(C.GDK_KEY_H) + KEY_I = uint(C.GDK_KEY_I) + KEY_J = uint(C.GDK_KEY_J) + KEY_K = uint(C.GDK_KEY_K) + KEY_L = uint(C.GDK_KEY_L) + KEY_M = uint(C.GDK_KEY_M) + KEY_N = uint(C.GDK_KEY_N) + KEY_O = uint(C.GDK_KEY_O) + KEY_P = uint(C.GDK_KEY_P) + KEY_Q = uint(C.GDK_KEY_Q) + KEY_R = uint(C.GDK_KEY_R) + KEY_S = uint(C.GDK_KEY_S) + KEY_T = uint(C.GDK_KEY_T) + KEY_U = uint(C.GDK_KEY_U) + KEY_V = uint(C.GDK_KEY_V) + KEY_W = uint(C.GDK_KEY_W) + KEY_X = uint(C.GDK_KEY_X) + KEY_Y = uint(C.GDK_KEY_Y) + KEY_Z = uint(C.GDK_KEY_Z) + KEY_bracketleft = uint(C.GDK_KEY_bracketleft) + KEY_backslash = uint(C.GDK_KEY_backslash) + KEY_bracketright = uint(C.GDK_KEY_bracketright) + KEY_asciicircum = uint(C.GDK_KEY_asciicircum) + KEY_underscore = uint(C.GDK_KEY_underscore) + KEY_grave = uint(C.GDK_KEY_grave) + KEY_quoteleft = uint(C.GDK_KEY_quoteleft) + KEY_a = uint(C.GDK_KEY_a) + KEY_b = uint(C.GDK_KEY_b) + KEY_c = uint(C.GDK_KEY_c) + KEY_d = uint(C.GDK_KEY_d) + KEY_e = uint(C.GDK_KEY_e) + KEY_f = uint(C.GDK_KEY_f) + KEY_g = uint(C.GDK_KEY_g) + KEY_h = uint(C.GDK_KEY_h) + KEY_i = uint(C.GDK_KEY_i) + KEY_j = uint(C.GDK_KEY_j) + KEY_k = uint(C.GDK_KEY_k) + KEY_l = uint(C.GDK_KEY_l) + KEY_m = uint(C.GDK_KEY_m) + KEY_n = uint(C.GDK_KEY_n) + KEY_o = uint(C.GDK_KEY_o) + KEY_p = uint(C.GDK_KEY_p) + KEY_q = uint(C.GDK_KEY_q) + KEY_r = uint(C.GDK_KEY_r) + KEY_s = uint(C.GDK_KEY_s) + KEY_t = uint(C.GDK_KEY_t) + KEY_u = uint(C.GDK_KEY_u) + KEY_v = uint(C.GDK_KEY_v) + KEY_w = uint(C.GDK_KEY_w) + KEY_x = uint(C.GDK_KEY_x) + KEY_y = uint(C.GDK_KEY_y) + KEY_z = uint(C.GDK_KEY_z) + KEY_braceleft = uint(C.GDK_KEY_braceleft) + KEY_bar = uint(C.GDK_KEY_bar) + KEY_braceright = uint(C.GDK_KEY_braceright) + KEY_asciitilde = uint(C.GDK_KEY_asciitilde) + KEY_nobreakspace = uint(C.GDK_KEY_nobreakspace) + KEY_exclamdown = uint(C.GDK_KEY_exclamdown) + KEY_cent = uint(C.GDK_KEY_cent) + KEY_sterling = uint(C.GDK_KEY_sterling) + KEY_currency = uint(C.GDK_KEY_currency) + KEY_yen = uint(C.GDK_KEY_yen) + KEY_brokenbar = uint(C.GDK_KEY_brokenbar) + KEY_section = uint(C.GDK_KEY_section) + KEY_diaeresis = uint(C.GDK_KEY_diaeresis) + KEY_copyright = uint(C.GDK_KEY_copyright) + KEY_ordfeminine = uint(C.GDK_KEY_ordfeminine) + KEY_guillemotleft = uint(C.GDK_KEY_guillemotleft) + KEY_notsign = uint(C.GDK_KEY_notsign) + KEY_hyphen = uint(C.GDK_KEY_hyphen) + KEY_registered = uint(C.GDK_KEY_registered) + KEY_macron = uint(C.GDK_KEY_macron) + KEY_degree = uint(C.GDK_KEY_degree) + KEY_plusminus = uint(C.GDK_KEY_plusminus) + KEY_twosuperior = uint(C.GDK_KEY_twosuperior) + KEY_threesuperior = uint(C.GDK_KEY_threesuperior) + KEY_acute = uint(C.GDK_KEY_acute) + KEY_mu = uint(C.GDK_KEY_mu) + KEY_paragraph = uint(C.GDK_KEY_paragraph) + KEY_periodcentered = uint(C.GDK_KEY_periodcentered) + KEY_cedilla = uint(C.GDK_KEY_cedilla) + KEY_onesuperior = uint(C.GDK_KEY_onesuperior) + KEY_masculine = uint(C.GDK_KEY_masculine) + KEY_guillemotright = uint(C.GDK_KEY_guillemotright) + KEY_onequarter = uint(C.GDK_KEY_onequarter) + KEY_onehalf = uint(C.GDK_KEY_onehalf) + KEY_threequarters = uint(C.GDK_KEY_threequarters) + KEY_questiondown = uint(C.GDK_KEY_questiondown) + KEY_Agrave = uint(C.GDK_KEY_Agrave) + KEY_Aacute = uint(C.GDK_KEY_Aacute) + KEY_Acircumflex = uint(C.GDK_KEY_Acircumflex) + KEY_Atilde = uint(C.GDK_KEY_Atilde) + KEY_Adiaeresis = uint(C.GDK_KEY_Adiaeresis) + KEY_Aring = uint(C.GDK_KEY_Aring) + KEY_AE = uint(C.GDK_KEY_AE) + KEY_Ccedilla = uint(C.GDK_KEY_Ccedilla) + KEY_Egrave = uint(C.GDK_KEY_Egrave) + KEY_Eacute = uint(C.GDK_KEY_Eacute) + KEY_Ecircumflex = uint(C.GDK_KEY_Ecircumflex) + KEY_Ediaeresis = uint(C.GDK_KEY_Ediaeresis) + KEY_Igrave = uint(C.GDK_KEY_Igrave) + KEY_Iacute = uint(C.GDK_KEY_Iacute) + KEY_Icircumflex = uint(C.GDK_KEY_Icircumflex) + KEY_Idiaeresis = uint(C.GDK_KEY_Idiaeresis) + KEY_ETH = uint(C.GDK_KEY_ETH) + KEY_Eth = uint(C.GDK_KEY_Eth) + KEY_Ntilde = uint(C.GDK_KEY_Ntilde) + KEY_Ograve = uint(C.GDK_KEY_Ograve) + KEY_Oacute = uint(C.GDK_KEY_Oacute) + KEY_Ocircumflex = uint(C.GDK_KEY_Ocircumflex) + KEY_Otilde = uint(C.GDK_KEY_Otilde) + KEY_Odiaeresis = uint(C.GDK_KEY_Odiaeresis) + KEY_multiply = uint(C.GDK_KEY_multiply) + KEY_Oslash = uint(C.GDK_KEY_Oslash) + KEY_Ooblique = uint(C.GDK_KEY_Ooblique) + KEY_Ugrave = uint(C.GDK_KEY_Ugrave) + KEY_Uacute = uint(C.GDK_KEY_Uacute) + KEY_Ucircumflex = uint(C.GDK_KEY_Ucircumflex) + KEY_Udiaeresis = uint(C.GDK_KEY_Udiaeresis) + KEY_Yacute = uint(C.GDK_KEY_Yacute) + KEY_THORN = uint(C.GDK_KEY_THORN) + KEY_Thorn = uint(C.GDK_KEY_Thorn) + KEY_ssharp = uint(C.GDK_KEY_ssharp) + KEY_agrave = uint(C.GDK_KEY_agrave) + KEY_aacute = uint(C.GDK_KEY_aacute) + KEY_acircumflex = uint(C.GDK_KEY_acircumflex) + KEY_atilde = uint(C.GDK_KEY_atilde) + KEY_adiaeresis = uint(C.GDK_KEY_adiaeresis) + KEY_aring = uint(C.GDK_KEY_aring) + KEY_ae = uint(C.GDK_KEY_ae) + KEY_ccedilla = uint(C.GDK_KEY_ccedilla) + KEY_egrave = uint(C.GDK_KEY_egrave) + KEY_eacute = uint(C.GDK_KEY_eacute) + KEY_ecircumflex = uint(C.GDK_KEY_ecircumflex) + KEY_ediaeresis = uint(C.GDK_KEY_ediaeresis) + KEY_igrave = uint(C.GDK_KEY_igrave) + KEY_iacute = uint(C.GDK_KEY_iacute) + KEY_icircumflex = uint(C.GDK_KEY_icircumflex) + KEY_idiaeresis = uint(C.GDK_KEY_idiaeresis) + KEY_eth = uint(C.GDK_KEY_eth) + KEY_ntilde = uint(C.GDK_KEY_ntilde) + KEY_ograve = uint(C.GDK_KEY_ograve) + KEY_oacute = uint(C.GDK_KEY_oacute) + KEY_ocircumflex = uint(C.GDK_KEY_ocircumflex) + KEY_otilde = uint(C.GDK_KEY_otilde) + KEY_odiaeresis = uint(C.GDK_KEY_odiaeresis) + KEY_division = uint(C.GDK_KEY_division) + KEY_oslash = uint(C.GDK_KEY_oslash) + KEY_ooblique = uint(C.GDK_KEY_ooblique) + KEY_ugrave = uint(C.GDK_KEY_ugrave) + KEY_uacute = uint(C.GDK_KEY_uacute) + KEY_ucircumflex = uint(C.GDK_KEY_ucircumflex) + KEY_udiaeresis = uint(C.GDK_KEY_udiaeresis) + KEY_yacute = uint(C.GDK_KEY_yacute) + KEY_thorn = uint(C.GDK_KEY_thorn) + KEY_ydiaeresis = uint(C.GDK_KEY_ydiaeresis) + KEY_Aogonek = uint(C.GDK_KEY_Aogonek) + KEY_breve = uint(C.GDK_KEY_breve) + KEY_Lstroke = uint(C.GDK_KEY_Lstroke) + KEY_Lcaron = uint(C.GDK_KEY_Lcaron) + KEY_Sacute = uint(C.GDK_KEY_Sacute) + KEY_Scaron = uint(C.GDK_KEY_Scaron) + KEY_Scedilla = uint(C.GDK_KEY_Scedilla) + KEY_Tcaron = uint(C.GDK_KEY_Tcaron) + KEY_Zacute = uint(C.GDK_KEY_Zacute) + KEY_Zcaron = uint(C.GDK_KEY_Zcaron) + KEY_Zabovedot = uint(C.GDK_KEY_Zabovedot) + KEY_aogonek = uint(C.GDK_KEY_aogonek) + KEY_ogonek = uint(C.GDK_KEY_ogonek) + KEY_lstroke = uint(C.GDK_KEY_lstroke) + KEY_lcaron = uint(C.GDK_KEY_lcaron) + KEY_sacute = uint(C.GDK_KEY_sacute) + KEY_caron = uint(C.GDK_KEY_caron) + KEY_scaron = uint(C.GDK_KEY_scaron) + KEY_scedilla = uint(C.GDK_KEY_scedilla) + KEY_tcaron = uint(C.GDK_KEY_tcaron) + KEY_zacute = uint(C.GDK_KEY_zacute) + KEY_doubleacute = uint(C.GDK_KEY_doubleacute) + KEY_zcaron = uint(C.GDK_KEY_zcaron) + KEY_zabovedot = uint(C.GDK_KEY_zabovedot) + KEY_Racute = uint(C.GDK_KEY_Racute) + KEY_Abreve = uint(C.GDK_KEY_Abreve) + KEY_Lacute = uint(C.GDK_KEY_Lacute) + KEY_Cacute = uint(C.GDK_KEY_Cacute) + KEY_Ccaron = uint(C.GDK_KEY_Ccaron) + KEY_Eogonek = uint(C.GDK_KEY_Eogonek) + KEY_Ecaron = uint(C.GDK_KEY_Ecaron) + KEY_Dcaron = uint(C.GDK_KEY_Dcaron) + KEY_Dstroke = uint(C.GDK_KEY_Dstroke) + KEY_Nacute = uint(C.GDK_KEY_Nacute) + KEY_Ncaron = uint(C.GDK_KEY_Ncaron) + KEY_Odoubleacute = uint(C.GDK_KEY_Odoubleacute) + KEY_Rcaron = uint(C.GDK_KEY_Rcaron) + KEY_Uring = uint(C.GDK_KEY_Uring) + KEY_Udoubleacute = uint(C.GDK_KEY_Udoubleacute) + KEY_Tcedilla = uint(C.GDK_KEY_Tcedilla) + KEY_racute = uint(C.GDK_KEY_racute) + KEY_abreve = uint(C.GDK_KEY_abreve) + KEY_lacute = uint(C.GDK_KEY_lacute) + KEY_cacute = uint(C.GDK_KEY_cacute) + KEY_ccaron = uint(C.GDK_KEY_ccaron) + KEY_eogonek = uint(C.GDK_KEY_eogonek) + KEY_ecaron = uint(C.GDK_KEY_ecaron) + KEY_dcaron = uint(C.GDK_KEY_dcaron) + KEY_dstroke = uint(C.GDK_KEY_dstroke) + KEY_nacute = uint(C.GDK_KEY_nacute) + KEY_ncaron = uint(C.GDK_KEY_ncaron) + KEY_odoubleacute = uint(C.GDK_KEY_odoubleacute) + KEY_rcaron = uint(C.GDK_KEY_rcaron) + KEY_uring = uint(C.GDK_KEY_uring) + KEY_udoubleacute = uint(C.GDK_KEY_udoubleacute) + KEY_tcedilla = uint(C.GDK_KEY_tcedilla) + KEY_abovedot = uint(C.GDK_KEY_abovedot) + KEY_Hstroke = uint(C.GDK_KEY_Hstroke) + KEY_Hcircumflex = uint(C.GDK_KEY_Hcircumflex) + KEY_Iabovedot = uint(C.GDK_KEY_Iabovedot) + KEY_Gbreve = uint(C.GDK_KEY_Gbreve) + KEY_Jcircumflex = uint(C.GDK_KEY_Jcircumflex) + KEY_hstroke = uint(C.GDK_KEY_hstroke) + KEY_hcircumflex = uint(C.GDK_KEY_hcircumflex) + KEY_idotless = uint(C.GDK_KEY_idotless) + KEY_gbreve = uint(C.GDK_KEY_gbreve) + KEY_jcircumflex = uint(C.GDK_KEY_jcircumflex) + KEY_Cabovedot = uint(C.GDK_KEY_Cabovedot) + KEY_Ccircumflex = uint(C.GDK_KEY_Ccircumflex) + KEY_Gabovedot = uint(C.GDK_KEY_Gabovedot) + KEY_Gcircumflex = uint(C.GDK_KEY_Gcircumflex) + KEY_Ubreve = uint(C.GDK_KEY_Ubreve) + KEY_Scircumflex = uint(C.GDK_KEY_Scircumflex) + KEY_cabovedot = uint(C.GDK_KEY_cabovedot) + KEY_ccircumflex = uint(C.GDK_KEY_ccircumflex) + KEY_gabovedot = uint(C.GDK_KEY_gabovedot) + KEY_gcircumflex = uint(C.GDK_KEY_gcircumflex) + KEY_ubreve = uint(C.GDK_KEY_ubreve) + KEY_scircumflex = uint(C.GDK_KEY_scircumflex) + KEY_kra = uint(C.GDK_KEY_kra) + KEY_kappa = uint(C.GDK_KEY_kappa) + KEY_Rcedilla = uint(C.GDK_KEY_Rcedilla) + KEY_Itilde = uint(C.GDK_KEY_Itilde) + KEY_Lcedilla = uint(C.GDK_KEY_Lcedilla) + KEY_Emacron = uint(C.GDK_KEY_Emacron) + KEY_Gcedilla = uint(C.GDK_KEY_Gcedilla) + KEY_Tslash = uint(C.GDK_KEY_Tslash) + KEY_rcedilla = uint(C.GDK_KEY_rcedilla) + KEY_itilde = uint(C.GDK_KEY_itilde) + KEY_lcedilla = uint(C.GDK_KEY_lcedilla) + KEY_emacron = uint(C.GDK_KEY_emacron) + KEY_gcedilla = uint(C.GDK_KEY_gcedilla) + KEY_tslash = uint(C.GDK_KEY_tslash) + KEY_ENG = uint(C.GDK_KEY_ENG) + KEY_eng = uint(C.GDK_KEY_eng) + KEY_Amacron = uint(C.GDK_KEY_Amacron) + KEY_Iogonek = uint(C.GDK_KEY_Iogonek) + KEY_Eabovedot = uint(C.GDK_KEY_Eabovedot) + KEY_Imacron = uint(C.GDK_KEY_Imacron) + KEY_Ncedilla = uint(C.GDK_KEY_Ncedilla) + KEY_Omacron = uint(C.GDK_KEY_Omacron) + KEY_Kcedilla = uint(C.GDK_KEY_Kcedilla) + KEY_Uogonek = uint(C.GDK_KEY_Uogonek) + KEY_Utilde = uint(C.GDK_KEY_Utilde) + KEY_Umacron = uint(C.GDK_KEY_Umacron) + KEY_amacron = uint(C.GDK_KEY_amacron) + KEY_iogonek = uint(C.GDK_KEY_iogonek) + KEY_eabovedot = uint(C.GDK_KEY_eabovedot) + KEY_imacron = uint(C.GDK_KEY_imacron) + KEY_ncedilla = uint(C.GDK_KEY_ncedilla) + KEY_omacron = uint(C.GDK_KEY_omacron) + KEY_kcedilla = uint(C.GDK_KEY_kcedilla) + KEY_uogonek = uint(C.GDK_KEY_uogonek) + KEY_utilde = uint(C.GDK_KEY_utilde) + KEY_umacron = uint(C.GDK_KEY_umacron) + KEY_Wcircumflex = uint(C.GDK_KEY_Wcircumflex) + KEY_wcircumflex = uint(C.GDK_KEY_wcircumflex) + KEY_Ycircumflex = uint(C.GDK_KEY_Ycircumflex) + KEY_ycircumflex = uint(C.GDK_KEY_ycircumflex) + KEY_Babovedot = uint(C.GDK_KEY_Babovedot) + KEY_babovedot = uint(C.GDK_KEY_babovedot) + KEY_Dabovedot = uint(C.GDK_KEY_Dabovedot) + KEY_dabovedot = uint(C.GDK_KEY_dabovedot) + KEY_Fabovedot = uint(C.GDK_KEY_Fabovedot) + KEY_fabovedot = uint(C.GDK_KEY_fabovedot) + KEY_Mabovedot = uint(C.GDK_KEY_Mabovedot) + KEY_mabovedot = uint(C.GDK_KEY_mabovedot) + KEY_Pabovedot = uint(C.GDK_KEY_Pabovedot) + KEY_pabovedot = uint(C.GDK_KEY_pabovedot) + KEY_Sabovedot = uint(C.GDK_KEY_Sabovedot) + KEY_sabovedot = uint(C.GDK_KEY_sabovedot) + KEY_Tabovedot = uint(C.GDK_KEY_Tabovedot) + KEY_tabovedot = uint(C.GDK_KEY_tabovedot) + KEY_Wgrave = uint(C.GDK_KEY_Wgrave) + KEY_wgrave = uint(C.GDK_KEY_wgrave) + KEY_Wacute = uint(C.GDK_KEY_Wacute) + KEY_wacute = uint(C.GDK_KEY_wacute) + KEY_Wdiaeresis = uint(C.GDK_KEY_Wdiaeresis) + KEY_wdiaeresis = uint(C.GDK_KEY_wdiaeresis) + KEY_Ygrave = uint(C.GDK_KEY_Ygrave) + KEY_ygrave = uint(C.GDK_KEY_ygrave) + KEY_OE = uint(C.GDK_KEY_OE) + KEY_oe = uint(C.GDK_KEY_oe) + KEY_Ydiaeresis = uint(C.GDK_KEY_Ydiaeresis) + KEY_overline = uint(C.GDK_KEY_overline) + KEY_kana_fullstop = uint(C.GDK_KEY_kana_fullstop) + KEY_kana_openingbracket = uint(C.GDK_KEY_kana_openingbracket) + KEY_kana_closingbracket = uint(C.GDK_KEY_kana_closingbracket) + KEY_kana_comma = uint(C.GDK_KEY_kana_comma) + KEY_kana_conjunctive = uint(C.GDK_KEY_kana_conjunctive) + KEY_kana_middledot = uint(C.GDK_KEY_kana_middledot) + KEY_kana_WO = uint(C.GDK_KEY_kana_WO) + KEY_kana_a = uint(C.GDK_KEY_kana_a) + KEY_kana_i = uint(C.GDK_KEY_kana_i) + KEY_kana_u = uint(C.GDK_KEY_kana_u) + KEY_kana_e = uint(C.GDK_KEY_kana_e) + KEY_kana_o = uint(C.GDK_KEY_kana_o) + KEY_kana_ya = uint(C.GDK_KEY_kana_ya) + KEY_kana_yu = uint(C.GDK_KEY_kana_yu) + KEY_kana_yo = uint(C.GDK_KEY_kana_yo) + KEY_kana_tsu = uint(C.GDK_KEY_kana_tsu) + KEY_kana_tu = uint(C.GDK_KEY_kana_tu) + KEY_prolongedsound = uint(C.GDK_KEY_prolongedsound) + KEY_kana_A = uint(C.GDK_KEY_kana_A) + KEY_kana_I = uint(C.GDK_KEY_kana_I) + KEY_kana_U = uint(C.GDK_KEY_kana_U) + KEY_kana_E = uint(C.GDK_KEY_kana_E) + KEY_kana_O = uint(C.GDK_KEY_kana_O) + KEY_kana_KA = uint(C.GDK_KEY_kana_KA) + KEY_kana_KI = uint(C.GDK_KEY_kana_KI) + KEY_kana_KU = uint(C.GDK_KEY_kana_KU) + KEY_kana_KE = uint(C.GDK_KEY_kana_KE) + KEY_kana_KO = uint(C.GDK_KEY_kana_KO) + KEY_kana_SA = uint(C.GDK_KEY_kana_SA) + KEY_kana_SHI = uint(C.GDK_KEY_kana_SHI) + KEY_kana_SU = uint(C.GDK_KEY_kana_SU) + KEY_kana_SE = uint(C.GDK_KEY_kana_SE) + KEY_kana_SO = uint(C.GDK_KEY_kana_SO) + KEY_kana_TA = uint(C.GDK_KEY_kana_TA) + KEY_kana_CHI = uint(C.GDK_KEY_kana_CHI) + KEY_kana_TI = uint(C.GDK_KEY_kana_TI) + KEY_kana_TSU = uint(C.GDK_KEY_kana_TSU) + KEY_kana_TU = uint(C.GDK_KEY_kana_TU) + KEY_kana_TE = uint(C.GDK_KEY_kana_TE) + KEY_kana_TO = uint(C.GDK_KEY_kana_TO) + KEY_kana_NA = uint(C.GDK_KEY_kana_NA) + KEY_kana_NI = uint(C.GDK_KEY_kana_NI) + KEY_kana_NU = uint(C.GDK_KEY_kana_NU) + KEY_kana_NE = uint(C.GDK_KEY_kana_NE) + KEY_kana_NO = uint(C.GDK_KEY_kana_NO) + KEY_kana_HA = uint(C.GDK_KEY_kana_HA) + KEY_kana_HI = uint(C.GDK_KEY_kana_HI) + KEY_kana_FU = uint(C.GDK_KEY_kana_FU) + KEY_kana_HU = uint(C.GDK_KEY_kana_HU) + KEY_kana_HE = uint(C.GDK_KEY_kana_HE) + KEY_kana_HO = uint(C.GDK_KEY_kana_HO) + KEY_kana_MA = uint(C.GDK_KEY_kana_MA) + KEY_kana_MI = uint(C.GDK_KEY_kana_MI) + KEY_kana_MU = uint(C.GDK_KEY_kana_MU) + KEY_kana_ME = uint(C.GDK_KEY_kana_ME) + KEY_kana_MO = uint(C.GDK_KEY_kana_MO) + KEY_kana_YA = uint(C.GDK_KEY_kana_YA) + KEY_kana_YU = uint(C.GDK_KEY_kana_YU) + KEY_kana_YO = uint(C.GDK_KEY_kana_YO) + KEY_kana_RA = uint(C.GDK_KEY_kana_RA) + KEY_kana_RI = uint(C.GDK_KEY_kana_RI) + KEY_kana_RU = uint(C.GDK_KEY_kana_RU) + KEY_kana_RE = uint(C.GDK_KEY_kana_RE) + KEY_kana_RO = uint(C.GDK_KEY_kana_RO) + KEY_kana_WA = uint(C.GDK_KEY_kana_WA) + KEY_kana_N = uint(C.GDK_KEY_kana_N) + KEY_voicedsound = uint(C.GDK_KEY_voicedsound) + KEY_semivoicedsound = uint(C.GDK_KEY_semivoicedsound) + KEY_kana_switch = uint(C.GDK_KEY_kana_switch) + KEY_Farsi_0 = uint(C.GDK_KEY_Farsi_0) + KEY_Farsi_1 = uint(C.GDK_KEY_Farsi_1) + KEY_Farsi_2 = uint(C.GDK_KEY_Farsi_2) + KEY_Farsi_3 = uint(C.GDK_KEY_Farsi_3) + KEY_Farsi_4 = uint(C.GDK_KEY_Farsi_4) + KEY_Farsi_5 = uint(C.GDK_KEY_Farsi_5) + KEY_Farsi_6 = uint(C.GDK_KEY_Farsi_6) + KEY_Farsi_7 = uint(C.GDK_KEY_Farsi_7) + KEY_Farsi_8 = uint(C.GDK_KEY_Farsi_8) + KEY_Farsi_9 = uint(C.GDK_KEY_Farsi_9) + KEY_Arabic_percent = uint(C.GDK_KEY_Arabic_percent) + KEY_Arabic_superscript_alef = uint(C.GDK_KEY_Arabic_superscript_alef) + KEY_Arabic_tteh = uint(C.GDK_KEY_Arabic_tteh) + KEY_Arabic_peh = uint(C.GDK_KEY_Arabic_peh) + KEY_Arabic_tcheh = uint(C.GDK_KEY_Arabic_tcheh) + KEY_Arabic_ddal = uint(C.GDK_KEY_Arabic_ddal) + KEY_Arabic_rreh = uint(C.GDK_KEY_Arabic_rreh) + KEY_Arabic_comma = uint(C.GDK_KEY_Arabic_comma) + KEY_Arabic_fullstop = uint(C.GDK_KEY_Arabic_fullstop) + KEY_Arabic_0 = uint(C.GDK_KEY_Arabic_0) + KEY_Arabic_1 = uint(C.GDK_KEY_Arabic_1) + KEY_Arabic_2 = uint(C.GDK_KEY_Arabic_2) + KEY_Arabic_3 = uint(C.GDK_KEY_Arabic_3) + KEY_Arabic_4 = uint(C.GDK_KEY_Arabic_4) + KEY_Arabic_5 = uint(C.GDK_KEY_Arabic_5) + KEY_Arabic_6 = uint(C.GDK_KEY_Arabic_6) + KEY_Arabic_7 = uint(C.GDK_KEY_Arabic_7) + KEY_Arabic_8 = uint(C.GDK_KEY_Arabic_8) + KEY_Arabic_9 = uint(C.GDK_KEY_Arabic_9) + KEY_Arabic_semicolon = uint(C.GDK_KEY_Arabic_semicolon) + KEY_Arabic_question_mark = uint(C.GDK_KEY_Arabic_question_mark) + KEY_Arabic_hamza = uint(C.GDK_KEY_Arabic_hamza) + KEY_Arabic_maddaonalef = uint(C.GDK_KEY_Arabic_maddaonalef) + KEY_Arabic_hamzaonalef = uint(C.GDK_KEY_Arabic_hamzaonalef) + KEY_Arabic_hamzaonwaw = uint(C.GDK_KEY_Arabic_hamzaonwaw) + KEY_Arabic_hamzaunderalef = uint(C.GDK_KEY_Arabic_hamzaunderalef) + KEY_Arabic_hamzaonyeh = uint(C.GDK_KEY_Arabic_hamzaonyeh) + KEY_Arabic_alef = uint(C.GDK_KEY_Arabic_alef) + KEY_Arabic_beh = uint(C.GDK_KEY_Arabic_beh) + KEY_Arabic_tehmarbuta = uint(C.GDK_KEY_Arabic_tehmarbuta) + KEY_Arabic_teh = uint(C.GDK_KEY_Arabic_teh) + KEY_Arabic_theh = uint(C.GDK_KEY_Arabic_theh) + KEY_Arabic_jeem = uint(C.GDK_KEY_Arabic_jeem) + KEY_Arabic_hah = uint(C.GDK_KEY_Arabic_hah) + KEY_Arabic_khah = uint(C.GDK_KEY_Arabic_khah) + KEY_Arabic_dal = uint(C.GDK_KEY_Arabic_dal) + KEY_Arabic_thal = uint(C.GDK_KEY_Arabic_thal) + KEY_Arabic_ra = uint(C.GDK_KEY_Arabic_ra) + KEY_Arabic_zain = uint(C.GDK_KEY_Arabic_zain) + KEY_Arabic_seen = uint(C.GDK_KEY_Arabic_seen) + KEY_Arabic_sheen = uint(C.GDK_KEY_Arabic_sheen) + KEY_Arabic_sad = uint(C.GDK_KEY_Arabic_sad) + KEY_Arabic_dad = uint(C.GDK_KEY_Arabic_dad) + KEY_Arabic_tah = uint(C.GDK_KEY_Arabic_tah) + KEY_Arabic_zah = uint(C.GDK_KEY_Arabic_zah) + KEY_Arabic_ain = uint(C.GDK_KEY_Arabic_ain) + KEY_Arabic_ghain = uint(C.GDK_KEY_Arabic_ghain) + KEY_Arabic_tatweel = uint(C.GDK_KEY_Arabic_tatweel) + KEY_Arabic_feh = uint(C.GDK_KEY_Arabic_feh) + KEY_Arabic_qaf = uint(C.GDK_KEY_Arabic_qaf) + KEY_Arabic_kaf = uint(C.GDK_KEY_Arabic_kaf) + KEY_Arabic_lam = uint(C.GDK_KEY_Arabic_lam) + KEY_Arabic_meem = uint(C.GDK_KEY_Arabic_meem) + KEY_Arabic_noon = uint(C.GDK_KEY_Arabic_noon) + KEY_Arabic_ha = uint(C.GDK_KEY_Arabic_ha) + KEY_Arabic_heh = uint(C.GDK_KEY_Arabic_heh) + KEY_Arabic_waw = uint(C.GDK_KEY_Arabic_waw) + KEY_Arabic_alefmaksura = uint(C.GDK_KEY_Arabic_alefmaksura) + KEY_Arabic_yeh = uint(C.GDK_KEY_Arabic_yeh) + KEY_Arabic_fathatan = uint(C.GDK_KEY_Arabic_fathatan) + KEY_Arabic_dammatan = uint(C.GDK_KEY_Arabic_dammatan) + KEY_Arabic_kasratan = uint(C.GDK_KEY_Arabic_kasratan) + KEY_Arabic_fatha = uint(C.GDK_KEY_Arabic_fatha) + KEY_Arabic_damma = uint(C.GDK_KEY_Arabic_damma) + KEY_Arabic_kasra = uint(C.GDK_KEY_Arabic_kasra) + KEY_Arabic_shadda = uint(C.GDK_KEY_Arabic_shadda) + KEY_Arabic_sukun = uint(C.GDK_KEY_Arabic_sukun) + KEY_Arabic_madda_above = uint(C.GDK_KEY_Arabic_madda_above) + KEY_Arabic_hamza_above = uint(C.GDK_KEY_Arabic_hamza_above) + KEY_Arabic_hamza_below = uint(C.GDK_KEY_Arabic_hamza_below) + KEY_Arabic_jeh = uint(C.GDK_KEY_Arabic_jeh) + KEY_Arabic_veh = uint(C.GDK_KEY_Arabic_veh) + KEY_Arabic_keheh = uint(C.GDK_KEY_Arabic_keheh) + KEY_Arabic_gaf = uint(C.GDK_KEY_Arabic_gaf) + KEY_Arabic_noon_ghunna = uint(C.GDK_KEY_Arabic_noon_ghunna) + KEY_Arabic_heh_doachashmee = uint(C.GDK_KEY_Arabic_heh_doachashmee) + KEY_Farsi_yeh = uint(C.GDK_KEY_Farsi_yeh) + KEY_Arabic_farsi_yeh = uint(C.GDK_KEY_Arabic_farsi_yeh) + KEY_Arabic_yeh_baree = uint(C.GDK_KEY_Arabic_yeh_baree) + KEY_Arabic_heh_goal = uint(C.GDK_KEY_Arabic_heh_goal) + KEY_Arabic_switch = uint(C.GDK_KEY_Arabic_switch) + KEY_Cyrillic_GHE_bar = uint(C.GDK_KEY_Cyrillic_GHE_bar) + KEY_Cyrillic_ghe_bar = uint(C.GDK_KEY_Cyrillic_ghe_bar) + KEY_Cyrillic_ZHE_descender = uint(C.GDK_KEY_Cyrillic_ZHE_descender) + KEY_Cyrillic_zhe_descender = uint(C.GDK_KEY_Cyrillic_zhe_descender) + KEY_Cyrillic_KA_descender = uint(C.GDK_KEY_Cyrillic_KA_descender) + KEY_Cyrillic_ka_descender = uint(C.GDK_KEY_Cyrillic_ka_descender) + KEY_Cyrillic_KA_vertstroke = uint(C.GDK_KEY_Cyrillic_KA_vertstroke) + KEY_Cyrillic_ka_vertstroke = uint(C.GDK_KEY_Cyrillic_ka_vertstroke) + KEY_Cyrillic_EN_descender = uint(C.GDK_KEY_Cyrillic_EN_descender) + KEY_Cyrillic_en_descender = uint(C.GDK_KEY_Cyrillic_en_descender) + KEY_Cyrillic_U_straight = uint(C.GDK_KEY_Cyrillic_U_straight) + KEY_Cyrillic_u_straight = uint(C.GDK_KEY_Cyrillic_u_straight) + KEY_Cyrillic_U_straight_bar = uint(C.GDK_KEY_Cyrillic_U_straight_bar) + KEY_Cyrillic_u_straight_bar = uint(C.GDK_KEY_Cyrillic_u_straight_bar) + KEY_Cyrillic_HA_descender = uint(C.GDK_KEY_Cyrillic_HA_descender) + KEY_Cyrillic_ha_descender = uint(C.GDK_KEY_Cyrillic_ha_descender) + KEY_Cyrillic_CHE_descender = uint(C.GDK_KEY_Cyrillic_CHE_descender) + KEY_Cyrillic_che_descender = uint(C.GDK_KEY_Cyrillic_che_descender) + KEY_Cyrillic_CHE_vertstroke = uint(C.GDK_KEY_Cyrillic_CHE_vertstroke) + KEY_Cyrillic_che_vertstroke = uint(C.GDK_KEY_Cyrillic_che_vertstroke) + KEY_Cyrillic_SHHA = uint(C.GDK_KEY_Cyrillic_SHHA) + KEY_Cyrillic_shha = uint(C.GDK_KEY_Cyrillic_shha) + KEY_Cyrillic_SCHWA = uint(C.GDK_KEY_Cyrillic_SCHWA) + KEY_Cyrillic_schwa = uint(C.GDK_KEY_Cyrillic_schwa) + KEY_Cyrillic_I_macron = uint(C.GDK_KEY_Cyrillic_I_macron) + KEY_Cyrillic_i_macron = uint(C.GDK_KEY_Cyrillic_i_macron) + KEY_Cyrillic_O_bar = uint(C.GDK_KEY_Cyrillic_O_bar) + KEY_Cyrillic_o_bar = uint(C.GDK_KEY_Cyrillic_o_bar) + KEY_Cyrillic_U_macron = uint(C.GDK_KEY_Cyrillic_U_macron) + KEY_Cyrillic_u_macron = uint(C.GDK_KEY_Cyrillic_u_macron) + KEY_Serbian_dje = uint(C.GDK_KEY_Serbian_dje) + KEY_Macedonia_gje = uint(C.GDK_KEY_Macedonia_gje) + KEY_Cyrillic_io = uint(C.GDK_KEY_Cyrillic_io) + KEY_Ukrainian_ie = uint(C.GDK_KEY_Ukrainian_ie) + KEY_Ukranian_je = uint(C.GDK_KEY_Ukranian_je) + KEY_Macedonia_dse = uint(C.GDK_KEY_Macedonia_dse) + KEY_Ukrainian_i = uint(C.GDK_KEY_Ukrainian_i) + KEY_Ukranian_i = uint(C.GDK_KEY_Ukranian_i) + KEY_Ukrainian_yi = uint(C.GDK_KEY_Ukrainian_yi) + KEY_Ukranian_yi = uint(C.GDK_KEY_Ukranian_yi) + KEY_Cyrillic_je = uint(C.GDK_KEY_Cyrillic_je) + KEY_Serbian_je = uint(C.GDK_KEY_Serbian_je) + KEY_Cyrillic_lje = uint(C.GDK_KEY_Cyrillic_lje) + KEY_Serbian_lje = uint(C.GDK_KEY_Serbian_lje) + KEY_Cyrillic_nje = uint(C.GDK_KEY_Cyrillic_nje) + KEY_Serbian_nje = uint(C.GDK_KEY_Serbian_nje) + KEY_Serbian_tshe = uint(C.GDK_KEY_Serbian_tshe) + KEY_Macedonia_kje = uint(C.GDK_KEY_Macedonia_kje) + KEY_Ukrainian_ghe_with_upturn = uint(C.GDK_KEY_Ukrainian_ghe_with_upturn) + KEY_Byelorussian_shortu = uint(C.GDK_KEY_Byelorussian_shortu) + KEY_Cyrillic_dzhe = uint(C.GDK_KEY_Cyrillic_dzhe) + KEY_Serbian_dze = uint(C.GDK_KEY_Serbian_dze) + KEY_numerosign = uint(C.GDK_KEY_numerosign) + KEY_Serbian_DJE = uint(C.GDK_KEY_Serbian_DJE) + KEY_Macedonia_GJE = uint(C.GDK_KEY_Macedonia_GJE) + KEY_Cyrillic_IO = uint(C.GDK_KEY_Cyrillic_IO) + KEY_Ukrainian_IE = uint(C.GDK_KEY_Ukrainian_IE) + KEY_Ukranian_JE = uint(C.GDK_KEY_Ukranian_JE) + KEY_Macedonia_DSE = uint(C.GDK_KEY_Macedonia_DSE) + KEY_Ukrainian_I = uint(C.GDK_KEY_Ukrainian_I) + KEY_Ukranian_I = uint(C.GDK_KEY_Ukranian_I) + KEY_Ukrainian_YI = uint(C.GDK_KEY_Ukrainian_YI) + KEY_Ukranian_YI = uint(C.GDK_KEY_Ukranian_YI) + KEY_Cyrillic_JE = uint(C.GDK_KEY_Cyrillic_JE) + KEY_Serbian_JE = uint(C.GDK_KEY_Serbian_JE) + KEY_Cyrillic_LJE = uint(C.GDK_KEY_Cyrillic_LJE) + KEY_Serbian_LJE = uint(C.GDK_KEY_Serbian_LJE) + KEY_Cyrillic_NJE = uint(C.GDK_KEY_Cyrillic_NJE) + KEY_Serbian_NJE = uint(C.GDK_KEY_Serbian_NJE) + KEY_Serbian_TSHE = uint(C.GDK_KEY_Serbian_TSHE) + KEY_Macedonia_KJE = uint(C.GDK_KEY_Macedonia_KJE) + KEY_Ukrainian_GHE_WITH_UPTURN = uint(C.GDK_KEY_Ukrainian_GHE_WITH_UPTURN) + KEY_Byelorussian_SHORTU = uint(C.GDK_KEY_Byelorussian_SHORTU) + KEY_Cyrillic_DZHE = uint(C.GDK_KEY_Cyrillic_DZHE) + KEY_Serbian_DZE = uint(C.GDK_KEY_Serbian_DZE) + KEY_Cyrillic_yu = uint(C.GDK_KEY_Cyrillic_yu) + KEY_Cyrillic_a = uint(C.GDK_KEY_Cyrillic_a) + KEY_Cyrillic_be = uint(C.GDK_KEY_Cyrillic_be) + KEY_Cyrillic_tse = uint(C.GDK_KEY_Cyrillic_tse) + KEY_Cyrillic_de = uint(C.GDK_KEY_Cyrillic_de) + KEY_Cyrillic_ie = uint(C.GDK_KEY_Cyrillic_ie) + KEY_Cyrillic_ef = uint(C.GDK_KEY_Cyrillic_ef) + KEY_Cyrillic_ghe = uint(C.GDK_KEY_Cyrillic_ghe) + KEY_Cyrillic_ha = uint(C.GDK_KEY_Cyrillic_ha) + KEY_Cyrillic_i = uint(C.GDK_KEY_Cyrillic_i) + KEY_Cyrillic_shorti = uint(C.GDK_KEY_Cyrillic_shorti) + KEY_Cyrillic_ka = uint(C.GDK_KEY_Cyrillic_ka) + KEY_Cyrillic_el = uint(C.GDK_KEY_Cyrillic_el) + KEY_Cyrillic_em = uint(C.GDK_KEY_Cyrillic_em) + KEY_Cyrillic_en = uint(C.GDK_KEY_Cyrillic_en) + KEY_Cyrillic_o = uint(C.GDK_KEY_Cyrillic_o) + KEY_Cyrillic_pe = uint(C.GDK_KEY_Cyrillic_pe) + KEY_Cyrillic_ya = uint(C.GDK_KEY_Cyrillic_ya) + KEY_Cyrillic_er = uint(C.GDK_KEY_Cyrillic_er) + KEY_Cyrillic_es = uint(C.GDK_KEY_Cyrillic_es) + KEY_Cyrillic_te = uint(C.GDK_KEY_Cyrillic_te) + KEY_Cyrillic_u = uint(C.GDK_KEY_Cyrillic_u) + KEY_Cyrillic_zhe = uint(C.GDK_KEY_Cyrillic_zhe) + KEY_Cyrillic_ve = uint(C.GDK_KEY_Cyrillic_ve) + KEY_Cyrillic_softsign = uint(C.GDK_KEY_Cyrillic_softsign) + KEY_Cyrillic_yeru = uint(C.GDK_KEY_Cyrillic_yeru) + KEY_Cyrillic_ze = uint(C.GDK_KEY_Cyrillic_ze) + KEY_Cyrillic_sha = uint(C.GDK_KEY_Cyrillic_sha) + KEY_Cyrillic_e = uint(C.GDK_KEY_Cyrillic_e) + KEY_Cyrillic_shcha = uint(C.GDK_KEY_Cyrillic_shcha) + KEY_Cyrillic_che = uint(C.GDK_KEY_Cyrillic_che) + KEY_Cyrillic_hardsign = uint(C.GDK_KEY_Cyrillic_hardsign) + KEY_Cyrillic_YU = uint(C.GDK_KEY_Cyrillic_YU) + KEY_Cyrillic_A = uint(C.GDK_KEY_Cyrillic_A) + KEY_Cyrillic_BE = uint(C.GDK_KEY_Cyrillic_BE) + KEY_Cyrillic_TSE = uint(C.GDK_KEY_Cyrillic_TSE) + KEY_Cyrillic_DE = uint(C.GDK_KEY_Cyrillic_DE) + KEY_Cyrillic_IE = uint(C.GDK_KEY_Cyrillic_IE) + KEY_Cyrillic_EF = uint(C.GDK_KEY_Cyrillic_EF) + KEY_Cyrillic_GHE = uint(C.GDK_KEY_Cyrillic_GHE) + KEY_Cyrillic_HA = uint(C.GDK_KEY_Cyrillic_HA) + KEY_Cyrillic_I = uint(C.GDK_KEY_Cyrillic_I) + KEY_Cyrillic_SHORTI = uint(C.GDK_KEY_Cyrillic_SHORTI) + KEY_Cyrillic_KA = uint(C.GDK_KEY_Cyrillic_KA) + KEY_Cyrillic_EL = uint(C.GDK_KEY_Cyrillic_EL) + KEY_Cyrillic_EM = uint(C.GDK_KEY_Cyrillic_EM) + KEY_Cyrillic_EN = uint(C.GDK_KEY_Cyrillic_EN) + KEY_Cyrillic_O = uint(C.GDK_KEY_Cyrillic_O) + KEY_Cyrillic_PE = uint(C.GDK_KEY_Cyrillic_PE) + KEY_Cyrillic_YA = uint(C.GDK_KEY_Cyrillic_YA) + KEY_Cyrillic_ER = uint(C.GDK_KEY_Cyrillic_ER) + KEY_Cyrillic_ES = uint(C.GDK_KEY_Cyrillic_ES) + KEY_Cyrillic_TE = uint(C.GDK_KEY_Cyrillic_TE) + KEY_Cyrillic_U = uint(C.GDK_KEY_Cyrillic_U) + KEY_Cyrillic_ZHE = uint(C.GDK_KEY_Cyrillic_ZHE) + KEY_Cyrillic_VE = uint(C.GDK_KEY_Cyrillic_VE) + KEY_Cyrillic_SOFTSIGN = uint(C.GDK_KEY_Cyrillic_SOFTSIGN) + KEY_Cyrillic_YERU = uint(C.GDK_KEY_Cyrillic_YERU) + KEY_Cyrillic_ZE = uint(C.GDK_KEY_Cyrillic_ZE) + KEY_Cyrillic_SHA = uint(C.GDK_KEY_Cyrillic_SHA) + KEY_Cyrillic_E = uint(C.GDK_KEY_Cyrillic_E) + KEY_Cyrillic_SHCHA = uint(C.GDK_KEY_Cyrillic_SHCHA) + KEY_Cyrillic_CHE = uint(C.GDK_KEY_Cyrillic_CHE) + KEY_Cyrillic_HARDSIGN = uint(C.GDK_KEY_Cyrillic_HARDSIGN) + KEY_Greek_ALPHAaccent = uint(C.GDK_KEY_Greek_ALPHAaccent) + KEY_Greek_EPSILONaccent = uint(C.GDK_KEY_Greek_EPSILONaccent) + KEY_Greek_ETAaccent = uint(C.GDK_KEY_Greek_ETAaccent) + KEY_Greek_IOTAaccent = uint(C.GDK_KEY_Greek_IOTAaccent) + KEY_Greek_IOTAdieresis = uint(C.GDK_KEY_Greek_IOTAdieresis) + KEY_Greek_IOTAdiaeresis = uint(C.GDK_KEY_Greek_IOTAdiaeresis) + KEY_Greek_OMICRONaccent = uint(C.GDK_KEY_Greek_OMICRONaccent) + KEY_Greek_UPSILONaccent = uint(C.GDK_KEY_Greek_UPSILONaccent) + KEY_Greek_UPSILONdieresis = uint(C.GDK_KEY_Greek_UPSILONdieresis) + KEY_Greek_OMEGAaccent = uint(C.GDK_KEY_Greek_OMEGAaccent) + KEY_Greek_accentdieresis = uint(C.GDK_KEY_Greek_accentdieresis) + KEY_Greek_horizbar = uint(C.GDK_KEY_Greek_horizbar) + KEY_Greek_alphaaccent = uint(C.GDK_KEY_Greek_alphaaccent) + KEY_Greek_epsilonaccent = uint(C.GDK_KEY_Greek_epsilonaccent) + KEY_Greek_etaaccent = uint(C.GDK_KEY_Greek_etaaccent) + KEY_Greek_iotaaccent = uint(C.GDK_KEY_Greek_iotaaccent) + KEY_Greek_iotadieresis = uint(C.GDK_KEY_Greek_iotadieresis) + KEY_Greek_iotaaccentdieresis = uint(C.GDK_KEY_Greek_iotaaccentdieresis) + KEY_Greek_omicronaccent = uint(C.GDK_KEY_Greek_omicronaccent) + KEY_Greek_upsilonaccent = uint(C.GDK_KEY_Greek_upsilonaccent) + KEY_Greek_upsilondieresis = uint(C.GDK_KEY_Greek_upsilondieresis) + KEY_Greek_upsilonaccentdieresis = uint(C.GDK_KEY_Greek_upsilonaccentdieresis) + KEY_Greek_omegaaccent = uint(C.GDK_KEY_Greek_omegaaccent) + KEY_Greek_ALPHA = uint(C.GDK_KEY_Greek_ALPHA) + KEY_Greek_BETA = uint(C.GDK_KEY_Greek_BETA) + KEY_Greek_GAMMA = uint(C.GDK_KEY_Greek_GAMMA) + KEY_Greek_DELTA = uint(C.GDK_KEY_Greek_DELTA) + KEY_Greek_EPSILON = uint(C.GDK_KEY_Greek_EPSILON) + KEY_Greek_ZETA = uint(C.GDK_KEY_Greek_ZETA) + KEY_Greek_ETA = uint(C.GDK_KEY_Greek_ETA) + KEY_Greek_THETA = uint(C.GDK_KEY_Greek_THETA) + KEY_Greek_IOTA = uint(C.GDK_KEY_Greek_IOTA) + KEY_Greek_KAPPA = uint(C.GDK_KEY_Greek_KAPPA) + KEY_Greek_LAMDA = uint(C.GDK_KEY_Greek_LAMDA) + KEY_Greek_LAMBDA = uint(C.GDK_KEY_Greek_LAMBDA) + KEY_Greek_MU = uint(C.GDK_KEY_Greek_MU) + KEY_Greek_NU = uint(C.GDK_KEY_Greek_NU) + KEY_Greek_XI = uint(C.GDK_KEY_Greek_XI) + KEY_Greek_OMICRON = uint(C.GDK_KEY_Greek_OMICRON) + KEY_Greek_PI = uint(C.GDK_KEY_Greek_PI) + KEY_Greek_RHO = uint(C.GDK_KEY_Greek_RHO) + KEY_Greek_SIGMA = uint(C.GDK_KEY_Greek_SIGMA) + KEY_Greek_TAU = uint(C.GDK_KEY_Greek_TAU) + KEY_Greek_UPSILON = uint(C.GDK_KEY_Greek_UPSILON) + KEY_Greek_PHI = uint(C.GDK_KEY_Greek_PHI) + KEY_Greek_CHI = uint(C.GDK_KEY_Greek_CHI) + KEY_Greek_PSI = uint(C.GDK_KEY_Greek_PSI) + KEY_Greek_OMEGA = uint(C.GDK_KEY_Greek_OMEGA) + KEY_Greek_alpha = uint(C.GDK_KEY_Greek_alpha) + KEY_Greek_beta = uint(C.GDK_KEY_Greek_beta) + KEY_Greek_gamma = uint(C.GDK_KEY_Greek_gamma) + KEY_Greek_delta = uint(C.GDK_KEY_Greek_delta) + KEY_Greek_epsilon = uint(C.GDK_KEY_Greek_epsilon) + KEY_Greek_zeta = uint(C.GDK_KEY_Greek_zeta) + KEY_Greek_eta = uint(C.GDK_KEY_Greek_eta) + KEY_Greek_theta = uint(C.GDK_KEY_Greek_theta) + KEY_Greek_iota = uint(C.GDK_KEY_Greek_iota) + KEY_Greek_kappa = uint(C.GDK_KEY_Greek_kappa) + KEY_Greek_lamda = uint(C.GDK_KEY_Greek_lamda) + KEY_Greek_lambda = uint(C.GDK_KEY_Greek_lambda) + KEY_Greek_mu = uint(C.GDK_KEY_Greek_mu) + KEY_Greek_nu = uint(C.GDK_KEY_Greek_nu) + KEY_Greek_xi = uint(C.GDK_KEY_Greek_xi) + KEY_Greek_omicron = uint(C.GDK_KEY_Greek_omicron) + KEY_Greek_pi = uint(C.GDK_KEY_Greek_pi) + KEY_Greek_rho = uint(C.GDK_KEY_Greek_rho) + KEY_Greek_sigma = uint(C.GDK_KEY_Greek_sigma) + KEY_Greek_finalsmallsigma = uint(C.GDK_KEY_Greek_finalsmallsigma) + KEY_Greek_tau = uint(C.GDK_KEY_Greek_tau) + KEY_Greek_upsilon = uint(C.GDK_KEY_Greek_upsilon) + KEY_Greek_phi = uint(C.GDK_KEY_Greek_phi) + KEY_Greek_chi = uint(C.GDK_KEY_Greek_chi) + KEY_Greek_psi = uint(C.GDK_KEY_Greek_psi) + KEY_Greek_omega = uint(C.GDK_KEY_Greek_omega) + KEY_Greek_switch = uint(C.GDK_KEY_Greek_switch) + KEY_leftradical = uint(C.GDK_KEY_leftradical) + KEY_topleftradical = uint(C.GDK_KEY_topleftradical) + KEY_horizconnector = uint(C.GDK_KEY_horizconnector) + KEY_topintegral = uint(C.GDK_KEY_topintegral) + KEY_botintegral = uint(C.GDK_KEY_botintegral) + KEY_vertconnector = uint(C.GDK_KEY_vertconnector) + KEY_topleftsqbracket = uint(C.GDK_KEY_topleftsqbracket) + KEY_botleftsqbracket = uint(C.GDK_KEY_botleftsqbracket) + KEY_toprightsqbracket = uint(C.GDK_KEY_toprightsqbracket) + KEY_botrightsqbracket = uint(C.GDK_KEY_botrightsqbracket) + KEY_topleftparens = uint(C.GDK_KEY_topleftparens) + KEY_botleftparens = uint(C.GDK_KEY_botleftparens) + KEY_toprightparens = uint(C.GDK_KEY_toprightparens) + KEY_botrightparens = uint(C.GDK_KEY_botrightparens) + KEY_leftmiddlecurlybrace = uint(C.GDK_KEY_leftmiddlecurlybrace) + KEY_rightmiddlecurlybrace = uint(C.GDK_KEY_rightmiddlecurlybrace) + KEY_topleftsummation = uint(C.GDK_KEY_topleftsummation) + KEY_botleftsummation = uint(C.GDK_KEY_botleftsummation) + KEY_topvertsummationconnector = uint(C.GDK_KEY_topvertsummationconnector) + KEY_botvertsummationconnector = uint(C.GDK_KEY_botvertsummationconnector) + KEY_toprightsummation = uint(C.GDK_KEY_toprightsummation) + KEY_botrightsummation = uint(C.GDK_KEY_botrightsummation) + KEY_rightmiddlesummation = uint(C.GDK_KEY_rightmiddlesummation) + KEY_lessthanequal = uint(C.GDK_KEY_lessthanequal) + KEY_notequal = uint(C.GDK_KEY_notequal) + KEY_greaterthanequal = uint(C.GDK_KEY_greaterthanequal) + KEY_integral = uint(C.GDK_KEY_integral) + KEY_therefore = uint(C.GDK_KEY_therefore) + KEY_variation = uint(C.GDK_KEY_variation) + KEY_infinity = uint(C.GDK_KEY_infinity) + KEY_nabla = uint(C.GDK_KEY_nabla) + KEY_approximate = uint(C.GDK_KEY_approximate) + KEY_similarequal = uint(C.GDK_KEY_similarequal) + KEY_ifonlyif = uint(C.GDK_KEY_ifonlyif) + KEY_implies = uint(C.GDK_KEY_implies) + KEY_identical = uint(C.GDK_KEY_identical) + KEY_radical = uint(C.GDK_KEY_radical) + KEY_includedin = uint(C.GDK_KEY_includedin) + KEY_includes = uint(C.GDK_KEY_includes) + KEY_intersection = uint(C.GDK_KEY_intersection) + KEY_union = uint(C.GDK_KEY_union) + KEY_logicaland = uint(C.GDK_KEY_logicaland) + KEY_logicalor = uint(C.GDK_KEY_logicalor) + KEY_partialderivative = uint(C.GDK_KEY_partialderivative) + KEY_function = uint(C.GDK_KEY_function) + KEY_leftarrow = uint(C.GDK_KEY_leftarrow) + KEY_uparrow = uint(C.GDK_KEY_uparrow) + KEY_rightarrow = uint(C.GDK_KEY_rightarrow) + KEY_downarrow = uint(C.GDK_KEY_downarrow) + KEY_blank = uint(C.GDK_KEY_blank) + KEY_soliddiamond = uint(C.GDK_KEY_soliddiamond) + KEY_checkerboard = uint(C.GDK_KEY_checkerboard) + KEY_ht = uint(C.GDK_KEY_ht) + KEY_ff = uint(C.GDK_KEY_ff) + KEY_cr = uint(C.GDK_KEY_cr) + KEY_lf = uint(C.GDK_KEY_lf) + KEY_nl = uint(C.GDK_KEY_nl) + KEY_vt = uint(C.GDK_KEY_vt) + KEY_lowrightcorner = uint(C.GDK_KEY_lowrightcorner) + KEY_uprightcorner = uint(C.GDK_KEY_uprightcorner) + KEY_upleftcorner = uint(C.GDK_KEY_upleftcorner) + KEY_lowleftcorner = uint(C.GDK_KEY_lowleftcorner) + KEY_crossinglines = uint(C.GDK_KEY_crossinglines) + KEY_horizlinescan1 = uint(C.GDK_KEY_horizlinescan1) + KEY_horizlinescan3 = uint(C.GDK_KEY_horizlinescan3) + KEY_horizlinescan5 = uint(C.GDK_KEY_horizlinescan5) + KEY_horizlinescan7 = uint(C.GDK_KEY_horizlinescan7) + KEY_horizlinescan9 = uint(C.GDK_KEY_horizlinescan9) + KEY_leftt = uint(C.GDK_KEY_leftt) + KEY_rightt = uint(C.GDK_KEY_rightt) + KEY_bott = uint(C.GDK_KEY_bott) + KEY_topt = uint(C.GDK_KEY_topt) + KEY_vertbar = uint(C.GDK_KEY_vertbar) + KEY_emspace = uint(C.GDK_KEY_emspace) + KEY_enspace = uint(C.GDK_KEY_enspace) + KEY_em3space = uint(C.GDK_KEY_em3space) + KEY_em4space = uint(C.GDK_KEY_em4space) + KEY_digitspace = uint(C.GDK_KEY_digitspace) + KEY_punctspace = uint(C.GDK_KEY_punctspace) + KEY_thinspace = uint(C.GDK_KEY_thinspace) + KEY_hairspace = uint(C.GDK_KEY_hairspace) + KEY_emdash = uint(C.GDK_KEY_emdash) + KEY_endash = uint(C.GDK_KEY_endash) + KEY_signifblank = uint(C.GDK_KEY_signifblank) + KEY_ellipsis = uint(C.GDK_KEY_ellipsis) + KEY_doubbaselinedot = uint(C.GDK_KEY_doubbaselinedot) + KEY_onethird = uint(C.GDK_KEY_onethird) + KEY_twothirds = uint(C.GDK_KEY_twothirds) + KEY_onefifth = uint(C.GDK_KEY_onefifth) + KEY_twofifths = uint(C.GDK_KEY_twofifths) + KEY_threefifths = uint(C.GDK_KEY_threefifths) + KEY_fourfifths = uint(C.GDK_KEY_fourfifths) + KEY_onesixth = uint(C.GDK_KEY_onesixth) + KEY_fivesixths = uint(C.GDK_KEY_fivesixths) + KEY_careof = uint(C.GDK_KEY_careof) + KEY_figdash = uint(C.GDK_KEY_figdash) + KEY_leftanglebracket = uint(C.GDK_KEY_leftanglebracket) + KEY_decimalpoint = uint(C.GDK_KEY_decimalpoint) + KEY_rightanglebracket = uint(C.GDK_KEY_rightanglebracket) + KEY_marker = uint(C.GDK_KEY_marker) + KEY_oneeighth = uint(C.GDK_KEY_oneeighth) + KEY_threeeighths = uint(C.GDK_KEY_threeeighths) + KEY_fiveeighths = uint(C.GDK_KEY_fiveeighths) + KEY_seveneighths = uint(C.GDK_KEY_seveneighths) + KEY_trademark = uint(C.GDK_KEY_trademark) + KEY_signaturemark = uint(C.GDK_KEY_signaturemark) + KEY_trademarkincircle = uint(C.GDK_KEY_trademarkincircle) + KEY_leftopentriangle = uint(C.GDK_KEY_leftopentriangle) + KEY_rightopentriangle = uint(C.GDK_KEY_rightopentriangle) + KEY_emopencircle = uint(C.GDK_KEY_emopencircle) + KEY_emopenrectangle = uint(C.GDK_KEY_emopenrectangle) + KEY_leftsinglequotemark = uint(C.GDK_KEY_leftsinglequotemark) + KEY_rightsinglequotemark = uint(C.GDK_KEY_rightsinglequotemark) + KEY_leftdoublequotemark = uint(C.GDK_KEY_leftdoublequotemark) + KEY_rightdoublequotemark = uint(C.GDK_KEY_rightdoublequotemark) + KEY_prescription = uint(C.GDK_KEY_prescription) + KEY_permille = uint(C.GDK_KEY_permille) + KEY_minutes = uint(C.GDK_KEY_minutes) + KEY_seconds = uint(C.GDK_KEY_seconds) + KEY_latincross = uint(C.GDK_KEY_latincross) + KEY_hexagram = uint(C.GDK_KEY_hexagram) + KEY_filledrectbullet = uint(C.GDK_KEY_filledrectbullet) + KEY_filledlefttribullet = uint(C.GDK_KEY_filledlefttribullet) + KEY_filledrighttribullet = uint(C.GDK_KEY_filledrighttribullet) + KEY_emfilledcircle = uint(C.GDK_KEY_emfilledcircle) + KEY_emfilledrect = uint(C.GDK_KEY_emfilledrect) + KEY_enopencircbullet = uint(C.GDK_KEY_enopencircbullet) + KEY_enopensquarebullet = uint(C.GDK_KEY_enopensquarebullet) + KEY_openrectbullet = uint(C.GDK_KEY_openrectbullet) + KEY_opentribulletup = uint(C.GDK_KEY_opentribulletup) + KEY_opentribulletdown = uint(C.GDK_KEY_opentribulletdown) + KEY_openstar = uint(C.GDK_KEY_openstar) + KEY_enfilledcircbullet = uint(C.GDK_KEY_enfilledcircbullet) + KEY_enfilledsqbullet = uint(C.GDK_KEY_enfilledsqbullet) + KEY_filledtribulletup = uint(C.GDK_KEY_filledtribulletup) + KEY_filledtribulletdown = uint(C.GDK_KEY_filledtribulletdown) + KEY_leftpointer = uint(C.GDK_KEY_leftpointer) + KEY_rightpointer = uint(C.GDK_KEY_rightpointer) + KEY_club = uint(C.GDK_KEY_club) + KEY_diamond = uint(C.GDK_KEY_diamond) + KEY_heart = uint(C.GDK_KEY_heart) + KEY_maltesecross = uint(C.GDK_KEY_maltesecross) + KEY_dagger = uint(C.GDK_KEY_dagger) + KEY_doubledagger = uint(C.GDK_KEY_doubledagger) + KEY_checkmark = uint(C.GDK_KEY_checkmark) + KEY_ballotcross = uint(C.GDK_KEY_ballotcross) + KEY_musicalsharp = uint(C.GDK_KEY_musicalsharp) + KEY_musicalflat = uint(C.GDK_KEY_musicalflat) + KEY_malesymbol = uint(C.GDK_KEY_malesymbol) + KEY_femalesymbol = uint(C.GDK_KEY_femalesymbol) + KEY_telephone = uint(C.GDK_KEY_telephone) + KEY_telephonerecorder = uint(C.GDK_KEY_telephonerecorder) + KEY_phonographcopyright = uint(C.GDK_KEY_phonographcopyright) + KEY_caret = uint(C.GDK_KEY_caret) + KEY_singlelowquotemark = uint(C.GDK_KEY_singlelowquotemark) + KEY_doublelowquotemark = uint(C.GDK_KEY_doublelowquotemark) + KEY_cursor = uint(C.GDK_KEY_cursor) + KEY_leftcaret = uint(C.GDK_KEY_leftcaret) + KEY_rightcaret = uint(C.GDK_KEY_rightcaret) + KEY_downcaret = uint(C.GDK_KEY_downcaret) + KEY_upcaret = uint(C.GDK_KEY_upcaret) + KEY_overbar = uint(C.GDK_KEY_overbar) + KEY_downtack = uint(C.GDK_KEY_downtack) + KEY_upshoe = uint(C.GDK_KEY_upshoe) + KEY_downstile = uint(C.GDK_KEY_downstile) + KEY_underbar = uint(C.GDK_KEY_underbar) + KEY_jot = uint(C.GDK_KEY_jot) + KEY_quad = uint(C.GDK_KEY_quad) + KEY_uptack = uint(C.GDK_KEY_uptack) + KEY_circle = uint(C.GDK_KEY_circle) + KEY_upstile = uint(C.GDK_KEY_upstile) + KEY_downshoe = uint(C.GDK_KEY_downshoe) + KEY_rightshoe = uint(C.GDK_KEY_rightshoe) + KEY_leftshoe = uint(C.GDK_KEY_leftshoe) + KEY_lefttack = uint(C.GDK_KEY_lefttack) + KEY_righttack = uint(C.GDK_KEY_righttack) + KEY_hebrew_doublelowline = uint(C.GDK_KEY_hebrew_doublelowline) + KEY_hebrew_aleph = uint(C.GDK_KEY_hebrew_aleph) + KEY_hebrew_bet = uint(C.GDK_KEY_hebrew_bet) + KEY_hebrew_beth = uint(C.GDK_KEY_hebrew_beth) + KEY_hebrew_gimel = uint(C.GDK_KEY_hebrew_gimel) + KEY_hebrew_gimmel = uint(C.GDK_KEY_hebrew_gimmel) + KEY_hebrew_dalet = uint(C.GDK_KEY_hebrew_dalet) + KEY_hebrew_daleth = uint(C.GDK_KEY_hebrew_daleth) + KEY_hebrew_he = uint(C.GDK_KEY_hebrew_he) + KEY_hebrew_waw = uint(C.GDK_KEY_hebrew_waw) + KEY_hebrew_zain = uint(C.GDK_KEY_hebrew_zain) + KEY_hebrew_zayin = uint(C.GDK_KEY_hebrew_zayin) + KEY_hebrew_chet = uint(C.GDK_KEY_hebrew_chet) + KEY_hebrew_het = uint(C.GDK_KEY_hebrew_het) + KEY_hebrew_tet = uint(C.GDK_KEY_hebrew_tet) + KEY_hebrew_teth = uint(C.GDK_KEY_hebrew_teth) + KEY_hebrew_yod = uint(C.GDK_KEY_hebrew_yod) + KEY_hebrew_finalkaph = uint(C.GDK_KEY_hebrew_finalkaph) + KEY_hebrew_kaph = uint(C.GDK_KEY_hebrew_kaph) + KEY_hebrew_lamed = uint(C.GDK_KEY_hebrew_lamed) + KEY_hebrew_finalmem = uint(C.GDK_KEY_hebrew_finalmem) + KEY_hebrew_mem = uint(C.GDK_KEY_hebrew_mem) + KEY_hebrew_finalnun = uint(C.GDK_KEY_hebrew_finalnun) + KEY_hebrew_nun = uint(C.GDK_KEY_hebrew_nun) + KEY_hebrew_samech = uint(C.GDK_KEY_hebrew_samech) + KEY_hebrew_samekh = uint(C.GDK_KEY_hebrew_samekh) + KEY_hebrew_ayin = uint(C.GDK_KEY_hebrew_ayin) + KEY_hebrew_finalpe = uint(C.GDK_KEY_hebrew_finalpe) + KEY_hebrew_pe = uint(C.GDK_KEY_hebrew_pe) + KEY_hebrew_finalzade = uint(C.GDK_KEY_hebrew_finalzade) + KEY_hebrew_finalzadi = uint(C.GDK_KEY_hebrew_finalzadi) + KEY_hebrew_zade = uint(C.GDK_KEY_hebrew_zade) + KEY_hebrew_zadi = uint(C.GDK_KEY_hebrew_zadi) + KEY_hebrew_qoph = uint(C.GDK_KEY_hebrew_qoph) + KEY_hebrew_kuf = uint(C.GDK_KEY_hebrew_kuf) + KEY_hebrew_resh = uint(C.GDK_KEY_hebrew_resh) + KEY_hebrew_shin = uint(C.GDK_KEY_hebrew_shin) + KEY_hebrew_taw = uint(C.GDK_KEY_hebrew_taw) + KEY_hebrew_taf = uint(C.GDK_KEY_hebrew_taf) + KEY_Hebrew_switch = uint(C.GDK_KEY_Hebrew_switch) + KEY_Thai_kokai = uint(C.GDK_KEY_Thai_kokai) + KEY_Thai_khokhai = uint(C.GDK_KEY_Thai_khokhai) + KEY_Thai_khokhuat = uint(C.GDK_KEY_Thai_khokhuat) + KEY_Thai_khokhwai = uint(C.GDK_KEY_Thai_khokhwai) + KEY_Thai_khokhon = uint(C.GDK_KEY_Thai_khokhon) + KEY_Thai_khorakhang = uint(C.GDK_KEY_Thai_khorakhang) + KEY_Thai_ngongu = uint(C.GDK_KEY_Thai_ngongu) + KEY_Thai_chochan = uint(C.GDK_KEY_Thai_chochan) + KEY_Thai_choching = uint(C.GDK_KEY_Thai_choching) + KEY_Thai_chochang = uint(C.GDK_KEY_Thai_chochang) + KEY_Thai_soso = uint(C.GDK_KEY_Thai_soso) + KEY_Thai_chochoe = uint(C.GDK_KEY_Thai_chochoe) + KEY_Thai_yoying = uint(C.GDK_KEY_Thai_yoying) + KEY_Thai_dochada = uint(C.GDK_KEY_Thai_dochada) + KEY_Thai_topatak = uint(C.GDK_KEY_Thai_topatak) + KEY_Thai_thothan = uint(C.GDK_KEY_Thai_thothan) + KEY_Thai_thonangmontho = uint(C.GDK_KEY_Thai_thonangmontho) + KEY_Thai_thophuthao = uint(C.GDK_KEY_Thai_thophuthao) + KEY_Thai_nonen = uint(C.GDK_KEY_Thai_nonen) + KEY_Thai_dodek = uint(C.GDK_KEY_Thai_dodek) + KEY_Thai_totao = uint(C.GDK_KEY_Thai_totao) + KEY_Thai_thothung = uint(C.GDK_KEY_Thai_thothung) + KEY_Thai_thothahan = uint(C.GDK_KEY_Thai_thothahan) + KEY_Thai_thothong = uint(C.GDK_KEY_Thai_thothong) + KEY_Thai_nonu = uint(C.GDK_KEY_Thai_nonu) + KEY_Thai_bobaimai = uint(C.GDK_KEY_Thai_bobaimai) + KEY_Thai_popla = uint(C.GDK_KEY_Thai_popla) + KEY_Thai_phophung = uint(C.GDK_KEY_Thai_phophung) + KEY_Thai_fofa = uint(C.GDK_KEY_Thai_fofa) + KEY_Thai_phophan = uint(C.GDK_KEY_Thai_phophan) + KEY_Thai_fofan = uint(C.GDK_KEY_Thai_fofan) + KEY_Thai_phosamphao = uint(C.GDK_KEY_Thai_phosamphao) + KEY_Thai_moma = uint(C.GDK_KEY_Thai_moma) + KEY_Thai_yoyak = uint(C.GDK_KEY_Thai_yoyak) + KEY_Thai_rorua = uint(C.GDK_KEY_Thai_rorua) + KEY_Thai_ru = uint(C.GDK_KEY_Thai_ru) + KEY_Thai_loling = uint(C.GDK_KEY_Thai_loling) + KEY_Thai_lu = uint(C.GDK_KEY_Thai_lu) + KEY_Thai_wowaen = uint(C.GDK_KEY_Thai_wowaen) + KEY_Thai_sosala = uint(C.GDK_KEY_Thai_sosala) + KEY_Thai_sorusi = uint(C.GDK_KEY_Thai_sorusi) + KEY_Thai_sosua = uint(C.GDK_KEY_Thai_sosua) + KEY_Thai_hohip = uint(C.GDK_KEY_Thai_hohip) + KEY_Thai_lochula = uint(C.GDK_KEY_Thai_lochula) + KEY_Thai_oang = uint(C.GDK_KEY_Thai_oang) + KEY_Thai_honokhuk = uint(C.GDK_KEY_Thai_honokhuk) + KEY_Thai_paiyannoi = uint(C.GDK_KEY_Thai_paiyannoi) + KEY_Thai_saraa = uint(C.GDK_KEY_Thai_saraa) + KEY_Thai_maihanakat = uint(C.GDK_KEY_Thai_maihanakat) + KEY_Thai_saraaa = uint(C.GDK_KEY_Thai_saraaa) + KEY_Thai_saraam = uint(C.GDK_KEY_Thai_saraam) + KEY_Thai_sarai = uint(C.GDK_KEY_Thai_sarai) + KEY_Thai_saraii = uint(C.GDK_KEY_Thai_saraii) + KEY_Thai_saraue = uint(C.GDK_KEY_Thai_saraue) + KEY_Thai_sarauee = uint(C.GDK_KEY_Thai_sarauee) + KEY_Thai_sarau = uint(C.GDK_KEY_Thai_sarau) + KEY_Thai_sarauu = uint(C.GDK_KEY_Thai_sarauu) + KEY_Thai_phinthu = uint(C.GDK_KEY_Thai_phinthu) + KEY_Thai_maihanakat_maitho = uint(C.GDK_KEY_Thai_maihanakat_maitho) + KEY_Thai_baht = uint(C.GDK_KEY_Thai_baht) + KEY_Thai_sarae = uint(C.GDK_KEY_Thai_sarae) + KEY_Thai_saraae = uint(C.GDK_KEY_Thai_saraae) + KEY_Thai_sarao = uint(C.GDK_KEY_Thai_sarao) + KEY_Thai_saraaimaimuan = uint(C.GDK_KEY_Thai_saraaimaimuan) + KEY_Thai_saraaimaimalai = uint(C.GDK_KEY_Thai_saraaimaimalai) + KEY_Thai_lakkhangyao = uint(C.GDK_KEY_Thai_lakkhangyao) + KEY_Thai_maiyamok = uint(C.GDK_KEY_Thai_maiyamok) + KEY_Thai_maitaikhu = uint(C.GDK_KEY_Thai_maitaikhu) + KEY_Thai_maiek = uint(C.GDK_KEY_Thai_maiek) + KEY_Thai_maitho = uint(C.GDK_KEY_Thai_maitho) + KEY_Thai_maitri = uint(C.GDK_KEY_Thai_maitri) + KEY_Thai_maichattawa = uint(C.GDK_KEY_Thai_maichattawa) + KEY_Thai_thanthakhat = uint(C.GDK_KEY_Thai_thanthakhat) + KEY_Thai_nikhahit = uint(C.GDK_KEY_Thai_nikhahit) + KEY_Thai_leksun = uint(C.GDK_KEY_Thai_leksun) + KEY_Thai_leknung = uint(C.GDK_KEY_Thai_leknung) + KEY_Thai_leksong = uint(C.GDK_KEY_Thai_leksong) + KEY_Thai_leksam = uint(C.GDK_KEY_Thai_leksam) + KEY_Thai_leksi = uint(C.GDK_KEY_Thai_leksi) + KEY_Thai_lekha = uint(C.GDK_KEY_Thai_lekha) + KEY_Thai_lekhok = uint(C.GDK_KEY_Thai_lekhok) + KEY_Thai_lekchet = uint(C.GDK_KEY_Thai_lekchet) + KEY_Thai_lekpaet = uint(C.GDK_KEY_Thai_lekpaet) + KEY_Thai_lekkao = uint(C.GDK_KEY_Thai_lekkao) + KEY_Hangul = uint(C.GDK_KEY_Hangul) + KEY_Hangul_Start = uint(C.GDK_KEY_Hangul_Start) + KEY_Hangul_End = uint(C.GDK_KEY_Hangul_End) + KEY_Hangul_Hanja = uint(C.GDK_KEY_Hangul_Hanja) + KEY_Hangul_Jamo = uint(C.GDK_KEY_Hangul_Jamo) + KEY_Hangul_Romaja = uint(C.GDK_KEY_Hangul_Romaja) + KEY_Hangul_Codeinput = uint(C.GDK_KEY_Hangul_Codeinput) + KEY_Hangul_Jeonja = uint(C.GDK_KEY_Hangul_Jeonja) + KEY_Hangul_Banja = uint(C.GDK_KEY_Hangul_Banja) + KEY_Hangul_PreHanja = uint(C.GDK_KEY_Hangul_PreHanja) + KEY_Hangul_PostHanja = uint(C.GDK_KEY_Hangul_PostHanja) + KEY_Hangul_SingleCandidate = uint(C.GDK_KEY_Hangul_SingleCandidate) + KEY_Hangul_MultipleCandidate = uint(C.GDK_KEY_Hangul_MultipleCandidate) + KEY_Hangul_PreviousCandidate = uint(C.GDK_KEY_Hangul_PreviousCandidate) + KEY_Hangul_Special = uint(C.GDK_KEY_Hangul_Special) + KEY_Hangul_switch = uint(C.GDK_KEY_Hangul_switch) + KEY_Hangul_Kiyeog = uint(C.GDK_KEY_Hangul_Kiyeog) + KEY_Hangul_SsangKiyeog = uint(C.GDK_KEY_Hangul_SsangKiyeog) + KEY_Hangul_KiyeogSios = uint(C.GDK_KEY_Hangul_KiyeogSios) + KEY_Hangul_Nieun = uint(C.GDK_KEY_Hangul_Nieun) + KEY_Hangul_NieunJieuj = uint(C.GDK_KEY_Hangul_NieunJieuj) + KEY_Hangul_NieunHieuh = uint(C.GDK_KEY_Hangul_NieunHieuh) + KEY_Hangul_Dikeud = uint(C.GDK_KEY_Hangul_Dikeud) + KEY_Hangul_SsangDikeud = uint(C.GDK_KEY_Hangul_SsangDikeud) + KEY_Hangul_Rieul = uint(C.GDK_KEY_Hangul_Rieul) + KEY_Hangul_RieulKiyeog = uint(C.GDK_KEY_Hangul_RieulKiyeog) + KEY_Hangul_RieulMieum = uint(C.GDK_KEY_Hangul_RieulMieum) + KEY_Hangul_RieulPieub = uint(C.GDK_KEY_Hangul_RieulPieub) + KEY_Hangul_RieulSios = uint(C.GDK_KEY_Hangul_RieulSios) + KEY_Hangul_RieulTieut = uint(C.GDK_KEY_Hangul_RieulTieut) + KEY_Hangul_RieulPhieuf = uint(C.GDK_KEY_Hangul_RieulPhieuf) + KEY_Hangul_RieulHieuh = uint(C.GDK_KEY_Hangul_RieulHieuh) + KEY_Hangul_Mieum = uint(C.GDK_KEY_Hangul_Mieum) + KEY_Hangul_Pieub = uint(C.GDK_KEY_Hangul_Pieub) + KEY_Hangul_SsangPieub = uint(C.GDK_KEY_Hangul_SsangPieub) + KEY_Hangul_PieubSios = uint(C.GDK_KEY_Hangul_PieubSios) + KEY_Hangul_Sios = uint(C.GDK_KEY_Hangul_Sios) + KEY_Hangul_SsangSios = uint(C.GDK_KEY_Hangul_SsangSios) + KEY_Hangul_Ieung = uint(C.GDK_KEY_Hangul_Ieung) + KEY_Hangul_Jieuj = uint(C.GDK_KEY_Hangul_Jieuj) + KEY_Hangul_SsangJieuj = uint(C.GDK_KEY_Hangul_SsangJieuj) + KEY_Hangul_Cieuc = uint(C.GDK_KEY_Hangul_Cieuc) + KEY_Hangul_Khieuq = uint(C.GDK_KEY_Hangul_Khieuq) + KEY_Hangul_Tieut = uint(C.GDK_KEY_Hangul_Tieut) + KEY_Hangul_Phieuf = uint(C.GDK_KEY_Hangul_Phieuf) + KEY_Hangul_Hieuh = uint(C.GDK_KEY_Hangul_Hieuh) + KEY_Hangul_A = uint(C.GDK_KEY_Hangul_A) + KEY_Hangul_AE = uint(C.GDK_KEY_Hangul_AE) + KEY_Hangul_YA = uint(C.GDK_KEY_Hangul_YA) + KEY_Hangul_YAE = uint(C.GDK_KEY_Hangul_YAE) + KEY_Hangul_EO = uint(C.GDK_KEY_Hangul_EO) + KEY_Hangul_E = uint(C.GDK_KEY_Hangul_E) + KEY_Hangul_YEO = uint(C.GDK_KEY_Hangul_YEO) + KEY_Hangul_YE = uint(C.GDK_KEY_Hangul_YE) + KEY_Hangul_O = uint(C.GDK_KEY_Hangul_O) + KEY_Hangul_WA = uint(C.GDK_KEY_Hangul_WA) + KEY_Hangul_WAE = uint(C.GDK_KEY_Hangul_WAE) + KEY_Hangul_OE = uint(C.GDK_KEY_Hangul_OE) + KEY_Hangul_YO = uint(C.GDK_KEY_Hangul_YO) + KEY_Hangul_U = uint(C.GDK_KEY_Hangul_U) + KEY_Hangul_WEO = uint(C.GDK_KEY_Hangul_WEO) + KEY_Hangul_WE = uint(C.GDK_KEY_Hangul_WE) + KEY_Hangul_WI = uint(C.GDK_KEY_Hangul_WI) + KEY_Hangul_YU = uint(C.GDK_KEY_Hangul_YU) + KEY_Hangul_EU = uint(C.GDK_KEY_Hangul_EU) + KEY_Hangul_YI = uint(C.GDK_KEY_Hangul_YI) + KEY_Hangul_I = uint(C.GDK_KEY_Hangul_I) + KEY_Hangul_J_Kiyeog = uint(C.GDK_KEY_Hangul_J_Kiyeog) + KEY_Hangul_J_SsangKiyeog = uint(C.GDK_KEY_Hangul_J_SsangKiyeog) + KEY_Hangul_J_KiyeogSios = uint(C.GDK_KEY_Hangul_J_KiyeogSios) + KEY_Hangul_J_Nieun = uint(C.GDK_KEY_Hangul_J_Nieun) + KEY_Hangul_J_NieunJieuj = uint(C.GDK_KEY_Hangul_J_NieunJieuj) + KEY_Hangul_J_NieunHieuh = uint(C.GDK_KEY_Hangul_J_NieunHieuh) + KEY_Hangul_J_Dikeud = uint(C.GDK_KEY_Hangul_J_Dikeud) + KEY_Hangul_J_Rieul = uint(C.GDK_KEY_Hangul_J_Rieul) + KEY_Hangul_J_RieulKiyeog = uint(C.GDK_KEY_Hangul_J_RieulKiyeog) + KEY_Hangul_J_RieulMieum = uint(C.GDK_KEY_Hangul_J_RieulMieum) + KEY_Hangul_J_RieulPieub = uint(C.GDK_KEY_Hangul_J_RieulPieub) + KEY_Hangul_J_RieulSios = uint(C.GDK_KEY_Hangul_J_RieulSios) + KEY_Hangul_J_RieulTieut = uint(C.GDK_KEY_Hangul_J_RieulTieut) + KEY_Hangul_J_RieulPhieuf = uint(C.GDK_KEY_Hangul_J_RieulPhieuf) + KEY_Hangul_J_RieulHieuh = uint(C.GDK_KEY_Hangul_J_RieulHieuh) + KEY_Hangul_J_Mieum = uint(C.GDK_KEY_Hangul_J_Mieum) + KEY_Hangul_J_Pieub = uint(C.GDK_KEY_Hangul_J_Pieub) + KEY_Hangul_J_PieubSios = uint(C.GDK_KEY_Hangul_J_PieubSios) + KEY_Hangul_J_Sios = uint(C.GDK_KEY_Hangul_J_Sios) + KEY_Hangul_J_SsangSios = uint(C.GDK_KEY_Hangul_J_SsangSios) + KEY_Hangul_J_Ieung = uint(C.GDK_KEY_Hangul_J_Ieung) + KEY_Hangul_J_Jieuj = uint(C.GDK_KEY_Hangul_J_Jieuj) + KEY_Hangul_J_Cieuc = uint(C.GDK_KEY_Hangul_J_Cieuc) + KEY_Hangul_J_Khieuq = uint(C.GDK_KEY_Hangul_J_Khieuq) + KEY_Hangul_J_Tieut = uint(C.GDK_KEY_Hangul_J_Tieut) + KEY_Hangul_J_Phieuf = uint(C.GDK_KEY_Hangul_J_Phieuf) + KEY_Hangul_J_Hieuh = uint(C.GDK_KEY_Hangul_J_Hieuh) + KEY_Hangul_RieulYeorinHieuh = uint(C.GDK_KEY_Hangul_RieulYeorinHieuh) + KEY_Hangul_SunkyeongeumMieum = uint(C.GDK_KEY_Hangul_SunkyeongeumMieum) + KEY_Hangul_SunkyeongeumPieub = uint(C.GDK_KEY_Hangul_SunkyeongeumPieub) + KEY_Hangul_PanSios = uint(C.GDK_KEY_Hangul_PanSios) + KEY_Hangul_KkogjiDalrinIeung = uint(C.GDK_KEY_Hangul_KkogjiDalrinIeung) + KEY_Hangul_SunkyeongeumPhieuf = uint(C.GDK_KEY_Hangul_SunkyeongeumPhieuf) + KEY_Hangul_YeorinHieuh = uint(C.GDK_KEY_Hangul_YeorinHieuh) + KEY_Hangul_AraeA = uint(C.GDK_KEY_Hangul_AraeA) + KEY_Hangul_AraeAE = uint(C.GDK_KEY_Hangul_AraeAE) + KEY_Hangul_J_PanSios = uint(C.GDK_KEY_Hangul_J_PanSios) + KEY_Hangul_J_KkogjiDalrinIeung = uint(C.GDK_KEY_Hangul_J_KkogjiDalrinIeung) + KEY_Hangul_J_YeorinHieuh = uint(C.GDK_KEY_Hangul_J_YeorinHieuh) + KEY_Korean_Won = uint(C.GDK_KEY_Korean_Won) + KEY_Armenian_ligature_ew = uint(C.GDK_KEY_Armenian_ligature_ew) + KEY_Armenian_full_stop = uint(C.GDK_KEY_Armenian_full_stop) + KEY_Armenian_verjaket = uint(C.GDK_KEY_Armenian_verjaket) + KEY_Armenian_separation_mark = uint(C.GDK_KEY_Armenian_separation_mark) + KEY_Armenian_but = uint(C.GDK_KEY_Armenian_but) + KEY_Armenian_hyphen = uint(C.GDK_KEY_Armenian_hyphen) + KEY_Armenian_yentamna = uint(C.GDK_KEY_Armenian_yentamna) + KEY_Armenian_exclam = uint(C.GDK_KEY_Armenian_exclam) + KEY_Armenian_amanak = uint(C.GDK_KEY_Armenian_amanak) + KEY_Armenian_accent = uint(C.GDK_KEY_Armenian_accent) + KEY_Armenian_shesht = uint(C.GDK_KEY_Armenian_shesht) + KEY_Armenian_question = uint(C.GDK_KEY_Armenian_question) + KEY_Armenian_paruyk = uint(C.GDK_KEY_Armenian_paruyk) + KEY_Armenian_AYB = uint(C.GDK_KEY_Armenian_AYB) + KEY_Armenian_ayb = uint(C.GDK_KEY_Armenian_ayb) + KEY_Armenian_BEN = uint(C.GDK_KEY_Armenian_BEN) + KEY_Armenian_ben = uint(C.GDK_KEY_Armenian_ben) + KEY_Armenian_GIM = uint(C.GDK_KEY_Armenian_GIM) + KEY_Armenian_gim = uint(C.GDK_KEY_Armenian_gim) + KEY_Armenian_DA = uint(C.GDK_KEY_Armenian_DA) + KEY_Armenian_da = uint(C.GDK_KEY_Armenian_da) + KEY_Armenian_YECH = uint(C.GDK_KEY_Armenian_YECH) + KEY_Armenian_yech = uint(C.GDK_KEY_Armenian_yech) + KEY_Armenian_ZA = uint(C.GDK_KEY_Armenian_ZA) + KEY_Armenian_za = uint(C.GDK_KEY_Armenian_za) + KEY_Armenian_E = uint(C.GDK_KEY_Armenian_E) + KEY_Armenian_e = uint(C.GDK_KEY_Armenian_e) + KEY_Armenian_AT = uint(C.GDK_KEY_Armenian_AT) + KEY_Armenian_at = uint(C.GDK_KEY_Armenian_at) + KEY_Armenian_TO = uint(C.GDK_KEY_Armenian_TO) + KEY_Armenian_to = uint(C.GDK_KEY_Armenian_to) + KEY_Armenian_ZHE = uint(C.GDK_KEY_Armenian_ZHE) + KEY_Armenian_zhe = uint(C.GDK_KEY_Armenian_zhe) + KEY_Armenian_INI = uint(C.GDK_KEY_Armenian_INI) + KEY_Armenian_ini = uint(C.GDK_KEY_Armenian_ini) + KEY_Armenian_LYUN = uint(C.GDK_KEY_Armenian_LYUN) + KEY_Armenian_lyun = uint(C.GDK_KEY_Armenian_lyun) + KEY_Armenian_KHE = uint(C.GDK_KEY_Armenian_KHE) + KEY_Armenian_khe = uint(C.GDK_KEY_Armenian_khe) + KEY_Armenian_TSA = uint(C.GDK_KEY_Armenian_TSA) + KEY_Armenian_tsa = uint(C.GDK_KEY_Armenian_tsa) + KEY_Armenian_KEN = uint(C.GDK_KEY_Armenian_KEN) + KEY_Armenian_ken = uint(C.GDK_KEY_Armenian_ken) + KEY_Armenian_HO = uint(C.GDK_KEY_Armenian_HO) + KEY_Armenian_ho = uint(C.GDK_KEY_Armenian_ho) + KEY_Armenian_DZA = uint(C.GDK_KEY_Armenian_DZA) + KEY_Armenian_dza = uint(C.GDK_KEY_Armenian_dza) + KEY_Armenian_GHAT = uint(C.GDK_KEY_Armenian_GHAT) + KEY_Armenian_ghat = uint(C.GDK_KEY_Armenian_ghat) + KEY_Armenian_TCHE = uint(C.GDK_KEY_Armenian_TCHE) + KEY_Armenian_tche = uint(C.GDK_KEY_Armenian_tche) + KEY_Armenian_MEN = uint(C.GDK_KEY_Armenian_MEN) + KEY_Armenian_men = uint(C.GDK_KEY_Armenian_men) + KEY_Armenian_HI = uint(C.GDK_KEY_Armenian_HI) + KEY_Armenian_hi = uint(C.GDK_KEY_Armenian_hi) + KEY_Armenian_NU = uint(C.GDK_KEY_Armenian_NU) + KEY_Armenian_nu = uint(C.GDK_KEY_Armenian_nu) + KEY_Armenian_SHA = uint(C.GDK_KEY_Armenian_SHA) + KEY_Armenian_sha = uint(C.GDK_KEY_Armenian_sha) + KEY_Armenian_VO = uint(C.GDK_KEY_Armenian_VO) + KEY_Armenian_vo = uint(C.GDK_KEY_Armenian_vo) + KEY_Armenian_CHA = uint(C.GDK_KEY_Armenian_CHA) + KEY_Armenian_cha = uint(C.GDK_KEY_Armenian_cha) + KEY_Armenian_PE = uint(C.GDK_KEY_Armenian_PE) + KEY_Armenian_pe = uint(C.GDK_KEY_Armenian_pe) + KEY_Armenian_JE = uint(C.GDK_KEY_Armenian_JE) + KEY_Armenian_je = uint(C.GDK_KEY_Armenian_je) + KEY_Armenian_RA = uint(C.GDK_KEY_Armenian_RA) + KEY_Armenian_ra = uint(C.GDK_KEY_Armenian_ra) + KEY_Armenian_SE = uint(C.GDK_KEY_Armenian_SE) + KEY_Armenian_se = uint(C.GDK_KEY_Armenian_se) + KEY_Armenian_VEV = uint(C.GDK_KEY_Armenian_VEV) + KEY_Armenian_vev = uint(C.GDK_KEY_Armenian_vev) + KEY_Armenian_TYUN = uint(C.GDK_KEY_Armenian_TYUN) + KEY_Armenian_tyun = uint(C.GDK_KEY_Armenian_tyun) + KEY_Armenian_RE = uint(C.GDK_KEY_Armenian_RE) + KEY_Armenian_re = uint(C.GDK_KEY_Armenian_re) + KEY_Armenian_TSO = uint(C.GDK_KEY_Armenian_TSO) + KEY_Armenian_tso = uint(C.GDK_KEY_Armenian_tso) + KEY_Armenian_VYUN = uint(C.GDK_KEY_Armenian_VYUN) + KEY_Armenian_vyun = uint(C.GDK_KEY_Armenian_vyun) + KEY_Armenian_PYUR = uint(C.GDK_KEY_Armenian_PYUR) + KEY_Armenian_pyur = uint(C.GDK_KEY_Armenian_pyur) + KEY_Armenian_KE = uint(C.GDK_KEY_Armenian_KE) + KEY_Armenian_ke = uint(C.GDK_KEY_Armenian_ke) + KEY_Armenian_O = uint(C.GDK_KEY_Armenian_O) + KEY_Armenian_o = uint(C.GDK_KEY_Armenian_o) + KEY_Armenian_FE = uint(C.GDK_KEY_Armenian_FE) + KEY_Armenian_fe = uint(C.GDK_KEY_Armenian_fe) + KEY_Armenian_apostrophe = uint(C.GDK_KEY_Armenian_apostrophe) + KEY_Georgian_an = uint(C.GDK_KEY_Georgian_an) + KEY_Georgian_ban = uint(C.GDK_KEY_Georgian_ban) + KEY_Georgian_gan = uint(C.GDK_KEY_Georgian_gan) + KEY_Georgian_don = uint(C.GDK_KEY_Georgian_don) + KEY_Georgian_en = uint(C.GDK_KEY_Georgian_en) + KEY_Georgian_vin = uint(C.GDK_KEY_Georgian_vin) + KEY_Georgian_zen = uint(C.GDK_KEY_Georgian_zen) + KEY_Georgian_tan = uint(C.GDK_KEY_Georgian_tan) + KEY_Georgian_in = uint(C.GDK_KEY_Georgian_in) + KEY_Georgian_kan = uint(C.GDK_KEY_Georgian_kan) + KEY_Georgian_las = uint(C.GDK_KEY_Georgian_las) + KEY_Georgian_man = uint(C.GDK_KEY_Georgian_man) + KEY_Georgian_nar = uint(C.GDK_KEY_Georgian_nar) + KEY_Georgian_on = uint(C.GDK_KEY_Georgian_on) + KEY_Georgian_par = uint(C.GDK_KEY_Georgian_par) + KEY_Georgian_zhar = uint(C.GDK_KEY_Georgian_zhar) + KEY_Georgian_rae = uint(C.GDK_KEY_Georgian_rae) + KEY_Georgian_san = uint(C.GDK_KEY_Georgian_san) + KEY_Georgian_tar = uint(C.GDK_KEY_Georgian_tar) + KEY_Georgian_un = uint(C.GDK_KEY_Georgian_un) + KEY_Georgian_phar = uint(C.GDK_KEY_Georgian_phar) + KEY_Georgian_khar = uint(C.GDK_KEY_Georgian_khar) + KEY_Georgian_ghan = uint(C.GDK_KEY_Georgian_ghan) + KEY_Georgian_qar = uint(C.GDK_KEY_Georgian_qar) + KEY_Georgian_shin = uint(C.GDK_KEY_Georgian_shin) + KEY_Georgian_chin = uint(C.GDK_KEY_Georgian_chin) + KEY_Georgian_can = uint(C.GDK_KEY_Georgian_can) + KEY_Georgian_jil = uint(C.GDK_KEY_Georgian_jil) + KEY_Georgian_cil = uint(C.GDK_KEY_Georgian_cil) + KEY_Georgian_char = uint(C.GDK_KEY_Georgian_char) + KEY_Georgian_xan = uint(C.GDK_KEY_Georgian_xan) + KEY_Georgian_jhan = uint(C.GDK_KEY_Georgian_jhan) + KEY_Georgian_hae = uint(C.GDK_KEY_Georgian_hae) + KEY_Georgian_he = uint(C.GDK_KEY_Georgian_he) + KEY_Georgian_hie = uint(C.GDK_KEY_Georgian_hie) + KEY_Georgian_we = uint(C.GDK_KEY_Georgian_we) + KEY_Georgian_har = uint(C.GDK_KEY_Georgian_har) + KEY_Georgian_hoe = uint(C.GDK_KEY_Georgian_hoe) + KEY_Georgian_fi = uint(C.GDK_KEY_Georgian_fi) + KEY_Xabovedot = uint(C.GDK_KEY_Xabovedot) + KEY_Ibreve = uint(C.GDK_KEY_Ibreve) + KEY_Zstroke = uint(C.GDK_KEY_Zstroke) + KEY_Gcaron = uint(C.GDK_KEY_Gcaron) + KEY_Ocaron = uint(C.GDK_KEY_Ocaron) + KEY_Obarred = uint(C.GDK_KEY_Obarred) + KEY_xabovedot = uint(C.GDK_KEY_xabovedot) + KEY_ibreve = uint(C.GDK_KEY_ibreve) + KEY_zstroke = uint(C.GDK_KEY_zstroke) + KEY_gcaron = uint(C.GDK_KEY_gcaron) + KEY_ocaron = uint(C.GDK_KEY_ocaron) + KEY_obarred = uint(C.GDK_KEY_obarred) + KEY_SCHWA = uint(C.GDK_KEY_SCHWA) + KEY_schwa = uint(C.GDK_KEY_schwa) + KEY_EZH = uint(C.GDK_KEY_EZH) + KEY_ezh = uint(C.GDK_KEY_ezh) + KEY_Lbelowdot = uint(C.GDK_KEY_Lbelowdot) + KEY_lbelowdot = uint(C.GDK_KEY_lbelowdot) + KEY_Abelowdot = uint(C.GDK_KEY_Abelowdot) + KEY_abelowdot = uint(C.GDK_KEY_abelowdot) + KEY_Ahook = uint(C.GDK_KEY_Ahook) + KEY_ahook = uint(C.GDK_KEY_ahook) + KEY_Acircumflexacute = uint(C.GDK_KEY_Acircumflexacute) + KEY_acircumflexacute = uint(C.GDK_KEY_acircumflexacute) + KEY_Acircumflexgrave = uint(C.GDK_KEY_Acircumflexgrave) + KEY_acircumflexgrave = uint(C.GDK_KEY_acircumflexgrave) + KEY_Acircumflexhook = uint(C.GDK_KEY_Acircumflexhook) + KEY_acircumflexhook = uint(C.GDK_KEY_acircumflexhook) + KEY_Acircumflextilde = uint(C.GDK_KEY_Acircumflextilde) + KEY_acircumflextilde = uint(C.GDK_KEY_acircumflextilde) + KEY_Acircumflexbelowdot = uint(C.GDK_KEY_Acircumflexbelowdot) + KEY_acircumflexbelowdot = uint(C.GDK_KEY_acircumflexbelowdot) + KEY_Abreveacute = uint(C.GDK_KEY_Abreveacute) + KEY_abreveacute = uint(C.GDK_KEY_abreveacute) + KEY_Abrevegrave = uint(C.GDK_KEY_Abrevegrave) + KEY_abrevegrave = uint(C.GDK_KEY_abrevegrave) + KEY_Abrevehook = uint(C.GDK_KEY_Abrevehook) + KEY_abrevehook = uint(C.GDK_KEY_abrevehook) + KEY_Abrevetilde = uint(C.GDK_KEY_Abrevetilde) + KEY_abrevetilde = uint(C.GDK_KEY_abrevetilde) + KEY_Abrevebelowdot = uint(C.GDK_KEY_Abrevebelowdot) + KEY_abrevebelowdot = uint(C.GDK_KEY_abrevebelowdot) + KEY_Ebelowdot = uint(C.GDK_KEY_Ebelowdot) + KEY_ebelowdot = uint(C.GDK_KEY_ebelowdot) + KEY_Ehook = uint(C.GDK_KEY_Ehook) + KEY_ehook = uint(C.GDK_KEY_ehook) + KEY_Etilde = uint(C.GDK_KEY_Etilde) + KEY_etilde = uint(C.GDK_KEY_etilde) + KEY_Ecircumflexacute = uint(C.GDK_KEY_Ecircumflexacute) + KEY_ecircumflexacute = uint(C.GDK_KEY_ecircumflexacute) + KEY_Ecircumflexgrave = uint(C.GDK_KEY_Ecircumflexgrave) + KEY_ecircumflexgrave = uint(C.GDK_KEY_ecircumflexgrave) + KEY_Ecircumflexhook = uint(C.GDK_KEY_Ecircumflexhook) + KEY_ecircumflexhook = uint(C.GDK_KEY_ecircumflexhook) + KEY_Ecircumflextilde = uint(C.GDK_KEY_Ecircumflextilde) + KEY_ecircumflextilde = uint(C.GDK_KEY_ecircumflextilde) + KEY_Ecircumflexbelowdot = uint(C.GDK_KEY_Ecircumflexbelowdot) + KEY_ecircumflexbelowdot = uint(C.GDK_KEY_ecircumflexbelowdot) + KEY_Ihook = uint(C.GDK_KEY_Ihook) + KEY_ihook = uint(C.GDK_KEY_ihook) + KEY_Ibelowdot = uint(C.GDK_KEY_Ibelowdot) + KEY_ibelowdot = uint(C.GDK_KEY_ibelowdot) + KEY_Obelowdot = uint(C.GDK_KEY_Obelowdot) + KEY_obelowdot = uint(C.GDK_KEY_obelowdot) + KEY_Ohook = uint(C.GDK_KEY_Ohook) + KEY_ohook = uint(C.GDK_KEY_ohook) + KEY_Ocircumflexacute = uint(C.GDK_KEY_Ocircumflexacute) + KEY_ocircumflexacute = uint(C.GDK_KEY_ocircumflexacute) + KEY_Ocircumflexgrave = uint(C.GDK_KEY_Ocircumflexgrave) + KEY_ocircumflexgrave = uint(C.GDK_KEY_ocircumflexgrave) + KEY_Ocircumflexhook = uint(C.GDK_KEY_Ocircumflexhook) + KEY_ocircumflexhook = uint(C.GDK_KEY_ocircumflexhook) + KEY_Ocircumflextilde = uint(C.GDK_KEY_Ocircumflextilde) + KEY_ocircumflextilde = uint(C.GDK_KEY_ocircumflextilde) + KEY_Ocircumflexbelowdot = uint(C.GDK_KEY_Ocircumflexbelowdot) + KEY_ocircumflexbelowdot = uint(C.GDK_KEY_ocircumflexbelowdot) + KEY_Ohornacute = uint(C.GDK_KEY_Ohornacute) + KEY_ohornacute = uint(C.GDK_KEY_ohornacute) + KEY_Ohorngrave = uint(C.GDK_KEY_Ohorngrave) + KEY_ohorngrave = uint(C.GDK_KEY_ohorngrave) + KEY_Ohornhook = uint(C.GDK_KEY_Ohornhook) + KEY_ohornhook = uint(C.GDK_KEY_ohornhook) + KEY_Ohorntilde = uint(C.GDK_KEY_Ohorntilde) + KEY_ohorntilde = uint(C.GDK_KEY_ohorntilde) + KEY_Ohornbelowdot = uint(C.GDK_KEY_Ohornbelowdot) + KEY_ohornbelowdot = uint(C.GDK_KEY_ohornbelowdot) + KEY_Ubelowdot = uint(C.GDK_KEY_Ubelowdot) + KEY_ubelowdot = uint(C.GDK_KEY_ubelowdot) + KEY_Uhook = uint(C.GDK_KEY_Uhook) + KEY_uhook = uint(C.GDK_KEY_uhook) + KEY_Uhornacute = uint(C.GDK_KEY_Uhornacute) + KEY_uhornacute = uint(C.GDK_KEY_uhornacute) + KEY_Uhorngrave = uint(C.GDK_KEY_Uhorngrave) + KEY_uhorngrave = uint(C.GDK_KEY_uhorngrave) + KEY_Uhornhook = uint(C.GDK_KEY_Uhornhook) + KEY_uhornhook = uint(C.GDK_KEY_uhornhook) + KEY_Uhorntilde = uint(C.GDK_KEY_Uhorntilde) + KEY_uhorntilde = uint(C.GDK_KEY_uhorntilde) + KEY_Uhornbelowdot = uint(C.GDK_KEY_Uhornbelowdot) + KEY_uhornbelowdot = uint(C.GDK_KEY_uhornbelowdot) + KEY_Ybelowdot = uint(C.GDK_KEY_Ybelowdot) + KEY_ybelowdot = uint(C.GDK_KEY_ybelowdot) + KEY_Yhook = uint(C.GDK_KEY_Yhook) + KEY_yhook = uint(C.GDK_KEY_yhook) + KEY_Ytilde = uint(C.GDK_KEY_Ytilde) + KEY_ytilde = uint(C.GDK_KEY_ytilde) + KEY_Ohorn = uint(C.GDK_KEY_Ohorn) + KEY_ohorn = uint(C.GDK_KEY_ohorn) + KEY_Uhorn = uint(C.GDK_KEY_Uhorn) + KEY_uhorn = uint(C.GDK_KEY_uhorn) + KEY_EcuSign = uint(C.GDK_KEY_EcuSign) + KEY_ColonSign = uint(C.GDK_KEY_ColonSign) + KEY_CruzeiroSign = uint(C.GDK_KEY_CruzeiroSign) + KEY_FFrancSign = uint(C.GDK_KEY_FFrancSign) + KEY_LiraSign = uint(C.GDK_KEY_LiraSign) + KEY_MillSign = uint(C.GDK_KEY_MillSign) + KEY_NairaSign = uint(C.GDK_KEY_NairaSign) + KEY_PesetaSign = uint(C.GDK_KEY_PesetaSign) + KEY_RupeeSign = uint(C.GDK_KEY_RupeeSign) + KEY_WonSign = uint(C.GDK_KEY_WonSign) + KEY_NewSheqelSign = uint(C.GDK_KEY_NewSheqelSign) + KEY_DongSign = uint(C.GDK_KEY_DongSign) + KEY_EuroSign = uint(C.GDK_KEY_EuroSign) + KEY_zerosuperior = uint(C.GDK_KEY_zerosuperior) + KEY_foursuperior = uint(C.GDK_KEY_foursuperior) + KEY_fivesuperior = uint(C.GDK_KEY_fivesuperior) + KEY_sixsuperior = uint(C.GDK_KEY_sixsuperior) + KEY_sevensuperior = uint(C.GDK_KEY_sevensuperior) + KEY_eightsuperior = uint(C.GDK_KEY_eightsuperior) + KEY_ninesuperior = uint(C.GDK_KEY_ninesuperior) + KEY_zerosubscript = uint(C.GDK_KEY_zerosubscript) + KEY_onesubscript = uint(C.GDK_KEY_onesubscript) + KEY_twosubscript = uint(C.GDK_KEY_twosubscript) + KEY_threesubscript = uint(C.GDK_KEY_threesubscript) + KEY_foursubscript = uint(C.GDK_KEY_foursubscript) + KEY_fivesubscript = uint(C.GDK_KEY_fivesubscript) + KEY_sixsubscript = uint(C.GDK_KEY_sixsubscript) + KEY_sevensubscript = uint(C.GDK_KEY_sevensubscript) + KEY_eightsubscript = uint(C.GDK_KEY_eightsubscript) + KEY_ninesubscript = uint(C.GDK_KEY_ninesubscript) + KEY_partdifferential = uint(C.GDK_KEY_partdifferential) + KEY_emptyset = uint(C.GDK_KEY_emptyset) + KEY_elementof = uint(C.GDK_KEY_elementof) + KEY_notelementof = uint(C.GDK_KEY_notelementof) + KEY_containsas = uint(C.GDK_KEY_containsas) + KEY_squareroot = uint(C.GDK_KEY_squareroot) + KEY_cuberoot = uint(C.GDK_KEY_cuberoot) + KEY_fourthroot = uint(C.GDK_KEY_fourthroot) + KEY_dintegral = uint(C.GDK_KEY_dintegral) + KEY_tintegral = uint(C.GDK_KEY_tintegral) + KEY_because = uint(C.GDK_KEY_because) + KEY_approxeq = uint(C.GDK_KEY_approxeq) + KEY_notapproxeq = uint(C.GDK_KEY_notapproxeq) + KEY_notidentical = uint(C.GDK_KEY_notidentical) + KEY_stricteq = uint(C.GDK_KEY_stricteq) + KEY_braille_dot_1 = uint(C.GDK_KEY_braille_dot_1) + KEY_braille_dot_2 = uint(C.GDK_KEY_braille_dot_2) + KEY_braille_dot_3 = uint(C.GDK_KEY_braille_dot_3) + KEY_braille_dot_4 = uint(C.GDK_KEY_braille_dot_4) + KEY_braille_dot_5 = uint(C.GDK_KEY_braille_dot_5) + KEY_braille_dot_6 = uint(C.GDK_KEY_braille_dot_6) + KEY_braille_dot_7 = uint(C.GDK_KEY_braille_dot_7) + KEY_braille_dot_8 = uint(C.GDK_KEY_braille_dot_8) + KEY_braille_dot_9 = uint(C.GDK_KEY_braille_dot_9) + KEY_braille_dot_10 = uint(C.GDK_KEY_braille_dot_10) + KEY_braille_blank = uint(C.GDK_KEY_braille_blank) + KEY_braille_dots_1 = uint(C.GDK_KEY_braille_dots_1) + KEY_braille_dots_2 = uint(C.GDK_KEY_braille_dots_2) + KEY_braille_dots_12 = uint(C.GDK_KEY_braille_dots_12) + KEY_braille_dots_3 = uint(C.GDK_KEY_braille_dots_3) + KEY_braille_dots_13 = uint(C.GDK_KEY_braille_dots_13) + KEY_braille_dots_23 = uint(C.GDK_KEY_braille_dots_23) + KEY_braille_dots_123 = uint(C.GDK_KEY_braille_dots_123) + KEY_braille_dots_4 = uint(C.GDK_KEY_braille_dots_4) + KEY_braille_dots_14 = uint(C.GDK_KEY_braille_dots_14) + KEY_braille_dots_24 = uint(C.GDK_KEY_braille_dots_24) + KEY_braille_dots_124 = uint(C.GDK_KEY_braille_dots_124) + KEY_braille_dots_34 = uint(C.GDK_KEY_braille_dots_34) + KEY_braille_dots_134 = uint(C.GDK_KEY_braille_dots_134) + KEY_braille_dots_234 = uint(C.GDK_KEY_braille_dots_234) + KEY_braille_dots_1234 = uint(C.GDK_KEY_braille_dots_1234) + KEY_braille_dots_5 = uint(C.GDK_KEY_braille_dots_5) + KEY_braille_dots_15 = uint(C.GDK_KEY_braille_dots_15) + KEY_braille_dots_25 = uint(C.GDK_KEY_braille_dots_25) + KEY_braille_dots_125 = uint(C.GDK_KEY_braille_dots_125) + KEY_braille_dots_35 = uint(C.GDK_KEY_braille_dots_35) + KEY_braille_dots_135 = uint(C.GDK_KEY_braille_dots_135) + KEY_braille_dots_235 = uint(C.GDK_KEY_braille_dots_235) + KEY_braille_dots_1235 = uint(C.GDK_KEY_braille_dots_1235) + KEY_braille_dots_45 = uint(C.GDK_KEY_braille_dots_45) + KEY_braille_dots_145 = uint(C.GDK_KEY_braille_dots_145) + KEY_braille_dots_245 = uint(C.GDK_KEY_braille_dots_245) + KEY_braille_dots_1245 = uint(C.GDK_KEY_braille_dots_1245) + KEY_braille_dots_345 = uint(C.GDK_KEY_braille_dots_345) + KEY_braille_dots_1345 = uint(C.GDK_KEY_braille_dots_1345) + KEY_braille_dots_2345 = uint(C.GDK_KEY_braille_dots_2345) + KEY_braille_dots_12345 = uint(C.GDK_KEY_braille_dots_12345) + KEY_braille_dots_6 = uint(C.GDK_KEY_braille_dots_6) + KEY_braille_dots_16 = uint(C.GDK_KEY_braille_dots_16) + KEY_braille_dots_26 = uint(C.GDK_KEY_braille_dots_26) + KEY_braille_dots_126 = uint(C.GDK_KEY_braille_dots_126) + KEY_braille_dots_36 = uint(C.GDK_KEY_braille_dots_36) + KEY_braille_dots_136 = uint(C.GDK_KEY_braille_dots_136) + KEY_braille_dots_236 = uint(C.GDK_KEY_braille_dots_236) + KEY_braille_dots_1236 = uint(C.GDK_KEY_braille_dots_1236) + KEY_braille_dots_46 = uint(C.GDK_KEY_braille_dots_46) + KEY_braille_dots_146 = uint(C.GDK_KEY_braille_dots_146) + KEY_braille_dots_246 = uint(C.GDK_KEY_braille_dots_246) + KEY_braille_dots_1246 = uint(C.GDK_KEY_braille_dots_1246) + KEY_braille_dots_346 = uint(C.GDK_KEY_braille_dots_346) + KEY_braille_dots_1346 = uint(C.GDK_KEY_braille_dots_1346) + KEY_braille_dots_2346 = uint(C.GDK_KEY_braille_dots_2346) + KEY_braille_dots_12346 = uint(C.GDK_KEY_braille_dots_12346) + KEY_braille_dots_56 = uint(C.GDK_KEY_braille_dots_56) + KEY_braille_dots_156 = uint(C.GDK_KEY_braille_dots_156) + KEY_braille_dots_256 = uint(C.GDK_KEY_braille_dots_256) + KEY_braille_dots_1256 = uint(C.GDK_KEY_braille_dots_1256) + KEY_braille_dots_356 = uint(C.GDK_KEY_braille_dots_356) + KEY_braille_dots_1356 = uint(C.GDK_KEY_braille_dots_1356) + KEY_braille_dots_2356 = uint(C.GDK_KEY_braille_dots_2356) + KEY_braille_dots_12356 = uint(C.GDK_KEY_braille_dots_12356) + KEY_braille_dots_456 = uint(C.GDK_KEY_braille_dots_456) + KEY_braille_dots_1456 = uint(C.GDK_KEY_braille_dots_1456) + KEY_braille_dots_2456 = uint(C.GDK_KEY_braille_dots_2456) + KEY_braille_dots_12456 = uint(C.GDK_KEY_braille_dots_12456) + KEY_braille_dots_3456 = uint(C.GDK_KEY_braille_dots_3456) + KEY_braille_dots_13456 = uint(C.GDK_KEY_braille_dots_13456) + KEY_braille_dots_23456 = uint(C.GDK_KEY_braille_dots_23456) + KEY_braille_dots_123456 = uint(C.GDK_KEY_braille_dots_123456) + KEY_braille_dots_7 = uint(C.GDK_KEY_braille_dots_7) + KEY_braille_dots_17 = uint(C.GDK_KEY_braille_dots_17) + KEY_braille_dots_27 = uint(C.GDK_KEY_braille_dots_27) + KEY_braille_dots_127 = uint(C.GDK_KEY_braille_dots_127) + KEY_braille_dots_37 = uint(C.GDK_KEY_braille_dots_37) + KEY_braille_dots_137 = uint(C.GDK_KEY_braille_dots_137) + KEY_braille_dots_237 = uint(C.GDK_KEY_braille_dots_237) + KEY_braille_dots_1237 = uint(C.GDK_KEY_braille_dots_1237) + KEY_braille_dots_47 = uint(C.GDK_KEY_braille_dots_47) + KEY_braille_dots_147 = uint(C.GDK_KEY_braille_dots_147) + KEY_braille_dots_247 = uint(C.GDK_KEY_braille_dots_247) + KEY_braille_dots_1247 = uint(C.GDK_KEY_braille_dots_1247) + KEY_braille_dots_347 = uint(C.GDK_KEY_braille_dots_347) + KEY_braille_dots_1347 = uint(C.GDK_KEY_braille_dots_1347) + KEY_braille_dots_2347 = uint(C.GDK_KEY_braille_dots_2347) + KEY_braille_dots_12347 = uint(C.GDK_KEY_braille_dots_12347) + KEY_braille_dots_57 = uint(C.GDK_KEY_braille_dots_57) + KEY_braille_dots_157 = uint(C.GDK_KEY_braille_dots_157) + KEY_braille_dots_257 = uint(C.GDK_KEY_braille_dots_257) + KEY_braille_dots_1257 = uint(C.GDK_KEY_braille_dots_1257) + KEY_braille_dots_357 = uint(C.GDK_KEY_braille_dots_357) + KEY_braille_dots_1357 = uint(C.GDK_KEY_braille_dots_1357) + KEY_braille_dots_2357 = uint(C.GDK_KEY_braille_dots_2357) + KEY_braille_dots_12357 = uint(C.GDK_KEY_braille_dots_12357) + KEY_braille_dots_457 = uint(C.GDK_KEY_braille_dots_457) + KEY_braille_dots_1457 = uint(C.GDK_KEY_braille_dots_1457) + KEY_braille_dots_2457 = uint(C.GDK_KEY_braille_dots_2457) + KEY_braille_dots_12457 = uint(C.GDK_KEY_braille_dots_12457) + KEY_braille_dots_3457 = uint(C.GDK_KEY_braille_dots_3457) + KEY_braille_dots_13457 = uint(C.GDK_KEY_braille_dots_13457) + KEY_braille_dots_23457 = uint(C.GDK_KEY_braille_dots_23457) + KEY_braille_dots_123457 = uint(C.GDK_KEY_braille_dots_123457) + KEY_braille_dots_67 = uint(C.GDK_KEY_braille_dots_67) + KEY_braille_dots_167 = uint(C.GDK_KEY_braille_dots_167) + KEY_braille_dots_267 = uint(C.GDK_KEY_braille_dots_267) + KEY_braille_dots_1267 = uint(C.GDK_KEY_braille_dots_1267) + KEY_braille_dots_367 = uint(C.GDK_KEY_braille_dots_367) + KEY_braille_dots_1367 = uint(C.GDK_KEY_braille_dots_1367) + KEY_braille_dots_2367 = uint(C.GDK_KEY_braille_dots_2367) + KEY_braille_dots_12367 = uint(C.GDK_KEY_braille_dots_12367) + KEY_braille_dots_467 = uint(C.GDK_KEY_braille_dots_467) + KEY_braille_dots_1467 = uint(C.GDK_KEY_braille_dots_1467) + KEY_braille_dots_2467 = uint(C.GDK_KEY_braille_dots_2467) + KEY_braille_dots_12467 = uint(C.GDK_KEY_braille_dots_12467) + KEY_braille_dots_3467 = uint(C.GDK_KEY_braille_dots_3467) + KEY_braille_dots_13467 = uint(C.GDK_KEY_braille_dots_13467) + KEY_braille_dots_23467 = uint(C.GDK_KEY_braille_dots_23467) + KEY_braille_dots_123467 = uint(C.GDK_KEY_braille_dots_123467) + KEY_braille_dots_567 = uint(C.GDK_KEY_braille_dots_567) + KEY_braille_dots_1567 = uint(C.GDK_KEY_braille_dots_1567) + KEY_braille_dots_2567 = uint(C.GDK_KEY_braille_dots_2567) + KEY_braille_dots_12567 = uint(C.GDK_KEY_braille_dots_12567) + KEY_braille_dots_3567 = uint(C.GDK_KEY_braille_dots_3567) + KEY_braille_dots_13567 = uint(C.GDK_KEY_braille_dots_13567) + KEY_braille_dots_23567 = uint(C.GDK_KEY_braille_dots_23567) + KEY_braille_dots_123567 = uint(C.GDK_KEY_braille_dots_123567) + KEY_braille_dots_4567 = uint(C.GDK_KEY_braille_dots_4567) + KEY_braille_dots_14567 = uint(C.GDK_KEY_braille_dots_14567) + KEY_braille_dots_24567 = uint(C.GDK_KEY_braille_dots_24567) + KEY_braille_dots_124567 = uint(C.GDK_KEY_braille_dots_124567) + KEY_braille_dots_34567 = uint(C.GDK_KEY_braille_dots_34567) + KEY_braille_dots_134567 = uint(C.GDK_KEY_braille_dots_134567) + KEY_braille_dots_234567 = uint(C.GDK_KEY_braille_dots_234567) + KEY_braille_dots_1234567 = uint(C.GDK_KEY_braille_dots_1234567) + KEY_braille_dots_8 = uint(C.GDK_KEY_braille_dots_8) + KEY_braille_dots_18 = uint(C.GDK_KEY_braille_dots_18) + KEY_braille_dots_28 = uint(C.GDK_KEY_braille_dots_28) + KEY_braille_dots_128 = uint(C.GDK_KEY_braille_dots_128) + KEY_braille_dots_38 = uint(C.GDK_KEY_braille_dots_38) + KEY_braille_dots_138 = uint(C.GDK_KEY_braille_dots_138) + KEY_braille_dots_238 = uint(C.GDK_KEY_braille_dots_238) + KEY_braille_dots_1238 = uint(C.GDK_KEY_braille_dots_1238) + KEY_braille_dots_48 = uint(C.GDK_KEY_braille_dots_48) + KEY_braille_dots_148 = uint(C.GDK_KEY_braille_dots_148) + KEY_braille_dots_248 = uint(C.GDK_KEY_braille_dots_248) + KEY_braille_dots_1248 = uint(C.GDK_KEY_braille_dots_1248) + KEY_braille_dots_348 = uint(C.GDK_KEY_braille_dots_348) + KEY_braille_dots_1348 = uint(C.GDK_KEY_braille_dots_1348) + KEY_braille_dots_2348 = uint(C.GDK_KEY_braille_dots_2348) + KEY_braille_dots_12348 = uint(C.GDK_KEY_braille_dots_12348) + KEY_braille_dots_58 = uint(C.GDK_KEY_braille_dots_58) + KEY_braille_dots_158 = uint(C.GDK_KEY_braille_dots_158) + KEY_braille_dots_258 = uint(C.GDK_KEY_braille_dots_258) + KEY_braille_dots_1258 = uint(C.GDK_KEY_braille_dots_1258) + KEY_braille_dots_358 = uint(C.GDK_KEY_braille_dots_358) + KEY_braille_dots_1358 = uint(C.GDK_KEY_braille_dots_1358) + KEY_braille_dots_2358 = uint(C.GDK_KEY_braille_dots_2358) + KEY_braille_dots_12358 = uint(C.GDK_KEY_braille_dots_12358) + KEY_braille_dots_458 = uint(C.GDK_KEY_braille_dots_458) + KEY_braille_dots_1458 = uint(C.GDK_KEY_braille_dots_1458) + KEY_braille_dots_2458 = uint(C.GDK_KEY_braille_dots_2458) + KEY_braille_dots_12458 = uint(C.GDK_KEY_braille_dots_12458) + KEY_braille_dots_3458 = uint(C.GDK_KEY_braille_dots_3458) + KEY_braille_dots_13458 = uint(C.GDK_KEY_braille_dots_13458) + KEY_braille_dots_23458 = uint(C.GDK_KEY_braille_dots_23458) + KEY_braille_dots_123458 = uint(C.GDK_KEY_braille_dots_123458) + KEY_braille_dots_68 = uint(C.GDK_KEY_braille_dots_68) + KEY_braille_dots_168 = uint(C.GDK_KEY_braille_dots_168) + KEY_braille_dots_268 = uint(C.GDK_KEY_braille_dots_268) + KEY_braille_dots_1268 = uint(C.GDK_KEY_braille_dots_1268) + KEY_braille_dots_368 = uint(C.GDK_KEY_braille_dots_368) + KEY_braille_dots_1368 = uint(C.GDK_KEY_braille_dots_1368) + KEY_braille_dots_2368 = uint(C.GDK_KEY_braille_dots_2368) + KEY_braille_dots_12368 = uint(C.GDK_KEY_braille_dots_12368) + KEY_braille_dots_468 = uint(C.GDK_KEY_braille_dots_468) + KEY_braille_dots_1468 = uint(C.GDK_KEY_braille_dots_1468) + KEY_braille_dots_2468 = uint(C.GDK_KEY_braille_dots_2468) + KEY_braille_dots_12468 = uint(C.GDK_KEY_braille_dots_12468) + KEY_braille_dots_3468 = uint(C.GDK_KEY_braille_dots_3468) + KEY_braille_dots_13468 = uint(C.GDK_KEY_braille_dots_13468) + KEY_braille_dots_23468 = uint(C.GDK_KEY_braille_dots_23468) + KEY_braille_dots_123468 = uint(C.GDK_KEY_braille_dots_123468) + KEY_braille_dots_568 = uint(C.GDK_KEY_braille_dots_568) + KEY_braille_dots_1568 = uint(C.GDK_KEY_braille_dots_1568) + KEY_braille_dots_2568 = uint(C.GDK_KEY_braille_dots_2568) + KEY_braille_dots_12568 = uint(C.GDK_KEY_braille_dots_12568) + KEY_braille_dots_3568 = uint(C.GDK_KEY_braille_dots_3568) + KEY_braille_dots_13568 = uint(C.GDK_KEY_braille_dots_13568) + KEY_braille_dots_23568 = uint(C.GDK_KEY_braille_dots_23568) + KEY_braille_dots_123568 = uint(C.GDK_KEY_braille_dots_123568) + KEY_braille_dots_4568 = uint(C.GDK_KEY_braille_dots_4568) + KEY_braille_dots_14568 = uint(C.GDK_KEY_braille_dots_14568) + KEY_braille_dots_24568 = uint(C.GDK_KEY_braille_dots_24568) + KEY_braille_dots_124568 = uint(C.GDK_KEY_braille_dots_124568) + KEY_braille_dots_34568 = uint(C.GDK_KEY_braille_dots_34568) + KEY_braille_dots_134568 = uint(C.GDK_KEY_braille_dots_134568) + KEY_braille_dots_234568 = uint(C.GDK_KEY_braille_dots_234568) + KEY_braille_dots_1234568 = uint(C.GDK_KEY_braille_dots_1234568) + KEY_braille_dots_78 = uint(C.GDK_KEY_braille_dots_78) + KEY_braille_dots_178 = uint(C.GDK_KEY_braille_dots_178) + KEY_braille_dots_278 = uint(C.GDK_KEY_braille_dots_278) + KEY_braille_dots_1278 = uint(C.GDK_KEY_braille_dots_1278) + KEY_braille_dots_378 = uint(C.GDK_KEY_braille_dots_378) + KEY_braille_dots_1378 = uint(C.GDK_KEY_braille_dots_1378) + KEY_braille_dots_2378 = uint(C.GDK_KEY_braille_dots_2378) + KEY_braille_dots_12378 = uint(C.GDK_KEY_braille_dots_12378) + KEY_braille_dots_478 = uint(C.GDK_KEY_braille_dots_478) + KEY_braille_dots_1478 = uint(C.GDK_KEY_braille_dots_1478) + KEY_braille_dots_2478 = uint(C.GDK_KEY_braille_dots_2478) + KEY_braille_dots_12478 = uint(C.GDK_KEY_braille_dots_12478) + KEY_braille_dots_3478 = uint(C.GDK_KEY_braille_dots_3478) + KEY_braille_dots_13478 = uint(C.GDK_KEY_braille_dots_13478) + KEY_braille_dots_23478 = uint(C.GDK_KEY_braille_dots_23478) + KEY_braille_dots_123478 = uint(C.GDK_KEY_braille_dots_123478) + KEY_braille_dots_578 = uint(C.GDK_KEY_braille_dots_578) + KEY_braille_dots_1578 = uint(C.GDK_KEY_braille_dots_1578) + KEY_braille_dots_2578 = uint(C.GDK_KEY_braille_dots_2578) + KEY_braille_dots_12578 = uint(C.GDK_KEY_braille_dots_12578) + KEY_braille_dots_3578 = uint(C.GDK_KEY_braille_dots_3578) + KEY_braille_dots_13578 = uint(C.GDK_KEY_braille_dots_13578) + KEY_braille_dots_23578 = uint(C.GDK_KEY_braille_dots_23578) + KEY_braille_dots_123578 = uint(C.GDK_KEY_braille_dots_123578) + KEY_braille_dots_4578 = uint(C.GDK_KEY_braille_dots_4578) + KEY_braille_dots_14578 = uint(C.GDK_KEY_braille_dots_14578) + KEY_braille_dots_24578 = uint(C.GDK_KEY_braille_dots_24578) + KEY_braille_dots_124578 = uint(C.GDK_KEY_braille_dots_124578) + KEY_braille_dots_34578 = uint(C.GDK_KEY_braille_dots_34578) + KEY_braille_dots_134578 = uint(C.GDK_KEY_braille_dots_134578) + KEY_braille_dots_234578 = uint(C.GDK_KEY_braille_dots_234578) + KEY_braille_dots_1234578 = uint(C.GDK_KEY_braille_dots_1234578) + KEY_braille_dots_678 = uint(C.GDK_KEY_braille_dots_678) + KEY_braille_dots_1678 = uint(C.GDK_KEY_braille_dots_1678) + KEY_braille_dots_2678 = uint(C.GDK_KEY_braille_dots_2678) + KEY_braille_dots_12678 = uint(C.GDK_KEY_braille_dots_12678) + KEY_braille_dots_3678 = uint(C.GDK_KEY_braille_dots_3678) + KEY_braille_dots_13678 = uint(C.GDK_KEY_braille_dots_13678) + KEY_braille_dots_23678 = uint(C.GDK_KEY_braille_dots_23678) + KEY_braille_dots_123678 = uint(C.GDK_KEY_braille_dots_123678) + KEY_braille_dots_4678 = uint(C.GDK_KEY_braille_dots_4678) + KEY_braille_dots_14678 = uint(C.GDK_KEY_braille_dots_14678) + KEY_braille_dots_24678 = uint(C.GDK_KEY_braille_dots_24678) + KEY_braille_dots_124678 = uint(C.GDK_KEY_braille_dots_124678) + KEY_braille_dots_34678 = uint(C.GDK_KEY_braille_dots_34678) + KEY_braille_dots_134678 = uint(C.GDK_KEY_braille_dots_134678) + KEY_braille_dots_234678 = uint(C.GDK_KEY_braille_dots_234678) + KEY_braille_dots_1234678 = uint(C.GDK_KEY_braille_dots_1234678) + KEY_braille_dots_5678 = uint(C.GDK_KEY_braille_dots_5678) + KEY_braille_dots_15678 = uint(C.GDK_KEY_braille_dots_15678) + KEY_braille_dots_25678 = uint(C.GDK_KEY_braille_dots_25678) + KEY_braille_dots_125678 = uint(C.GDK_KEY_braille_dots_125678) + KEY_braille_dots_35678 = uint(C.GDK_KEY_braille_dots_35678) + KEY_braille_dots_135678 = uint(C.GDK_KEY_braille_dots_135678) + KEY_braille_dots_235678 = uint(C.GDK_KEY_braille_dots_235678) + KEY_braille_dots_1235678 = uint(C.GDK_KEY_braille_dots_1235678) + KEY_braille_dots_45678 = uint(C.GDK_KEY_braille_dots_45678) + KEY_braille_dots_145678 = uint(C.GDK_KEY_braille_dots_145678) + KEY_braille_dots_245678 = uint(C.GDK_KEY_braille_dots_245678) + KEY_braille_dots_1245678 = uint(C.GDK_KEY_braille_dots_1245678) + KEY_braille_dots_345678 = uint(C.GDK_KEY_braille_dots_345678) + KEY_braille_dots_1345678 = uint(C.GDK_KEY_braille_dots_1345678) + KEY_braille_dots_2345678 = uint(C.GDK_KEY_braille_dots_2345678) + KEY_braille_dots_12345678 = uint(C.GDK_KEY_braille_dots_12345678) + KEY_Sinh_ng = uint(C.GDK_KEY_Sinh_ng) + KEY_Sinh_h2 = uint(C.GDK_KEY_Sinh_h2) + KEY_Sinh_a = uint(C.GDK_KEY_Sinh_a) + KEY_Sinh_aa = uint(C.GDK_KEY_Sinh_aa) + KEY_Sinh_ae = uint(C.GDK_KEY_Sinh_ae) + KEY_Sinh_aee = uint(C.GDK_KEY_Sinh_aee) + KEY_Sinh_i = uint(C.GDK_KEY_Sinh_i) + KEY_Sinh_ii = uint(C.GDK_KEY_Sinh_ii) + KEY_Sinh_u = uint(C.GDK_KEY_Sinh_u) + KEY_Sinh_uu = uint(C.GDK_KEY_Sinh_uu) + KEY_Sinh_ri = uint(C.GDK_KEY_Sinh_ri) + KEY_Sinh_rii = uint(C.GDK_KEY_Sinh_rii) + KEY_Sinh_lu = uint(C.GDK_KEY_Sinh_lu) + KEY_Sinh_luu = uint(C.GDK_KEY_Sinh_luu) + KEY_Sinh_e = uint(C.GDK_KEY_Sinh_e) + KEY_Sinh_ee = uint(C.GDK_KEY_Sinh_ee) + KEY_Sinh_ai = uint(C.GDK_KEY_Sinh_ai) + KEY_Sinh_o = uint(C.GDK_KEY_Sinh_o) + KEY_Sinh_oo = uint(C.GDK_KEY_Sinh_oo) + KEY_Sinh_au = uint(C.GDK_KEY_Sinh_au) + KEY_Sinh_ka = uint(C.GDK_KEY_Sinh_ka) + KEY_Sinh_kha = uint(C.GDK_KEY_Sinh_kha) + KEY_Sinh_ga = uint(C.GDK_KEY_Sinh_ga) + KEY_Sinh_gha = uint(C.GDK_KEY_Sinh_gha) + KEY_Sinh_ng2 = uint(C.GDK_KEY_Sinh_ng2) + KEY_Sinh_nga = uint(C.GDK_KEY_Sinh_nga) + KEY_Sinh_ca = uint(C.GDK_KEY_Sinh_ca) + KEY_Sinh_cha = uint(C.GDK_KEY_Sinh_cha) + KEY_Sinh_ja = uint(C.GDK_KEY_Sinh_ja) + KEY_Sinh_jha = uint(C.GDK_KEY_Sinh_jha) + KEY_Sinh_nya = uint(C.GDK_KEY_Sinh_nya) + KEY_Sinh_jnya = uint(C.GDK_KEY_Sinh_jnya) + KEY_Sinh_nja = uint(C.GDK_KEY_Sinh_nja) + KEY_Sinh_tta = uint(C.GDK_KEY_Sinh_tta) + KEY_Sinh_ttha = uint(C.GDK_KEY_Sinh_ttha) + KEY_Sinh_dda = uint(C.GDK_KEY_Sinh_dda) + KEY_Sinh_ddha = uint(C.GDK_KEY_Sinh_ddha) + KEY_Sinh_nna = uint(C.GDK_KEY_Sinh_nna) + KEY_Sinh_ndda = uint(C.GDK_KEY_Sinh_ndda) + KEY_Sinh_tha = uint(C.GDK_KEY_Sinh_tha) + KEY_Sinh_thha = uint(C.GDK_KEY_Sinh_thha) + KEY_Sinh_dha = uint(C.GDK_KEY_Sinh_dha) + KEY_Sinh_dhha = uint(C.GDK_KEY_Sinh_dhha) + KEY_Sinh_na = uint(C.GDK_KEY_Sinh_na) + KEY_Sinh_ndha = uint(C.GDK_KEY_Sinh_ndha) + KEY_Sinh_pa = uint(C.GDK_KEY_Sinh_pa) + KEY_Sinh_pha = uint(C.GDK_KEY_Sinh_pha) + KEY_Sinh_ba = uint(C.GDK_KEY_Sinh_ba) + KEY_Sinh_bha = uint(C.GDK_KEY_Sinh_bha) + KEY_Sinh_ma = uint(C.GDK_KEY_Sinh_ma) + KEY_Sinh_mba = uint(C.GDK_KEY_Sinh_mba) + KEY_Sinh_ya = uint(C.GDK_KEY_Sinh_ya) + KEY_Sinh_ra = uint(C.GDK_KEY_Sinh_ra) + KEY_Sinh_la = uint(C.GDK_KEY_Sinh_la) + KEY_Sinh_va = uint(C.GDK_KEY_Sinh_va) + KEY_Sinh_sha = uint(C.GDK_KEY_Sinh_sha) + KEY_Sinh_ssha = uint(C.GDK_KEY_Sinh_ssha) + KEY_Sinh_sa = uint(C.GDK_KEY_Sinh_sa) + KEY_Sinh_ha = uint(C.GDK_KEY_Sinh_ha) + KEY_Sinh_lla = uint(C.GDK_KEY_Sinh_lla) + KEY_Sinh_fa = uint(C.GDK_KEY_Sinh_fa) + KEY_Sinh_al = uint(C.GDK_KEY_Sinh_al) + KEY_Sinh_aa2 = uint(C.GDK_KEY_Sinh_aa2) + KEY_Sinh_ae2 = uint(C.GDK_KEY_Sinh_ae2) + KEY_Sinh_aee2 = uint(C.GDK_KEY_Sinh_aee2) + KEY_Sinh_i2 = uint(C.GDK_KEY_Sinh_i2) + KEY_Sinh_ii2 = uint(C.GDK_KEY_Sinh_ii2) + KEY_Sinh_u2 = uint(C.GDK_KEY_Sinh_u2) + KEY_Sinh_uu2 = uint(C.GDK_KEY_Sinh_uu2) + KEY_Sinh_ru2 = uint(C.GDK_KEY_Sinh_ru2) + KEY_Sinh_e2 = uint(C.GDK_KEY_Sinh_e2) + KEY_Sinh_ee2 = uint(C.GDK_KEY_Sinh_ee2) + KEY_Sinh_ai2 = uint(C.GDK_KEY_Sinh_ai2) + KEY_Sinh_o2 = uint(C.GDK_KEY_Sinh_o2) + KEY_Sinh_oo2 = uint(C.GDK_KEY_Sinh_oo2) + KEY_Sinh_au2 = uint(C.GDK_KEY_Sinh_au2) + KEY_Sinh_lu2 = uint(C.GDK_KEY_Sinh_lu2) + KEY_Sinh_ruu2 = uint(C.GDK_KEY_Sinh_ruu2) + KEY_Sinh_luu2 = uint(C.GDK_KEY_Sinh_luu2) + KEY_Sinh_kunddaliya = uint(C.GDK_KEY_Sinh_kunddaliya) + KEY_ModeLock = uint(C.GDK_KEY_ModeLock) + KEY_MonBrightnessUp = uint(C.GDK_KEY_MonBrightnessUp) + KEY_MonBrightnessDown = uint(C.GDK_KEY_MonBrightnessDown) + KEY_KbdLightOnOff = uint(C.GDK_KEY_KbdLightOnOff) + KEY_KbdBrightnessUp = uint(C.GDK_KEY_KbdBrightnessUp) + KEY_KbdBrightnessDown = uint(C.GDK_KEY_KbdBrightnessDown) + KEY_Standby = uint(C.GDK_KEY_Standby) + KEY_AudioLowerVolume = uint(C.GDK_KEY_AudioLowerVolume) + KEY_AudioMute = uint(C.GDK_KEY_AudioMute) + KEY_AudioRaiseVolume = uint(C.GDK_KEY_AudioRaiseVolume) + KEY_AudioPlay = uint(C.GDK_KEY_AudioPlay) + KEY_AudioStop = uint(C.GDK_KEY_AudioStop) + KEY_AudioPrev = uint(C.GDK_KEY_AudioPrev) + KEY_AudioNext = uint(C.GDK_KEY_AudioNext) + KEY_HomePage = uint(C.GDK_KEY_HomePage) + KEY_Mail = uint(C.GDK_KEY_Mail) + KEY_Start = uint(C.GDK_KEY_Start) + KEY_Search = uint(C.GDK_KEY_Search) + KEY_AudioRecord = uint(C.GDK_KEY_AudioRecord) + KEY_Calculator = uint(C.GDK_KEY_Calculator) + KEY_Memo = uint(C.GDK_KEY_Memo) + KEY_ToDoList = uint(C.GDK_KEY_ToDoList) + KEY_Calendar = uint(C.GDK_KEY_Calendar) + KEY_PowerDown = uint(C.GDK_KEY_PowerDown) + KEY_ContrastAdjust = uint(C.GDK_KEY_ContrastAdjust) + KEY_RockerUp = uint(C.GDK_KEY_RockerUp) + KEY_RockerDown = uint(C.GDK_KEY_RockerDown) + KEY_RockerEnter = uint(C.GDK_KEY_RockerEnter) + KEY_Back = uint(C.GDK_KEY_Back) + KEY_Forward = uint(C.GDK_KEY_Forward) + KEY_Stop = uint(C.GDK_KEY_Stop) + KEY_Refresh = uint(C.GDK_KEY_Refresh) + KEY_PowerOff = uint(C.GDK_KEY_PowerOff) + KEY_WakeUp = uint(C.GDK_KEY_WakeUp) + KEY_Eject = uint(C.GDK_KEY_Eject) + KEY_ScreenSaver = uint(C.GDK_KEY_ScreenSaver) + KEY_WWW = uint(C.GDK_KEY_WWW) + KEY_Sleep = uint(C.GDK_KEY_Sleep) + KEY_Favorites = uint(C.GDK_KEY_Favorites) + KEY_AudioPause = uint(C.GDK_KEY_AudioPause) + KEY_AudioMedia = uint(C.GDK_KEY_AudioMedia) + KEY_MyComputer = uint(C.GDK_KEY_MyComputer) + KEY_VendorHome = uint(C.GDK_KEY_VendorHome) + KEY_LightBulb = uint(C.GDK_KEY_LightBulb) + KEY_Shop = uint(C.GDK_KEY_Shop) + KEY_History = uint(C.GDK_KEY_History) + KEY_OpenURL = uint(C.GDK_KEY_OpenURL) + KEY_AddFavorite = uint(C.GDK_KEY_AddFavorite) + KEY_HotLinks = uint(C.GDK_KEY_HotLinks) + KEY_BrightnessAdjust = uint(C.GDK_KEY_BrightnessAdjust) + KEY_Finance = uint(C.GDK_KEY_Finance) + KEY_Community = uint(C.GDK_KEY_Community) + KEY_AudioRewind = uint(C.GDK_KEY_AudioRewind) + KEY_BackForward = uint(C.GDK_KEY_BackForward) + KEY_Launch0 = uint(C.GDK_KEY_Launch0) + KEY_Launch1 = uint(C.GDK_KEY_Launch1) + KEY_Launch2 = uint(C.GDK_KEY_Launch2) + KEY_Launch3 = uint(C.GDK_KEY_Launch3) + KEY_Launch4 = uint(C.GDK_KEY_Launch4) + KEY_Launch5 = uint(C.GDK_KEY_Launch5) + KEY_Launch6 = uint(C.GDK_KEY_Launch6) + KEY_Launch7 = uint(C.GDK_KEY_Launch7) + KEY_Launch8 = uint(C.GDK_KEY_Launch8) + KEY_Launch9 = uint(C.GDK_KEY_Launch9) + KEY_LaunchA = uint(C.GDK_KEY_LaunchA) + KEY_LaunchB = uint(C.GDK_KEY_LaunchB) + KEY_LaunchC = uint(C.GDK_KEY_LaunchC) + KEY_LaunchD = uint(C.GDK_KEY_LaunchD) + KEY_LaunchE = uint(C.GDK_KEY_LaunchE) + KEY_LaunchF = uint(C.GDK_KEY_LaunchF) + KEY_ApplicationLeft = uint(C.GDK_KEY_ApplicationLeft) + KEY_ApplicationRight = uint(C.GDK_KEY_ApplicationRight) + KEY_Book = uint(C.GDK_KEY_Book) + KEY_CD = uint(C.GDK_KEY_CD) + KEY_WindowClear = uint(C.GDK_KEY_WindowClear) + KEY_Close = uint(C.GDK_KEY_Close) + KEY_Copy = uint(C.GDK_KEY_Copy) + KEY_Cut = uint(C.GDK_KEY_Cut) + KEY_Display = uint(C.GDK_KEY_Display) + KEY_DOS = uint(C.GDK_KEY_DOS) + KEY_Documents = uint(C.GDK_KEY_Documents) + KEY_Excel = uint(C.GDK_KEY_Excel) + KEY_Explorer = uint(C.GDK_KEY_Explorer) + KEY_Game = uint(C.GDK_KEY_Game) + KEY_Go = uint(C.GDK_KEY_Go) + KEY_iTouch = uint(C.GDK_KEY_iTouch) + KEY_LogOff = uint(C.GDK_KEY_LogOff) + KEY_Market = uint(C.GDK_KEY_Market) + KEY_Meeting = uint(C.GDK_KEY_Meeting) + KEY_MenuKB = uint(C.GDK_KEY_MenuKB) + KEY_MenuPB = uint(C.GDK_KEY_MenuPB) + KEY_MySites = uint(C.GDK_KEY_MySites) + KEY_New = uint(C.GDK_KEY_New) + KEY_News = uint(C.GDK_KEY_News) + KEY_OfficeHome = uint(C.GDK_KEY_OfficeHome) + KEY_Open = uint(C.GDK_KEY_Open) + KEY_Option = uint(C.GDK_KEY_Option) + KEY_Paste = uint(C.GDK_KEY_Paste) + KEY_Phone = uint(C.GDK_KEY_Phone) + KEY_Reply = uint(C.GDK_KEY_Reply) + KEY_Reload = uint(C.GDK_KEY_Reload) + KEY_RotateWindows = uint(C.GDK_KEY_RotateWindows) + KEY_RotationPB = uint(C.GDK_KEY_RotationPB) + KEY_RotationKB = uint(C.GDK_KEY_RotationKB) + KEY_Save = uint(C.GDK_KEY_Save) + KEY_ScrollUp = uint(C.GDK_KEY_ScrollUp) + KEY_ScrollDown = uint(C.GDK_KEY_ScrollDown) + KEY_ScrollClick = uint(C.GDK_KEY_ScrollClick) + KEY_Send = uint(C.GDK_KEY_Send) + KEY_Spell = uint(C.GDK_KEY_Spell) + KEY_SplitScreen = uint(C.GDK_KEY_SplitScreen) + KEY_Support = uint(C.GDK_KEY_Support) + KEY_TaskPane = uint(C.GDK_KEY_TaskPane) + KEY_Terminal = uint(C.GDK_KEY_Terminal) + KEY_Tools = uint(C.GDK_KEY_Tools) + KEY_Travel = uint(C.GDK_KEY_Travel) + KEY_UserPB = uint(C.GDK_KEY_UserPB) + KEY_User1KB = uint(C.GDK_KEY_User1KB) + KEY_User2KB = uint(C.GDK_KEY_User2KB) + KEY_Video = uint(C.GDK_KEY_Video) + KEY_WheelButton = uint(C.GDK_KEY_WheelButton) + KEY_Word = uint(C.GDK_KEY_Word) + KEY_Xfer = uint(C.GDK_KEY_Xfer) + KEY_ZoomIn = uint(C.GDK_KEY_ZoomIn) + KEY_ZoomOut = uint(C.GDK_KEY_ZoomOut) + KEY_Away = uint(C.GDK_KEY_Away) + KEY_Messenger = uint(C.GDK_KEY_Messenger) + KEY_WebCam = uint(C.GDK_KEY_WebCam) + KEY_MailForward = uint(C.GDK_KEY_MailForward) + KEY_Pictures = uint(C.GDK_KEY_Pictures) + KEY_Music = uint(C.GDK_KEY_Music) + KEY_Battery = uint(C.GDK_KEY_Battery) + KEY_Bluetooth = uint(C.GDK_KEY_Bluetooth) + KEY_WLAN = uint(C.GDK_KEY_WLAN) + KEY_UWB = uint(C.GDK_KEY_UWB) + KEY_AudioForward = uint(C.GDK_KEY_AudioForward) + KEY_AudioRepeat = uint(C.GDK_KEY_AudioRepeat) + KEY_AudioRandomPlay = uint(C.GDK_KEY_AudioRandomPlay) + KEY_Subtitle = uint(C.GDK_KEY_Subtitle) + KEY_AudioCycleTrack = uint(C.GDK_KEY_AudioCycleTrack) + KEY_CycleAngle = uint(C.GDK_KEY_CycleAngle) + KEY_FrameBack = uint(C.GDK_KEY_FrameBack) + KEY_FrameForward = uint(C.GDK_KEY_FrameForward) + KEY_Time = uint(C.GDK_KEY_Time) + KEY_SelectButton = uint(C.GDK_KEY_SelectButton) + KEY_View = uint(C.GDK_KEY_View) + KEY_TopMenu = uint(C.GDK_KEY_TopMenu) + KEY_Red = uint(C.GDK_KEY_Red) + KEY_Green = uint(C.GDK_KEY_Green) + KEY_Yellow = uint(C.GDK_KEY_Yellow) + KEY_Blue = uint(C.GDK_KEY_Blue) + KEY_Suspend = uint(C.GDK_KEY_Suspend) + KEY_Hibernate = uint(C.GDK_KEY_Hibernate) + KEY_TouchpadToggle = uint(C.GDK_KEY_TouchpadToggle) + KEY_TouchpadOn = uint(C.GDK_KEY_TouchpadOn) + KEY_TouchpadOff = uint(C.GDK_KEY_TouchpadOff) + KEY_AudioMicMute = uint(C.GDK_KEY_AudioMicMute) + KEY_Switch_VT_1 = uint(C.GDK_KEY_Switch_VT_1) + KEY_Switch_VT_2 = uint(C.GDK_KEY_Switch_VT_2) + KEY_Switch_VT_3 = uint(C.GDK_KEY_Switch_VT_3) + KEY_Switch_VT_4 = uint(C.GDK_KEY_Switch_VT_4) + KEY_Switch_VT_5 = uint(C.GDK_KEY_Switch_VT_5) + KEY_Switch_VT_6 = uint(C.GDK_KEY_Switch_VT_6) + KEY_Switch_VT_7 = uint(C.GDK_KEY_Switch_VT_7) + KEY_Switch_VT_8 = uint(C.GDK_KEY_Switch_VT_8) + KEY_Switch_VT_9 = uint(C.GDK_KEY_Switch_VT_9) + KEY_Switch_VT_10 = uint(C.GDK_KEY_Switch_VT_10) + KEY_Switch_VT_11 = uint(C.GDK_KEY_Switch_VT_11) + KEY_Switch_VT_12 = uint(C.GDK_KEY_Switch_VT_12) + KEY_Ungrab = uint(C.GDK_KEY_Ungrab) + KEY_ClearGrab = uint(C.GDK_KEY_ClearGrab) + KEY_Next_VMode = uint(C.GDK_KEY_Next_VMode) + KEY_Prev_VMode = uint(C.GDK_KEY_Prev_VMode) + KEY_LogWindowTree = uint(C.GDK_KEY_LogWindowTree) + KEY_LogGrabInfo = uint(C.GDK_KEY_LogGrabInfo) +) diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf.go new file mode 100644 index 0000000..4fc8357 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf.go @@ -0,0 +1,668 @@ +// Same copyright and license as the rest of the files in this project + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" +import ( + "errors" + "reflect" + "runtime" + "strconv" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gdk_pixbuf_alpha_mode_get_type()), marshalPixbufAlphaMode}, + + // Objects/Interfaces + {glib.Type(C.gdk_pixbuf_get_type()), marshalPixbuf}, + {glib.Type(C.gdk_pixbuf_animation_get_type()), marshalPixbufAnimation}, + {glib.Type(C.gdk_pixbuf_loader_get_type()), marshalPixbufLoader}, + } + glib.RegisterGValueMarshalers(tm) +} + +/* + * Constants + */ + +// TODO: +// GdkPixbufError + +// PixbufRotation is a representation of GDK's GdkPixbufRotation. +type PixbufRotation int + +const ( + PIXBUF_ROTATE_NONE PixbufRotation = C.GDK_PIXBUF_ROTATE_NONE + PIXBUF_ROTATE_COUNTERCLOCKWISE PixbufRotation = C.GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE + PIXBUF_ROTATE_UPSIDEDOWN PixbufRotation = C.GDK_PIXBUF_ROTATE_UPSIDEDOWN + PIXBUF_ROTATE_CLOCKWISE PixbufRotation = C.GDK_PIXBUF_ROTATE_CLOCKWISE +) + +// PixbufAlphaMode is a representation of GDK's GdkPixbufAlphaMode. +type PixbufAlphaMode int + +const ( + GDK_PIXBUF_ALPHA_BILEVEL PixbufAlphaMode = C.GDK_PIXBUF_ALPHA_BILEVEL + GDK_PIXBUF_ALPHA_FULL PixbufAlphaMode = C.GDK_PIXBUF_ALPHA_FULL +) + +func marshalPixbufAlphaMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PixbufAlphaMode(c), nil +} + +/* + * GdkPixbuf + */ + +// PixbufGetType is a wrapper around gdk_pixbuf_get_type(). +func PixbufGetType() glib.Type { + return glib.Type(C.gdk_pixbuf_get_type()) +} + +// Pixbuf is a representation of GDK's GdkPixbuf. +type Pixbuf struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkPixbuf. +func (v *Pixbuf) native() *C.GdkPixbuf { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbuf(p) +} + +// Native returns a pointer to the underlying GdkPixbuf. +func (v *Pixbuf) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Pixbuf) NativePrivate() *C.GdkPixbuf { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbuf(p) +} + +func marshalPixbuf(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Pixbuf{obj}, nil +} + +// PixbufNew is a wrapper around gdk_pixbuf_new(). +func PixbufNew(colorspace Colorspace, hasAlpha bool, bitsPerSample, width, height int) (*Pixbuf, error) { + c := C.gdk_pixbuf_new(C.GdkColorspace(colorspace), gbool(hasAlpha), + C.int(bitsPerSample), C.int(width), C.int(height)) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// File Loading + +// PixbufNewFromFile is a wrapper around gdk_pixbuf_new_from_file(). +func PixbufNewFromFile(filename string) (*Pixbuf, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + + var err *C.GError + c := C.gdk_pixbuf_new_from_file((*C.char)(cstr), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// Image Data in Memory + +// PixbufNewFromData is a wrapper around gdk_pixbuf_new_from_data(). +func PixbufNewFromData(pixbufData []byte, cs Colorspace, hasAlpha bool, bitsPerSample, width, height, rowStride int) (*Pixbuf, error) { + arrayPtr := (*C.guchar)(unsafe.Pointer(&pixbufData[0])) + + c := C.gdk_pixbuf_new_from_data( + arrayPtr, + C.GdkColorspace(cs), + gbool(hasAlpha), + C.int(bitsPerSample), + C.int(width), + C.int(height), + C.int(rowStride), + nil, // TODO: missing support for GdkPixbufDestroyNotify + nil, + ) + + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + + return p, nil +} + +// PixbufNewFromDataOnly is a convenient alternative to PixbufNewFromData() and also a wrapper around gdk_pixbuf_new_from_data(). +func PixbufNewFromDataOnly(pixbufData []byte) (*Pixbuf, error) { + pixbufLoader, err := PixbufLoaderNew() + if err == nil { + return nil, err + } + return pixbufLoader.WriteAndReturnPixbuf(pixbufData) +} + +// PixbufNewFromResource is a wrapper around gdk_pixbuf_new_from_resource() +func PixbufNewFromResource(resourcePath string) (*Pixbuf, error) { + var gerr *C.GError + + cstr := C.CString(resourcePath) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gdk_pixbuf_new_from_resource((*C.gchar)(cstr), &gerr) + + if gerr != nil { + defer C.g_error_free(gerr) + return nil, errors.New(C.GoString(gerr.message)) + } + + obj := glib.Take(unsafe.Pointer(c)) + return &Pixbuf{obj}, nil +} + +// PixbufNewFromResourceAtScale is a wrapper around gdk_pixbuf_new_from_resource_at_scale() +func PixbufNewFromResourceAtScale(resourcePath string, width, height int, preserveAspectRatio bool) (*Pixbuf, error) { + var gerr *C.GError + + cstr := C.CString(resourcePath) + defer C.free(unsafe.Pointer(cstr)) + + cPreserveAspectRatio := gbool(preserveAspectRatio) + + c := C.gdk_pixbuf_new_from_resource_at_scale( + (*C.gchar)(cstr), + C.gint(width), + C.gint(height), + C.gboolean(cPreserveAspectRatio), + &gerr, + ) + + if gerr != nil { + defer C.g_error_free(gerr) + return nil, errors.New(C.GoString(gerr.message)) + } + + obj := glib.Take(unsafe.Pointer(c)) + return &Pixbuf{obj}, nil +} + +// TODO: +// gdk_pixbuf_new_from_xpm_data(). +// gdk_pixbuf_new_subpixbuf() + +// PixbufCopy is a wrapper around gdk_pixbuf_copy(). +func PixbufCopy(v *Pixbuf) (*Pixbuf, error) { + c := C.gdk_pixbuf_copy(v.native()) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// The GdkPixbuf Structure + +// GetColorspace is a wrapper around gdk_pixbuf_get_colorspace(). +func (v *Pixbuf) GetColorspace() Colorspace { + c := C.gdk_pixbuf_get_colorspace(v.native()) + return Colorspace(c) +} + +// GetNChannels is a wrapper around gdk_pixbuf_get_n_channels(). +func (v *Pixbuf) GetNChannels() int { + c := C.gdk_pixbuf_get_n_channels(v.native()) + return int(c) +} + +// GetHasAlpha is a wrapper around gdk_pixbuf_get_has_alpha(). +func (v *Pixbuf) GetHasAlpha() bool { + c := C.gdk_pixbuf_get_has_alpha(v.native()) + return gobool(c) +} + +// GetBitsPerSample is a wrapper around gdk_pixbuf_get_bits_per_sample(). +func (v *Pixbuf) GetBitsPerSample() int { + c := C.gdk_pixbuf_get_bits_per_sample(v.native()) + return int(c) +} + +// GetPixels is a wrapper around gdk_pixbuf_get_pixels_with_length(). +// A Go slice is used to represent the underlying Pixbuf data array, one +// byte per channel. +func (v *Pixbuf) GetPixels() (channels []byte) { + var length C.guint + c := C.gdk_pixbuf_get_pixels_with_length(v.native(), &length) + sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&channels)) + sliceHeader.Data = uintptr(unsafe.Pointer(c)) + sliceHeader.Len = int(length) + sliceHeader.Cap = int(length) + + // To make sure the slice doesn't outlive the Pixbuf, add a reference + v.Ref() + runtime.SetFinalizer(&channels, func(_ *[]byte) { + v.Unref() + }) + return +} + +// GetWidth is a wrapper around gdk_pixbuf_get_width(). +func (v *Pixbuf) GetWidth() int { + c := C.gdk_pixbuf_get_width(v.native()) + return int(c) +} + +// GetHeight is a wrapper around gdk_pixbuf_get_height(). +func (v *Pixbuf) GetHeight() int { + c := C.gdk_pixbuf_get_height(v.native()) + return int(c) +} + +// GetRowstride is a wrapper around gdk_pixbuf_get_rowstride(). +func (v *Pixbuf) GetRowstride() int { + c := C.gdk_pixbuf_get_rowstride(v.native()) + return int(c) +} + +// GetOption is a wrapper around gdk_pixbuf_get_option(). ok is true if +// the key has an associated value. +func (v *Pixbuf) GetOption(key string) (value string, ok bool) { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gdk_pixbuf_get_option(v.native(), (*C.gchar)(cstr)) + if c == nil { + return "", false + } + return C.GoString((*C.char)(c)), true +} + +// Scaling + +// ScaleSimple is a wrapper around gdk_pixbuf_scale_simple(). +func (v *Pixbuf) ScaleSimple(destWidth, destHeight int, interpType InterpType) (*Pixbuf, error) { + c := C.gdk_pixbuf_scale_simple(v.native(), C.int(destWidth), + C.int(destHeight), C.GdkInterpType(interpType)) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// Scale is a wrapper around gdk_pixbuf_scale(). +func (v *Pixbuf) Scale(dest *Pixbuf, destX, destY, destWidth, destHeight int, offsetX, offsetY, scaleX, scaleY float64, interpType InterpType) { + C.gdk_pixbuf_scale( + v.native(), + dest.native(), + C.int(destX), + C.int(destY), + C.int(destWidth), + C.int(destHeight), + C.double(offsetX), + C.double(offsetY), + C.double(scaleX), + C.double(scaleY), + C.GdkInterpType(interpType), + ) +} + +// Composite is a wrapper around gdk_pixbuf_composite(). +func (v *Pixbuf) Composite(dest *Pixbuf, destX, destY, destWidth, destHeight int, offsetX, offsetY, scaleX, scaleY float64, interpType InterpType, overallAlpha int) { + C.gdk_pixbuf_composite( + v.native(), + dest.native(), + C.int(destX), + C.int(destY), + C.int(destWidth), + C.int(destHeight), + C.double(offsetX), + C.double(offsetY), + C.double(scaleX), + C.double(scaleY), + C.GdkInterpType(interpType), + C.int(overallAlpha), + ) +} + +// TODO: +// gdk_pixbuf_composite_color_simple(). +// gdk_pixbuf_composite_color(). + +// Utilities + +// TODO: +// gdk_pixbuf_copy_area(). +// gdk_pixbuf_saturate_and_pixelate(). + +// Fill is a wrapper around gdk_pixbuf_fill(). The given pixel is an RGBA value. +func (v *Pixbuf) Fill(pixel uint32) { + C.gdk_pixbuf_fill(v.native(), C.guint32(pixel)) +} + +// AddAlpha is a wrapper around gdk_pixbuf_add_alpha(). If substituteColor is +// true, then the color specified by r, g and b will be assigned zero opacity. +func (v *Pixbuf) AddAlpha(substituteColor bool, r, g, b uint8) *Pixbuf { + c := C.gdk_pixbuf_add_alpha(v.native(), gbool(substituteColor), C.guchar(r), C.guchar(g), C.guchar(b)) + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + + return p +} + +// File saving + +// TODO: +// gdk_pixbuf_savev(). +// gdk_pixbuf_save(). + +// SaveJPEG is a convenience wrapper around gdk_pixbuf_save() for saving image as jpeg file. +// Quality is a number between 0...100 +func (v *Pixbuf) SaveJPEG(path string, quality int) error { + cpath := C.CString(path) + cquality := C.CString(strconv.Itoa(quality)) + defer C.free(unsafe.Pointer(cpath)) + defer C.free(unsafe.Pointer(cquality)) + + var err *C.GError + c := C._gdk_pixbuf_save_jpeg(v.native(), cpath, &err, cquality) + if !gobool(c) { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + + return nil +} + +// SavePNG is a convenience wrapper around gdk_pixbuf_save() for saving image as png file. +// Compression is a number between 0...9 +func (v *Pixbuf) SavePNG(path string, compression int) error { + cpath := C.CString(path) + ccompression := C.CString(strconv.Itoa(compression)) + defer C.free(unsafe.Pointer(cpath)) + defer C.free(unsafe.Pointer(ccompression)) + + var err *C.GError + c := C._gdk_pixbuf_save_png(v.native(), cpath, &err, ccompression) + if !gobool(c) { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +/* + * PixbufFormat + */ + +type PixbufFormat struct { + format *C.GdkPixbufFormat +} + +// native returns a pointer to the underlying GdkPixbuf. +func (v *PixbufFormat) native() *C.GdkPixbufFormat { + if v == nil { + return nil + } + + return v.format +} + +func wrapPixbufFormat(obj *C.GdkPixbufFormat) *PixbufFormat { + return &PixbufFormat{obj} +} + +// Native returns a pointer to the underlying GdkPixbuf. +func (v *PixbufFormat) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +/* + * GdkPixbufAnimation + */ + +// PixbufAnimation is a representation of GDK's GdkPixbufAnimation. +type PixbufAnimation struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkPixbufAnimation. +func (v *PixbufAnimation) native() *C.GdkPixbufAnimation { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbufAnimation(p) +} + +func (v *PixbufAnimation) NativePrivate() *C.GdkPixbufAnimation { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbufAnimation(p) +} + +func (v *PixbufAnimation) GetStaticImage() *Pixbuf { + c := C.gdk_pixbuf_animation_get_static_image(v.native()) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + + // Add a reference so the pixbuf doesn't outlive the parent pixbuf + // animation. + v.Ref() + runtime.SetFinalizer(p, func(*Pixbuf) { v.Unref() }) + + return p +} + +func marshalPixbufAnimation(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &PixbufAnimation{obj}, nil +} + +// PixbufAnimationNewFromFile is a wrapper around gdk_pixbuf_animation_new_from_file(). +func PixbufAnimationNewFromFile(filename string) (*PixbufAnimation, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + + var err *C.GError + c := C.gdk_pixbuf_animation_new_from_file((*C.char)(cstr), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &PixbufAnimation{obj} + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// TODO: +// gdk_pixbuf_animation_new_from_resource(). + +/* + * GdkPixbufLoader + */ + +// PixbufLoader is a representation of GDK's GdkPixbufLoader. +// Users of PixbufLoader are expected to call Close() when they are finished. +type PixbufLoader struct { + *glib.Object +} + +// native() returns a pointer to the underlying GdkPixbufLoader. +func (v *PixbufLoader) native() *C.GdkPixbufLoader { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkPixbufLoader(p) +} + +func marshalPixbufLoader(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &PixbufLoader{obj}, nil +} + +// PixbufLoaderNew() is a wrapper around gdk_pixbuf_loader_new(). +func PixbufLoaderNew() (*PixbufLoader, error) { + c := C.gdk_pixbuf_loader_new() + if c == nil { + return nil, nilPtrErr + } + return &PixbufLoader{glib.AssumeOwnership(unsafe.Pointer(c))}, nil +} + +// PixbufLoaderNewWithType() is a wrapper around gdk_pixbuf_loader_new_with_type(). +func PixbufLoaderNewWithType(t string) (*PixbufLoader, error) { + var err *C.GError + + cstr := C.CString(t) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gdk_pixbuf_loader_new_with_type((*C.char)(cstr), &err) + if err != nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + + if c == nil { + return nil, nilPtrErr + } + + return &PixbufLoader{glib.AssumeOwnership(unsafe.Pointer(c))}, nil +} + +// Write() is a wrapper around gdk_pixbuf_loader_write(). The +// function signature differs from the C equivalent to satisify the +// io.Writer interface. +func (v *PixbufLoader) Write(data []byte) (int, error) { + // n is set to 0 on error, and set to len(data) otherwise. + // This is a tiny hacky to satisfy io.Writer and io.WriteCloser, + // which would allow access to all io and ioutil goodies, + // and play along nice with go environment. + + if len(data) == 0 { + return 0, nil + } + + var err *C.GError + c := C.gdk_pixbuf_loader_write(v.native(), + (*C.guchar)(unsafe.Pointer(&data[0])), C.gsize(len(data)), + &err) + + if !gobool(c) { + defer C.g_error_free(err) + return 0, errors.New(C.GoString((*C.char)(err.message))) + } + + return len(data), nil +} + +// Convenient function like above for Pixbuf. Write data, close loader and return Pixbuf. +func (v *PixbufLoader) WriteAndReturnPixbuf(data []byte) (*Pixbuf, error) { + _, err := v.Write(data) + if err != nil { + return nil, err + } + + if err := v.Close(); err != nil { + return nil, err + } + + return v.GetPixbuf() +} + +// Close is a wrapper around gdk_pixbuf_loader_close(). An error is +// returned instead of a bool like the native C function to support the +// io.Closer interface. +func (v *PixbufLoader) Close() error { + var err *C.GError + + if ok := gobool(C.gdk_pixbuf_loader_close(v.native(), &err)); !ok { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// GetPixbuf is a wrapper around gdk_pixbuf_loader_get_pixbuf(). +func (v *PixbufLoader) GetPixbuf() (*Pixbuf, error) { + c := C.gdk_pixbuf_loader_get_pixbuf(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Pixbuf{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetAnimation is a wrapper around gdk_pixbuf_loader_get_animation(). +func (v *PixbufLoader) GetAnimation() (*PixbufAnimation, error) { + c := C.gdk_pixbuf_loader_get_animation(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &PixbufAnimation{glib.Take(unsafe.Pointer(c))}, nil +} + +// Convenient function like above for Pixbuf. Write data, close loader and return PixbufAnimation. +func (v *PixbufLoader) WriteAndReturnPixbufAnimation(data []byte) (*PixbufAnimation, error) { + _, err := v.Write(data) + if err != nil { + return nil, err + } + + if err := v.Close(); err != nil { + return nil, err + } + + return v.GetAnimation() +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf.go.h b/vendor/github.com/gotk3/gotk3/gdk/pixbuf.go.h new file mode 100644 index 0000000..618b34e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf.go.h @@ -0,0 +1,26 @@ +// Same copyright and license as the rest of the files in this project + +#include + +static GdkPixbuf *toGdkPixbuf(void *p) { return (GDK_PIXBUF(p)); } + +static GdkPixbufAnimation *toGdkPixbufAnimation(void *p) { + return (GDK_PIXBUF_ANIMATION(p)); +} +static gboolean + +_gdk_pixbuf_save_png(GdkPixbuf *pixbuf, const char *filename, GError **err, + const char *compression) { + return gdk_pixbuf_save(pixbuf, filename, "png", err, "compression", + compression, NULL); +} + +static gboolean _gdk_pixbuf_save_jpeg(GdkPixbuf *pixbuf, const char *filename, + GError **err, const char *quality) { + return gdk_pixbuf_save(pixbuf, filename, "jpeg", err, "quality", quality, + NULL); +} + +static GdkPixbufLoader *toGdkPixbufLoader(void *p) { + return (GDK_PIXBUF_LOADER(p)); +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_deprecated_since_2_32.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_deprecated_since_2_32.go new file mode 100644 index 0000000..9bed35a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_deprecated_since_2_32.go @@ -0,0 +1,16 @@ +// Same copyright and license as the rest of the files in this project + +//+build gdk_pixbuf_2_2 gdk_pixbuf_2_4 gdk_pixbuf_2_6 gdk_pixbuf_2_8 gdk_pixbuf_2_12 gdk_pixbuf_2_14 gdk_pixbuf_2_24 gdk_pixbuf_2_26 gdk_pixbuf_2_28 gdk_pixbuf_2_30 gdk_pixbuf_deprecated + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" + +// Image Data in Memory + +// TODO: +// gdk_pixbuf_new_from_inline(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_12.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_12.go new file mode 100644 index 0000000..1c67505 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_12.go @@ -0,0 +1,33 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// Utilities + +// ApplyEmbeddedOrientation is a wrapper around gdk_pixbuf_apply_embedded_orientation(). +func (v *Pixbuf) ApplyEmbeddedOrientation() (*Pixbuf, error) { + c := C.gdk_pixbuf_apply_embedded_orientation(v.native()) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_14.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_14.go new file mode 100644 index 0000000..bd5030d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_14.go @@ -0,0 +1,23 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" + +// File Loading + +// TODO: +// gdk_pixbuf_new_from_stream(). +// gdk_pixbuf_new_from_stream_async(). +// gdk_pixbuf_new_from_stream_at_scale(). + +// File saving + +// TODO: +// gdk_pixbuf_save_to_stream(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_2.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_2.go new file mode 100644 index 0000000..8c1a8ea --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_2.go @@ -0,0 +1,97 @@ +// Same copyright and license as the rest of the files in this project + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// The GdkPixbuf Structure + +// TODO: +// gdk_pixbuf_set_option(). + +/* + * GdkPixbufLoader + */ + +// SetSize is a wrapper around gdk_pixbuf_loader_set_size(). +func (v *PixbufLoader) SetSize(width, height int) { + C.gdk_pixbuf_loader_set_size(v.native(), C.int(width), C.int(height)) +} + +/* + * PixbufFormat + */ + +// PixbufGetFormats is a wrapper around gdk_pixbuf_get_formats(). +func PixbufGetFormats() []*PixbufFormat { + l := (*C.struct__GSList)(C.gdk_pixbuf_get_formats()) + formats := glib.WrapSList(uintptr(unsafe.Pointer(l))) + if formats == nil { + return nil // no error. A nil list is considered to be empty. + } + + // "The structures themselves are owned by GdkPixbuf". Free the list only. + defer formats.Free() + + ret := make([]*PixbufFormat, 0, formats.Length()) + formats.Foreach(func(item interface{}) { + ret = append(ret, &PixbufFormat{item.(*C.GdkPixbufFormat)}) + }) + + return ret +} + +// GetName is a wrapper around gdk_pixbuf_format_get_name(). +func (f *PixbufFormat) GetName() (string, error) { + c := C.gdk_pixbuf_format_get_name(f.native()) + return C.GoString((*C.char)(c)), nil +} + +// GetDescription is a wrapper around gdk_pixbuf_format_get_description(). +func (f *PixbufFormat) GetDescription() (string, error) { + c := C.gdk_pixbuf_format_get_description(f.native()) + return C.GoString((*C.char)(c)), nil +} + +// GetMimeTypes is a wrapper around gdk_pixbuf_format_get_mime_types(). +func (f *PixbufFormat) GetMimeTypes() []string { + var types []string + c := C.gdk_pixbuf_format_get_mime_types(f.native()) + if c == nil { + return nil + } + for *c != nil { + types = append(types, C.GoString((*C.char)(*c))) + c = C.next_gcharptr(c) + } + return types +} + +// GetExtensions is a wrapper around gdk_pixbuf_format_get_extensions(). +func (f *PixbufFormat) GetExtensions() []string { + var extensions []string + c := C.gdk_pixbuf_format_get_extensions(f.native()) + if c == nil { + return nil + } + for *c != nil { + extensions = append(extensions, C.GoString((*C.char)(*c))) + c = C.next_gcharptr(c) + } + return extensions +} + +// GetLicense is a wrapper around gdk_pixbuf_format_get_license(). +func (f *PixbufFormat) GetLicense() (string, error) { + c := C.gdk_pixbuf_format_get_license(f.native()) + return C.GoString((*C.char)(c)), nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_22.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_22.go new file mode 100644 index 0000000..3446ad0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_22.go @@ -0,0 +1,18 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12,!gdk_pixbuf_2_14 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" + +/* + * PixbufFormat + */ + +// TODO: +// gdk_pixbuf_format_copy(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_24.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_24.go new file mode 100644 index 0000000..c94d523 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_24.go @@ -0,0 +1,23 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12,!gdk_pixbuf_2_14,!gdk_pixbuf_2_22 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" + +// File Loading + +// TODO: +// gdk_pixbuf_new_from_stream_finish(). +// gdk_pixbuf_new_from_stream_at_scale_async(). + +// File saving + +// TODO: +// gdk_pixbuf_save_to_stream_async(). +// gdk_pixbuf_save_to_stream_finish(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_26.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_26.go new file mode 100644 index 0000000..1a17a12 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_26.go @@ -0,0 +1,25 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12,!gdk_pixbuf_2_14,!gdk_pixbuf_2_22,!gdk_pixbuf_2_24 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" + +// File Loading + +// TODO: +// gdk_pixbuf_new_from_resource(). +// gdk_pixbuf_new_from_resource_at_scale(). + +// The GdkPixbuf Structure + +// GetByteLength is a wrapper around gdk_pixbuf_get_byte_length(). +func (v *Pixbuf) GetByteLength() int { + c := C.gdk_pixbuf_get_byte_length(v.native()) + return int(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_32.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_32.go new file mode 100644 index 0000000..2fced1f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_32.go @@ -0,0 +1,68 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12,!gdk_pixbuf_2_14,!gdk_pixbuf_2_22,!gdk_pixbuf_2_24,!gdk_pixbuf_2_26,!gdk_pixbuf_2_28,!gdk_pixbuf_2_30 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// Image Data in Memory + +// PixbufNewFromBytes is a wrapper around gdk_pixbuf_new_from_bytes(). +// see go package "encoding/base64" +func PixbufNewFromBytes(pixbufData []byte, cs Colorspace, hasAlpha bool, bitsPerSample, width, height, rowStride int) (*Pixbuf, error) { + arrayPtr := (*C.GBytes)(unsafe.Pointer(&pixbufData[0])) + + c := C.gdk_pixbuf_new_from_bytes( + arrayPtr, + C.GdkColorspace(cs), + gbool(hasAlpha), + C.int(bitsPerSample), + C.int(width), + C.int(height), + C.int(rowStride), + ) + + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + + return p, nil +} + +// PixbufNewFromBytesOnly is a convenient alternative to PixbufNewFromBytes() and also a wrapper around gdk_pixbuf_new_from_bytes(). +// see go package "encoding/base64" +func PixbufNewFromBytesOnly(pixbufData []byte) (*Pixbuf, error) { + pixbufLoader, err := PixbufLoaderNew() + if err != nil { + return nil, err + } + return pixbufLoader.WriteAndReturnPixbuf(pixbufData) +} + +// File loading + +// TODO: +// gdk_pixbuf_get_file_info_async(). +// gdk_pixbuf_get_file_info_finish(). + +// The GdkPixbuf Structure + +// TODO: +// gdk_pixbuf_get_options(). +// gdk_pixbuf_read_pixels(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_36.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_36.go new file mode 100644 index 0000000..d423582 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_36.go @@ -0,0 +1,23 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4,!gdk_pixbuf_2_6,!gdk_pixbuf_2_8,!gdk_pixbuf_2_12,!gdk_pixbuf_2_14,!gdk_pixbuf_2_22,!gdk_pixbuf_2_24,!gdk_pixbuf_2_26,!gdk_pixbuf_2_28,!gdk_pixbuf_2_30,!gdk_pixbuf_2_32 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" + +// File saving + +// TODO: +// gdk_pixbuf_save_to_streamv(). +// gdk_pixbuf_save_to_streamv_async(). + +// The GdkPixbuf Structure + +// TODO: +// gdk_pixbuf_remove_option(). +// gdk_pixbuf_copy_options(). diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_4.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_4.go new file mode 100644 index 0000000..b0e90cf --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_4.go @@ -0,0 +1,143 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 gmodule-2.0 +// #include +// #include +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +// #include "pixbuf_since_2_4.go.h" +import "C" +import ( + "errors" + "io" + "reflect" + "runtime" + "strconv" + "unsafe" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +// File saving + +//export goPixbufSaveCallback +func goPixbufSaveCallback(buf *C.gchar, count C.gsize, gerr **C.GError, id C.gpointer) C.gboolean { + v := callback.Get(uintptr(id)) + + if v == nil { + C._pixbuf_error_set_callback_not_found(gerr) + return C.FALSE + } + + var bytes []byte + header := (*reflect.SliceHeader)((unsafe.Pointer(&bytes))) + header.Cap = int(count) + header.Len = int(count) + header.Data = uintptr(unsafe.Pointer(buf)) + + _, err := v.(io.Writer).Write(bytes) + if err != nil { + cerr := C.CString(err.Error()) + defer C.free(unsafe.Pointer(cerr)) + + C._pixbuf_error_set(gerr, cerr) + return C.FALSE + } + + return C.TRUE +} + +// WritePNG is a convenience wrapper around gdk_pixbuf_save_to_callback() for +// saving images using a streaming callback API. Compression is a number from 0 +// to 9. +func (v *Pixbuf) WritePNG(w io.Writer, compression int) error { + ccompression := C.CString(strconv.Itoa(compression)) + defer C.free(unsafe.Pointer(ccompression)) + + id := callback.Assign(w) + + var err *C.GError + c := C._gdk_pixbuf_save_png_writer(v.native(), C.gpointer(id), &err, ccompression) + + callback.Delete(id) + + if !gobool(c) { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + + return nil +} + +// WriteJPEG is a convenience wrapper around gdk_pixbuf_save_to_callback() for +// saving images using a streaming callback API. Quality is a number from 0 to +// 100. +func (v *Pixbuf) WriteJPEG(w io.Writer, quality int) error { + cquality := C.CString(strconv.Itoa(quality)) + defer C.free(unsafe.Pointer(cquality)) + + id := callback.Assign(w) + + var err *C.GError + c := C._gdk_pixbuf_save_jpeg_writer(v.native(), C.gpointer(id), &err, cquality) + + callback.Delete(id) + + if !gobool(c) { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + + return nil +} + +// TODO: +// GdkPixbufSaveFunc +// gdk_pixbuf_save_to_callback(). +// gdk_pixbuf_save_to_callbackv(). +// gdk_pixbuf_save_to_buffer(). +// gdk_pixbuf_save_to_bufferv(). + +// File Loading + +// PixbufNewFromFileAtSize is a wrapper around gdk_pixbuf_new_from_file_at_size(). +func PixbufNewFromFileAtSize(filename string, width, height int) (*Pixbuf, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + + var err *C.GError = nil + c := C.gdk_pixbuf_new_from_file_at_size(cstr, C.int(width), C.int(height), &err) + if err != nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// PixbufGetFileInfo is a wrapper around gdk_pixbuf_get_file_info(). +func PixbufGetFileInfo(filename string) (*PixbufFormat, int, int, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + var cw, ch C.gint + format := C.gdk_pixbuf_get_file_info((*C.gchar)(cstr), &cw, &ch) + if format == nil { + return nil, -1, -1, nilPtrErr + } + // The returned PixbufFormat value is owned by Pixbuf and should not be freed. + return wrapPixbufFormat(format), int(cw), int(ch), nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_4.go.h b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_4.go.h new file mode 100644 index 0000000..f4f5ee9 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_4.go.h @@ -0,0 +1,34 @@ +// Same copyright and license as the rest of the files in this project + +#include + +extern gboolean goPixbufSaveCallback(gchar *buf, gsize count, GError **error, + gpointer data); + +static inline gboolean _gdk_pixbuf_save_png_writer(GdkPixbuf *pixbuf, + gpointer callback_id, + GError **err, + const char *compression) { + return gdk_pixbuf_save_to_callback( + pixbuf, (GdkPixbufSaveFunc)(goPixbufSaveCallback), callback_id, "png", + err, "compression", compression, NULL); +} + +static inline gboolean _gdk_pixbuf_save_jpeg_writer(GdkPixbuf *pixbuf, + gpointer callback_id, + GError **err, + const char *quality) { + return gdk_pixbuf_save_to_callback( + pixbuf, (GdkPixbufSaveFunc)(goPixbufSaveCallback), callback_id, "jpeg", + err, "quality", quality, NULL); +} + +static inline void _pixbuf_error_set_callback_not_found(GError **err) { + GQuark domain = g_quark_from_static_string("go error"); + g_set_error_literal(err, domain, 1, "pixbuf callback not found"); +} + +static inline void _pixbuf_error_set(GError **err, char *message) { + GQuark domain = g_quark_from_static_string("go error"); + g_set_error_literal(err, domain, 1, message); +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_6.go b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_6.go new file mode 100644 index 0000000..f52ade5 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/pixbuf_since_2_6.go @@ -0,0 +1,74 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gdk_pixbuf_2_2,!gdk_pixbuf_2_4 + +package gdk + +// #cgo pkg-config: gdk-3.0 glib-2.0 gobject-2.0 +// #include +// #include "gdk.go.h" +// #include "pixbuf.go.h" +import "C" +import ( + "errors" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// File Loading + +// PixbufNewFromFileAtScale is a wrapper around gdk_pixbuf_new_from_file_at_scale(). +func PixbufNewFromFileAtScale(filename string, width, height int, preserveAspectRatio bool) (*Pixbuf, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + + var err *C.GError = nil + c := C.gdk_pixbuf_new_from_file_at_scale(cstr, C.int(width), C.int(height), + gbool(preserveAspectRatio), &err) + if err != nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// Scaling + +// RotateSimple is a wrapper around gdk_pixbuf_rotate_simple(). +func (v *Pixbuf) RotateSimple(angle PixbufRotation) (*Pixbuf, error) { + c := C.gdk_pixbuf_rotate_simple(v.native(), C.GdkPixbufRotation(angle)) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} + +// Flip is a wrapper around gdk_pixbuf_flip(). +func (v *Pixbuf) Flip(horizontal bool) (*Pixbuf, error) { + c := C.gdk_pixbuf_flip(v.native(), gbool(horizontal)) + if c == nil { + return nil, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &Pixbuf{obj} + //obj.Ref() + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + return p, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/screen.go b/vendor/github.com/gotk3/gotk3/gdk/screen.go new file mode 100644 index 0000000..858be77 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/screen.go @@ -0,0 +1,114 @@ +package gdk + +// #include +// #include "gdk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +/* + * GdkScreen + */ + +// Screen is a representation of GDK's GdkScreen. +type Screen struct { + *glib.Object +} + +// native returns a pointer to the underlying GdkScreen. +func (v *Screen) native() *C.GdkScreen { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkScreen(p) +} + +// Native returns a pointer to the underlying GdkScreen. +func (v *Screen) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalScreen(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &Screen{obj}, nil +} + +func toScreen(s *C.GdkScreen) (*Screen, error) { + if s == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(s))} + return &Screen{obj}, nil +} + +// GetRGBAVisual is a wrapper around gdk_screen_get_rgba_visual(). +func (v *Screen) GetRGBAVisual() (*Visual, error) { + c := C.gdk_screen_get_rgba_visual(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Visual{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetSystemVisual is a wrapper around gdk_screen_get_system_visual(). +func (v *Screen) GetSystemVisual() (*Visual, error) { + c := C.gdk_screen_get_system_visual(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return &Visual{glib.Take(unsafe.Pointer(c))}, nil +} + +// ScreenGetDefault is a wrapper around gdk_screen_get_default(). +func ScreenGetDefault() (*Screen, error) { + return toScreen(C.gdk_screen_get_default()) +} + +// IsComposited is a wrapper around gdk_screen_is_composited(). +func (v *Screen) IsComposited() bool { + return gobool(C.gdk_screen_is_composited(v.native())) +} + +// GetRootWindow is a wrapper around gdk_screen_get_root_window(). +func (v *Screen) GetRootWindow() (*Window, error) { + return toWindow(C.gdk_screen_get_root_window(v.native())) +} + +// GetDisplay is a wrapper around gdk_screen_get_display(). +func (v *Screen) GetDisplay() (*Display, error) { + return toDisplay(C.gdk_screen_get_display(v.native())) +} + +func toString(c *C.gchar) (string, error) { + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// GetResolution is a wrapper around gdk_screen_get_resolution(). +func (v *Screen) GetResolution() float64 { + return float64(C.gdk_screen_get_resolution(v.native())) +} + +// SetResolution is a wrapper around gdk_screen_set_resolution(). +func (v *Screen) SetResolution(r float64) { + C.gdk_screen_set_resolution(v.native(), C.gdouble(r)) +} + +// TODO: +// void gdk_screen_set_font_options () +// gboolean gdk_screen_get_setting () +// const cairo_font_options_t * gdk_screen_get_font_options () +// GList * gdk_screen_get_window_stack () +// GList * gdk_screen_list_visuals () +// GList * gdk_screen_get_toplevel_windows () +// void gdk_screen_get_monitor_geometry () +// void gdk_screen_get_monitor_workarea () diff --git a/vendor/github.com/gotk3/gotk3/gdk/screen_no_x11.go b/vendor/github.com/gotk3/gotk3/gdk/screen_no_x11.go new file mode 100644 index 0000000..9551598 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/screen_no_x11.go @@ -0,0 +1,25 @@ +// +build !linux no_x11 + +package gdk + +func WorkspaceControlSupported() bool { + return false +} + +// GetScreenNumber is a wrapper around gdk_x11_screen_get_screen_number(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Screen) GetScreenNumber() int { + return -1 +} + +// GetNumberOfDesktops is a wrapper around gdk_x11_screen_get_number_of_desktops(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Screen) GetNumberOfDesktops() uint32 { + return 0 +} + +// GetCurrentDesktop is a wrapper around gdk_x11_screen_get_current_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Screen) GetCurrentDesktop() uint32 { + return 0 +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/screen_x11.go b/vendor/github.com/gotk3/gotk3/gdk/screen_x11.go new file mode 100644 index 0000000..ba17d1a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/screen_x11.go @@ -0,0 +1,30 @@ +// +build linux +// +build !no_x11 + +package gdk + +// #include +// #include +import "C" + +func WorkspaceControlSupported() bool { + return true +} + +// GetScreenNumber is a wrapper around gdk_x11_screen_get_screen_number(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Screen) GetScreenNumber() int { + return int(C.gdk_x11_screen_get_screen_number(v.native())) +} + +// GetNumberOfDesktops is a wrapper around gdk_x11_screen_get_number_of_desktops(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Screen) GetNumberOfDesktops() uint32 { + return uint32(C.gdk_x11_screen_get_number_of_desktops(v.native())) +} + +// GetCurrentDesktop is a wrapper around gdk_x11_screen_get_current_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Screen) GetCurrentDesktop() uint32 { + return uint32(C.gdk_x11_screen_get_current_desktop(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/testing.go b/vendor/github.com/gotk3/gotk3/gdk/testing.go new file mode 100644 index 0000000..be74a7a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/testing.go @@ -0,0 +1,38 @@ +package gdk + +// #include +import "C" + +// TestRenderSync retrieves a pixel from window to force the windowing system to carry out any pending rendering commands. +// This function is intended to be used to synchronize with rendering pipelines, to benchmark windowing system rendering operations. +// This is a wrapper around gdk_test_render_sync(). +func TestRenderSync(window *Window) { + C.gdk_test_render_sync(window.native()) +} + +// TestSimulateButton simulates a single mouse button event (press or release) at the given coordinates relative to the window. +// Hint: a single click of a button requires this method to be called twice, once for pressed and once for released. +// In most cases, gtk.TestWidgetClick() should be used. +// +// button: Mouse button number, starts with 0 +// modifiers: Keyboard modifiers for the button event +// buttonPressRelease: either GDK_BUTTON_PRESS or GDK_BUTTON_RELEASE +// +// This is a wrapper around gdk_test_simulate_button(). +func TestSimulateButton(window *Window, x, y int, button Button, modifiers ModifierType, buttonPressRelease EventType) bool { + return gobool(C.gdk_test_simulate_button(window.native(), C.gint(x), C.gint(y), C.guint(button), C.GdkModifierType(modifiers), C.GdkEventType(buttonPressRelease))) +} + +// TestSimulateButton simulates a keyboard event (press or release) at the given coordinates relative to the window. +// If the coordinates (-1, -1) are used, the window origin is used instead. +// Hint: a single key press requires this method to be called twice, once for pressed and once for released. +// In most cases, gtk.TestWidgetSendKey() should be used. +// +// keyval: A GDK keyboard value (See KeyvalFromName(), UnicodeToKeyval(), ...) +// modifiers: Keyboard modifiers for the key event +// buttonPressRelease: either GDK_BUTTON_PRESS or GDK_BUTTON_RELEASE +// +// This is a wrapper around gdk_test_simulate_key(). +func TestSimulateKey(window *Window, x, y int, keyval uint, modifiers ModifierType, buttonPressRelease EventType) bool { + return gobool(C.gdk_test_simulate_key(window.native(), C.gint(x), C.gint(y), C.guint(keyval), C.GdkModifierType(modifiers), C.GdkEventType(buttonPressRelease))) +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/window_no_x11.go b/vendor/github.com/gotk3/gotk3/gdk/window_no_x11.go new file mode 100644 index 0000000..72c5665 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/window_no_x11.go @@ -0,0 +1,17 @@ +// +build !linux no_x11 + +package gdk + +func (v *Window) MoveToCurrentDesktop() { +} + +// GetDesktop is a wrapper around gdk_x11_window_get_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Window) GetDesktop() uint32 { + return 0 +} + +// MoveToDesktop is a wrapper around gdk_x11_window_move_to_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Window) MoveToDesktop(d uint32) { +} diff --git a/vendor/github.com/gotk3/gotk3/gdk/window_x11.go b/vendor/github.com/gotk3/gotk3/gdk/window_x11.go new file mode 100644 index 0000000..16de7eb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gdk/window_x11.go @@ -0,0 +1,47 @@ +// +build linux +// +build !no_x11 + +package gdk + +// #include +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// MoveToCurrentDesktop is a wrapper around gdk_x11_window_move_to_current_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Window) MoveToCurrentDesktop() { + C.gdk_x11_window_move_to_current_desktop(v.native()) +} + +// GetDesktop is a wrapper around gdk_x11_window_get_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Window) GetDesktop() uint32 { + return uint32(C.gdk_x11_window_get_desktop(v.native())) +} + +// MoveToDesktop is a wrapper around gdk_x11_window_move_to_desktop(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Window) MoveToDesktop(d uint32) { + C.gdk_x11_window_move_to_desktop(v.native(), C.guint32(d)) +} + +// GetXID is a wrapper around gdk_x11_window_get_xid(). +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Window) GetXID() uint32 { + return uint32(C.gdk_x11_window_get_xid(v.native())) +} + +//ForeignNewForDisplay is a wrapper around gdk_x11_window_foreign_new_for_display() +// It only works on GDK versions compiled with X11 support - its return value can't be used if WorkspaceControlSupported returns false +func (v *Display) ForeignNewForDisplay(xid uint32) (*Window, error) { + c := C.gdk_x11_window_foreign_new_for_display(v.native(), C.Window(xid)) + if c == nil { + return nil, nilPtrErr + } + return &Window{glib.Take(unsafe.Pointer(c))}, nil +} diff --git a/vendor/github.com/gotk3/gotk3/glib/application.go b/vendor/github.com/gotk3/gotk3/glib/application.go new file mode 100644 index 0000000..a60cdb9 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/application.go @@ -0,0 +1,196 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// Application is a representation of GApplication. +type Application struct { + *Object + + // Interfaces + IActionMap + IActionGroup +} + +// native() returns a pointer to the underlying GApplication. +func (v *Application) native() *C.GApplication { + if v == nil || v.GObject == nil { + return nil + } + return C.toGApplication(unsafe.Pointer(v.GObject)) +} + +func (v *Application) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalApplication(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapApplication(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapApplication(obj *Object) *Application { + am := wrapActionMap(obj) + ag := wrapActionGroup(obj) + return &Application{obj, am, ag} +} + +// ApplicationIDIsValid is a wrapper around g_application_id_is_valid(). +func ApplicationIDIsValid(id string) bool { + cstr1 := (*C.gchar)(C.CString(id)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_application_id_is_valid(cstr1)) +} + +// ApplicationNew is a wrapper around g_application_new(). +func ApplicationNew(appID string, flags ApplicationFlags) *Application { + cstr1 := (*C.gchar)(C.CString(appID)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_application_new(cstr1, C.GApplicationFlags(flags)) + if c == nil { + return nil + } + return wrapApplication(wrapObject(unsafe.Pointer(c))) +} + +// GetApplicationID is a wrapper around g_application_get_application_id(). +func (v *Application) GetApplicationID() string { + c := C.g_application_get_application_id(v.native()) + + return C.GoString((*C.char)(c)) +} + +// SetApplicationID is a wrapper around g_application_set_application_id(). +func (v *Application) SetApplicationID(id string) { + cstr1 := (*C.gchar)(C.CString(id)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_application_set_application_id(v.native(), cstr1) +} + +// GetInactivityTimeout is a wrapper around g_application_get_inactivity_timeout(). +func (v *Application) GetInactivityTimeout() uint { + return uint(C.g_application_get_inactivity_timeout(v.native())) +} + +// SetInactivityTimeout is a wrapper around g_application_set_inactivity_timeout(). +func (v *Application) SetInactivityTimeout(timeout uint) { + C.g_application_set_inactivity_timeout(v.native(), C.guint(timeout)) +} + +// GetFlags is a wrapper around g_application_get_flags(). +func (v *Application) GetFlags() ApplicationFlags { + return ApplicationFlags(C.g_application_get_flags(v.native())) +} + +// SetFlags is a wrapper around g_application_set_flags(). +func (v *Application) SetFlags(flags ApplicationFlags) { + C.g_application_set_flags(v.native(), C.GApplicationFlags(flags)) +} + +// GetDbusObjectPath is a wrapper around g_application_get_dbus_object_path(). +func (v *Application) GetDbusObjectPath() string { + c := C.g_application_get_dbus_object_path(v.native()) + + return C.GoString((*C.char)(c)) +} + +// GetIsRegistered is a wrapper around g_application_get_is_registered(). +func (v *Application) GetIsRegistered() bool { + return gobool(C.g_application_get_is_registered(v.native())) +} + +// GetIsRemote is a wrapper around g_application_get_is_remote(). +func (v *Application) GetIsRemote() bool { + return gobool(C.g_application_get_is_remote(v.native())) +} + +// Hold is a wrapper around g_application_hold(). +func (v *Application) Hold() { + C.g_application_hold(v.native()) +} + +// Release is a wrapper around g_application_release(). +func (v *Application) Release() { + C.g_application_release(v.native()) +} + +// Quit is a wrapper around g_application_quit(). +func (v *Application) Quit() { + C.g_application_quit(v.native()) +} + +// Activate is a wrapper around g_application_activate(). +func (v *Application) Activate() { + C.g_application_activate(v.native()) +} + +// SendNotification is a wrapper around g_application_send_notification(). +func (v *Application) SendNotification(id string, notification *Notification) { + cstr1 := (*C.gchar)(C.CString(id)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_application_send_notification(v.native(), cstr1, notification.native()) +} + +// WithdrawNotification is a wrapper around g_application_withdraw_notification(). +func (v *Application) WithdrawNotification(id string) { + cstr1 := (*C.gchar)(C.CString(id)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_application_withdraw_notification(v.native(), cstr1) +} + +// SetDefault is a wrapper around g_application_set_default(). +func (v *Application) SetDefault() { + C.g_application_set_default(v.native()) +} + +// ApplicationGetDefault is a wrapper around g_application_get_default(). +func ApplicationGetDefault() *Application { + c := C.g_application_get_default() + if c == nil { + return nil + } + return wrapApplication(wrapObject(unsafe.Pointer(c))) +} + +// MarkBusy is a wrapper around g_application_mark_busy(). +func (v *Application) MarkBusy() { + C.g_application_mark_busy(v.native()) +} + +// UnmarkBusy is a wrapper around g_application_unmark_busy(). +func (v *Application) UnmarkBusy() { + C.g_application_unmark_busy(v.native()) +} + +// Run is a wrapper around g_application_run(). +func (v *Application) Run(args []string) int { + cargs := C.make_strings(C.int(len(args))) + defer C.destroy_strings(cargs) + + for i, arg := range args { + cstr := C.CString(arg) + defer C.free(unsafe.Pointer(cstr)) + C.set_string(cargs, C.int(i), (*C.char)(cstr)) + } + + return int(C.g_application_run(v.native(), C.int(len(args)), cargs)) +} + +// void g_application_bind_busy_property () +// void g_application_unbind_busy_property () +// gboolean g_application_register () // requires GCancellable +// void g_application_set_action_group () // Deprecated since 2.32 +// GDBusConnection * g_application_get_dbus_connection () // No support for GDBusConnection +// void g_application_open () // Needs GFile +// void g_application_add_main_option_entries () //Needs GOptionEntry +// void g_application_add_main_option () //Needs GOptionFlags and GOptionArg +// void g_application_add_option_group () // Needs GOptionGroup diff --git a/vendor/github.com/gotk3/gotk3/glib/connect.go b/vendor/github.com/gotk3/gotk3/glib/connect.go new file mode 100644 index 0000000..e89ddb3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/connect.go @@ -0,0 +1,153 @@ +package glib + +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "reflect" + "unsafe" + + "github.com/gotk3/gotk3/internal/closure" +) + +/* + * Events + */ + +// SignalHandle is the ID of a signal handler. +type SignalHandle uint + +// Connect is a wrapper around g_signal_connect_closure(). f must be a function +// with at least one parameter matching the type it is connected to. +// +// It is optional to list the rest of the required types from Gtk, as values +// that don't fit into the function parameter will simply be ignored; however, +// extraneous types will trigger a runtime panic. Arguments for f must be a +// matching Go equivalent type for the C callback, or an interface type which +// the value may be packed in. If the type is not suitable, a runtime panic will +// occur when the signal is emitted. +// +// Circular References +// +// To prevent circular references, prefer declaring Connect functions like so: +// +// obj.Connect(func(obj *ObjType) { obj.Do() }) +// +// Instead of directly referencing the object from outside like so: +// +// obj.Connect(func() { obj.Do() }) +// +// When using Connect, beware of referencing variables outside the closure that +// may cause a circular reference that prevents both Go from garbage collecting +// the callback and GTK from successfully unreferencing its values. +// +// Below is an example piece of code that is considered "leaky": +// +// type ChatBox struct { +// gtk.TextView +// Loader *gdk.PixbufLoader +// +// State State +// } +// +// func (box *ChatBox) Method() { +// box.Loader.Connect("size-allocate", func(loader *gdk.PixbufLoader) { +// // Here, we're dereferencing box to get the state, which might +// // keep box alive along with the PixbufLoader, causing a circular +// // reference. +// loader.SetSize(box.State.Width, box.State.Height) +// }) +// } +// +// There are many solutions to fix the above piece of code. For example, +// box.Loader could be discarded manually immediately after it's done by setting +// it to nil, or the signal handle could be disconnected manually, or box could +// be set to nil after its first call in the callback. +func (v *Object) Connect(detailedSignal string, f interface{}) SignalHandle { + return v.connectClosure(false, detailedSignal, f) +} + +// ConnectAfter is a wrapper around g_signal_connect_closure(). The difference +// between Connect and ConnectAfter is that the latter will be invoked after the +// default handler, not before. For more information, refer to Connect. +func (v *Object) ConnectAfter(detailedSignal string, f interface{}) SignalHandle { + return v.connectClosure(true, detailedSignal, f) +} + +// ClosureCheckReceiver, if true, will make GLib check for every single +// closure's first argument to ensure that it is correct, otherwise it will +// panic with a message warning about the possible circular references. The +// receiver in this case is most often the first argument of the callback. +// +// This constant can be changed by using go.mod's replace directive for +// debugging purposes. +const ClosureCheckReceiver = false + +func (v *Object) connectClosure(after bool, detailedSignal string, f interface{}) SignalHandle { + fs := closure.NewFuncStack(f, 2) + + if ClosureCheckReceiver { + // This is a bit slow, but we could be careful. + objValue, err := v.goValue() + if err == nil { + fsType := fs.Func.Type() + if fsType.NumIn() < 1 { + fs.Panicf("callback should have the object receiver to avoid circular references") + } + objType := reflect.TypeOf(objValue) + if first := fsType.In(0); !objType.ConvertibleTo(first) { + fs.Panicf("receiver not convertible to expected type %s, got %s", objType, first) + } + } + + // Allow the type check to fail if we can't get a value marshaler. This + // rarely happens, but it might, and we want to at least allow working + // around it. + } + + cstr := C.CString(detailedSignal) + defer C.free(unsafe.Pointer(cstr)) + + gclosure := ClosureNewFunc(fs) + c := C.g_signal_connect_closure(C.gpointer(v.native()), (*C.gchar)(cstr), gclosure, gbool(after)) + + // TODO: There's a slight race condition here, where + // g_signal_connect_closure may trigger signal callbacks before the signal + // is registered. It is therefore ideal to have another intermediate ID to + // pass into the connect function. This is not a big issue though, since + // there isn't really any guarantee that signals should arrive until after + // the Connect functions return successfully. + closure.RegisterSignal(uint(c), unsafe.Pointer(gclosure)) + + return SignalHandle(c) +} + +// ClosureNew creates a new GClosure and adds its callback function to the +// internal registry. It's exported for visibility to other gotk3 packages and +// should not be used in a regular application. +func ClosureNew(f interface{}) *C.GClosure { + return ClosureNewFunc(closure.NewFuncStack(f, 2)) +} + +// ClosureNewFunc creates a new GClosure and adds its callback function to the +// internal registry. It's exported for visibility to other gotk3 packages; it +// cannot be used in application code, as package closure is part of the +// internals. +func ClosureNewFunc(funcStack closure.FuncStack) *C.GClosure { + gclosure := C._g_closure_new() + C._g_closure_add_finalize_notifier(gclosure) + closure.Assign(unsafe.Pointer(gclosure), funcStack) + + return gclosure +} + +// removeClosure removes a closure from the internal closures map. This is +// needed to prevent a leak where Go code can access the closure context +// (along with rf and userdata) even after an object has been destroyed and +// the GClosure is invalidated and will never run. +// +//export removeClosure +func removeClosure(_ C.gpointer, gclosure *C.GClosure) { + closure.Delete(unsafe.Pointer(gclosure)) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gaction.go b/vendor/github.com/gotk3/gotk3/glib/gaction.go new file mode 100644 index 0000000..7fcfdcf --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gaction.go @@ -0,0 +1,227 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "unsafe" +) + +func init() { + tm := []TypeMarshaler{ + // Objects/Interfaces + {Type(C.g_simple_action_get_type()), marshalSimpleAction}, + {Type(C.g_action_get_type()), marshalAction}, + {Type(C.g_property_action_get_type()), marshalPropertyAction}, + } + RegisterGValueMarshalers(tm) +} + +// Action is a representation of glib's GAction GInterface. +type Action struct { + *Object +} + +// IAction is an interface type implemented by all structs +// embedding an Action. It is meant to be used as an argument type +// for wrapper functions that wrap around a C function taking a +// GAction. +type IAction interface { + toGAction() *C.GAction + toAction() *Action +} + +func (v *Action) toGAction() *C.GAction { + if v == nil { + return nil + } + return v.native() +} + +func (v *Action) toAction() *Action { + return v +} + +// gboolean g_action_parse_detailed_name (const gchar *detailed_name, gchar **action_name, GVariant **target_value, GError **error); + +// ActionPrintDetailedName is a wrapper around g_action_print_detailed_name(). +func ActionPrintDetailedName(action_name string, target_value *Variant) string { + cstr := C.CString(action_name) + defer C.free(unsafe.Pointer(cstr)) + return C.GoString((*C.char)(C.g_action_print_detailed_name((*C.gchar)(cstr), target_value.native()))) +} + +// native() returns a pointer to the underlying GAction. +func (v *Action) native() *C.GAction { + if v == nil || v.GObject == nil { + return nil + } + return C.toGAction(unsafe.Pointer(v.GObject)) +} + +func (v *Action) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalAction(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapAction(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapAction(obj *Object) *Action { + return &Action{obj} +} + +// ActionNameIsValid is a wrapper around g_action_name_is_valid +func ActionNameIsValid(actionName string) bool { + cstr := (*C.gchar)(C.CString(actionName)) + return gobool(C.g_action_name_is_valid(cstr)) +} + +// GetName is a wrapper around g_action_get_name +func (v *Action) GetName() string { + return C.GoString((*C.char)(C.g_action_get_name(v.native()))) +} + +// GetEnabled is a wrapper around g_action_get_enabled +func (v *Action) GetEnabled() bool { + return gobool(C.g_action_get_enabled(v.native())) +} + +// GetState is a wrapper around g_action_get_state +func (v *Action) GetState() *Variant { + c := C.g_action_get_state(v.native()) + if c == nil { + return nil + } + return newVariant((*C.GVariant)(c)) +} + +// GetStateHint is a wrapper around g_action_get_state_hint +func (v *Action) GetStateHint() *Variant { + c := C.g_action_get_state_hint(v.native()) + if c == nil { + return nil + } + return newVariant((*C.GVariant)(c)) +} + +// GetParameterType is a wrapper around g_action_get_parameter_type +func (v *Action) GetParameterType() *VariantType { + c := C.g_action_get_parameter_type(v.native()) + if c == nil { + return nil + } + return newVariantType((*C.GVariantType)(c)) +} + +// GetStateType is a wrapper around g_action_get_state_type +func (v *Action) GetStateType() *VariantType { + c := C.g_action_get_state_type(v.native()) + if c == nil { + return nil + } + return newVariantType((*C.GVariantType)(c)) +} + +// ChangeState is a wrapper around g_action_change_state +func (v *Action) ChangeState(value *Variant) { + C.g_action_change_state(v.native(), value.native()) +} + +// Activate is a wrapper around g_action_activate +func (v *Action) Activate(parameter *Variant) { + C.g_action_activate(v.native(), parameter.native()) +} + +// SimpleAction is a representation of GSimpleAction +type SimpleAction struct { + Action +} + +func (v *SimpleAction) native() *C.GSimpleAction { + if v == nil || v.GObject == nil { + return nil + } + return C.toGSimpleAction(unsafe.Pointer(v.GObject)) +} + +func (v *SimpleAction) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSimpleAction(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSimpleAction(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapSimpleAction(obj *Object) *SimpleAction { + return &SimpleAction{Action{obj}} +} + +// SimpleActionNew is a wrapper around g_simple_action_new +func SimpleActionNew(name string, parameterType *VariantType) *SimpleAction { + c := C.g_simple_action_new((*C.gchar)(C.CString(name)), parameterType.native()) + if c == nil { + return nil + } + return wrapSimpleAction(wrapObject(unsafe.Pointer(c))) +} + +// SimpleActionNewStateful is a wrapper around g_simple_action_new_stateful +func SimpleActionNewStateful(name string, parameterType *VariantType, state *Variant) *SimpleAction { + c := C.g_simple_action_new_stateful((*C.gchar)(C.CString(name)), parameterType.native(), state.native()) + if c == nil { + return nil + } + return wrapSimpleAction(wrapObject(unsafe.Pointer(c))) +} + +// SetEnabled is a wrapper around g_simple_action_set_enabled +func (v *SimpleAction) SetEnabled(enabled bool) { + C.g_simple_action_set_enabled(v.native(), gbool(enabled)) +} + +// SetState is a wrapper around g_simple_action_set_state +// This should only be called by the implementor of the action. +// Users of the action should not attempt to directly modify the 'state' property. +// Instead, they should call ChangeState [g_action_change_state()] to request the change. +func (v *SimpleAction) SetState(value *Variant) { + C.g_simple_action_set_state(v.native(), value.native()) +} + +// PropertyAction is a representation of GPropertyAction +type PropertyAction struct { + Action +} + +func (v *PropertyAction) native() *C.GPropertyAction { + if v == nil || v.GObject == nil { + return nil + } + return C.toGPropertyAction(unsafe.Pointer(v.GObject)) +} + +func (v *PropertyAction) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalPropertyAction(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapPropertyAction(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapPropertyAction(obj *Object) *PropertyAction { + return &PropertyAction{Action{obj}} +} + +// PropertyActionNew is a wrapper around g_property_action_new +func PropertyActionNew(name string, object *Object, propertyName string) *PropertyAction { + c := C.g_property_action_new((*C.gchar)(C.CString(name)), C.gpointer(unsafe.Pointer(object.native())), (*C.gchar)(C.CString(propertyName))) + if c == nil { + return nil + } + return wrapPropertyAction(wrapObject(unsafe.Pointer(c))) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gactiongroup.go b/vendor/github.com/gotk3/gotk3/glib/gactiongroup.go new file mode 100644 index 0000000..4c1c654 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gactiongroup.go @@ -0,0 +1,113 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// IActionGroup is an interface representation of ActionGroup, +// used to avoid duplication when embedding the type in a wrapper of another GObject-based type. +type IActionGroup interface { + Native() uintptr + + HasAction(actionName string) bool + GetActionEnabled(actionName string) bool + GetActionParameterType(actionName string) *VariantType + GetActionStateType(actionName string) *VariantType + GetActionState(actionName string) *Variant + GetActionStateHint(actionName string) *Variant + ChangeActionState(actionName string, value *Variant) + Activate(actionName string, parameter *Variant) +} + +// ActionGroup is a representation of glib's GActionGroup GInterface +type ActionGroup struct { + *Object +} + +// g_action_group_list_actions() +// g_action_group_query_action() +// should only called from implementations: +// g_action_group_action_added +// g_action_group_action_removed +// g_action_group_action_enabled_changed +// g_action_group_action_state_changed + +// native() returns a pointer to the underlying GActionGroup. +func (v *ActionGroup) native() *C.GActionGroup { + if v == nil || v.GObject == nil { + return nil + } + return C.toGActionGroup(unsafe.Pointer(v.GObject)) +} + +func (v *ActionGroup) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalActionGroup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapActionGroup(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapActionGroup(obj *Object) *ActionGroup { + return &ActionGroup{obj} +} + +// HasAction is a wrapper around g_action_group_has_action(). +func (v *ActionGroup) HasAction(actionName string) bool { + return gobool(C.g_action_group_has_action(v.native(), (*C.gchar)(C.CString(actionName)))) +} + +// GetActionEnabled is a wrapper around g_action_group_get_action_enabled(). +func (v *ActionGroup) GetActionEnabled(actionName string) bool { + return gobool(C.g_action_group_get_action_enabled(v.native(), (*C.gchar)(C.CString(actionName)))) +} + +// GetActionParameterType is a wrapper around g_action_group_get_action_parameter_type(). +func (v *ActionGroup) GetActionParameterType(actionName string) *VariantType { + c := C.g_action_group_get_action_parameter_type(v.native(), (*C.gchar)(C.CString(actionName))) + if c == nil { + return nil + } + return newVariantType((*C.GVariantType)(c)) +} + +// GetActionStateType is a wrapper around g_action_group_get_action_state_type(). +func (v *ActionGroup) GetActionStateType(actionName string) *VariantType { + c := C.g_action_group_get_action_state_type(v.native(), (*C.gchar)(C.CString(actionName))) + if c == nil { + return nil + } + return newVariantType((*C.GVariantType)(c)) +} + +// GetActionState is a wrapper around g_action_group_get_action_state(). +func (v *ActionGroup) GetActionState(actionName string) *Variant { + c := C.g_action_group_get_action_state(v.native(), (*C.gchar)(C.CString(actionName))) + if c == nil { + return nil + } + return newVariant((*C.GVariant)(c)) +} + +// GetActionStateHint is a wrapper around g_action_group_get_action_state_hint(). +func (v *ActionGroup) GetActionStateHint(actionName string) *Variant { + c := C.g_action_group_get_action_state_hint(v.native(), (*C.gchar)(C.CString(actionName))) + if c == nil { + return nil + } + return newVariant((*C.GVariant)(c)) +} + +// ChangeActionState is a wrapper around g_action_group_change_action_state +func (v *ActionGroup) ChangeActionState(actionName string, value *Variant) { + C.g_action_group_change_action_state(v.native(), (*C.gchar)(C.CString(actionName)), value.native()) +} + +// Activate is a wrapper around g_action_group_activate_action +func (v *ActionGroup) Activate(actionName string, parameter *Variant) { + C.g_action_group_activate_action(v.native(), (*C.gchar)(C.CString(actionName)), parameter.native()) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gactionmap.go b/vendor/github.com/gotk3/gotk3/glib/gactionmap.go new file mode 100644 index 0000000..f5b8998 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gactionmap.go @@ -0,0 +1,66 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// IActionMap is an interface representation of ActionMap, +// used to avoid duplication when embedding the type in a wrapper of another GObject-based type. +type IActionMap interface { + Native() uintptr + + LookupAction(actionName string) *Action + AddAction(action IAction) + RemoveAction(actionName string) +} + +// ActionMap is a representation of glib's GActionMap GInterface +type ActionMap struct { + *Object +} + +// void g_action_map_add_action_entries (GActionMap *action_map, const GActionEntry *entries, gint n_entries, gpointer user_data); +// struct GActionEntry + +// native() returns a pointer to the underlying GActionMap. +func (v *ActionMap) native() *C.GActionMap { + if v == nil || v.GObject == nil { + return nil + } + return C.toGActionMap(unsafe.Pointer(v.GObject)) +} + +func (v *ActionMap) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalActionMap(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapActionMap(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapActionMap(obj *Object) *ActionMap { + return &ActionMap{obj} +} + +// LookupAction is a wrapper around g_action_map_lookup_action +func (v *ActionMap) LookupAction(actionName string) *Action { + c := C.g_action_map_lookup_action(v.native(), (*C.gchar)(C.CString(actionName))) + if c == nil { + return nil + } + return wrapAction(wrapObject(unsafe.Pointer(c))) +} + +// AddAction is a wrapper around g_action_map_add_action +func (v *ActionMap) AddAction(action IAction) { + C.g_action_map_add_action(v.native(), action.toGAction()) +} + +// RemoveAction is a wrapper around g_action_map_remove_action +func (v *ActionMap) RemoveAction(actionName string) { + C.g_action_map_remove_action(v.native(), (*C.gchar)(C.CString(actionName))) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gasyncresult.go b/vendor/github.com/gotk3/gotk3/glib/gasyncresult.go new file mode 100644 index 0000000..e3826f0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gasyncresult.go @@ -0,0 +1,73 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "errors" + "unsafe" +) + +// IAsyncResult is an interface representation of AsyncResult, +// used to avoid duplication when embedding the type in a wrapper of another GObject-based type. +type IAsyncResult interface { + GetUserData() uintptr + GetSourceObject() *Object + IsTagged(sourceTag uintptr) bool + LegacyPropagateError() error +} + +// AsyncReadyCallback is a representation of GAsyncReadyCallback +type AsyncReadyCallback func(object *Object, res *AsyncResult) + +// AsyncResult is a representation of GIO's GAsyncResult. +type AsyncResult struct { + *Object +} + +// native() returns a pointer to the underlying GAsyncResult. +func (v *AsyncResult) native() *C.GAsyncResult { + if v == nil || v.GObject == nil { + return nil + } + return C.toGAsyncResult(unsafe.Pointer(v.GObject)) +} + +func wrapAsyncResult(obj *Object) *AsyncResult { + return &AsyncResult{obj} +} + +// GetUserData is a wrapper around g_async_result_get_user_data() +func (v *AsyncResult) GetUserData() uintptr { + c := C.g_async_result_get_user_data(v.native()) + return uintptr(unsafe.Pointer(c)) +} + +// GetSourceObject is a wrapper around g_async_result_get_source_object +func (v *AsyncResult) GetSourceObject() *Object { + obj := C.g_async_result_get_source_object(v.native()) + if obj == nil { + return nil + } + return wrapObject(unsafe.Pointer(obj)) +} + +// IsTagged is a wrapper around g_async_result_is_tagged +func (v *AsyncResult) IsTagged(sourceTag uintptr) bool { + c := C.g_async_result_is_tagged(v.native(), C.gpointer(sourceTag)) + return gobool(c) +} + +// LegacyPropagateError is a wrapper around g_async_result_legacy_propagate_error +func (v *AsyncResult) LegacyPropagateError() error { + var err *C.GError + c := C.g_async_result_legacy_propagate_error(v.native(), &err) + isSimpleAsyncResult := gobool(c) + if isSimpleAsyncResult { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gbinding.go b/vendor/github.com/gotk3/gotk3/glib/gbinding.go new file mode 100644 index 0000000..133ce12 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gbinding.go @@ -0,0 +1,98 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +type BindingFlags int + +const ( + BINDING_DEFAULT BindingFlags = C.G_BINDING_DEFAULT + BINDING_BIDIRECTIONAL BindingFlags = C.G_BINDING_BIDIRECTIONAL + BINDING_SYNC_CREATE = C.G_BINDING_SYNC_CREATE + BINDING_INVERT_BOOLEAN = C.G_BINDING_INVERT_BOOLEAN +) + +type Binding struct { + *Object +} + +func (v *Binding) native() *C.GBinding { + if v == nil || v.GObject == nil { + return nil + } + return C.toGBinding(unsafe.Pointer(v.GObject)) +} + +func marshalBinding(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return &Binding{wrapObject(unsafe.Pointer(c))}, nil +} + +// Creates a binding between source property on source and target property on +// target . Whenever the source property is changed the target_property is +// updated using the same value. +func BindProperty(source *Object, sourceProperty string, + target *Object, targetProperty string, + flags BindingFlags) *Binding { + srcStr := (*C.gchar)(C.CString(sourceProperty)) + defer C.free(unsafe.Pointer(srcStr)) + tgtStr := (*C.gchar)(C.CString(targetProperty)) + defer C.free(unsafe.Pointer(tgtStr)) + obj := C.g_object_bind_property( + C.gpointer(source.GObject), srcStr, + C.gpointer(target.GObject), tgtStr, + C.GBindingFlags(flags), + ) + if obj == nil { + return nil + } + return &Binding{wrapObject(unsafe.Pointer(obj))} +} + +// Explicitly releases the binding between the source and the target property +// expressed by Binding +func (v *Binding) Unbind() { + C.g_binding_unbind(v.native()) +} + +// Retrieves the GObject instance used as the source of the binding +func (v *Binding) GetSource() *Object { + obj := C.g_binding_get_source(v.native()) + if obj == nil { + return nil + } + return wrapObject(unsafe.Pointer(obj)) +} + +// Retrieves the name of the property of “source” used as the source of +// the binding. +func (v *Binding) GetSourceProperty() string { + s := C.g_binding_get_source_property(v.native()) + return C.GoString((*C.char)(s)) +} + +// Retrieves the GObject instance used as the target of the binding. +func (v *Binding) GetTarget() *Object { + obj := C.g_binding_get_target(v.native()) + if obj == nil { + return nil + } + return wrapObject(unsafe.Pointer(obj)) +} + +// Retrieves the name of the property of “target” used as the target of +// the binding. +func (v *Binding) GetTargetProperty() string { + s := C.g_binding_get_target_property(v.native()) + return C.GoString((*C.char)(s)) +} + +// Retrieves the flags passed when constructing the GBinding. +func (v *Binding) GetFlags() BindingFlags { + flags := C.g_binding_get_flags(v.native()) + return BindingFlags(flags) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gcancellable.go b/vendor/github.com/gotk3/gotk3/glib/gcancellable.go new file mode 100644 index 0000000..097df4f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gcancellable.go @@ -0,0 +1,83 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "errors" + "unsafe" +) + +// Cancellable is a representation of GIO's GCancellable. +type Cancellable struct { + *Object +} + +// native returns a pointer to the underlying GCancellable. +func (v *Cancellable) native() *C.GCancellable { + if v == nil || v.GObject == nil { + return nil + } + return C.toCancellable(unsafe.Pointer(v.GObject)) +} + +func marshalCancellable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapCancellable(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapCancellable(obj *Object) *Cancellable { + return &Cancellable{obj} +} + +// CancellableNew is a wrapper around g_cancellable_new(). +func CancellableNew() (*Cancellable, error) { + c := C.g_cancellable_new() + if c == nil { + return nil, nilPtrErr + } + return wrapCancellable(wrapObject(unsafe.Pointer(c))), nil +} + +// IsCancelled is a wrapper around g_cancellable_is_cancelled(). +func (v *Cancellable) IsCancelled() bool { + c := C.g_cancellable_is_cancelled(v.native()) + return gobool(c) +} + +// SetErrorIfCancelled is a wrapper around g_cancellable_set_error_if_cancelled(). +func (v *Cancellable) SetErrorIfCancelled() error { + var err *C.GError + c := C.g_cancellable_set_error_if_cancelled(v.native(), &err) + cancelled := gobool(c) + if cancelled { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// GetFD is a wrapper around g_cancellable_get_fd(). +func (v *Cancellable) GetFD() int { + c := C.g_cancellable_get_fd(v.native()) + return int(c) +} + +// MakePollFD is a wrapper around g_cancellable_make_pollfd(). +// func (v *Cancellable) MakePollFD(pollFD *PollFD) bool { +// c := C.g_cancellable_make_pollfd(v.native(), ) +// return gobool(c) +// } + +// ReleaseFD is a wrapper around g_cancellable_release_fd(). +func (v *Cancellable) ReleaseFD() { + C.g_cancellable_release_fd(v.native()) +} + +// SourceNew is a wrapper around g_cancellable_source_new(). +func (v *Cancellable) SourceNew() *Source { + c := C.g_cancellable_source_new(v.native()) + return wrapSource(c) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gfile.go b/vendor/github.com/gotk3/gotk3/glib/gfile.go new file mode 100644 index 0000000..8b68ba3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gfile.go @@ -0,0 +1,367 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +// #include "gfile.go.h" +import "C" +import ( + "errors" + "unsafe" +) + +func init() { + + tm := []TypeMarshaler{ + {Type(C.g_file_get_type()), marshalFile}, + {Type(C.g_file_input_stream_get_type()), marshalFileInputStream}, + {Type(C.g_file_output_stream_get_type()), marshalFileOutputStream}, + } + + RegisterGValueMarshalers(tm) +} + +func goString(cstr *C.gchar) string { + return C.GoString((*C.char)(cstr)) +} + +/* + * GFile + */ + +// File is a representation of GIO's GFile. +type File struct { + *Object +} + +// native returns a pointer to the underlying GFile. +func (v *File) native() *C.GFile { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFile(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *File) NativePrivate() *C.GFile { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFile(p) +} + +// Native returns a pointer to the underlying GFile. +func (v *File) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalFile(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapFile(obj), nil +} + +func wrapFile(obj *Object) *File { + return &File{obj} +} + +// FileNew is a wrapper around g_file_new_for_path(). +// To avoid breaking previous implementation of GFile ... +func FileNew(path string) *File { + f, e := FileNewForPath(path) + if e != nil { + return nil + } + return f +} + +// FileNewForPath is a wrapper around g_file_new_for_path(). +func FileNewForPath(path string) (*File, error) { + cstr := (*C.char)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr)) + + c := C.g_file_new_for_path(cstr) + if c == nil { + return nil, nilPtrErr + } + return wrapFile(Take(unsafe.Pointer(c))), nil +} + +// TODO g_file_*** and more +/* +void (*GFileProgressCallback) () +gboolean (*GFileReadMoreCallback) () +void (*GFileMeasureProgressCallback) () +GFile * g_file_new_for_uri () +GFile * g_file_new_for_commandline_arg () +GFile * g_file_new_for_commandline_arg_and_cwd () +GFile * g_file_new_tmp () +GFile * g_file_parse_name () +GFile * g_file_new_build_filename () +GFile * g_file_dup () +guint g_file_hash () +gboolean g_file_equal () +char * g_file_get_basename () +*/ + +/* +char * +g_file_get_path (GFile *file); +*/ +// GetPath is a wrapper around g_file_get_path(). +func (v *File) GetPath() string { + var s string + if c := C.g_file_get_path(v.native()); c != nil { + s = C.GoString(c) + defer C.g_free((C.gpointer)(c)) + } + + return s +} + +/* +const char * g_file_peek_path () +char * g_file_get_uri () +char * g_file_get_parse_name () +GFile * g_file_get_parent () +gboolean g_file_has_parent () +GFile * g_file_get_child () +GFile * g_file_get_child_for_display_name () +gboolean g_file_has_prefix () +char * g_file_get_relative_path () +GFile * g_file_resolve_relative_path () +gboolean g_file_is_native () +gboolean g_file_has_uri_scheme () +char * g_file_get_uri_scheme () +*/ + +/* +GFileInputStream * +g_file_read (GFile *file, + GCancellable *cancellable, + GError **error); +*/ +// Read is a wrapper around g_file_read(). +// Object.Unref() must be used after use +func (v *File) Read(cancellable *Cancellable) (*FileInputStream, error) { + var gerr *C.GError + c := C.g_file_read( + v.native(), + cancellable.native(), + &gerr) + if c == nil { + defer C.g_error_free(gerr) + return nil, errors.New(goString(gerr.message)) + } + return wrapFileInputStream(Take(unsafe.Pointer(c))), nil +} + +/* +void g_file_read_async () +GFileInputStream * g_file_read_finish () +GFileOutputStream * g_file_append_to () +GFileOutputStream * g_file_create () +GFileOutputStream * g_file_replace () +void g_file_append_to_async () +GFileOutputStream * g_file_append_to_finish () +void g_file_create_async () +GFileOutputStream * g_file_create_finish () +void g_file_replace_async () +GFileOutputStream * g_file_replace_finish () +GFileInfo * g_file_query_info () +void g_file_query_info_async () +GFileInfo * g_file_query_info_finish () +gboolean g_file_query_exists () +GFileType g_file_query_file_type () +GFileInfo * g_file_query_filesystem_info () +void g_file_query_filesystem_info_async () +GFileInfo * g_file_query_filesystem_info_finish () +GAppInfo * g_file_query_default_handler () +void g_file_query_default_handler_async () +GAppInfo * g_file_query_default_handler_finish () +gboolean g_file_measure_disk_usage () +void g_file_measure_disk_usage_async () +gboolean g_file_measure_disk_usage_finish () +GMount * g_file_find_enclosing_mount () +void g_file_find_enclosing_mount_async () +GMount * g_file_find_enclosing_mount_finish () +GFileEnumerator * g_file_enumerate_children () +void g_file_enumerate_children_async () +GFileEnumerator * g_file_enumerate_children_finish () +GFile * g_file_set_display_name () +void g_file_set_display_name_async () +GFile * g_file_set_display_name_finish () +gboolean g_file_delete () +void g_file_delete_async () +gboolean g_file_delete_finish () +gboolean g_file_trash () +void g_file_trash_async () +gboolean g_file_trash_finish () +gboolean g_file_copy () +void g_file_copy_async () +gboolean g_file_copy_finish () +gboolean g_file_move () +gboolean g_file_make_directory () +void g_file_make_directory_async () +gboolean g_file_make_directory_finish () +gboolean g_file_make_directory_with_parents () +gboolean g_file_make_symbolic_link () +GFileAttributeInfoList * g_file_query_settable_attributes () +GFileAttributeInfoList * g_file_query_writable_namespaces () +gboolean g_file_set_attribute () +gboolean g_file_set_attributes_from_info () +void g_file_set_attributes_async () +gboolean g_file_set_attributes_finish () +gboolean g_file_set_attribute_string () +gboolean g_file_set_attribute_byte_string () +gboolean g_file_set_attribute_uint32 () +gboolean g_file_set_attribute_int32 () +gboolean g_file_set_attribute_uint64 () +gboolean g_file_set_attribute_int64 () +void g_file_mount_mountable () +GFile * g_file_mount_mountable_finish () +void g_file_unmount_mountable () +gboolean g_file_unmount_mountable_finish () +void g_file_unmount_mountable_with_operation () +gboolean g_file_unmount_mountable_with_operation_finish () +void g_file_eject_mountable () +gboolean g_file_eject_mountable_finish () +void g_file_eject_mountable_with_operation () +gboolean g_file_eject_mountable_with_operation_finish () +void g_file_start_mountable () +gboolean g_file_start_mountable_finish () +void g_file_stop_mountable () +gboolean g_file_stop_mountable_finish () +void g_file_poll_mountable () +gboolean g_file_poll_mountable_finish () +void g_file_mount_enclosing_volume () +gboolean g_file_mount_enclosing_volume_finish () +GFileMonitor * g_file_monitor_directory () +GFileMonitor * g_file_monitor_file () +GFileMonitor * g_file_monitor () +GBytes * g_file_load_bytes () +void g_file_load_bytes_async () +GBytes * g_file_load_bytes_finish () +gboolean g_file_load_contents () +void g_file_load_contents_async () +gboolean g_file_load_contents_finish () +void g_file_load_partial_contents_async () +gboolean g_file_load_partial_contents_finish () +gboolean g_file_replace_contents () +void g_file_replace_contents_async () +void g_file_replace_contents_bytes_async () +gboolean g_file_replace_contents_finish () +gboolean g_file_copy_attributes () +GFileIOStream * g_file_create_readwrite () +void g_file_create_readwrite_async () +GFileIOStream * g_file_create_readwrite_finish () +GFileIOStream * g_file_open_readwrite () +void g_file_open_readwrite_async () +GFileIOStream * g_file_open_readwrite_finish () +GFileIOStream * g_file_replace_readwrite () +void g_file_replace_readwrite_async () +GFileIOStream * g_file_replace_readwrite_finish () +gboolean g_file_supports_thread_contexts () +*/ + +/* + * GFileInputStream + */ + +// FileInputStream is a representation of GIO's GFileInputStream. +type FileInputStream struct { + *InputStream +} + +// native returns a pointer to the underlying GFileInputStream. +func (v *FileInputStream) native() *C.GFileInputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFileInputStream(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *FileInputStream) NativePrivate() *C.GFileInputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFileInputStream(p) +} + +// Native returns a pointer to the underlying GFileInputStream. +func (v *FileInputStream) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalFileInputStream(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapFileInputStream(obj), nil +} + +func wrapFileInputStream(obj *Object) *FileInputStream { + return &FileInputStream{wrapInputStream(obj)} +} + +// TODO g_file_input_stream_query_info and more +/* +GFileInfo * g_file_input_stream_query_info () +void g_file_input_stream_query_info_async () +GFileInfo * g_file_input_stream_query_info_finish () +*/ + +/* + * GFileOutputStream + */ + +// FileOutputStream is a representation of GIO's GFileOutputStream. +type FileOutputStream struct { + *OutputStream +} + +// native returns a pointer to the underlying GFileOutputStream. +func (v *FileOutputStream) native() *C.GFileOutputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFileOutputStream(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *FileOutputStream) NativePrivate() *C.GFileOutputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFileOutputStream(p) +} + +// Native returns a pointer to the underlying GFileOutputStream. +func (v *FileOutputStream) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalFileOutputStream(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapFileOutputStream(obj), nil +} + +func wrapFileOutputStream(obj *Object) *FileOutputStream { + return &FileOutputStream{wrapOutputStream(obj)} +} + +// TODO g_file_output_stream_query_info and more +/* +GFileInfo * g_file_output_stream_query_info () +void g_file_output_stream_query_info_async () +GFileInfo * g_file_output_stream_query_info_finish () +char * g_file_output_stream_get_etag () +*/ diff --git a/vendor/github.com/gotk3/gotk3/glib/gfile.go.h b/vendor/github.com/gotk3/gotk3/glib/gfile.go.h new file mode 100644 index 0000000..8892344 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gfile.go.h @@ -0,0 +1,13 @@ +#include +#include +#include + +#include + +static GFileInputStream *toGFileInputStream(void *p) { + return (G_FILE_INPUT_STREAM(p)); +} + +static GFileOutputStream *toGFileOutputStream(void *p) { + return (G_FILE_OUTPUT_STREAM(p)); +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gicon.go b/vendor/github.com/gotk3/gotk3/glib/gicon.go new file mode 100644 index 0000000..0f178af --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gicon.go @@ -0,0 +1,177 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "errors" + "runtime" + "unsafe" +) + +func init() { + + tm := []TypeMarshaler{ + {Type(C.g_file_get_type()), marshalFile}, + {Type(C.g_file_icon_get_type()), marshalFileIcon}, + } + + RegisterGValueMarshalers(tm) +} + +/* + * GIcon + */ + +// Icon is a representation of GIO's GIcon. +// Interface for icons +type Icon struct { + *Object +} + +// native returns a pointer to the underlying GIcon. +func (v *Icon) native() *C.GIcon { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGIcon(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *Icon) NativePrivate() *C.GIcon { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGIcon(p) +} + +// Native returns a pointer to the underlying GIcon. +func (v *Icon) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalIcon(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapIcon(obj), nil +} + +func wrapIcon(obj *Object) *Icon { + return &Icon{obj} +} + +// TODO I dont know how to handle it ... +/* +guint +g_icon_hash (gconstpointer icon); +*/ + +// Equal is a wrapper around g_icon_equal(). +func (v *Icon) Equal(icon *Icon) bool { + return gobool(C.g_icon_equal(v.native(), icon.native())) +} + +// ToString is a wrapper around g_icon_to_string(). +func (v *Icon) ToString() string { + var s string + if c := C.g_icon_to_string(v.native()); c != nil { + s = goString(c) + defer C.g_free((C.gpointer)(c)) + } + + return s +} + +// IconNewForString is a wrapper around g_icon_new_for_string(). +func IconNewForString(str string) (*Icon, error) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + + var err *C.GError + c := C.g_icon_new_for_string((*C.gchar)(cstr), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + + obj := &Object{ToGObject(unsafe.Pointer(c))} + i := &Icon{obj} + + runtime.SetFinalizer(i, func(_ interface{}) { obj.Unref() }) + return i, nil +} + +// TODO Requiere GVariant +/* +GVariant * g_icon_serialize () +GIcon * g_icon_deserialize () +*/ + +/* + * GFileIcon + */ + +// FileIcon is a representation of GIO's GFileIcon. +type FileIcon struct { + *Object +} + +// native returns a pointer to the underlying GFileIcon. +func (v *FileIcon) native() *C.GFileIcon { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFileIcon(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *FileIcon) NativePrivate() *C.GFileIcon { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGFileIcon(p) +} + +// Native returns a pointer to the underlying GFileIcon. +func (v *FileIcon) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalFileIcon(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapFileIcon(obj), nil +} + +func wrapFileIcon(obj *Object) *FileIcon { + return &FileIcon{obj} +} + +// FileIconNewN is a wrapper around g_file_icon_new(). +// This version respect Gtk3 documentation. +func FileIconNewN(file *File) (*Icon, error) { + + c := C.g_file_icon_new(file.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapIcon(Take(unsafe.Pointer(c))), nil +} + +// FileIconNew is a wrapper around g_file_icon_new(). +// To not break previous implementation of GFileIcon ... +func FileIconNew(path string) *Icon { + file := FileNew(path) + + c := C.g_file_icon_new(file.native()) + if c == nil { + return nil + } + return wrapIcon(Take(unsafe.Pointer(c))) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/giostream.go b/vendor/github.com/gotk3/gotk3/glib/giostream.go new file mode 100644 index 0000000..f91e5a6 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/giostream.go @@ -0,0 +1,437 @@ +package glib + +// #cgo pkg-config: gio-2.0 glib-2.0 gobject-2.0 +// #include +// #include +// #include "giostream.go.h" +import "C" +import ( + "bytes" + "errors" + "unsafe" +) + +func init() { + + tm := []TypeMarshaler{ + {Type(C.g_io_stream_get_type()), marshalIOStream}, + {Type(C.g_output_stream_get_type()), marshalOutputStream}, + {Type(C.g_input_stream_get_type()), marshalInputStream}, + } + + RegisterGValueMarshalers(tm) +} + +// OutputStreamSpliceFlags is a representation of GTK's GOutputStreamSpliceFlags. +type OutputStreamSpliceFlags int + +const ( + OUTPUT_STREAM_SPLICE_NONE OutputStreamSpliceFlags = C.G_OUTPUT_STREAM_SPLICE_NONE + OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = C.G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE + OUTPUT_STREAM_SPLICE_CLOSE_TARGET = C.G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET +) + +/* + * GIOStream + */ + +// IOStream is a representation of GIO's GIOStream. +// Base class for implementing read/write streams +type IOStream struct { + *Object +} + +// native returns a pointer to the underlying GIOStream. +func (v *IOStream) native() *C.GIOStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGIOStream(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *IOStream) NativePrivate() *C.GIOStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGIOStream(p) +} + +// Native returns a pointer to the underlying GIOStream. +func (v *IOStream) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalIOStream(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapIOStream(obj), nil +} + +func wrapIOStream(obj *Object) *IOStream { + return &IOStream{obj} +} + +/* +GInputStream * g_io_stream_get_input_stream () +GOutputStream * g_io_stream_get_output_stream () +void g_io_stream_splice_async () +gboolean g_io_stream_splice_finish () +*/ + +// Close is a wrapper around g_io_stream_close(). +func (v *IOStream) Close(cancellable *Cancellable) (bool, error) { + var gerr *C.GError + ok := gobool(C.g_io_stream_close( + v.native(), + cancellable.native(), + &gerr)) + if !ok { + defer C.g_error_free(gerr) + return false, errors.New(goString(gerr.message)) + } + return ok, nil +} + +/* +void g_io_stream_close_async () +gboolean g_io_stream_close_finish () +gboolean g_io_stream_is_closed () +gboolean g_io_stream_has_pending () +gboolean g_io_stream_set_pending () +void g_io_stream_clear_pending () +*/ + +/* + * GInputStream + */ + +// InputStream is a representation of GIO's GInputStream. +// Base class for implementing streaming input +type InputStream struct { + *Object +} + +// native returns a pointer to the underlying GInputStream. +func (v *InputStream) native() *C.GInputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGInputStream(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *InputStream) NativePrivate() *C.GInputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGInputStream(p) +} + +// Native returns a pointer to the underlying GInputStream. +func (v *InputStream) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalInputStream(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapInputStream(obj), nil +} + +func wrapInputStream(obj *Object) *InputStream { + return &InputStream{obj} +} + +// Read is a wrapper around g_input_stream_read(). +func (v *InputStream) Read(length uint, cancellable *Cancellable) (*bytes.Buffer, int, error) { + var gerr *C.GError + var buffer = bytes.NewBuffer(make([]byte, length)) + + c := C.g_input_stream_read( + v.native(), + unsafe.Pointer(&buffer.Bytes()[0]), + C.gsize(length), + cancellable.native(), + &gerr) + if c == -1 { + defer C.g_error_free(gerr) + return nil, -1, errors.New(goString(gerr.message)) + } + return buffer, int(c), nil +} + +// TODO find a way to get size to be read without asking for ... +/* +gboolean +g_input_stream_read_all (GInputStream *stream, + void *buffer, + gsize count, + gsize *bytes_read, + GCancellable *cancellable, + GError **error); +*/ + +/* +void g_input_stream_read_all_async () +gboolean g_input_stream_read_all_finish () +gssize g_input_stream_skip () +*/ + +// Close is a wrapper around g_input_stream_close(). +func (v *InputStream) Close(cancellable *Cancellable) (bool, error) { + var gerr *C.GError + ok := gobool(C.g_input_stream_close( + v.native(), + cancellable.native(), + &gerr)) + if !ok { + defer C.g_error_free(gerr) + return false, errors.New(goString(gerr.message)) + } + return ok, nil +} + +// TODO g_input_stream*** +/* +void g_input_stream_read_async () +gssize g_input_stream_read_finish () +void g_input_stream_skip_async () +gssize g_input_stream_skip_finish () +void g_input_stream_close_async () +gboolean g_input_stream_close_finish () +*/ + +// IsClosed is a wrapper around g_input_stream_is_closed(). +func (v *InputStream) IsClosed() bool { + return gobool(C.g_input_stream_is_closed(v.native())) +} + +// HasPending is a wrapper around g_input_stream_has_pending(). +func (v *InputStream) HasPending() bool { + return gobool(C.g_input_stream_has_pending(v.native())) +} + +// SetPending is a wrapper around g_input_stream_set_pending(). +func (v *InputStream) SetPending() (bool, error) { + var gerr *C.GError + ok := gobool(C.g_input_stream_set_pending( + v.native(), + &gerr)) + if !ok { + defer C.g_error_free(gerr) + return false, errors.New(goString(gerr.message)) + } + return ok, nil +} + +// ClearPending is a wrapper around g_input_stream_clear_pending(). +func (v *InputStream) ClearPending() { + C.g_input_stream_clear_pending(v.native()) +} + +/* Useless functions due to Go language specification and actual + implementation of (*InputStream).Read that do same thing. + +GBytes * g_input_stream_read_bytes () +void g_input_stream_read_bytes_async () +GBytes * g_input_stream_read_bytes_finish () +*/ + +/* + * GOutputStream + */ + +// OutputStream is a representation of GIO's GOutputStream. +// Base class for implementing streaming output +type OutputStream struct { + *Object +} + +// native returns a pointer to the underlying GOutputStream. +func (v *OutputStream) native() *C.GOutputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGOutputStream(p) +} + +// NativePrivate: to be used inside Gotk3 only. +func (v *OutputStream) NativePrivate() *C.GOutputStream { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGOutputStream(p) +} + +// Native returns a pointer to the underlying GOutputStream. +func (v *OutputStream) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalOutputStream(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := Take(unsafe.Pointer(c)) + return wrapOutputStream(obj), nil +} + +func wrapOutputStream(obj *Object) *OutputStream { + return &OutputStream{obj} +} + +/* +gssize +g_output_stream_write (GOutputStream *stream, + const void *buffer, + gsize count, + GCancellable *cancellable, + GError **error); +*/ + +// Write is a wrapper around g_output_stream_write(). +// buffer := bytes.NewBuffer(make([]byte, length)) +func (v *OutputStream) Write(buffer *bytes.Buffer, cancellable *Cancellable) (int, error) { + var gerr *C.GError + length := buffer.Len() + + c := C.g_output_stream_write( + v.native(), + unsafe.Pointer(&buffer.Bytes()[0]), + C.gsize(length), + cancellable.native(), + &gerr) + if c == -1 { + defer C.g_error_free(gerr) + return -1, errors.New(goString(gerr.message)) + } + return int(c), nil +} + +// Write is a wrapper around g_output_stream_write(). +// func (v *OutputStream) Write(buffer *[]byte, cancellable *Cancellable) (int, error) { +// // cdata := C.CString(data) +// // defer C.free(unsafe.Pointer(cdata)) +// var gerr *C.GError +// c := C.g_output_stream_write( +// v.native(), +// unsafe.Pointer(buffer), +// C.gsize(len(*buffer)), +// cancellable.native(), +// &gerr) +// if c == -1 { +// defer C.g_error_free(gerr) +// return 0, errors.New(goString(gerr.message)) +// } +// return int(c), nil +// } + +/* +gboolean g_output_stream_write_all () +*/ + +// TODO outputStream asynch functions +/* +void g_output_stream_write_all_async () +gboolean g_output_stream_write_all_finish () +gboolean g_output_stream_writev () +gboolean g_output_stream_writev_all () +void g_output_stream_writev_async () +gboolean g_output_stream_writev_finish () +void g_output_stream_writev_all_async () +gboolean g_output_stream_writev_all_finish () +*/ +/* +gssize +g_output_stream_splice (GOutputStream *stream, + GInputStream *source, + GOutputStreamSpliceFlags flags, + GCancellable *cancellable, + GError **error); +*/ + +// Flush is a wrapper around g_output_stream_flush(). +func (v *OutputStream) Flush(cancellable *Cancellable) (bool, error) { + var gerr *C.GError + ok := gobool(C.g_output_stream_flush( + v.native(), + cancellable.native(), + &gerr)) + if !ok { + defer C.g_error_free(gerr) + return false, errors.New(goString(gerr.message)) + } + return ok, nil +} + +// Close is a wrapper around g_output_stream_close(). +func (v *OutputStream) Close(cancellable *Cancellable) (bool, error) { + var gerr *C.GError + ok := gobool(C.g_output_stream_close( + v.native(), + cancellable.native(), + &gerr)) + if !ok { + defer C.g_error_free(gerr) + return false, errors.New(goString(gerr.message)) + } + return ok, nil +} + +// TODO outputStream asynch functions +/* +void g_output_stream_write_async () +gssize g_output_stream_write_finish () +void g_output_stream_splice_async () +gssize g_output_stream_splice_finish () +void g_output_stream_flush_async () +gboolean g_output_stream_flush_finish () +void g_output_stream_close_async () +gboolean g_output_stream_close_finish () +*/ + +// IsClosing is a wrapper around g_output_stream_is_closing(). +func (v *OutputStream) IsClosing() bool { + return gobool(C.g_output_stream_is_closing(v.native())) +} + +// IsClosed is a wrapper around g_output_stream_is_closed(). +func (v *OutputStream) IsClosed() bool { + return gobool(C.g_output_stream_is_closed(v.native())) +} + +// HasPending is a wrapper around g_output_stream_has_pending(). +func (v *OutputStream) HasPending() bool { + return gobool(C.g_output_stream_has_pending(v.native())) +} + +// SetPending is a wrapper around g_output_stream_set_pending(). +func (v *OutputStream) SetPending() (bool, error) { + var gerr *C.GError + ok := gobool(C.g_output_stream_set_pending( + v.native(), + &gerr)) + if !ok { + defer C.g_error_free(gerr) + return false, errors.New(goString(gerr.message)) + } + return ok, nil +} + +// ClearPending is a wrapper around g_output_stream_clear_pending(). +func (v *OutputStream) ClearPending() { + C.g_output_stream_clear_pending(v.native()) +} + +/* +gssize g_output_stream_write_bytes () +void g_output_stream_write_bytes_async () +gssize g_output_stream_write_bytes_finish () +gboolean g_output_stream_printf () +gboolean g_output_stream_vprintf () +*/ diff --git a/vendor/github.com/gotk3/gotk3/glib/giostream.go.h b/vendor/github.com/gotk3/gotk3/glib/giostream.go.h new file mode 100644 index 0000000..44eba09 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/giostream.go.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +static GIOStream *toGIOStream(void *p) { return (G_IO_STREAM(p)); } + +static GInputStream *toGInputStream(void *p) { return (G_INPUT_STREAM(p)); } + +static GOutputStream *toGOutputStream(void *p) { return (G_OUTPUT_STREAM(p)); } diff --git a/vendor/github.com/gotk3/gotk3/glib/glib.go b/vendor/github.com/gotk3/gotk3/glib/glib.go new file mode 100644 index 0000000..b862b05 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib.go @@ -0,0 +1,1403 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// Package glib provides Go bindings for GLib 2. It supports version 2.36 and +// later. +package glib + +// #cgo pkg-config: gio-2.0 glib-2.0 gobject-2.0 +// #include +// #include +// #include +// #include "glib.go.h" +import "C" + +import ( + "errors" + "fmt" + "reflect" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/internal/closure" +) + +/* + * Type conversions + */ + +func gbool(b bool) C.gboolean { + if b { + return C.gboolean(1) + } + return C.gboolean(0) +} + +func gobool(b C.gboolean) bool { + if b != 0 { + return true + } + return false +} + +/* + * Unexported vars + */ + +var nilPtrErr = errors.New("cgo returned unexpected nil pointer") + +/* + * Constants + */ + +// Type is a representation of GLib's GType. +type Type uint + +const ( + TYPE_INVALID Type = C.G_TYPE_INVALID + TYPE_NONE Type = C.G_TYPE_NONE + TYPE_INTERFACE Type = C.G_TYPE_INTERFACE + TYPE_CHAR Type = C.G_TYPE_CHAR + TYPE_UCHAR Type = C.G_TYPE_UCHAR + TYPE_BOOLEAN Type = C.G_TYPE_BOOLEAN + TYPE_INT Type = C.G_TYPE_INT + TYPE_UINT Type = C.G_TYPE_UINT + TYPE_LONG Type = C.G_TYPE_LONG + TYPE_ULONG Type = C.G_TYPE_ULONG + TYPE_INT64 Type = C.G_TYPE_INT64 + TYPE_UINT64 Type = C.G_TYPE_UINT64 + TYPE_ENUM Type = C.G_TYPE_ENUM + TYPE_FLAGS Type = C.G_TYPE_FLAGS + TYPE_FLOAT Type = C.G_TYPE_FLOAT + TYPE_DOUBLE Type = C.G_TYPE_DOUBLE + TYPE_STRING Type = C.G_TYPE_STRING + TYPE_POINTER Type = C.G_TYPE_POINTER + TYPE_BOXED Type = C.G_TYPE_BOXED + TYPE_PARAM Type = C.G_TYPE_PARAM + TYPE_OBJECT Type = C.G_TYPE_OBJECT + TYPE_VARIANT Type = C.G_TYPE_VARIANT +) + +// IsValue checks whether the passed in type can be used for g_value_init(). +func (t Type) IsValue() bool { + return gobool(C._g_type_is_value(C.GType(t))) +} + +// Name is a wrapper around g_type_name(). +func (t Type) Name() string { + return C.GoString((*C.char)(C.g_type_name(C.GType(t)))) +} + +// Depth is a wrapper around g_type_depth(). +func (t Type) Depth() uint { + return uint(C.g_type_depth(C.GType(t))) +} + +// Parent is a wrapper around g_type_parent(). +func (t Type) Parent() Type { + return Type(C.g_type_parent(C.GType(t))) +} + +// IsA is a wrapper around g_type_is_a(). +func (t Type) IsA(isAType Type) bool { + return gobool(C.g_type_is_a(C.GType(t), C.GType(isAType))) +} + +// TypeFromName is a wrapper around g_type_from_name +func TypeFromName(typeName string) Type { + cstr := (*C.gchar)(C.CString(typeName)) + defer C.free(unsafe.Pointer(cstr)) + return Type(C.g_type_from_name(cstr)) +} + +//TypeNextBase is a wrapper around g_type_next_base +func TypeNextBase(leafType, rootType Type) Type { + return Type(C.g_type_next_base(C.GType(leafType), C.GType(rootType))) +} + +// SettingsBindFlags is a representation of GLib's GSettingsBindFlags. +type SettingsBindFlags int + +const ( + SETTINGS_BIND_DEFAULT SettingsBindFlags = C.G_SETTINGS_BIND_DEFAULT + SETTINGS_BIND_GET SettingsBindFlags = C.G_SETTINGS_BIND_GET + SETTINGS_BIND_SET SettingsBindFlags = C.G_SETTINGS_BIND_SET + SETTINGS_BIND_NO_SENSITIVITY SettingsBindFlags = C.G_SETTINGS_BIND_NO_SENSITIVITY + SETTINGS_BIND_GET_NO_CHANGES SettingsBindFlags = C.G_SETTINGS_BIND_GET_NO_CHANGES + SETTINGS_BIND_INVERT_BOOLEAN SettingsBindFlags = C.G_SETTINGS_BIND_INVERT_BOOLEAN +) + +// UserDirectory is a representation of GLib's GUserDirectory. +type UserDirectory int + +const ( + USER_DIRECTORY_DESKTOP UserDirectory = C.G_USER_DIRECTORY_DESKTOP + USER_DIRECTORY_DOCUMENTS UserDirectory = C.G_USER_DIRECTORY_DOCUMENTS + USER_DIRECTORY_DOWNLOAD UserDirectory = C.G_USER_DIRECTORY_DOWNLOAD + USER_DIRECTORY_MUSIC UserDirectory = C.G_USER_DIRECTORY_MUSIC + USER_DIRECTORY_PICTURES UserDirectory = C.G_USER_DIRECTORY_PICTURES + USER_DIRECTORY_PUBLIC_SHARE UserDirectory = C.G_USER_DIRECTORY_PUBLIC_SHARE + USER_DIRECTORY_TEMPLATES UserDirectory = C.G_USER_DIRECTORY_TEMPLATES + USER_DIRECTORY_VIDEOS UserDirectory = C.G_USER_DIRECTORY_VIDEOS +) + +const USER_N_DIRECTORIES int = C.G_USER_N_DIRECTORIES + +/* + * GApplicationFlags + */ + +type ApplicationFlags int + +const ( + APPLICATION_FLAGS_NONE ApplicationFlags = C.G_APPLICATION_FLAGS_NONE + APPLICATION_IS_SERVICE ApplicationFlags = C.G_APPLICATION_IS_SERVICE + APPLICATION_HANDLES_OPEN ApplicationFlags = C.G_APPLICATION_HANDLES_OPEN + APPLICATION_HANDLES_COMMAND_LINE ApplicationFlags = C.G_APPLICATION_HANDLES_COMMAND_LINE + APPLICATION_SEND_ENVIRONMENT ApplicationFlags = C.G_APPLICATION_SEND_ENVIRONMENT + APPLICATION_NON_UNIQUE ApplicationFlags = C.G_APPLICATION_NON_UNIQUE +) + +// goMarshal is called by the GLib runtime when a closure needs to be invoked. +// The closure will be invoked with as many arguments as it can take, from 0 to +// the full amount provided by the call. If the closure asks for more parameters +// than there are to give, then a runtime panic will occur. +// +//export goMarshal +func goMarshal( + gclosure *C.GClosure, + retValue *C.GValue, + nParams C.guint, + params *C.GValue, + invocationHint C.gpointer, + marshalData *C.GValue) { + + // Get the function value associated with this callback closure. + fs := closure.Get(unsafe.Pointer(gclosure)) + if !fs.IsValid() { + // Possible data race, bail. + return + } + + fsType := fs.Func.Type() + + // Get number of parameters passed in. + nGLibParams := int(nParams) + nTotalParams := nGLibParams + + // Reflect may panic, so we defer recover here to re-panic with our trace. + defer fs.TryRepanic() + + // Get number of parameters from the callback closure. If this exceeds + // the total number of marshaled parameters, trigger a runtime panic. + nCbParams := fsType.NumIn() + if nCbParams > nTotalParams { + fs.Panicf("too many closure args: have %d, max %d", nCbParams, nTotalParams) + } + + // Create a slice of reflect.Values as arguments to call the function. + gValues := gValueSlice(params, nCbParams) + args := make([]reflect.Value, 0, nCbParams) + + // Fill beginning of args, up to the minimum of the total number of callback + // parameters and parameters from the glib runtime. + for i := 0; i < nCbParams && i < nGLibParams; i++ { + v := Value{&gValues[i]} + + val, err := v.GoValue() + if err != nil { + fs.Panicf("no suitable Go value for arg %d: %v", i, err) + } + + // Parameters that are descendants of GObject come wrapped in another + // GObject. For C applications, the default marshaller + // (g_cclosure_marshal_VOID__VOID in gmarshal.c in the GTK glib library) + // 'peeks' into the enclosing object and passes the wrapped object to + // the handler. Use the *Object.goValue function to emulate that for Go + // signal handlers. + switch objVal := val.(type) { + case *Object: + if innerVal, err := objVal.goValue(); err == nil { + val = innerVal + } + + case *Variant: + switch ts := objVal.TypeString(); ts { + case "s": + val = objVal.GetString() + case "b": + val = gobool(C.g_variant_get_boolean(objVal.native())) + case "d": + val = float64(C.g_variant_get_double(objVal.native())) + case "n": + val = int16(C.g_variant_get_int16(objVal.native())) + case "i": + val = int32(C.g_variant_get_int32(objVal.native())) + case "x": + val = int64(C.g_variant_get_int64(objVal.native())) + case "y": + val = uint8(C.g_variant_get_byte(objVal.native())) + case "q": + val = uint16(C.g_variant_get_uint16(objVal.native())) + case "u": + val = uint32(C.g_variant_get_uint32(objVal.native())) + case "t": + val = uint64(C.g_variant_get_uint64(objVal.native())) + default: + fs.Panicf("variant conversion not yet implemented for type %s", ts) + } + } + + args = append(args, reflect.ValueOf(val).Convert(fsType.In(i))) + } + + // Call closure with args. If the callback returns one or more values, save + // the GValue equivalent of the first. + rv := fs.Func.Call(args) + if retValue != nil && len(rv) > 0 { + g, err := GValue(rv[0].Interface()) + if err != nil { + fs.Panicf("cannot save callback return value: %v", err) + } + + t, _, err := g.Type() + if err != nil { + fs.Panicf("cannot determine callback return value: %v", err) + } + + // Explicitly copy the return value as it may point to go-owned memory. + C.g_value_unset(retValue) + C.g_value_init(retValue, C.GType(t)) + C.g_value_copy(g.native(), retValue) + + *retValue = *g.native() + } +} + +// gValueSlice converts a C array of GValues to a Go slice. +func gValueSlice(values *C.GValue, nValues int) (slice []C.GValue) { + header := (*reflect.SliceHeader)((unsafe.Pointer(&slice))) + header.Cap = nValues + header.Len = nValues + header.Data = uintptr(unsafe.Pointer(values)) + return +} + +/* + * Main event loop + */ + +// Priority is the enumerated type for GLib priority event sources. +type Priority int + +const ( + PRIORITY_HIGH Priority = C.G_PRIORITY_HIGH + PRIORITY_DEFAULT Priority = C.G_PRIORITY_DEFAULT // TimeoutAdd + PRIORITY_HIGH_IDLE Priority = C.G_PRIORITY_HIGH_IDLE + PRIORITY_DEFAULT_IDLE Priority = C.G_PRIORITY_DEFAULT_IDLE // IdleAdd + PRIORITY_LOW Priority = C.G_PRIORITY_LOW +) + +type SourceHandle uint + +// IdleAdd adds an idle source to the default main event loop context with the +// DefaultIdle priority. If f is not a function with no parameter, then IdleAdd +// will panic. +// +// After running once, the source func will be removed from the main event loop, +// unless f returns a single bool true. +func IdleAdd(f interface{}) SourceHandle { + return sourceAttach( + C.g_idle_source_new(), + f, PRIORITY_DEFAULT_IDLE, false, + ) +} + +// IdleAddPriority adds an idle source to the default main event loop context +// with the given priority. Its behavior is the same as IdleAdd. +func IdleAddPriority(priority Priority, f interface{}) SourceHandle { + return sourceAttach( + C.g_idle_source_new(), + f, priority, true, + ) +} + +// TimeoutAdd adds an timeout source to the default main event loop context. +// Timeout is in milliseconds. If f is not a function with no parameter, then it +// will panic. +// +// After running once, the source func will be removed from the main event loop, +// unless f returns a single bool true. +func TimeoutAdd(milliseconds uint, f interface{}) SourceHandle { + return sourceAttach( + C.g_timeout_source_new(C.guint(milliseconds)), + f, PRIORITY_DEFAULT, false, + ) +} + +// TimeoutAddPriority is similar to TimeoutAdd with the given priority. Refer to +// TimeoutAdd for more information. +func TimeoutAddPriority(milliseconds uint, priority Priority, f interface{}) SourceHandle { + return sourceAttach( + C.g_timeout_source_new(C.guint(milliseconds)), + f, priority, true, + ) +} + +// TimeoutSecondsAdd is similar to TimeoutAdd, except with seconds granularity. +func TimeoutSecondsAdd(seconds uint, f interface{}) SourceHandle { + return sourceAttach( + C.g_timeout_source_new_seconds(C.guint(seconds)), + f, PRIORITY_DEFAULT, false, + ) +} + +// TimeoutSecondsAddPriority adds a timeout source with the given priority. +// Refer to TimeoutSecondsAdd for more information. +func TimeoutSecondsAddPriority(seconds uint, priority Priority, f interface{}) SourceHandle { + return sourceAttach( + C.g_timeout_source_new_seconds(C.guint(seconds)), + f, priority, true, + ) +} + +// sourceAttach attaches a source to the default main loop context. +func sourceAttach(src *C.struct__GSource, f interface{}, priority Priority, set bool) SourceHandle { + if src == nil { + panic("unexpected nil GSource") + } + + fs := closure.NewFuncStack(f, 2) + // Ensure no parameters prematurely. + if fs.Func.Type().NumIn() > 0 { + fs.Panicf("timeout source should have no parameters") + } + + if set { + C.g_source_set_priority(src, C.gint(priority)) + } + + // Create a new GClosure from f that invalidates itself when f returns + // false. The error is ignored here, as this will always be a function. + gclosure := ClosureNewFunc(fs) + + // Set closure to run as a callback when the idle source runs. + C.g_source_set_closure(src, gclosure) + + // Attach the idle source func to the default main event loop context. + return SourceHandle(C.g_source_attach(src, nil)) +} + +// Destroy is a wrapper around g_source_destroy() +func (v *Source) Destroy() { + C.g_source_destroy(v.native()) +} + +// IsDestroyed is a wrapper around g_source_is_destroyed() +func (v *Source) IsDestroyed() bool { + return gobool(C.g_source_is_destroyed(v.native())) +} + +// Unref is a wrapper around g_source_unref() +func (v *Source) Unref() { + C.g_source_unref(v.native()) +} + +// Ref is a wrapper around g_source_ref() +func (v *Source) Ref() *Source { + c := C.g_source_ref(v.native()) + if c == nil { + return nil + } + return (*Source)(c) +} + +// SourceRemove is a wrapper around g_source_remove() +func SourceRemove(src SourceHandle) bool { + return gobool(C.g_source_remove(C.guint(src))) +} + +/* + * Miscellaneous Utility Functions + */ + +// GetHomeDir is a wrapper around g_get_home_dir(). +func GetHomeDir() string { + c := C.g_get_home_dir() + return C.GoString((*C.char)(c)) +} + +// GetUserCacheDir is a wrapper around g_get_user_cache_dir(). +func GetUserCacheDir() string { + c := C.g_get_user_cache_dir() + return C.GoString((*C.char)(c)) +} + +// GetUserDataDir is a wrapper around g_get_user_data_dir(). +func GetUserDataDir() string { + c := C.g_get_user_data_dir() + return C.GoString((*C.char)(c)) +} + +// GetUserConfigDir is a wrapper around g_get_user_config_dir(). +func GetUserConfigDir() string { + c := C.g_get_user_config_dir() + return C.GoString((*C.char)(c)) +} + +// GetUserRuntimeDir is a wrapper around g_get_user_runtime_dir(). +func GetUserRuntimeDir() string { + c := C.g_get_user_runtime_dir() + return C.GoString((*C.char)(c)) +} + +// GetUserSpecialDir is a wrapper around g_get_user_special_dir(). A +// non-nil error is returned in the case that g_get_user_special_dir() +// returns NULL to differentiate between NULL and an empty string. +func GetUserSpecialDir(directory UserDirectory) (string, error) { + c := C.g_get_user_special_dir(C.GUserDirectory(directory)) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// FormatSize is a wrapper around g_format_size(). +func FormatSize(size uint64) string { + char := C.g_format_size(C.guint64(size)) + defer C.free(unsafe.Pointer(char)) + + return C.GoString(char) +} + +// FormatSizeFlags are flags to modify the format of the string returned by +// FormatSizeFull. +type FormatSizeFlags int + +const ( + FORMAT_SIZE_DEFAULT FormatSizeFlags = C.G_FORMAT_SIZE_DEFAULT + FORMAT_SIZE_LONG_FORMAT FormatSizeFlags = C.G_FORMAT_SIZE_LONG_FORMAT + FORMAT_SIZE_IEC_UNITS FormatSizeFlags = C.G_FORMAT_SIZE_IEC_UNITS + FORMAT_SIZE_BITS FormatSizeFlags = C.G_FORMAT_SIZE_BITS +) + +// FormatSizeFull is a wrapper around g_format_size_full(). +func FormatSizeFull(size uint64, flags FormatSizeFlags) string { + char := C.g_format_size_full(C.guint64(size), C.GFormatSizeFlags(flags)) + defer C.free(unsafe.Pointer(char)) + + return C.GoString(char) +} + +// SpacedPrimesClosest is a wrapper around g_spaced_primes_closest(). +func SpacedPrimesClosest(num uint) uint { + return uint(C.g_spaced_primes_closest(C.guint(num))) +} + +/* + * GObject + */ + +// IObject is an interface type implemented by Object and all types which embed +// an Object. It is meant to be used as a type for function arguments which +// require GObjects or any subclasses thereof. +type IObject interface { + toGObject() *C.GObject + toObject() *Object +} + +// Object is a representation of GLib's GObject. +type Object struct { + GObject *C.GObject +} + +func (v *Object) toGObject() *C.GObject { + if v == nil { + return nil + } + return v.native() +} + +func (v *Object) toObject() *Object { + return v +} + +// newObject creates a new Object from a GObject pointer. +func newObject(p *C.GObject) *Object { + if p == nil { + return nil + } + return &Object{GObject: p} +} + +// native returns a pointer to the underlying GObject. +func (v *Object) native() *C.GObject { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGObject(p) +} + +// goValue converts a *Object to a Go type (e.g. *Object => *gtk.Entry). +// It is used in goMarshal to convert generic GObject parameters to +// signal handlers to the actual types expected by the signal handler. +func (v *Object) goValue() (interface{}, error) { + objType := Type(C._g_type_from_instance(C.gpointer(v.native()))) + f, err := gValueMarshalers.lookupType(objType) + if err != nil { + return nil, err + } + + // The marshalers expect Values, not Objects + val, err := ValueInit(objType) + if err != nil { + return nil, err + } + val.SetInstance(uintptr(unsafe.Pointer(v.GObject))) + rv, err := f(uintptr(unsafe.Pointer(val.native()))) + return rv, err +} + +// Take wraps a unsafe.Pointer as a glib.Object, taking ownership of it. +// This function is exported for visibility in other gotk3 packages and +// is not meant to be used by applications. +// +// To be clear, this should mostly be used when Gtk says "transfer none". Refer +// to AssumeOwnership for more details. +func Take(ptr unsafe.Pointer) *Object { + obj := newObject(ToGObject(ptr)) + if obj == nil { + return nil + } + + obj.RefSink() + runtime.SetFinalizer(obj, (*Object).Unref) + return obj +} + +// AssumeOwnership is similar to Take, except the function does not take a +// reference. This is usually used for newly constructed objects that for some +// reason does not have an initial floating reference. +// +// To be clear, this should often be used when Gtk says "transfer full", as it +// means the ownership is transferred to the caller, so we can assume that much. +// This is in contrary to Take, which is used when Gtk says "transfer none", as +// we're now referencing an object that might possibly be kept, so we should +// mark as such. +func AssumeOwnership(ptr unsafe.Pointer) *Object { + obj := newObject(ToGObject(ptr)) + runtime.SetFinalizer(obj, (*Object).Unref) + return obj +} + +// Native returns a pointer to the underlying GObject. +func (v *Object) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +// IsA is a wrapper around g_type_is_a(). +func (v *Object) IsA(typ Type) bool { + return gobool(C.g_type_is_a(C.GType(v.TypeFromInstance()), C.GType(typ))) +} + +// TypeFromInstance is a wrapper around g_type_from_instance(). +func (v *Object) TypeFromInstance() Type { + c := C._g_type_from_instance(C.gpointer(unsafe.Pointer(v.native()))) + return Type(c) +} + +// ToGObject type converts an unsafe.Pointer as a native C GObject. +// This function is exported for visibility in other gotk3 packages and +// is not meant to be used by applications. +func ToGObject(p unsafe.Pointer) *C.GObject { + return (*C.GObject)(p) + // return C.toGObject(p) +} + +// Ref is a wrapper around g_object_ref(). +func (v *Object) Ref() { + C.g_object_ref(C.gpointer(v.GObject)) +} + +// Unref is a wrapper around g_object_unref(). +func (v *Object) Unref() { + C.g_object_unref(C.gpointer(v.GObject)) +} + +// RefSink is a wrapper around g_object_ref_sink(). +func (v *Object) RefSink() { + C.g_object_ref_sink(C.gpointer(v.GObject)) +} + +// IsFloating is a wrapper around g_object_is_floating(). +func (v *Object) IsFloating() bool { + c := C.g_object_is_floating(C.gpointer(v.GObject)) + return gobool(c) +} + +// ForceFloating is a wrapper around g_object_force_floating(). +func (v *Object) ForceFloating() { + C.g_object_force_floating(v.GObject) +} + +// StopEmission is a wrapper around g_signal_stop_emission_by_name(). +func (v *Object) StopEmission(s string) { + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + C.g_signal_stop_emission_by_name((C.gpointer)(v.GObject), + (*C.gchar)(cstr)) +} + +// Set calls SetProperty. +func (v *Object) Set(name string, value interface{}) error { + return v.SetProperty(name, value) +} + +// GetPropertyType returns the Type of a property of the underlying GObject. +// If the property is missing it will return TYPE_INVALID and an error. +func (v *Object) GetPropertyType(name string) (Type, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + paramSpec := C.g_object_class_find_property(C._g_object_get_class(v.native()), (*C.gchar)(cstr)) + if paramSpec == nil { + return TYPE_INVALID, errors.New("couldn't find Property") + } + return Type(paramSpec.value_type), nil +} + +// GetProperty is a wrapper around g_object_get_property(). +func (v *Object) GetProperty(name string) (interface{}, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + t, err := v.GetPropertyType(name) + if err != nil { + return nil, err + } + + p, err := ValueInit(t) + if err != nil { + return nil, errors.New("unable to allocate value") + } + C.g_object_get_property(v.GObject, (*C.gchar)(cstr), p.native()) + return p.GoValue() +} + +// SetProperty is a wrapper around g_object_set_property(). +func (v *Object) SetProperty(name string, value interface{}) error { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + if _, ok := value.(Object); ok { + value = value.(Object).GObject + } + + p, err := GValue(value) + if err != nil { + return errors.New("Unable to perform type conversion") + } + C.g_object_set_property(v.GObject, (*C.gchar)(cstr), p.native()) + return nil +} + +/* + * GObject Signals + */ + +// Emit is a wrapper around g_signal_emitv() and emits the signal +// specified by the string s to an Object. Arguments to callback +// functions connected to this signal must be specified in args. Emit() +// returns an interface{} which must be type asserted as the Go +// equivalent type to the return value for native C callback. +// +// Note that this code is unsafe in that the types of values in args are +// not checked against whether they are suitable for the callback. +func (v *Object) Emit(s string, args ...interface{}) (interface{}, error) { + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + + // Create array of this instance and arguments + valv := C.alloc_gvalue_list(C.int(len(args)) + 1) + defer C.free(unsafe.Pointer(valv)) + + // Add args and valv + val, err := GValue(v) + if err != nil { + return nil, errors.New("Error converting Object to GValue: " + err.Error()) + } + C.val_list_insert(valv, C.int(0), val.native()) + for i := range args { + val, err := GValue(args[i]) + if err != nil { + return nil, fmt.Errorf("Error converting arg %d to GValue: %s", i, err.Error()) + } + C.val_list_insert(valv, C.int(i+1), val.native()) + } + + t := v.TypeFromInstance() + // TODO: use just the signal name + id := C.g_signal_lookup((*C.gchar)(cstr), C.GType(t)) + + ret, err := ValueAlloc() + if err != nil { + return nil, errors.New("Error creating Value for return value") + } + C.g_signal_emitv(valv, id, C.GQuark(0), ret.native()) + + return ret.GoValue() +} + +// HandlerBlock is a wrapper around g_signal_handler_block(). +func (v *Object) HandlerBlock(handle SignalHandle) { + C.g_signal_handler_block(C.gpointer(v.GObject), C.gulong(handle)) +} + +// HandlerUnblock is a wrapper around g_signal_handler_unblock(). +func (v *Object) HandlerUnblock(handle SignalHandle) { + C.g_signal_handler_unblock(C.gpointer(v.GObject), C.gulong(handle)) +} + +// HandlerDisconnect is a wrapper around g_signal_handler_disconnect(). +func (v *Object) HandlerDisconnect(handle SignalHandle) { + // Ensure that Gtk will not use the closure beforehand. + C.g_signal_handler_disconnect(C.gpointer(v.GObject), C.gulong(handle)) + closure.DisconnectSignal(uint(handle)) +} + +// Wrapper function for new objects with reference management. +func wrapObject(ptr unsafe.Pointer) *Object { + return Take(ptr) +} + +/* + * GInitiallyUnowned + */ + +// InitiallyUnowned is a representation of GLib's GInitiallyUnowned. +type InitiallyUnowned struct { + // This must be a pointer so copies of the ref-sinked object + // do not outlive the original object, causing an unref + // finalizer to prematurely run. + *Object +} + +// Native returns a pointer to the underlying GObject. This is implemented +// here rather than calling Native on the embedded Object to prevent a nil +// pointer dereference. +func (v *InitiallyUnowned) Native() uintptr { + if v == nil || v.Object == nil { + return uintptr(unsafe.Pointer(nil)) + } + return v.Object.Native() +} + +/* + * GValue + */ + +// Value is a representation of GLib's GValue. +// +// Don't allocate Values on the stack or heap manually as they may not +// be properly unset when going out of scope. Instead, use ValueAlloc(), +// which will set the runtime finalizer to unset the Value after it has +// left scope. +type Value struct { + GValue *C.GValue +} + +// native returns a pointer to the underlying GValue. +func (v *Value) native() *C.GValue { + return v.GValue +} + +// Native returns a pointer to the underlying GValue. +func (v *Value) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +// IsValue checks if value is a valid and initialized GValue structure. +func (v *Value) IsValue() bool { + return gobool(C._g_is_value(v.native())) +} + +// TypeName gets the type name of value. +func (v *Value) TypeName() string { + return C.GoString((*C.char)(C._g_value_type_name(v.native()))) +} + +// ValueAlloc allocates a Value and sets a runtime finalizer to call +// g_value_unset() on the underlying GValue after leaving scope. +// ValueAlloc() returns a non-nil error if the allocation failed. +func ValueAlloc() (*Value, error) { + c := C._g_value_alloc() + if c == nil { + return nil, nilPtrErr + } + + v := &Value{c} + + //An allocated GValue is not guaranteed to hold a value that can be unset + //We need to double check before unsetting, to prevent: + //`g_value_unset: assertion 'G_IS_VALUE (value)' failed` + runtime.SetFinalizer(v, func(f *Value) { + + if !f.IsValue() { + C.g_free(C.gpointer(f.native())) + return + } + + f.unset() + }) + + return v, nil +} + +// ValueInit is a wrapper around g_value_init() and allocates and +// initializes a new Value with the Type t. A runtime finalizer is set +// to call g_value_unset() on the underlying GValue after leaving scope. +// ValueInit() returns a non-nil error if the allocation failed. +func ValueInit(t Type) (*Value, error) { + c := C._g_value_init(C.GType(t)) + if c == nil { + return nil, nilPtrErr + } + + v := &Value{c} + + runtime.SetFinalizer(v, (*Value).unset) + return v, nil +} + +// ValueFromNative returns a type-asserted pointer to the Value. +func ValueFromNative(l unsafe.Pointer) *Value { + //TODO why it does not add finalizer to the value? + return &Value{(*C.GValue)(l)} +} + +func (v *Value) unset() { + C.g_value_unset(v.native()) +} + +// Type is a wrapper around the G_VALUE_HOLDS_GTYPE() macro and +// the g_value_get_gtype() function. GetType() returns TYPE_INVALID if v +// does not hold a Type, or otherwise returns the Type of v. +func (v *Value) Type() (actual Type, fundamental Type, err error) { + if !v.IsValue() { + return actual, fundamental, errors.New("invalid GValue") + } + cActual := C._g_value_type(v.native()) + cFundamental := C._g_value_fundamental(cActual) + return Type(cActual), Type(cFundamental), nil +} + +// GValue converts a Go type to a comparable GValue. GValue() +// returns a non-nil error if the conversion was unsuccessful. +func GValue(v interface{}) (gvalue *Value, err error) { + if v == nil { + val, err := ValueInit(TYPE_POINTER) + if err != nil { + return nil, err + } + val.SetPointer(uintptr(unsafe.Pointer(nil))) + return val, nil + } + + switch e := v.(type) { + case bool: + val, err := ValueInit(TYPE_BOOLEAN) + if err != nil { + return nil, err + } + val.SetBool(e) + return val, nil + + case int8: + val, err := ValueInit(TYPE_CHAR) + if err != nil { + return nil, err + } + val.SetSChar(e) + return val, nil + + case int64: + val, err := ValueInit(TYPE_INT64) + if err != nil { + return nil, err + } + val.SetInt64(e) + return val, nil + + case int: + val, err := ValueInit(TYPE_INT) + if err != nil { + return nil, err + } + val.SetInt(e) + return val, nil + + case uint8: + val, err := ValueInit(TYPE_UCHAR) + if err != nil { + return nil, err + } + val.SetUChar(e) + return val, nil + + case uint64: + val, err := ValueInit(TYPE_UINT64) + if err != nil { + return nil, err + } + val.SetUInt64(e) + return val, nil + + case uint: + val, err := ValueInit(TYPE_UINT) + if err != nil { + return nil, err + } + val.SetUInt(e) + return val, nil + + case float32: + val, err := ValueInit(TYPE_FLOAT) + if err != nil { + return nil, err + } + val.SetFloat(e) + return val, nil + + case float64: + val, err := ValueInit(TYPE_DOUBLE) + if err != nil { + return nil, err + } + val.SetDouble(e) + return val, nil + + case string: + val, err := ValueInit(TYPE_STRING) + if err != nil { + return nil, err + } + val.SetString(e) + return val, nil + + case *Object: + val, err := ValueInit(TYPE_OBJECT) + if err != nil { + return nil, err + } + val.SetInstance(uintptr(unsafe.Pointer(e.GObject))) + return val, nil + + default: + /* Try this since above doesn't catch constants under other types */ + rval := reflect.ValueOf(v) + switch rval.Kind() { + case reflect.Int8: + val, err := ValueInit(TYPE_CHAR) + if err != nil { + return nil, err + } + val.SetSChar(int8(rval.Int())) + return val, nil + + case reflect.Int16: + return nil, errors.New("Type not implemented") + + case reflect.Int32: + return nil, errors.New("Type not implemented") + + case reflect.Int64: + val, err := ValueInit(TYPE_INT64) + if err != nil { + return nil, err + } + val.SetInt64(rval.Int()) + return val, nil + + case reflect.Int: + val, err := ValueInit(TYPE_INT) + if err != nil { + return nil, err + } + val.SetInt(int(rval.Int())) + return val, nil + + case reflect.Uintptr, reflect.Ptr: + val, err := ValueInit(TYPE_POINTER) + if err != nil { + return nil, err + } + val.SetPointer(rval.Pointer()) + return val, nil + } + } + + return nil, errors.New("Type not implemented") +} + +// GValueMarshaler is a marshal function to convert a GValue into an +// appropriate Go type. The uintptr parameter is a *C.GValue. +type GValueMarshaler func(uintptr) (interface{}, error) + +// TypeMarshaler represents an actual type and it's associated marshaler. +type TypeMarshaler struct { + T Type + F GValueMarshaler +} + +// RegisterGValueMarshalers adds marshalers for several types to the +// internal marshalers map. Once registered, calling GoValue on any +// Value with a registered type will return the data returned by the +// marshaler. +func RegisterGValueMarshalers(tm []TypeMarshaler) { + gValueMarshalers.register(tm) +} + +type marshalMap map[Type]GValueMarshaler + +// gValueMarshalers is a map of Glib types to functions to marshal a +// GValue to a native Go type. +var gValueMarshalers = marshalMap{ + TYPE_INVALID: marshalInvalid, + TYPE_NONE: marshalNone, + TYPE_INTERFACE: marshalInterface, + TYPE_CHAR: marshalChar, + TYPE_UCHAR: marshalUchar, + TYPE_BOOLEAN: marshalBoolean, + TYPE_INT: marshalInt, + TYPE_LONG: marshalLong, + TYPE_ENUM: marshalEnum, + TYPE_INT64: marshalInt64, + TYPE_UINT: marshalUint, + TYPE_ULONG: marshalUlong, + TYPE_FLAGS: marshalFlags, + TYPE_UINT64: marshalUint64, + TYPE_FLOAT: marshalFloat, + TYPE_DOUBLE: marshalDouble, + TYPE_STRING: marshalString, + TYPE_POINTER: marshalPointer, + TYPE_BOXED: marshalBoxed, + TYPE_OBJECT: marshalObject, + TYPE_VARIANT: marshalVariant, +} + +func (m marshalMap) register(tm []TypeMarshaler) { + for i := range tm { + m[tm[i].T] = tm[i].F + } +} + +func (m marshalMap) lookup(v *Value) (GValueMarshaler, error) { + actual, fundamental, err := v.Type() + if err != nil { + return nil, err + } + + if f, ok := m[actual]; ok { + return f, nil + } + if f, ok := m[fundamental]; ok { + return f, nil + } + return nil, errors.New("missing marshaler for type") +} + +func (m marshalMap) lookupType(t Type) (GValueMarshaler, error) { + if f, ok := m[Type(t)]; ok { + return f, nil + } + return nil, errors.New("missing marshaler for type") +} + +func marshalInvalid(uintptr) (interface{}, error) { + return nil, errors.New("invalid type") +} + +func marshalNone(uintptr) (interface{}, error) { + return nil, nil +} + +func marshalInterface(uintptr) (interface{}, error) { + return nil, errors.New("interface conversion not yet implemented") +} + +func marshalChar(p uintptr) (interface{}, error) { + c := C.g_value_get_schar((*C.GValue)(unsafe.Pointer(p))) + return int8(c), nil +} + +func marshalUchar(p uintptr) (interface{}, error) { + c := C.g_value_get_uchar((*C.GValue)(unsafe.Pointer(p))) + return uint8(c), nil +} + +func marshalBoolean(p uintptr) (interface{}, error) { + c := C.g_value_get_boolean((*C.GValue)(unsafe.Pointer(p))) + return gobool(c), nil +} + +func marshalInt(p uintptr) (interface{}, error) { + c := C.g_value_get_int((*C.GValue)(unsafe.Pointer(p))) + return int(c), nil +} + +func marshalLong(p uintptr) (interface{}, error) { + c := C.g_value_get_long((*C.GValue)(unsafe.Pointer(p))) + return int(c), nil +} + +func marshalEnum(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return int(c), nil +} + +func marshalInt64(p uintptr) (interface{}, error) { + c := C.g_value_get_int64((*C.GValue)(unsafe.Pointer(p))) + return int64(c), nil +} + +func marshalUint(p uintptr) (interface{}, error) { + c := C.g_value_get_uint((*C.GValue)(unsafe.Pointer(p))) + return uint(c), nil +} + +func marshalUlong(p uintptr) (interface{}, error) { + c := C.g_value_get_ulong((*C.GValue)(unsafe.Pointer(p))) + return uint(c), nil +} + +func marshalFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_flags((*C.GValue)(unsafe.Pointer(p))) + return uint(c), nil +} + +func marshalUint64(p uintptr) (interface{}, error) { + c := C.g_value_get_uint64((*C.GValue)(unsafe.Pointer(p))) + return uint64(c), nil +} + +func marshalFloat(p uintptr) (interface{}, error) { + c := C.g_value_get_float((*C.GValue)(unsafe.Pointer(p))) + return float32(c), nil +} + +func marshalDouble(p uintptr) (interface{}, error) { + c := C.g_value_get_double((*C.GValue)(unsafe.Pointer(p))) + return float64(c), nil +} + +func marshalString(p uintptr) (interface{}, error) { + c := C.g_value_get_string((*C.GValue)(unsafe.Pointer(p))) + return C.GoString((*C.char)(c)), nil +} + +func marshalBoxed(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return uintptr(unsafe.Pointer(c)), nil +} + +func marshalPointer(p uintptr) (interface{}, error) { + c := C.g_value_get_pointer((*C.GValue)(unsafe.Pointer(p))) + return unsafe.Pointer(c), nil +} + +func marshalObject(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return newObject((*C.GObject)(c)), nil +} + +func marshalVariant(p uintptr) (interface{}, error) { + c := C.g_value_get_variant((*C.GValue)(unsafe.Pointer(p))) + return newVariant((*C.GVariant)(c)), nil +} + +// GoValue converts a Value to comparable Go type. GoValue() +// returns a non-nil error if the conversion was unsuccessful. The +// returned interface{} must be type asserted as the actual Go +// representation of the Value. +// +// This function is a wrapper around the many g_value_get_*() +// functions, depending on the type of the Value. +func (v *Value) GoValue() (interface{}, error) { + f, err := gValueMarshalers.lookup(v) + if err != nil { + return nil, err + } + + //No need to add finalizer because it is already done by ValueAlloc and ValueInit + rv, err := f(uintptr(unsafe.Pointer(v.native()))) + return rv, err +} + +// SetBool is a wrapper around g_value_set_boolean(). +func (v *Value) SetBool(val bool) { + C.g_value_set_boolean(v.native(), gbool(val)) +} + +// SetSChar is a wrapper around g_value_set_schar(). +func (v *Value) SetSChar(val int8) { + C.g_value_set_schar(v.native(), C.gint8(val)) +} + +// SetInt64 is a wrapper around g_value_set_int64(). +func (v *Value) SetInt64(val int64) { + C.g_value_set_int64(v.native(), C.gint64(val)) +} + +// SetInt is a wrapper around g_value_set_int(). +func (v *Value) SetInt(val int) { + C.g_value_set_int(v.native(), C.gint(val)) +} + +// SetUChar is a wrapper around g_value_set_uchar(). +func (v *Value) SetUChar(val uint8) { + C.g_value_set_uchar(v.native(), C.guchar(val)) +} + +// SetUInt64 is a wrapper around g_value_set_uint64(). +func (v *Value) SetUInt64(val uint64) { + C.g_value_set_uint64(v.native(), C.guint64(val)) +} + +// SetUInt is a wrapper around g_value_set_uint(). +func (v *Value) SetUInt(val uint) { + C.g_value_set_uint(v.native(), C.guint(val)) +} + +// SetFloat is a wrapper around g_value_set_float(). +func (v *Value) SetFloat(val float32) { + C.g_value_set_float(v.native(), C.gfloat(val)) +} + +// SetDouble is a wrapper around g_value_set_double(). +func (v *Value) SetDouble(val float64) { + C.g_value_set_double(v.native(), C.gdouble(val)) +} + +// SetString is a wrapper around g_value_set_string(). +func (v *Value) SetString(val string) { + cstr := C.CString(val) + defer C.free(unsafe.Pointer(cstr)) + C.g_value_set_string(v.native(), (*C.gchar)(cstr)) +} + +// SetInstance is a wrapper around g_value_set_instance(). +func (v *Value) SetInstance(instance uintptr) { + C.g_value_set_instance(v.native(), C.gpointer(instance)) +} + +// SetPointer is a wrapper around g_value_set_pointer(). +func (v *Value) SetPointer(p uintptr) { + C.g_value_set_pointer(v.native(), C.gpointer(p)) +} + +// GetPointer is a wrapper around g_value_get_pointer(). +func (v *Value) GetPointer() unsafe.Pointer { + return unsafe.Pointer(C.g_value_get_pointer(v.native())) +} + +// GetString is a wrapper around g_value_get_string(). GetString() +// returns a non-nil error if g_value_get_string() returned a NULL +// pointer to distinguish between returning a NULL pointer and returning +// an empty string. +func (v *Value) GetString() (string, error) { + c := C.g_value_get_string(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +type Signal struct { + name string + signalId C.guint +} + +func SignalNew(s string) (*Signal, error) { + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + + signalId := C._g_signal_new((*C.gchar)(cstr)) + + if signalId == 0 { + return nil, fmt.Errorf("invalid signal name: %s", s) + } + + return &Signal{ + name: s, + signalId: signalId, + }, nil +} + +func (s *Signal) String() string { + return s.name +} + +type Quark uint32 + +// GetPrgname is a wrapper around g_get_prgname(). +func GetPrgname() string { + c := C.g_get_prgname() + + return C.GoString((*C.char)(c)) +} + +// SetPrgname is a wrapper around g_set_prgname(). +func SetPrgname(name string) { + cstr := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr)) + + C.g_set_prgname(cstr) +} + +// GetApplicationName is a wrapper around g_get_application_name(). +func GetApplicationName() string { + c := C.g_get_application_name() + + return C.GoString((*C.char)(c)) +} + +// SetApplicationName is a wrapper around g_set_application_name(). +func SetApplicationName(name string) { + cstr := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr)) + + C.g_set_application_name(cstr) +} + +// InitI18n initializes the i18n subsystem. +func InitI18n(domain string, dir string) { + domainStr := C.CString(domain) + defer C.free(unsafe.Pointer(domainStr)) + + dirStr := C.CString(dir) + defer C.free(unsafe.Pointer(dirStr)) + + C.init_i18n(domainStr, dirStr) +} + +// Local localizes a string using gettext +func Local(input string) string { + cstr := C.CString(input) + defer C.free(unsafe.Pointer(cstr)) + + return C.GoString(C.localize(cstr)) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib.go.h b/vendor/github.com/gotk3/gotk3/glib/glib.go.h new file mode 100644 index 0000000..95440fb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib.go.h @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef __GLIB_GO_H__ +#define __GLIB_GO_H__ + +#include +#include +#include + +#include +#define G_SETTINGS_ENABLE_BACKEND +#include +#include +#include +#include +#include + +/* GObject Type Casting */ +static GObject *toGObject(void *p) { return (G_OBJECT(p)); } + +static GAction *toGAction(void *p) { return (G_ACTION(p)); } + +static GActionGroup *toGActionGroup(void *p) { return (G_ACTION_GROUP(p)); } + +static GActionMap *toGActionMap(void *p) { return (G_ACTION_MAP(p)); } + +static GAsyncResult *toGAsyncResult(void *p) { return (G_ASYNC_RESULT(p)); } + +static GSimpleAction *toGSimpleAction(void *p) { return (G_SIMPLE_ACTION(p)); } + +static GSimpleActionGroup *toGSimpleActionGroup(void *p) { + return (G_SIMPLE_ACTION_GROUP(p)); +} + +static GPropertyAction *toGPropertyAction(void *p) { + return (G_PROPERTY_ACTION(p)); +} + +static GMenuModel *toGMenuModel(void *p) { return (G_MENU_MODEL(p)); } + +static GMenu *toGMenu(void *p) { return (G_MENU(p)); } + +static GMenuItem *toGMenuItem(void *p) { return (G_MENU_ITEM(p)); } + +static GNotification *toGNotification(void *p) { return (G_NOTIFICATION(p)); } + +static GPermission *toGPermission(void *p) { return (G_PERMISSION(p)); } + +static GCancellable *toCancellable(void *p) { return (G_CANCELLABLE(p)); } + +static GIcon *toGIcon(void *p) { return (G_ICON(p)); } +static GFileIcon *toGFileIcon(void *p) { return (G_FILE_ICON(p)); } + +static GFile *toGFile(void *p) { return (G_FILE(p)); } + +static GApplication *toGApplication(void *p) { return (G_APPLICATION(p)); } + +static GSettings *toGSettings(void *p) { return (G_SETTINGS(p)); } + +static GSettingsBackend *toGSettingsBackend(void *p) { + return (G_SETTINGS_BACKEND(p)); +} + +static GBinding *toGBinding(void *p) { return (G_BINDING(p)); } + +static GType _g_type_from_instance(gpointer instance) { + return (G_TYPE_FROM_INSTANCE(instance)); +} + +/* Wrapper to avoid variable arg list */ +static void _g_object_set_one(gpointer object, const gchar *property_name, + void *val) { + g_object_set(object, property_name, *(gpointer **)val, NULL); +} + +static GValue *alloc_gvalue_list(int n) { + GValue *valv; + + valv = g_new0(GValue, n); + return (valv); +} + +static void val_list_insert(GValue *valv, int i, GValue *val) { + valv[i] = *val; +} + +/* + * GValue + */ + +static GValue *_g_value_alloc() { return (g_new0(GValue, 1)); } + +static GValue *_g_value_init(GType g_type) { + GValue *value; + + value = g_new0(GValue, 1); + return (g_value_init(value, g_type)); +} + +static gboolean _g_type_is_value(GType g_type) { + return (G_TYPE_IS_VALUE(g_type)); +} + +static gboolean _g_is_value(GValue *val) { return (G_IS_VALUE(val)); } + +static GType _g_value_type(GValue *val) { return (G_VALUE_TYPE(val)); } + +static const gchar *_g_value_type_name(GValue *val) { + return (G_VALUE_TYPE_NAME(val)); +} + +static GType _g_value_fundamental(GType type) { + return (G_TYPE_FUNDAMENTAL(type)); +} + +static GObjectClass *_g_object_get_class(GObject *object) { + return (G_OBJECT_GET_CLASS(object)); +} + +/* + * Closure support + */ + +extern void goMarshal(GClosure *, GValue *, guint, GValue *, gpointer, + GValue *); + +static inline GClosure *_g_closure_new() { + GClosure *closure; + + closure = g_closure_new_simple(sizeof(GClosure), NULL); + g_closure_set_marshal(closure, (GClosureMarshal)(goMarshal)); + return closure; +} + +extern void removeClosure(gpointer, GClosure *); + +static inline void _g_closure_add_finalize_notifier(GClosure *closure) { + g_closure_add_finalize_notifier(closure, NULL, + (GClosureNotify)(removeClosure)); +} + +static inline guint _g_signal_new(const gchar *name) { + return g_signal_new(name, G_TYPE_OBJECT, G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 0); +} + +static void init_i18n(const char *domain, const char *dir) { + setlocale(LC_ALL, ""); + bindtextdomain(domain, dir); + bind_textdomain_codeset(domain, "UTF-8"); + textdomain(domain); +} + +static const char *localize(const char *string) { return _(string); } + +static inline char **make_strings(int count) { + return (char **)malloc(sizeof(char *) * count); +} + +static inline void destroy_strings(char **strings) { free(strings); } + +static inline char *get_string(char **strings, int n) { return strings[n]; } + +static inline void set_string(char **strings, int n, char *str) { + strings[n] = str; +} + +static inline gchar **next_gcharptr(gchar **s) { return (s + 1); } + +extern gint goCompareDataFuncs(gconstpointer a, gconstpointer b, + gpointer user_data); + +#endif diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_export.go b/vendor/github.com/gotk3/gotk3/glib/glib_export.go new file mode 100644 index 0000000..4ced8cf --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_export.go @@ -0,0 +1,27 @@ +package glib + +// #cgo pkg-config: gio-2.0 +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/internal/callback" +) + +//export goAsyncReadyCallbacks +func goAsyncReadyCallbacks(sourceObject *C.GObject, res *C.GAsyncResult, userData C.gpointer) { + var source *Object + if sourceObject != nil { + source = wrapObject(unsafe.Pointer(sourceObject)) + } + + fn := callback.Get(uintptr(userData)).(AsyncReadyCallback) + fn(source, wrapAsyncResult(wrapObject(unsafe.Pointer(res)))) +} + +//export goCompareDataFuncs +func goCompareDataFuncs(a, b C.gconstpointer, userData C.gpointer) C.gint { + fn := callback.Get(uintptr(userData)).(CompareDataFunc) + return C.gint(fn(uintptr(a), uintptr(b))) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_extension.go b/vendor/github.com/gotk3/gotk3/glib/glib_extension.go new file mode 100644 index 0000000..f96286a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_extension.go @@ -0,0 +1,18 @@ +//glib_extension contains definitions and functions to interface between glib/gtk/gio and go universe + +package glib + +import ( + "reflect" +) + +// Should be implemented by any class which need special conversion like +// gtk.Application -> gio.Application +type IGlibConvert interface { + // If conversion can't be done, the function has to panic with a message that it can't convert to type + Convert(reflect.Type) reflect.Value +} + +var ( + IGlibConvertType reflect.Type +) diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_since_2_42.go b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_42.go new file mode 100644 index 0000000..45b70e7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_42.go @@ -0,0 +1,50 @@ +// Same copyright and license as the rest of the files in this project + +// +build !glib_2_40 + +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +/* + * Notification + */ + +// NotificationPriority is a representation of GLib's GNotificationPriority. +type NotificationPriority int + +const ( + NOTIFICATION_PRIORITY_NORMAL NotificationPriority = C.G_NOTIFICATION_PRIORITY_NORMAL + NOTIFICATION_PRIORITY_LOW NotificationPriority = C.G_NOTIFICATION_PRIORITY_LOW + NOTIFICATION_PRIORITY_HIGH NotificationPriority = C.G_NOTIFICATION_PRIORITY_HIGH + NOTIFICATION_PRIORITY_URGENT NotificationPriority = C.G_NOTIFICATION_PRIORITY_URGENT +) + +// SetPriority is a wrapper around g_notification_set_priority(). +func (v *Notification) SetPriority(prio NotificationPriority) { + C.g_notification_set_priority(v.native(), C.GNotificationPriority(prio)) +} + +/* + * Application + */ + +// GetResourceBasePath is a wrapper around g_application_get_resource_base_path(). +func (v *Application) GetResourceBasePath() string { + c := C.g_application_get_resource_base_path(v.native()) + + return C.GoString((*C.char)(c)) +} + +// SetResourceBasePath is a wrapper around g_application_set_resource_base_path(). +func (v *Application) SetResourceBasePath(bp string) { + cstr1 := (*C.gchar)(C.CString(bp)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_application_set_resource_base_path(v.native(), cstr1) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_since_2_44.go b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_44.go new file mode 100644 index 0000000..09ac77f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_44.go @@ -0,0 +1,30 @@ +// Same copyright and license as the rest of the files in this project + +// +build !glib_2_40,!glib_2_42 + +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +// #include "glib_since_2_44.go.h" +import "C" + +/* + * Application + */ + +// GetIsBusy is a wrapper around g_application_get_is_busy(). +func (v *Application) GetIsBusy() bool { + return gobool(C.g_application_get_is_busy(v.native())) +} + +/* + * SimpleAction + */ + +// SetStateHint is a wrapper around g_simple_action_set_state_hint +func (v *SimpleAction) SetStateHint(stateHint *Variant) { + C.g_simple_action_set_state_hint(v.native(), stateHint.native()) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_since_2_44.go.h b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_44.go.h new file mode 100644 index 0000000..344f29b --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_44.go.h @@ -0,0 +1,16 @@ +// Same copyright and license as the rest of the files in this project + +#include + +#include +#include + +static GListModel *toGListModel(void *p) { return (G_LIST_MODEL(p)); } + +static GListStore *toGListStore(void *p) { return (G_LIST_STORE(p)); } + +static inline void _g_list_store_insert_sorted(GListStore *model, gpointer item, + gpointer user_data) { + g_list_store_insert_sorted(model, item, + (GCompareDataFunc)(goCompareDataFuncs), user_data); +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_since_2_46.go b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_46.go new file mode 100644 index 0000000..18aaf97 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_46.go @@ -0,0 +1,23 @@ +// Same copyright and license as the rest of the files in this project + +// +build !glib_2_40,!glib_2_42,!glib_2_44 + +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +// #include "glib_since_2_44.go.h" +// #include "glib_since_2_46.go.h" +import "C" +import "github.com/gotk3/gotk3/internal/callback" + +/* + * GListStore + */ + +// Sort is a wrapper around g_list_store_sort(). +func (v *ListStore) Sort(compareFunc CompareDataFunc) { + C._g_list_store_sort(v.native(), C.gpointer(callback.Assign(compareFunc))) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_since_2_46.go.h b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_46.go.h new file mode 100644 index 0000000..e4558b4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_46.go.h @@ -0,0 +1,10 @@ +// Same copyright and license as the rest of the files in this project + +#include + +#include +#include + +static inline void _g_list_store_sort(GListStore *model, gpointer user_data) { + g_list_store_sort(model, (GCompareDataFunc)(goCompareDataFuncs), user_data); +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_since_2_64.go b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_64.go new file mode 100644 index 0000000..4be21c1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_since_2_64.go @@ -0,0 +1,20 @@ +// Same copyright and license as the rest of the files in this project + +// +build !glib_2_40,!glib_2_42,!glib_2_44,!glib_2_46,!glib_2_48,!glib_2_50,!glib_2_52,!glib_2_54,!glib_2_56,!glib_2_58,!glib_2_60,!glib_2_62 + +package glib + +// // #include +// // #include +// // #include +// // #include "glib.go.h" +// // #include "glib_since_2_44.go.h" +// import "C" + +/* + * GListStore + */ + +// TODO +// g_list_store_find +// g_list_store_find_with_equal_func diff --git a/vendor/github.com/gotk3/gotk3/glib/glib_test.go b/vendor/github.com/gotk3/gotk3/glib/glib_test.go new file mode 100644 index 0000000..a9c0cc3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glib_test.go @@ -0,0 +1,133 @@ +package glib_test + +import ( + "runtime" + "testing" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gtk" +) + +func init() { + gtk.Init(nil) +} + +// TestConnectNotifySignal ensures that property notification signals (those +// whose name begins with "notify::") are queried by the name "notify" (with the +// "::" and the property name omitted). This is because the signal is "notify" +// and the characters after the "::" are not recognized by the signal system. +// +// See +// https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#GObject-notify +// for background, and +// https://developer.gnome.org/gobject/stable/gobject-Signals.html#g-signal-new +// for the specification of valid signal names. +func TestConnectNotifySignal(t *testing.T) { + runtime.LockOSThread() + + // Create any GObject that has defined properties. + spacing := 0 + box, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, spacing) + + // Connect to a "notify::" signal to listen on property changes. + box.Connect("notify::spacing", func() { + gtk.MainQuit() + }) + + glib.IdleAdd(func(s string) bool { + t.Log(s) + spacing++ + box.SetSpacing(spacing) + return true + }, "IdleAdd executed") + + gtk.Main() +} + +/*At this moment Visionect specific*/ +func TestTimeoutAdd(t *testing.T) { + runtime.LockOSThread() + + glib.TimeoutAdd(2500, func(s string) bool { + t.Log(s) + gtk.MainQuit() + return false + }, "TimeoutAdd executed") + + gtk.Main() +} + +// TestTypeNames tests both glib.TypeFromName and glib.Type.Name +func TestTypeNames(t *testing.T) { + tp := glib.TypeFromName("GtkWindow") + name := tp.Name() + + if name != "GtkWindow" { + t.Error("Expected GtkWindow, got", name) + } +} + +func TestTypeIsA(t *testing.T) { + tp := glib.TypeFromName("GtkApplicationWindow") + tpParent := glib.TypeFromName("GtkWindow") + + isA := tp.IsA(tpParent) + + if !isA { + t.Error("Expected true, GtkApplicationWindow is a GtkWindow") + } +} + +func TestTypeNextBase(t *testing.T) { + tpLeaf := glib.TypeFromName("GtkWindow") + tpParent := glib.TypeFromName("GtkContainer") + + tpNextBase := glib.TypeNextBase(tpLeaf, tpParent) + name := tpNextBase.Name() + + if name != "GtkBin" { + t.Error("Expected GtkBin, got", name) + } +} + +func TestValueString_NonEmpty(t *testing.T) { + + expected := "test" + + value, err := glib.GValue(expected) + if err != nil { + t.Error("acquiring gvalue failed:", err.Error()) + return + } + + actual, err := value.GetString() + if err != nil { + t.Error(err.Error()) + return + } + + if actual != expected { + t.Errorf("Expected %q, got %q", expected, actual) + } +} + +func TestValueString_Empty(t *testing.T) { + + expected := "" + + value, err := glib.GValue(expected) + if err != nil { + t.Error("acquiring gvalue failed:", err.Error()) + return + } + + actual, err := value.GetString() + if err != nil { + t.Error(err.Error()) + return + } + + if actual != expected { + t.Errorf("Expected %q, got %q", expected, actual) + } +} diff --git a/vendor/github.com/gotk3/gotk3/glib/glistmodel.go b/vendor/github.com/gotk3/gotk3/glib/glistmodel.go new file mode 100644 index 0000000..219ea7c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/glistmodel.go @@ -0,0 +1,164 @@ +// Same copyright and license as the rest of the files in this project + +// +build !glib_2_40,!glib_2_42 + +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +// #include "glib_since_2_44.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/internal/callback" +) + +/* + * GListModel + */ + +// IListModel is an interface representation of ListModel, +// used to avoid duplication when embedding the type in a wrapper of another GObject-based type. +type IListModel interface { + toGListModel() *C.GListModel +} + +// ListModel is a representation of GIO's GListModel. +type ListModel struct { + *Object +} + +func (v *ListModel) toGListModel() *C.GListModel { + if v == nil { + return nil + } + return v.native() +} + +// native returns a pointer to the underlying GListModel. +func (v *ListModel) native() *C.GListModel { + if v == nil || v.GObject == nil { + return nil + } + return C.toGListModel(unsafe.Pointer(v.GObject)) +} + +// Native returns a pointer to the underlying GListModel. +func (v *ListModel) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalListModel(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapListModel(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapListModel(obj *Object) *ListModel { + return &ListModel{obj} +} + +// GetItemType is a wrapper around g_list_model_get_item_type(). +func (v *ListModel) GetItemType() Type { + return Type(C.g_list_model_get_item_type(v.native())) +} + +// GetNItems is a wrapper around g_list_model_get_n_items(). +func (v *ListModel) GetNItems() uint { + return uint(C.g_list_model_get_n_items(v.native())) +} + +// GetItem is a wrapper around g_list_model_get_item(). +func (v *ListModel) GetItem(position uint) uintptr { + c := C.g_list_model_get_item(v.native(), C.guint(position)) + return uintptr(unsafe.Pointer(c)) +} + +// GetObject is a wrapper around g_list_model_get_object(). +func (v *ListModel) GetObject(position uint) *Object { + c := C.g_list_model_get_object(v.native(), C.guint(position)) + return wrapObject(unsafe.Pointer(c)) +} + +// ItemsChanged is a wrapper around g_list_model_items_changed(). +func (v *ListModel) ItemsChanged(position, removed, added uint) { + C.g_list_model_items_changed(v.native(), C.guint(position), C.guint(removed), C.guint(added)) +} + +/* + * GListStore + */ + +// ListStore is a representation of GListStore +type ListStore struct { + ListModel +} + +func (v *ListStore) native() *C.GListStore { + if v == nil || v.GObject == nil { + return nil + } + return C.toGListStore(unsafe.Pointer(v.GObject)) +} + +func (v *ListStore) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalListStore(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapListStore(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapListStore(obj *Object) *ListStore { + return &ListStore{ListModel{obj}} +} + +// ListStoreNew is a wrapper around g_list_store_new(). +func ListStoreNew(itemType Type) *ListStore { + c := C.g_list_store_new(C.GType(itemType)) + if c == nil { + return nil + } + return wrapListStore(wrapObject(unsafe.Pointer(c))) +} + +// Insert is a wrapper around g_list_store_insert(). +func (v *ListStore) Insert(position uint, item interface{}) { + gItem := ToGObject(unsafe.Pointer(&item)) + C.g_list_store_insert(v.native(), C.guint(position), C.gpointer(gItem)) +} + +// InsertSorted is a wrapper around g_list_store_insert_sorted(). +func (v *ListStore) InsertSorted(item interface{}, compareFunc CompareDataFunc) { + gItem := ToGObject(unsafe.Pointer(&item)) + C._g_list_store_insert_sorted(v.native(), C.gpointer(gItem), C.gpointer(callback.Assign(compareFunc))) +} + +// Append is a wrapper around g_list_store_append(). +func (v *ListStore) Append(item interface{}) { + gItem := ToGObject(unsafe.Pointer(&item)) + C.g_list_store_append(v.native(), C.gpointer(gItem)) +} + +// Remove is a wrapper around g_list_store_remove(). +func (v *ListStore) Remove(position uint) { + C.g_list_store_remove(v.native(), C.guint(position)) +} + +// Splice is a wrapper around g_list_store_splice(). +func (v *ListStore) Splice(position uint, removalLength uint, additions []interface{}) { + + additionsLength := len(additions) + gAdditions := make([]*C.GObject, additionsLength) + for i, add := range additions { + gAdditions[i] = ToGObject(unsafe.Pointer(&add)) + } + gAdditions = append(gAdditions, nil) + + additionsPtr := C.gpointer(gAdditions[0]) + + C.g_list_store_splice(v.native(), C.guint(position), C.guint(removalLength), &additionsPtr, C.guint(additionsLength)) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gmain_context.go b/vendor/github.com/gotk3/gotk3/glib/gmain_context.go new file mode 100644 index 0000000..2fed553 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gmain_context.go @@ -0,0 +1,65 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" + +type MainContext C.GMainContext + +// native returns a pointer to the underlying GMainContext. +func (v *MainContext) native() *C.GMainContext { + if v == nil { + return nil + } + return (*C.GMainContext)(v) +} + +// MainContextDefault is a wrapper around g_main_context_default(). +func MainContextDefault() *MainContext { + c := C.g_main_context_default() + if c == nil { + return nil + } + return (*MainContext)(c) +} + +// Iteration is a wrapper around g_main_context_iteration() +func (v *MainContext) Iteration(mayBlock bool) bool { + return gobool(C.g_main_context_iteration(v.native(), gbool(mayBlock))) +} + +// Pending is a wrapper around g_main_context_pending() +func (v *MainContext) Pending() bool { + return gobool(C.g_main_context_pending(v.native())) +} + +// MainDepth is a wrapper around g_main_depth(). +func MainDepth() int { + return int(C.g_main_depth()) +} + +// FindSourceById is a wrapper around g_main_context_find_source_by_id() +func (v *MainContext) FindSourceById(hdlSrc SourceHandle) *Source { + c := C.g_main_context_find_source_by_id(v.native(), C.guint(hdlSrc)) + if c == nil { + return nil + } + return (*Source)(c) +} + +// Acquire is a wrapper around g_main_context_acquire(). +func (v *MainContext) Acquire() { + C.g_main_context_acquire(v.native()) +} + +// Release is a wrapper around g_main_context_release(). +func (v *MainContext) Release() { + C.g_main_context_release(v.native()) +} + +// IsOwner is a wrapper around g_main_context_is_owner(). +func (v *MainContext) IsOwner() bool { + return gobool(C.g_main_context_is_owner(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gpermission.go b/vendor/github.com/gotk3/gotk3/glib/gpermission.go new file mode 100644 index 0000000..f6f3f92 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gpermission.go @@ -0,0 +1,126 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +// #include "gpermission.go.h" +import "C" +import ( + "errors" + "unsafe" + + "github.com/gotk3/gotk3/internal/callback" +) + +// Permission is a representation of GIO's GPermission. +type Permission struct { + *Object +} + +func (v *Permission) native() *C.GPermission { + if v == nil || v.GObject == nil { + return nil + } + return C.toGPermission(unsafe.Pointer(v.GObject)) +} + +// Native returns a uintptr to the underlying C.GPermission. +func (v *Permission) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalPermission(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapPermission(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapPermission(obj *Object) *Permission { + return &Permission{obj} +} + +// WrapPermission wraps given unsafe pointer into Permission. +func WrapPermission(ptr unsafe.Pointer) *Permission { + return wrapPermission(wrapObject(ptr)) +} + +// GetAllowed is a wrapper around g_permission_get_allowed(). +func (v *Permission) GetAllowed() bool { + c := C.g_permission_get_allowed(v.native()) + return gobool(c) +} + +// GetCanAcquire is a wrapper around g_permission_get_can_acquire(). +func (v *Permission) GetCanAcquire() bool { + c := C.g_permission_get_can_acquire(v.native()) + return gobool(c) +} + +// GetCanRelease is a wrapper around g_permission_get_can_release(). +func (v *Permission) GetCanRelease() bool { + c := C.g_permission_get_can_release(v.native()) + return gobool(c) +} + +// Acquire is a wrapper around g_permission_acquire(). +func (v *Permission) Acquire(cancellable *Cancellable) error { + var err *C.GError + c := C.g_permission_acquire(v.native(), cancellable.native(), &err) + acquired := gobool(c) + if !acquired { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// AcquireAsync is a wrapper around g_permission_acquire_async(). +func (v *Permission) AcquireAsync(cancellable *Cancellable, fn AsyncReadyCallback) { + C._g_permission_acquire_async(v.native(), cancellable.native(), C.gpointer(callback.Assign(fn))) +} + +// AcquireFinish is a wrapper around g_permission_acquire_finish(). +func (v *Permission) AcquireFinish(result *AsyncResult) error { + var err *C.GError + c := C.g_permission_acquire_finish(v.native(), result.native(), &err) + acquired := gobool(c) + if !acquired { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// Release is a wrapper around g_permission_release(). +func (v *Permission) Release(cancellable *Cancellable) error { + var err *C.GError + c := C.g_permission_release(v.native(), cancellable.native(), &err) + released := gobool(c) + if !released { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// ReleaseAsync is a wrapper around g_permission_release_async(). +func (v *Permission) ReleaseAsync(cancellable *Cancellable, fn AsyncReadyCallback) { + C._g_permission_release_async(v.native(), cancellable.native(), C.gpointer(callback.Assign(fn))) +} + +// ReleaseFinish is a wrapper around g_permission_release_finish(). +func (v *Permission) ReleaseFinish(result *AsyncResult) error { + var err *C.GError + c := C.g_permission_release_finish(v.native(), result.native(), &err) + released := gobool(c) + if !released { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// ImplUpdate is a wrapper around g_permission_impl_update(). +func (v *Permission) ImplUpdate(allowed, canAcquire, canRelease bool) { + C.g_permission_impl_update(v.native(), gbool(allowed), gbool(canAcquire), gbool(canRelease)) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gpermission.go.h b/vendor/github.com/gotk3/gotk3/glib/gpermission.go.h new file mode 100644 index 0000000..5c0f05e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gpermission.go.h @@ -0,0 +1,24 @@ +// Same copyright and license as the rest of the files in this project + +/* + * GAsyncReadyCallback + */ + +extern void goAsyncReadyCallbacks(GObject *source_object, GAsyncResult *res, + gpointer user_data); + +static inline void _g_permission_acquire_async(GPermission *permission, + GCancellable *cancellable, + gpointer user_data) { + g_permission_acquire_async(permission, cancellable, + (GAsyncReadyCallback)(goAsyncReadyCallbacks), + user_data); +} + +static inline void _g_permission_release_async(GPermission *permission, + GCancellable *cancellable, + gpointer user_data) { + g_permission_release_async(permission, cancellable, + (GAsyncReadyCallback)(goAsyncReadyCallbacks), + user_data); +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gsimpleactiongroup.go b/vendor/github.com/gotk3/gotk3/glib/gsimpleactiongroup.go new file mode 100644 index 0000000..f96936e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gsimpleactiongroup.go @@ -0,0 +1,58 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "unsafe" +) + +// SimpleActionGroup is a representation of glib's GSimpleActionGroup +type SimpleActionGroup struct { + *Object + + // Interfaces + IActionMap + IActionGroup +} + +// deprecated since 2.38: +// g_simple_action_group_lookup() +// g_simple_action_group_insert() +// g_simple_action_group_remove() +// g_simple_action_group_add_entries() +// -> See implementations in ActionMap + +// native() returns a pointer to the underlying GSimpleActionGroup. +func (v *SimpleActionGroup) native() *C.GSimpleActionGroup { + if v == nil || v.GObject == nil { + return nil + } + return C.toGSimpleActionGroup(unsafe.Pointer(v.GObject)) +} + +func (v *SimpleActionGroup) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSimpleActionGroup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSimpleActionGroup(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapSimpleActionGroup(obj *Object) *SimpleActionGroup { + am := wrapActionMap(obj) + ag := wrapActionGroup(obj) + return &SimpleActionGroup{obj, am, ag} +} + +// SimpleActionGroupNew is a wrapper around g_simple_action_group_new +func SimpleActionGroupNew() *SimpleActionGroup { + c := C.g_simple_action_group_new() + if c == nil { + return nil + } + return wrapSimpleActionGroup(wrapObject(unsafe.Pointer(c))) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gsimpleactiongroup_test.go b/vendor/github.com/gotk3/gotk3/glib/gsimpleactiongroup_test.go new file mode 100644 index 0000000..0982bc6 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gsimpleactiongroup_test.go @@ -0,0 +1,70 @@ +package glib + +import ( + "testing" +) + +func TestSimpleActionGroupNew(t *testing.T) { + sag := SimpleActionGroupNew() + if sag == nil { + t.Error("SimpleActionGroupNew returned nil") + } + + if sag.IActionGroup == nil { + t.Error("Embedded IActionGroup is nil") + } + if sag.IActionMap == nil { + t.Error("Embedded IActionGroup is nil") + } +} + +func TestSimpleActionGroup_AddAction_RemoveAction_HasAction(t *testing.T) { + sag := SimpleActionGroupNew() + if sag == nil { + t.Error("SimpleActionGroup returned nil") + } + + // Check before: empty + hasAction := sag.HasAction("nope") + if hasAction { + t.Error("Action group contained unexpected action 'nope'") + } + hasAction = sag.HasAction("yepp") + if hasAction { + t.Error("Action group contained unexpected action 'yepp'") + } + + // Add a new action + act := SimpleActionNew("yepp", nil) + if act == nil { + t.Error("SimpleActionNew returned nil") + } + sag.AddAction(act) + + // Check that it exists + hasAction = sag.HasAction("nope") + if hasAction { + t.Error("Action group contained unexpected action 'nope'") + } + hasAction = sag.HasAction("yepp") + if !hasAction { + t.Error("Action group did not contain action 'yepp' after adding it") + } + + // Remove the action again + sag.RemoveAction("yepp") + + // Check that it was removed + hasAction = sag.HasAction("nope") + if hasAction { + t.Error("Action group contained unexpected action 'nope'") + } + hasAction = sag.HasAction("yepp") + if hasAction { + t.Error("Action group contained unexpected action 'yepp'") + } + + // NoFail check: removing a non-existing action + sag.RemoveAction("yepp") + sag.RemoveAction("nope") +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gsource.go b/vendor/github.com/gotk3/gotk3/glib/gsource.go new file mode 100644 index 0000000..d3518ec --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gsource.go @@ -0,0 +1,31 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" + +type Source C.GSource + +// native returns a pointer to the underlying GSource. +func (v *Source) native() *C.GSource { + if v == nil { + return nil + } + return (*C.GSource)(v) +} + +func wrapSource(sourcePtr *C.GSource) *Source { + source := Source(*sourcePtr) + return &source +} + +// MainCurrentSource is a wrapper around g_main_current_source(). +func MainCurrentSource() *Source { + c := C.g_main_current_source() + if c == nil { + return nil + } + return (*Source)(c) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariant.go b/vendor/github.com/gotk3/gotk3/glib/gvariant.go new file mode 100644 index 0000000..dacbcae --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariant.go @@ -0,0 +1,451 @@ +//GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +package glib + +// #include "gvariant.go.h" +// #include "glib.go.h" +import "C" + +import ( + "errors" + "fmt" + "runtime" + "unsafe" +) + +/* + * GVariant + */ + +// IVariant is an interface type implemented by Variant and all types which embed +// an Variant. It is meant to be used as a type for function arguments which +// require GVariants or any subclasses thereof. +type IVariant interface { + ToGVariant() *C.GVariant + ToVariant() *Variant +} + +// A Variant is a representation of GLib's GVariant. +type Variant struct { + GVariant *C.GVariant +} + +// ToGVariant exposes the underlying *C.GVariant type for this Variant, +// necessary to implement IVariant. +func (v *Variant) ToGVariant() *C.GVariant { + if v == nil { + return nil + } + return v.native() +} + +// ToVariant returns this Variant, necessary to implement IVariant. +func (v *Variant) ToVariant() *Variant { + return v +} + +// native returns a pointer to the underlying GVariant. +func (v *Variant) native() *C.GVariant { + if v == nil || v.GVariant == nil { + return nil + } + return v.GVariant +} + +// Native returns a pointer to the underlying GVariant. +func (v *Variant) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +// newVariant wraps a native GVariant. +// Does NOT handle reference counting! Use takeVariant() to take ownership of values. +func newVariant(p *C.GVariant) *Variant { + if p == nil { + return nil + } + return &Variant{GVariant: p} +} + +// TakeVariant wraps a unsafe.Pointer as a glib.Variant, taking ownership of it. +// This function is exported for visibility in other gotk3 packages and +// is not meant to be used by applications. +func TakeVariant(ptr unsafe.Pointer) *Variant { + return takeVariant(C.toGVariant(ptr)) +} + +// takeVariant wraps a native GVariant, +// takes ownership and sets up a finalizer to free the instance during GC. +func takeVariant(p *C.GVariant) *Variant { + if p == nil { + return nil + } + obj := &Variant{GVariant: p} + + if obj.IsFloating() { + obj.RefSink() + } else { + obj.Ref() + } + + runtime.SetFinalizer(obj, (*Variant).Unref) + return obj +} + +// IsFloating returns true if the variant has a floating reference count. +// Reference counting is usually handled in the gotk layer, +// most applications should not call this. +func (v *Variant) IsFloating() bool { + return gobool(C.g_variant_is_floating(v.native())) +} + +// Ref is a wrapper around g_variant_ref. +// Reference counting is usually handled in the gotk layer, +// most applications should not need to call this. +func (v *Variant) Ref() { + C.g_variant_ref(v.native()) +} + +// RefSink is a wrapper around g_variant_ref_sink. +// Reference counting is usually handled in the gotk layer, +// most applications should not need to call this. +func (v *Variant) RefSink() { + C.g_variant_ref_sink(v.native()) +} + +// TakeRef is a wrapper around g_variant_take_ref. +// Reference counting is usually handled in the gotk layer, +// most applications should not need to call this. +func (v *Variant) TakeRef() { + C.g_variant_take_ref(v.native()) +} + +// Unref is a wrapper around g_variant_unref. +// Reference counting is usually handled in the gotk layer, +// most applications should not need to call this. +func (v *Variant) Unref() { + C.g_variant_unref(v.native()) +} + +// VariantFromInt16 is a wrapper around g_variant_new_int16 +func VariantFromInt16(value int16) *Variant { + return takeVariant(C.g_variant_new_int16(C.gint16(value))) +} + +// VariantFromInt32 is a wrapper around g_variant_new_int32 +func VariantFromInt32(value int32) *Variant { + return takeVariant(C.g_variant_new_int32(C.gint32(value))) +} + +// VariantFromInt64 is a wrapper around g_variant_new_int64 +func VariantFromInt64(value int64) *Variant { + return takeVariant(C.g_variant_new_int64(C.gint64(value))) +} + +// VariantFromByte is a wrapper around g_variant_new_byte +func VariantFromByte(value uint8) *Variant { + return takeVariant(C.g_variant_new_byte(C.guint8(value))) +} + +// VariantFromUint16 is a wrapper around g_variant_new_uint16 +func VariantFromUint16(value uint16) *Variant { + return takeVariant(C.g_variant_new_uint16(C.guint16(value))) +} + +// VariantFromUint32 is a wrapper around g_variant_new_uint32 +func VariantFromUint32(value uint32) *Variant { + return takeVariant(C.g_variant_new_uint32(C.guint32(value))) +} + +// VariantFromUint64 is a wrapper around g_variant_new_uint64 +func VariantFromUint64(value uint64) *Variant { + return takeVariant(C.g_variant_new_uint64(C.guint64(value))) +} + +// VariantFromBoolean is a wrapper around g_variant_new_boolean +func VariantFromBoolean(value bool) *Variant { + return takeVariant(C.g_variant_new_boolean(gbool(value))) +} + +// VariantFromFloat64 is a wrapper around g_variant_new_double(). +// I chose to respect the Golang float64 nomenclature instead +// of 'double' 'C'. Corresponding VariantType is: 'VARIANT_TYPE_DOUBLE' +func VariantFromFloat64(value float64) *Variant { + return takeVariant(C.g_variant_new_double(C.gdouble(value))) +} + +// VariantFromString is a wrapper around g_variant_new_string/g_variant_new_take_string. +// Uses g_variant_new_take_string to reduce memory allocations if possible. +func VariantFromString(value string) *Variant { + cstr := (*C.gchar)(C.CString(value)) + // g_variant_new_take_string takes owhership of the cstring and will call free() on it when done. + // Do NOT free this string in this function! + return takeVariant(C.g_variant_new_take_string(cstr)) +} + +// VariantFromVariant is a wrapper around g_variant_new_variant. +func VariantFromVariant(value *Variant) *Variant { + return takeVariant(C.g_variant_new_variant(value.native())) +} + +// TypeString returns the g variant type string for this variant. +func (v *Variant) TypeString() string { + // the string returned from this belongs to GVariant and must not be freed. + return C.GoString((*C.char)(C.g_variant_get_type_string(v.native()))) +} + +// IsContainer returns true if the variant is a container and false otherwise. +func (v *Variant) IsContainer() bool { + return gobool(C.g_variant_is_container(v.native())) +} + +// GetBoolean returns the bool value of this variant. +func (v *Variant) GetBoolean() bool { + return gobool(C.g_variant_get_boolean(v.native())) +} + +// GetDouble is a wrapper around g_variant_get_double() +func (v *Variant) GetDouble() float64 { + return float64(C.g_variant_get_double(v.native())) +} + +// GetString is a wrapper around g_variant_get_string. +// It returns the string value of the variant. +func (v *Variant) GetString() string { + + // The string value remains valid as long as the GVariant exists, do NOT free the cstring in this function. + var len C.gsize + gc := C.g_variant_get_string(v.native(), &len) + + // This is opposed to g_variant_dup_string, which copies the string. + // g_variant_dup_string is not implemented, + // as we copy the string value anyways when converting to a go string. + + return C.GoStringN((*C.char)(gc), (C.int)(len)) +} + +// GetVariant is a wrapper around g_variant_get_variant. +// It unboxes a nested GVariant. +func (v *Variant) GetVariant() *Variant { + c := C.g_variant_get_variant(v.native()) + if c == nil { + return nil + } + // The returned value is returned with full ownership transfer, + // only Unref(), don't Ref(). + obj := newVariant(c) + runtime.SetFinalizer(obj, (*Variant).Unref) + return obj +} + +// GetStrv returns a slice of strings from this variant. It wraps +// g_variant_get_strv, but returns copies of the strings instead. +func (v *Variant) GetStrv() []string { + gstrv := C.g_variant_get_strv(v.native(), nil) + // we do not own the memory for these strings, so we must not use strfreev + // but we must free the actual pointer we receive (transfer container). + // We don't implement g_variant_dup_strv which copies the strings, + // as we need to copy anyways when converting to go strings. + c := gstrv + defer C.g_free(C.gpointer(gstrv)) + var strs []string + + for *c != nil { + strs = append(strs, C.GoString((*C.char)(*c))) + c = C.next_gcharptr(c) + } + return strs +} + +// GetObjv returns a slice of object paths from this variant. It wraps +// g_variant_get_objv, but returns copies of the strings instead. +func (v *Variant) GetObjv() []string { + gstrv := C.g_variant_get_objv(v.native(), nil) + // we do not own the memory for these strings, so we must not use strfreev + // but we must free the actual pointer we receive (transfer container). + // We don't implement g_variant_dup_objv which copies the strings, + // as we need to copy anyways when converting to go strings. + c := gstrv + defer C.g_free(C.gpointer(gstrv)) + var strs []string + + for *c != nil { + strs = append(strs, C.GoString((*C.char)(*c))) + c = C.next_gcharptr(c) + } + return strs +} + +// GetInt returns the int64 value of the variant if it is an integer type, and +// an error otherwise. It wraps variouns `g_variant_get_*` functions dealing +// with integers of different sizes. +func (v *Variant) GetInt() (int64, error) { + t := v.TypeString() + var i int64 + switch t { + case "n": + i = int64(C.g_variant_get_int16(v.native())) + case "i": + i = int64(C.g_variant_get_int32(v.native())) + case "x": + i = int64(C.g_variant_get_int64(v.native())) + default: + return 0, fmt.Errorf("variant type %s not a signed integer type", t) + } + return i, nil +} + +// GetUint returns the uint64 value of the variant if it is an integer type, and +// an error otherwise. It wraps variouns `g_variant_get_*` functions dealing +// with integers of different sizes. +func (v *Variant) GetUint() (uint64, error) { + t := v.TypeString() + var i uint64 + switch t { + case "y": + i = uint64(C.g_variant_get_byte(v.native())) + case "q": + i = uint64(C.g_variant_get_uint16(v.native())) + case "u": + i = uint64(C.g_variant_get_uint32(v.native())) + case "t": + i = uint64(C.g_variant_get_uint64(v.native())) + default: + return 0, fmt.Errorf("variant type %s not an unsigned integer type", t) + } + return i, nil +} + +// Type returns the VariantType for this variant. +func (v *Variant) Type() *VariantType { + // The return value is valid for the lifetime of value and must not be freed. + return newVariantType(C.g_variant_get_type(v.native())) +} + +// IsType returns true if the variant's type matches t. +func (v *Variant) IsType(t *VariantType) bool { + return gobool(C.g_variant_is_of_type(v.native(), t.native())) +} + +// String wraps g_variant_print(). It returns a string understood +// by g_variant_parse(). +func (v *Variant) String() string { + gc := C.g_variant_print(v.native(), gbool(false)) + defer C.g_free(C.gpointer(gc)) + return C.GoString((*C.char)(gc)) +} + +// AnnotatedString wraps g_variant_print(), but returns a type-annotated +// string. +func (v *Variant) AnnotatedString() string { + gc := C.g_variant_print(v.native(), gbool(true)) + defer C.g_free(C.gpointer(gc)) + return C.GoString((*C.char)(gc)) +} + +// TODO: +//gint g_variant_compare () +//GVariantClass g_variant_classify () +//gboolean g_variant_check_format_string () +//void g_variant_get () +//void g_variant_get_va () +//GVariant * g_variant_new () +//GVariant * g_variant_new_va () +//GVariant * g_variant_new_handle () +//GVariant * g_variant_new_printf () +//GVariant * g_variant_new_object_path () +//gboolean g_variant_is_object_path () +//GVariant * g_variant_new_signature () +//gboolean g_variant_is_signature () +//GVariant * g_variant_new_strv () +//GVariant * g_variant_new_objv () +//GVariant * g_variant_new_bytestring () +//GVariant * g_variant_new_bytestring_array () +//guchar g_variant_get_byte () +//gint16 g_variant_get_int16 () +//guint16 g_variant_get_uint16 () +//gint32 g_variant_get_int32 () +//guint32 g_variant_get_uint32 () +//gint64 g_variant_get_int64 () +//guint64 g_variant_get_uint64 () +//gint32 g_variant_get_handle () +//gdouble g_variant_get_double () +//const gchar * g_variant_get_bytestring () +//gchar * g_variant_dup_bytestring () +//const gchar ** g_variant_get_bytestring_array () +//gchar ** g_variant_dup_bytestring_array () +//GVariant * g_variant_new_maybe () +//GVariant * g_variant_new_array () +//GVariant * g_variant_new_tuple () +//GVariant * g_variant_new_dict_entry () +//GVariant * g_variant_new_fixed_array () +//GVariant * g_variant_get_maybe () +//gsize g_variant_n_children () +//GVariant * g_variant_get_child_value () +//void g_variant_get_child () +//GVariant * g_variant_lookup_value () +//gboolean g_variant_lookup () +//gconstpointer g_variant_get_fixed_array () +//gsize g_variant_get_size () +//gconstpointer g_variant_get_data () +//GBytes * g_variant_get_data_as_bytes () +//void g_variant_store () +//GVariant * g_variant_new_from_data () +//GVariant * g_variant_new_from_bytes () +//GVariant * g_variant_byteswap () +//GVariant * g_variant_get_normal_form () +//gboolean g_variant_is_normal_form () +//guint g_variant_hash () +//gboolean g_variant_equal () +//gchar * g_variant_print () +//GString * g_variant_print_string () +//GVariantIter * g_variant_iter_copy () +//void g_variant_iter_free () +//gsize g_variant_iter_init () +//gsize g_variant_iter_n_children () +//GVariantIter * g_variant_iter_new () +//GVariant * g_variant_iter_next_value () +//gboolean g_variant_iter_next () +//gboolean g_variant_iter_loop () +//void g_variant_builder_unref () +//GVariantBuilder * g_variant_builder_ref () +//GVariantBuilder * g_variant_builder_new () +//void g_variant_builder_init () +//void g_variant_builder_clear () +//void g_variant_builder_add_value () +//void g_variant_builder_add () +//void g_variant_builder_add_parsed () +//GVariant * g_variant_builder_end () +//void g_variant_builder_open () +//void g_variant_builder_close () +//void g_variant_dict_unref () +//GVariantDict * g_variant_dict_ref () +//GVariantDict * g_variant_dict_new () +//void g_variant_dict_init () +//void g_variant_dict_clear () +//gboolean g_variant_dict_contains () +//gboolean g_variant_dict_lookup () +//GVariant * g_variant_dict_lookup_value () +//void g_variant_dict_insert () +//void g_variant_dict_insert_value () +//gboolean g_variant_dict_remove () +//GVariant * g_variant_dict_end () +//#define G_VARIANT_PARSE_ERROR + +// VariantParse is a wrapper around g_variant_parse() +func VariantParse(vType *VariantType, text string) (*Variant, error) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + var gerr *C.GError + c := C.g_variant_parse(vType.native(), (*C.gchar)(cstr), nil, nil, &gerr) + if c == nil { + defer C.g_error_free(gerr) + return nil, errors.New(goString(gerr.message)) + } + // will be freed during GC + return takeVariant(c), nil +} + +//GVariant * g_variant_new_parsed_va () +//GVariant * g_variant_new_parsed () +//gchar * g_variant_parse_error_print_context () diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariant.go.h b/vendor/github.com/gotk3/gotk3/glib/gvariant.go.h new file mode 100644 index 0000000..e2b4d03 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariant.go.h @@ -0,0 +1,26 @@ +// Same copyright and license as the rest of the files in this project + +// GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +#ifndef __GVARIANT_GO_H__ +#define __GVARIANT_GO_H__ + +#include +#include +#include +#include + +// Type Casting + +static GVariant *toGVariant(void *p) { return (GVariant *)p; } + +static GVariantBuilder *toGVariantBuilder(void *p) { + return (GVariantBuilder *)p; +} + +static GVariantDict *toGVariantDict(void *p) { return (GVariantDict *)p; } + +static GVariantIter *toGVariantIter(void *p) { return (GVariantIter *)p; } + +#endif diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariant_test.go b/vendor/github.com/gotk3/gotk3/glib/gvariant_test.go new file mode 100644 index 0000000..3d26bff --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariant_test.go @@ -0,0 +1,188 @@ +// Same copyright and license as the rest of the files in this project + +package glib_test + +import ( + "math" + "testing" + + "github.com/gotk3/gotk3/glib" +) + +func TestVariantGetInt(t *testing.T) { + t.Run("int16", func(t *testing.T) { + expected := int16(math.MinInt16) + variant := glib.VariantFromInt16(expected) + actual, err := variant.GetInt() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if int64(expected) != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("int32", func(t *testing.T) { + expected := int32(math.MinInt32) + variant := glib.VariantFromInt32(expected) + actual, err := variant.GetInt() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if int64(expected) != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("int64", func(t *testing.T) { + expected := int64(math.MinInt64) + variant := glib.VariantFromInt64(expected) + actual, err := variant.GetInt() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if expected != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("other type", func(t *testing.T) { + variant := glib.VariantFromUint64(987) + _, err := variant.GetInt() + if err == nil { + t.Error("expected error, did not get one") + } + }) +} + +func TestVariantGetUint(t *testing.T) { + t.Run("byte", func(t *testing.T) { + expected := uint8(math.MaxUint8) + variant := glib.VariantFromByte(expected) + actual, err := variant.GetUint() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if uint64(expected) != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("int16", func(t *testing.T) { + expected := uint16(math.MaxUint16) + variant := glib.VariantFromUint16(expected) + actual, err := variant.GetUint() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if uint64(expected) != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("int32", func(t *testing.T) { + expected := uint32(math.MaxUint32) + variant := glib.VariantFromUint32(expected) + actual, err := variant.GetUint() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if uint64(expected) != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("int64", func(t *testing.T) { + expected := uint64(math.MaxUint64) + variant := glib.VariantFromUint64(expected) + actual, err := variant.GetUint() + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + if expected != actual { + t.Error("Expected", expected, "got", actual) + } + }) + + t.Run("other type", func(t *testing.T) { + variant := glib.VariantFromInt64(987) + _, err := variant.GetUint() + if err == nil { + t.Error("expected error, did not get one") + } + }) +} + +func TestVariantType(t *testing.T) { + variant := glib.VariantFromBoolean(true) + variantType := variant.Type() + if !glib.VariantTypeEqual(glib.VARIANT_TYPE_BOOLEAN, variantType) { + t.Error("Expected", glib.VARIANT_TYPE_BOOLEAN, "got", variantType) + } +} + +func TestVariantBool(t *testing.T) { + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "false", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + variant := glib.VariantFromBoolean(tC.value) + actual := variant.GetBoolean() + if tC.value != actual { + t.Error("Expected", tC.value, "got", actual) + } + }) + } +} + +func TestVariantString(t *testing.T) { + testCases := []struct { + desc string + value string + }{ + { + desc: "Plain string", + value: "Simple Data", + }, + { + desc: "String with special characters", + value: "Üö@/Data", + }, + { + desc: "Empty String", + value: "", + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + variant := glib.VariantFromString(tC.value) + actual := variant.GetString() + if tC.value != actual { + t.Error("Expected", tC.value, "got", actual) + } + }) + } +} + +func TestVariantVariant(t *testing.T) { + + boxed := glib.VariantFromString("I'm in a box") + + variant := glib.VariantFromVariant(boxed) + + actual := variant.GetVariant() + if boxed.Native() != actual.Native() { + t.Error("Expected", boxed.Native(), "got", actual.Native()) + } +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariantbuilder.go b/vendor/github.com/gotk3/gotk3/glib/gvariantbuilder.go new file mode 100644 index 0000000..c18e787 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariantbuilder.go @@ -0,0 +1,52 @@ +// Same copyright and license as the rest of the files in this project + +// GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +package glib + +// #include +// #include +// #include "glib.go.h" +// #include "gvariant.go.h" +import "C" +import "unsafe" + +/* + * GVariantBuilder + */ + +// VariantBuilder is a representation of GLib's VariantBuilder. +type VariantBuilder struct { + GVariantBuilder *C.GVariantBuilder +} + +func (v *VariantBuilder) toGVariantBuilder() *C.GVariantBuilder { + if v == nil { + return nil + } + return v.native() +} + +func (v *VariantBuilder) toVariantBuilder() *VariantBuilder { + return v +} + +// newVariantBuilder creates a new VariantBuilder from a GVariantBuilder pointer. +func newVariantBuilder(p *C.GVariantBuilder) *VariantBuilder { + return &VariantBuilder{GVariantBuilder: p} +} + +// native returns a pointer to the underlying GVariantBuilder. +func (v *VariantBuilder) native() *C.GVariantBuilder { + if v == nil || v.GVariantBuilder == nil { + return nil + } + p := unsafe.Pointer(v.GVariantBuilder) + return C.toGVariantBuilder(p) +} + +// Native returns a pointer to the underlying GVariantBuilder. +func (v *VariantBuilder) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariantclass.go b/vendor/github.com/gotk3/gotk3/glib/gvariantclass.go new file mode 100644 index 0000000..aea0618 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariantclass.go @@ -0,0 +1,39 @@ +// Same copyright and license as the rest of the files in this project + +//GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +package glib + +// #include +// #include +// #include "glib.go.h" +// #include "gvariant.go.h" +import "C" + +/* + * GVariantClass + */ + +type VariantClass int + +const ( + VARIANT_CLASS_BOOLEAN VariantClass = C.G_VARIANT_CLASS_BOOLEAN //The GVariant is a boolean. + VARIANT_CLASS_BYTE VariantClass = C.G_VARIANT_CLASS_BYTE //The GVariant is a byte. + VARIANT_CLASS_INT16 VariantClass = C.G_VARIANT_CLASS_INT16 //The GVariant is a signed 16 bit integer. + VARIANT_CLASS_UINT16 VariantClass = C.G_VARIANT_CLASS_UINT16 //The GVariant is an unsigned 16 bit integer. + VARIANT_CLASS_INT32 VariantClass = C.G_VARIANT_CLASS_INT32 //The GVariant is a signed 32 bit integer. + VARIANT_CLASS_UINT32 VariantClass = C.G_VARIANT_CLASS_UINT32 //The GVariant is an unsigned 32 bit integer. + VARIANT_CLASS_INT64 VariantClass = C.G_VARIANT_CLASS_INT64 //The GVariant is a signed 64 bit integer. + VARIANT_CLASS_UINT64 VariantClass = C.G_VARIANT_CLASS_UINT64 //The GVariant is an unsigned 64 bit integer. + VARIANT_CLASS_HANDLE VariantClass = C.G_VARIANT_CLASS_HANDLE //The GVariant is a file handle index. + VARIANT_CLASS_DOUBLE VariantClass = C.G_VARIANT_CLASS_DOUBLE //The GVariant is a double precision floating point value. + VARIANT_CLASS_STRING VariantClass = C.G_VARIANT_CLASS_STRING //The GVariant is a normal string. + VARIANT_CLASS_OBJECT_PATH VariantClass = C.G_VARIANT_CLASS_OBJECT_PATH //The GVariant is a D-Bus object path string. + VARIANT_CLASS_SIGNATURE VariantClass = C.G_VARIANT_CLASS_SIGNATURE //The GVariant is a D-Bus signature string. + VARIANT_CLASS_VARIANT VariantClass = C.G_VARIANT_CLASS_VARIANT //The GVariant is a variant. + VARIANT_CLASS_MAYBE VariantClass = C.G_VARIANT_CLASS_MAYBE //The GVariant is a maybe-typed value. + VARIANT_CLASS_ARRAY VariantClass = C.G_VARIANT_CLASS_ARRAY //The GVariant is an array. + VARIANT_CLASS_TUPLE VariantClass = C.G_VARIANT_CLASS_TUPLE //The GVariant is a tuple. + VARIANT_CLASS_DICT_ENTRY VariantClass = C.G_VARIANT_CLASS_DICT_ENTRY //The GVariant is a dictionary entry. +) diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariantdict.go b/vendor/github.com/gotk3/gotk3/glib/gvariantdict.go new file mode 100644 index 0000000..e682008 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariantdict.go @@ -0,0 +1,52 @@ +// Same copyright and license as the rest of the files in this project + +//GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +package glib + +// #include +// #include +// #include "glib.go.h" +// #include "gvariant.go.h" +import "C" +import "unsafe" + +/* + * GVariantDict + */ + +// VariantDict is a representation of GLib's VariantDict. +type VariantDict struct { + GVariantDict *C.GVariantDict +} + +func (v *VariantDict) toGVariantDict() *C.GVariantDict { + if v == nil { + return nil + } + return v.native() +} + +func (v *VariantDict) toVariantDict() *VariantDict { + return v +} + +// newVariantDict creates a new VariantDict from a GVariantDict pointer. +func newVariantDict(p *C.GVariantDict) *VariantDict { + return &VariantDict{GVariantDict: p} +} + +// native returns a pointer to the underlying GVariantDict. +func (v *VariantDict) native() *C.GVariantDict { + if v == nil || v.GVariantDict == nil { + return nil + } + p := unsafe.Pointer(v.GVariantDict) + return C.toGVariantDict(p) +} + +// Native returns a pointer to the underlying GVariantDict. +func (v *VariantDict) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gvariantiter.go b/vendor/github.com/gotk3/gotk3/glib/gvariantiter.go new file mode 100644 index 0000000..17b55ae --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvariantiter.go @@ -0,0 +1,52 @@ +// Same copyright and license as the rest of the files in this project + +//GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +package glib + +// #include +// #include +// #include "glib.go.h" +// #include "gvariant.go.h" +import "C" +import "unsafe" + +/* + * GVariantIter + */ + +// VariantIter is a representation of GLib's GVariantIter. +type VariantIter struct { + GVariantIter *C.GVariantIter +} + +func (v *VariantIter) toGVariantIter() *C.GVariantIter { + if v == nil { + return nil + } + return v.native() +} + +func (v *VariantIter) toVariantIter() *VariantIter { + return v +} + +// newVariantIter creates a new VariantIter from a GVariantIter pointer. +func newVariantIter(p *C.GVariantIter) *VariantIter { + return &VariantIter{GVariantIter: p} +} + +// native returns a pointer to the underlying GVariantIter. +func (v *VariantIter) native() *C.GVariantIter { + if v == nil || v.GVariantIter == nil { + return nil + } + p := unsafe.Pointer(v.GVariantIter) + return C.toGVariantIter(p) +} + +// Native returns a pointer to the underlying GVariantIter. +func (v *VariantIter) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/gvarianttype.go b/vendor/github.com/gotk3/gotk3/glib/gvarianttype.go new file mode 100644 index 0000000..3723f43 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvarianttype.go @@ -0,0 +1,147 @@ +// Same copyright and license as the rest of the files in this project + +//GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +package glib + +// #include +// #include +// #include "gvarianttype.go.h" +import "C" + +import ( + "runtime" + "unsafe" +) + +// A VariantType is a wrapper for the GVariantType, which encodes type +// information for GVariants. +type VariantType struct { + GVariantType *C.GVariantType +} + +func (v *VariantType) native() *C.GVariantType { + if v == nil { + return nil + } + return v.GVariantType +} + +// String returns a copy of this VariantType's type string. +func (v *VariantType) String() string { + ch := C.g_variant_type_dup_string(v.native()) + defer C.g_free(C.gpointer(ch)) + return C.GoString((*C.char)(ch)) +} + +// newVariantType wraps a native GVariantType. +// Does not create a finalizer. +// Use takeVariantType for instances which need to be freed after use. +func newVariantType(v *C.GVariantType) *VariantType { + if v == nil { + return nil + } + return &VariantType{v} +} + +// takeVariantType wraps a native GVariantType +// and sets up a finalizer to free the instance during GC. +func takeVariantType(v *C.GVariantType) *VariantType { + if v == nil { + return nil + } + obj := &VariantType{v} + runtime.SetFinalizer(obj, (*VariantType).Free) + return obj +} + +// Variant types for comparing between them. Cannot be const because +// they are pointers. +// Note that variant types cannot be compared by value, use VariantTypeEqual() instead. +var ( + VARIANT_TYPE_BOOLEAN = newVariantType(C._G_VARIANT_TYPE_BOOLEAN) + VARIANT_TYPE_BYTE = newVariantType(C._G_VARIANT_TYPE_BYTE) + VARIANT_TYPE_INT16 = newVariantType(C._G_VARIANT_TYPE_INT16) + VARIANT_TYPE_UINT16 = newVariantType(C._G_VARIANT_TYPE_UINT16) + VARIANT_TYPE_INT32 = newVariantType(C._G_VARIANT_TYPE_INT32) + VARIANT_TYPE_UINT32 = newVariantType(C._G_VARIANT_TYPE_UINT32) + VARIANT_TYPE_INT64 = newVariantType(C._G_VARIANT_TYPE_INT64) + VARIANT_TYPE_UINT64 = newVariantType(C._G_VARIANT_TYPE_UINT64) + VARIANT_TYPE_HANDLE = newVariantType(C._G_VARIANT_TYPE_HANDLE) + VARIANT_TYPE_DOUBLE = newVariantType(C._G_VARIANT_TYPE_DOUBLE) + VARIANT_TYPE_STRING = newVariantType(C._G_VARIANT_TYPE_STRING) + VARIANT_TYPE_OBJECT_PATH = newVariantType(C._G_VARIANT_TYPE_OBJECT_PATH) + VARIANT_TYPE_SIGNATURE = newVariantType(C._G_VARIANT_TYPE_SIGNATURE) + VARIANT_TYPE_VARIANT = newVariantType(C._G_VARIANT_TYPE_VARIANT) + VARIANT_TYPE_ANY = newVariantType(C._G_VARIANT_TYPE_ANY) + VARIANT_TYPE_BASIC = newVariantType(C._G_VARIANT_TYPE_BASIC) + VARIANT_TYPE_MAYBE = newVariantType(C._G_VARIANT_TYPE_MAYBE) + VARIANT_TYPE_ARRAY = newVariantType(C._G_VARIANT_TYPE_ARRAY) + VARIANT_TYPE_TUPLE = newVariantType(C._G_VARIANT_TYPE_TUPLE) + VARIANT_TYPE_UNIT = newVariantType(C._G_VARIANT_TYPE_UNIT) + VARIANT_TYPE_DICT_ENTRY = newVariantType(C._G_VARIANT_TYPE_DICT_ENTRY) + VARIANT_TYPE_DICTIONARY = newVariantType(C._G_VARIANT_TYPE_DICTIONARY) + VARIANT_TYPE_STRING_ARRAY = newVariantType(C._G_VARIANT_TYPE_STRING_ARRAY) + VARIANT_TYPE_OBJECT_PATH_ARRAY = newVariantType(C._G_VARIANT_TYPE_OBJECT_PATH_ARRAY) + VARIANT_TYPE_BYTESTRING = newVariantType(C._G_VARIANT_TYPE_BYTESTRING) + VARIANT_TYPE_BYTESTRING_ARRAY = newVariantType(C._G_VARIANT_TYPE_BYTESTRING_ARRAY) + VARIANT_TYPE_VARDICT = newVariantType(C._G_VARIANT_TYPE_VARDICT) +) + +// Free is a wrapper around g_variant_type_free. +// Reference counting is usually handled in the gotk layer, +// most applications should not call this. +func (v *VariantType) Free() { + C.g_variant_type_free(v.native()) +} + +// VariantTypeNew is a wrapper around g_variant_type_new. +func VariantTypeNew(typeString string) *VariantType { + cstr := (*C.gchar)(C.CString(typeString)) + defer C.free(unsafe.Pointer(cstr)) + + c := C.g_variant_type_new(cstr) + return takeVariantType(c) +} + +// VariantTypeStringIsValid is a wrapper around g_variant_type_string_is_valid. +func VariantTypeStringIsValid(typeString string) bool { + cstr := (*C.gchar)(C.CString(typeString)) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.g_variant_type_string_is_valid(cstr)) +} + +// VariantTypeEqual is a wrapper around g_variant_type_equal +func VariantTypeEqual(type1, type2 *VariantType) bool { + return gobool(C.g_variant_type_equal(C.gconstpointer(type1.native()), C.gconstpointer(type2.native()))) +} + +// IsSubtypeOf is a wrapper around g_variant_type_is_subtype_of +func (v *VariantType) IsSubtypeOf(supertype *VariantType) bool { + return gobool(C.g_variant_type_is_subtype_of(v.native(), supertype.native())) +} + +// TODO: +// g_variant_type_copy +// g_variant_type_string_scan +// g_variant_type_is_definite +// g_variant_type_is_container +// g_variant_type_is_basic +// g_variant_type_is_maybe +// g_variant_type_is_array +// g_variant_type_is_tuple +// g_variant_type_is_dict_entry +// g_variant_type_is_variant +// g_variant_type_hash +// g_variant_type_new_maybe +// g_variant_type_new_array +// g_variant_type_new_tuple +// g_variant_type_new_dict_entry +// g_variant_type_element +// g_variant_type_n_items +// g_variant_type_first +// g_variant_type_next +// g_variant_type_key +// g_variant_type_value diff --git a/vendor/github.com/gotk3/gotk3/glib/gvarianttype.go.h b/vendor/github.com/gotk3/gotk3/glib/gvarianttype.go.h new file mode 100644 index 0000000..283a9dc --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvarianttype.go.h @@ -0,0 +1,39 @@ +// Same copyright and license as the rest of the files in this project + +// GVariant : GVariant — strongly typed value datatype +// https://developer.gnome.org/glib/2.26/glib-GVariant.html + +#ifndef __GVARIANTTYPE_GO_H__ +#define __GVARIANTTYPE_GO_H__ + +const GVariantType *_G_VARIANT_TYPE_BOOLEAN = G_VARIANT_TYPE_BOOLEAN; +const GVariantType *_G_VARIANT_TYPE_BYTE = G_VARIANT_TYPE_BYTE; +const GVariantType *_G_VARIANT_TYPE_INT16 = G_VARIANT_TYPE_INT16; +const GVariantType *_G_VARIANT_TYPE_UINT16 = G_VARIANT_TYPE_UINT16; +const GVariantType *_G_VARIANT_TYPE_INT32 = G_VARIANT_TYPE_INT32; +const GVariantType *_G_VARIANT_TYPE_UINT32 = G_VARIANT_TYPE_UINT32; +const GVariantType *_G_VARIANT_TYPE_INT64 = G_VARIANT_TYPE_INT64; +const GVariantType *_G_VARIANT_TYPE_UINT64 = G_VARIANT_TYPE_UINT64; +const GVariantType *_G_VARIANT_TYPE_HANDLE = G_VARIANT_TYPE_HANDLE; +const GVariantType *_G_VARIANT_TYPE_DOUBLE = G_VARIANT_TYPE_DOUBLE; +const GVariantType *_G_VARIANT_TYPE_STRING = G_VARIANT_TYPE_STRING; +const GVariantType *_G_VARIANT_TYPE_OBJECT_PATH = G_VARIANT_TYPE_OBJECT_PATH; +const GVariantType *_G_VARIANT_TYPE_SIGNATURE = G_VARIANT_TYPE_SIGNATURE; +const GVariantType *_G_VARIANT_TYPE_VARIANT = G_VARIANT_TYPE_VARIANT; +const GVariantType *_G_VARIANT_TYPE_ANY = G_VARIANT_TYPE_ANY; +const GVariantType *_G_VARIANT_TYPE_BASIC = G_VARIANT_TYPE_BASIC; +const GVariantType *_G_VARIANT_TYPE_MAYBE = G_VARIANT_TYPE_MAYBE; +const GVariantType *_G_VARIANT_TYPE_ARRAY = G_VARIANT_TYPE_ARRAY; +const GVariantType *_G_VARIANT_TYPE_TUPLE = G_VARIANT_TYPE_TUPLE; +const GVariantType *_G_VARIANT_TYPE_UNIT = G_VARIANT_TYPE_UNIT; +const GVariantType *_G_VARIANT_TYPE_DICT_ENTRY = G_VARIANT_TYPE_DICT_ENTRY; +const GVariantType *_G_VARIANT_TYPE_DICTIONARY = G_VARIANT_TYPE_DICTIONARY; +const GVariantType *_G_VARIANT_TYPE_STRING_ARRAY = G_VARIANT_TYPE_STRING_ARRAY; +const GVariantType *_G_VARIANT_TYPE_OBJECT_PATH_ARRAY = + G_VARIANT_TYPE_OBJECT_PATH_ARRAY; +const GVariantType *_G_VARIANT_TYPE_BYTESTRING = G_VARIANT_TYPE_BYTESTRING; +const GVariantType *_G_VARIANT_TYPE_BYTESTRING_ARRAY = + G_VARIANT_TYPE_BYTESTRING_ARRAY; +const GVariantType *_G_VARIANT_TYPE_VARDICT = G_VARIANT_TYPE_VARDICT; + +#endif diff --git a/vendor/github.com/gotk3/gotk3/glib/gvarianttype_test.go b/vendor/github.com/gotk3/gotk3/glib/gvarianttype_test.go new file mode 100644 index 0000000..0481f3a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/gvarianttype_test.go @@ -0,0 +1,118 @@ +// Same copyright and license as the rest of the files in this project + +package glib_test + +import ( + "testing" + + "github.com/gotk3/gotk3/glib" +) + +func TestVariantTypeEqual(t *testing.T) { + testCases := []struct { + desc string + type1 *glib.VariantType + type2 *glib.VariantType + expected bool + }{ + { + desc: "bool == bool constants", + type1: glib.VARIANT_TYPE_BOOLEAN, + type2: glib.VARIANT_TYPE_BOOLEAN, + expected: true, + }, + { + desc: "bool != string constants", + type1: glib.VARIANT_TYPE_BOOLEAN, + type2: glib.VARIANT_TYPE_STRING, + expected: false, + }, + { + desc: "bool == bool dynamic", + type1: glib.VARIANT_TYPE_BOOLEAN, + type2: glib.VariantTypeNew("b"), + expected: true, + }, + { + desc: "bool != string dynamic", + type1: glib.VariantTypeNew("b"), + type2: glib.VariantTypeNew("s"), + expected: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + actual := glib.VariantTypeEqual(tC.type1, tC.type2) + if tC.expected != actual { + t.Error("Expected", tC.expected, "got", actual) + } + }) + } +} + +func TestVariantTypeStringIsValid(t *testing.T) { + testCases := []struct { + desc string + input string + expected bool + }{ + { + desc: "String", + input: "s", + expected: true, + }, + { + desc: "Boolean", + input: "b", + expected: true, + }, + { + desc: "Tuple of String and Boolean", + input: "(sb)", + expected: true, + }, + { + desc: "Junk", + input: "r{{sb}", + expected: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + actual := glib.VariantTypeStringIsValid(tC.input) + if tC.expected != actual { + t.Error("Expected", tC.expected, "got", actual) + } + }) + } +} + +func TestVariantIsSubtypeOf(t *testing.T) { + testCases := []struct { + desc string + type1 *glib.VariantType + superType *glib.VariantType + expected bool + }{ + { + desc: "bool is not a supertype", + type1: glib.VARIANT_TYPE_STRING, + superType: glib.VARIANT_TYPE_BOOLEAN, + expected: false, + }, + { + desc: "a* is supertype of as", + type1: glib.VariantTypeNew("as"), + superType: glib.VariantTypeNew("a*"), + expected: true, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + actual := tC.type1.IsSubtypeOf(tC.superType) + if tC.expected != actual { + t.Error("Expected", tC.expected, "got", actual) + } + }) + } +} diff --git a/vendor/github.com/gotk3/gotk3/glib/list.go b/vendor/github.com/gotk3/gotk3/glib/list.go new file mode 100644 index 0000000..a49a625 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/list.go @@ -0,0 +1,175 @@ +package glib + +// #include +// #include +// #include "glib.go.h" +import "C" +import ( + "unsafe" +) + +/* + * Linked Lists + */ + +// List is a representation of Glib's GList. +type List struct { + list *C.struct__GList + // If set, dataWrap is called every time NthData() + // or Data() is called to wrap raw underlying + // value into appropriate type. + dataWrap func(unsafe.Pointer) interface{} +} + +func WrapList(obj uintptr) *List { + return wrapList((*C.struct__GList)(unsafe.Pointer(obj))) +} + +func wrapList(obj *C.struct__GList) *List { + if obj == nil { + return nil + } + return &List{list: obj} +} + +func (v *List) wrapNewHead(obj *C.struct__GList) *List { + if obj == nil { + return nil + } + return &List{ + list: obj, + dataWrap: v.dataWrap, + } +} + +func (v *List) Native() uintptr { + return uintptr(unsafe.Pointer(v.list)) +} + +func (v *List) native() *C.struct__GList { + if v == nil || v.list == nil { + return nil + } + return v.list +} + +// DataWapper sets wrap functions, which is called during NthData() +// and Data(). It's used to cast raw C data into appropriate +// Go structures and types every time that data is retreived. +func (v *List) DataWrapper(fn func(unsafe.Pointer) interface{}) { + if v == nil { + return + } + v.dataWrap = fn +} + +// Append is a wrapper around g_list_append(). +func (v *List) Append(data uintptr) *List { + glist := C.g_list_append(v.native(), C.gpointer(data)) + return v.wrapNewHead(glist) +} + +// Prepend is a wrapper around g_list_prepend(). +func (v *List) Prepend(data uintptr) *List { + glist := C.g_list_prepend(v.native(), C.gpointer(data)) + return v.wrapNewHead(glist) +} + +// Insert is a wrapper around g_list_insert(). +func (v *List) Insert(data uintptr, position int) *List { + glist := C.g_list_insert(v.native(), C.gpointer(data), C.gint(position)) + return v.wrapNewHead(glist) +} + +// Length is a wrapper around g_list_length(). +func (v *List) Length() uint { + return uint(C.g_list_length(v.native())) +} + +// nthDataRaw is a wrapper around g_list_nth_data(). +func (v *List) nthDataRaw(n uint) unsafe.Pointer { + return unsafe.Pointer(C.g_list_nth_data(v.native(), C.guint(n))) +} + +// Nth() is a wrapper around g_list_nth(). +func (v *List) Nth(n uint) *List { + list := wrapList(C.g_list_nth(v.native(), C.guint(n))) + list.DataWrapper(v.dataWrap) + return list +} + +// NthData acts the same as g_list_nth_data(), but passes +// retrieved value before returning through wrap function, set by DataWrapper(). +// If no wrap function is set, it returns raw unsafe.Pointer. +func (v *List) NthData(n uint) interface{} { + ptr := v.nthDataRaw(n) + if v.dataWrap != nil { + return v.dataWrap(ptr) + } + return ptr +} + +// Free is a wrapper around g_list_free(). +func (v *List) Free() { + C.g_list_free(v.native()) +} + +// Next is a wrapper around the next struct field +func (v *List) Next() *List { + return v.wrapNewHead(v.native().next) +} + +// Previous is a wrapper around the prev struct field +func (v *List) Previous() *List { + return v.wrapNewHead(v.native().prev) +} + +// First is a wrapper around g_list_first(). +func (v *List) First() *List { + return v.wrapNewHead(C.g_list_first(v.native())) +} + +// Last is a wrapper around g_list_last(). +func (v *List) Last() *List { + return v.wrapNewHead(C.g_list_last(v.native())) +} + +// Reverse is a wrapper around g_list_reverse(). +func (v *List) Reverse() *List { + return v.wrapNewHead(C.g_list_reverse(v.native())) +} + +// dataRaw is a wrapper around the data struct field +func (v *List) dataRaw() unsafe.Pointer { + return unsafe.Pointer(v.native().data) +} + +// Data acts the same as data struct field, but passes +// retrieved value before returning through wrap function, set by DataWrapper(). +// If no wrap function is set, it returns raw unsafe.Pointer. +func (v *List) Data() interface{} { + ptr := v.dataRaw() + if v.dataWrap != nil { + return v.dataWrap(ptr) + } + return ptr +} + +// Foreach acts the same as g_list_foreach(). +// No user_data argument is implemented because of Go clojure capabilities. +func (v *List) Foreach(fn func(item interface{})) { + for l := v; l != nil; l = l.Next() { + fn(l.Data()) + } +} + +// FreeFull acts the same as g_list_free_full(). +// Calling list.FreeFull(fn) is equivalent to calling list.Foreach(fn) and +// list.Free() sequentially. +func (v *List) FreeFull(fn func(item interface{})) { + v.Foreach(fn) + v.Free() +} + +// CompareDataFunc is a representation of GCompareDataFunc +type CompareDataFunc func(a, b uintptr) int diff --git a/vendor/github.com/gotk3/gotk3/glib/list_test.go b/vendor/github.com/gotk3/gotk3/glib/list_test.go new file mode 100644 index 0000000..66e3693 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/list_test.go @@ -0,0 +1,76 @@ +package glib + +import ( + "fmt" + "testing" + "unsafe" +) + +func TestList_Basics(t *testing.T) { + list := (&List{}).Append(0).Append(1).Append(2) + if list.Length() != 3 { + t.Errorf("Length of list with 3 appended elements must be 3. (Got %v).", list.Length()) + } + + list = (&List{}).Prepend(0).Prepend(1).Prepend(2) + if list.Length() != 3 { + t.Errorf("Length of list with 3 prepended elements must be 3. (Got %v).", list.Length()) + } + + list = (&List{}).Insert(0, 0).Insert(1, 0).Insert(2, 0) + if list.Length() != 3 { + t.Errorf("Length of list with 3 inserted elements must be 3. (Got %v).", list.Length()) + } +} + +func TestList_DataWrapper(t *testing.T) { + list := (&List{}).Append(0).Append(1).Append(2) + list.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return fmt.Sprintf("Value %v", uintptr(ptr)) + }) + + i := 0 + for l := list; l != nil; l = l.Next() { + expect := fmt.Sprintf("Value %v", i) + i++ + actual, ok := l.Data().(string) + if !ok { + t.Error("DataWrapper must have returned a string!") + } + if actual != expect { + t.Errorf("DataWrapper returned unexpected result. Expected '%v', got '%v'.", expect, actual) + } + } +} + +func TestList_Foreach(t *testing.T) { + list := (&List{}).Append(0).Append(1).Append(2) + list.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return int(uintptr(ptr) + 1) + }) + + sum := 0 + list.Foreach(func(item interface{}) { + sum += item.(int) + }) + + if sum != 6 { + t.Errorf("Foreach resulted into wrong sum. Got %v, expected %v.", sum, 6) + } +} + +func TestList_Nth(t *testing.T) { + list := (&List{}).Append(0).Append(1).Append(2) + list.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return int(uintptr(ptr) + 1) + }) + + for i := uint(0); i < 3; i++ { + nth := list.Nth(i).Data().(int) + nthData := list.NthData(i).(int) + + if nth != nthData { + t.Errorf("%v's element didn't match. Nth->Data returned %v; NthData returned %v.", i, nth, nthData) + } + } +} diff --git a/vendor/github.com/gotk3/gotk3/glib/menu.go b/vendor/github.com/gotk3/gotk3/glib/menu.go new file mode 100644 index 0000000..0e3a68c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/menu.go @@ -0,0 +1,447 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// Predefined attribute names for GMenu +var ( + MENU_ATTRIBUTE_ACTION string = C.G_MENU_ATTRIBUTE_ACTION + MENU_ATTRIBUTE_ACTION_NAMESPACE string = C.G_MENU_ATTRIBUTE_ACTION_NAMESPACE + MENU_ATTRIBUTE_TARGET string = C.G_MENU_ATTRIBUTE_TARGET + MENU_ATTRIBUTE_LABEL string = C.G_MENU_ATTRIBUTE_LABEL + MENU_ATTRIBUTE_ICON string = C.G_MENU_ATTRIBUTE_ICON +) + +// Predefined link names for GMenu +var ( + MENU_LINK_SECTION string = C.G_MENU_LINK_SECTION + MENU_LINK_SUBMENU string = C.G_MENU_LINK_SUBMENU +) + +// MenuModel is a representation of GMenuModel. +type MenuModel struct { + *Object +} + +// native returns a pointer to the underlying GMenuModel. +func (v *MenuModel) native() *C.GMenuModel { + if v == nil || v.GObject == nil { + return nil + } + return C.toGMenuModel(unsafe.Pointer(v.GObject)) +} + +// Native returns a pointer to the underlying GMenuModel. +func (v *MenuModel) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalMenuModel(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapMenuModel(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapMenuModel(obj *Object) *MenuModel { + return &MenuModel{obj} +} + +// IsMutable is a wrapper around g_menu_model_is_mutable(). +func (v *MenuModel) IsMutable() bool { + return gobool(C.g_menu_model_is_mutable(v.native())) +} + +// GetNItems is a wrapper around g_menu_model_get_n_items(). +func (v *MenuModel) GetNItems() int { + return int(C.g_menu_model_get_n_items(v.native())) +} + +// GetItemLink is a wrapper around g_menu_model_get_item_link(). +func (v *MenuModel) GetItemLink(index int, link string) *MenuModel { + cstr := (*C.gchar)(C.CString(link)) + defer C.free(unsafe.Pointer(cstr)) + c := C.g_menu_model_get_item_link(v.native(), C.gint(index), cstr) + if c == nil { + return nil + } + return wrapMenuModel(wrapObject(unsafe.Pointer(c))) +} + +// ItemsChanged is a wrapper around g_menu_model_items_changed(). +func (v *MenuModel) ItemsChanged(position, removed, added int) { + C.g_menu_model_items_changed(v.native(), C.gint(position), C.gint(removed), C.gint(added)) +} + +// GVariant * g_menu_model_get_item_attribute_value () +// gboolean g_menu_model_get_item_attribute () +// GMenuAttributeIter * g_menu_model_iterate_item_attributes () +// GMenuLinkIter * g_menu_model_iterate_item_links () + +// Menu is a representation of GMenu. +type Menu struct { + MenuModel +} + +// native() returns a pointer to the underlying GMenu. +func (v *Menu) native() *C.GMenu { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGMenu(p) +} + +func marshalMenu(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapMenu(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapMenu(obj *Object) *Menu { + return &Menu{MenuModel{obj}} +} + +// MenuNew is a wrapper around g_menu_new(). +func MenuNew() *Menu { + c := C.g_menu_new() + if c == nil { + return nil + } + return wrapMenu(wrapObject(unsafe.Pointer(c))) +} + +// Freeze is a wrapper around g_menu_freeze(). +func (v *Menu) Freeze() { + C.g_menu_freeze(v.native()) +} + +// Insert is a wrapper around g_menu_insert(). +func (v *Menu) Insert(position int, label, detailedAction string) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr2)) + + C.g_menu_insert(v.native(), C.gint(position), cstr1, cstr2) +} + +// Prepend is a wrapper around g_menu_prepend(). +func (v *Menu) Prepend(label, detailedAction string) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr2)) + + C.g_menu_prepend(v.native(), cstr1, cstr2) +} + +// Append is a wrapper around g_menu_append(). +func (v *Menu) Append(label, detailedAction string) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr2)) + + C.g_menu_append(v.native(), cstr1, cstr2) +} + +// InsertItem is a wrapper around g_menu_insert_item(). +func (v *Menu) InsertItem(position int, item *MenuItem) { + C.g_menu_insert_item(v.native(), C.gint(position), item.native()) +} + +// AppendItem is a wrapper around g_menu_append_item(). +func (v *Menu) AppendItem(item *MenuItem) { + C.g_menu_append_item(v.native(), item.native()) +} + +// PrependItem is a wrapper around g_menu_prepend_item(). +func (v *Menu) PrependItem(item *MenuItem) { + C.g_menu_prepend_item(v.native(), item.native()) +} + +// InsertSection is a wrapper around g_menu_insert_section(). +func (v *Menu) InsertSection(position int, label string, section *MenuModel) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_insert_section(v.native(), C.gint(position), cstr1, section.native()) +} + +// PrependSection is a wrapper around g_menu_prepend_section(). +func (v *Menu) PrependSection(label string, section *MenuModel) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_prepend_section(v.native(), cstr1, section.native()) +} + +// AppendSection is a wrapper around g_menu_append_section(). +func (v *Menu) AppendSection(label string, section *MenuModel) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_append_section(v.native(), cstr1, section.native()) +} + +// InsertSectionWithoutLabel is a wrapper around g_menu_insert_section() +// with label set to null. +func (v *Menu) InsertSectionWithoutLabel(position int, section *MenuModel) { + C.g_menu_insert_section(v.native(), C.gint(position), nil, section.native()) +} + +// PrependSectionWithoutLabel is a wrapper around +// g_menu_prepend_section() with label set to null. +func (v *Menu) PrependSectionWithoutLabel(section *MenuModel) { + C.g_menu_prepend_section(v.native(), nil, section.native()) +} + +// AppendSectionWithoutLabel is a wrapper around g_menu_append_section() +// with label set to null. +func (v *Menu) AppendSectionWithoutLabel(section *MenuModel) { + C.g_menu_append_section(v.native(), nil, section.native()) +} + +// InsertSubmenu is a wrapper around g_menu_insert_submenu(). +func (v *Menu) InsertSubmenu(position int, label string, submenu *MenuModel) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_insert_submenu(v.native(), C.gint(position), cstr1, submenu.native()) +} + +// PrependSubmenu is a wrapper around g_menu_prepend_submenu(). +func (v *Menu) PrependSubmenu(label string, submenu *MenuModel) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_prepend_submenu(v.native(), cstr1, submenu.native()) +} + +// AppendSubmenu is a wrapper around g_menu_append_submenu(). +func (v *Menu) AppendSubmenu(label string, submenu *MenuModel) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_append_submenu(v.native(), cstr1, submenu.native()) +} + +// Remove is a wrapper around g_menu_remove(). +func (v *Menu) Remove(position int) { + C.g_menu_remove(v.native(), C.gint(position)) +} + +// RemoveAll is a wrapper around g_menu_remove_all(). +func (v *Menu) RemoveAll() { + C.g_menu_remove_all(v.native()) +} + +// MenuItem is a representation of GMenuItem. +type MenuItem struct { + *Object +} + +// native() returns a pointer to the underlying GMenuItem. +func (v *MenuItem) native() *C.GMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGMenuItem(p) +} + +func marshalMenuItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapMenuItem(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapMenuItem(obj *Object) *MenuItem { + return &MenuItem{obj} +} + +// MenuItemNew is a wrapper around g_menu_item_new(NULL, NULL). +func MenuItemNew() *MenuItem { + c := C.g_menu_item_new(nil, nil) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// MenuItemNewWithLabel is a wrapper around g_menu_item_new(label, NULL). +func MenuItemNewWithLabel(label string) *MenuItem { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_menu_item_new(cstr1, nil) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// MenuItemNewWithAction is a wrapper around g_menu_item_new(NULL, detailedAction). +func MenuItemNewWithAction(detailedAction string) *MenuItem { + cstr1 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_menu_item_new(nil, cstr1) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// MenuItemNewWithLabelAndAction is a wrapper around g_menu_item_new(label, detailedAction). +func MenuItemNewWithLabelAndAction(label, detailedAction string) *MenuItem { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr2)) + + c := C.g_menu_item_new(cstr1, cstr2) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// MenuItemNewSection is a wrapper around g_menu_item_new_section(). +func MenuItemNewSection(label string, section *MenuModel) *MenuItem { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_menu_item_new_section(cstr1, section.native()) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// MenuItemNewSubmenu is a wrapper around g_menu_item_new_submenu(). +func MenuItemNewSubmenu(label string, submenu *MenuModel) *MenuItem { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_menu_item_new_submenu(cstr1, submenu.native()) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// MenuItemNewFromModel is a wrapper around g_menu_item_new_from_model(). +func MenuItemNewFromModel(model *MenuModel, index int) *MenuItem { + c := C.g_menu_item_new_from_model(model.native(), C.gint(index)) + if c == nil { + return nil + } + return wrapMenuItem(wrapObject(unsafe.Pointer(c))) +} + +// SetLabel is a wrapper around g_menu_item_set_label(). +func (v *MenuItem) SetLabel(label string) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_item_set_label(v.native(), cstr1) +} + +// UnsetLabel is a wrapper around g_menu_item_set_label(NULL). +func (v *MenuItem) UnsetLabel() { + C.g_menu_item_set_label(v.native(), nil) +} + +// SetDetailedAction is a wrapper around g_menu_item_set_detailed_action(). +func (v *MenuItem) SetDetailedAction(act string) { + cstr1 := (*C.gchar)(C.CString(act)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_item_set_detailed_action(v.native(), cstr1) +} + +// SetSection is a wrapper around g_menu_item_set_section(). +func (v *MenuItem) SetSection(section *MenuModel) { + C.g_menu_item_set_section(v.native(), section.native()) +} + +// SetSubmenu is a wrapper around g_menu_item_set_submenu(). +func (v *MenuItem) SetSubmenu(submenu *MenuModel) { + C.g_menu_item_set_submenu(v.native(), submenu.native()) +} + +// GetLink is a wrapper around g_menu_item_get_link(). +func (v *MenuItem) GetLink(link string) *MenuModel { + cstr1 := (*C.gchar)(C.CString(link)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_menu_item_get_link(v.native(), cstr1) + if c == nil { + return nil + } + return wrapMenuModel(wrapObject(unsafe.Pointer(c))) +} + +// SetLink is a wrapper around g_menu_item_Set_link(). +func (v *MenuItem) SetLink(link string, model *MenuModel) { + cstr1 := (*C.gchar)(C.CString(link)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_item_set_link(v.native(), cstr1, model.native()) +} + +// SetActionAndTargetValue is a wrapper around g_menu_item_set_action_and_target_value() +func (v *MenuItem) SetActionAndTargetValue(action string, targetValue IVariant) { + cstr1 := (*C.gchar)(C.CString(action)) + defer C.free(unsafe.Pointer(cstr1)) + + var c *C.GVariant + if targetValue != nil { + c = targetValue.ToGVariant() + } + + C.g_menu_item_set_action_and_target_value(v.native(), cstr1, c) +} + +// UnsetAction is a wrapper around g_menu_item_set_action_and_target_value(NULL, NULL) +// Unsets both action and target value. Unsetting the action also clears the target value. +func (v *MenuItem) UnsetAction() { + C.g_menu_item_set_action_and_target_value(v.native(), nil, nil) +} + +// SetAttributeValue is a wrapper around g_menu_item_set_attribute_value() +func (v *MenuItem) SetAttributeValue(attribute string, value IVariant) { + var c *C.GVariant + if value != nil { + c = value.ToGVariant() + } + + cstr1 := (*C.gchar)(C.CString(attribute)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_menu_item_set_attribute_value(v.native(), cstr1, c) +} + +// GetAttributeValue is a wrapper around g_menu_item_get_attribute_value() +func (v *MenuItem) GetAttributeValue(attribute string, expectedType *VariantType) *Variant { + cstr1 := (*C.gchar)(C.CString(attribute)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_menu_item_get_attribute_value(v.native(), cstr1, expectedType.native()) + if c == nil { + return nil + } + return newVariant(c) +} + +// TODO: These require positional parameters with *any* type, according to the format string passed. +// This is likely not possible to represent 1:1 in go. +// gboolean g_menu_item_get_attribute () +// void g_menu_item_set_attribute () +// void g_menu_item_set_action_and_target () diff --git a/vendor/github.com/gotk3/gotk3/glib/menu_test.go b/vendor/github.com/gotk3/gotk3/glib/menu_test.go new file mode 100644 index 0000000..cdcdb80 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/menu_test.go @@ -0,0 +1,143 @@ +package glib_test + +import ( + "testing" + + "github.com/gotk3/gotk3/glib" +) + +func TestGetSetAttributeValueCustomBool(t *testing.T) { + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "false", + value: false, + }, + } + + menuItem := glib.MenuItemNew() + + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + variant := glib.VariantFromBoolean(tC.value) + + menuItem.SetAttributeValue("custom-bool-attribute", variant) + actual := menuItem.GetAttributeValue("custom-bool-attribute", glib.VARIANT_TYPE_BOOLEAN) + + if !actual.IsType(glib.VARIANT_TYPE_BOOLEAN) { + t.Error("Expected value of type", glib.VARIANT_TYPE_BOOLEAN, "got", actual.Type()) + } + + if tC.value != actual.GetBoolean() { + t.Error("Expected", tC.value, "got", actual) + } + }) + } +} + +func TestUnsetLabel(t *testing.T) { + menuItem := glib.MenuItemNewWithLabel("unit_label") + + menuItem.UnsetLabel() + + value := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_LABEL, glib.VARIANT_TYPE_STRING) + actual := value.GetString() + + if "" != actual { + t.Error("Expected empty string, got", actual) + } +} + +func TestSetLabel(t *testing.T) { + menuItem := glib.MenuItemNewWithLabel("unit_label") + + expected := "New Label" + menuItem.SetLabel(expected) + + value := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_LABEL, glib.VARIANT_TYPE_STRING) + actual := value.GetString() + + if expected != actual { + t.Error("Expected", expected, "got", actual) + } +} + +func TestSetDetailedAction(t *testing.T) { + menuItem := glib.MenuItemNewWithAction("unit_action") + + expected := "new-action" + menuItem.SetDetailedAction(expected) + + value := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_ACTION, glib.VARIANT_TYPE_STRING) + actual := value.GetString() + + if expected != actual { + t.Error("Expected", expected, "got", actual) + } +} + +func TestSetActionAndTargetValue(t *testing.T) { + menuItem := glib.MenuItemNew() + + t.Run("Action, Value", func(t *testing.T) { + expectedValue := glib.VariantFromString("Hello!") + expected := "act1" + menuItem.SetActionAndTargetValue(expected, expectedValue) + + // Check target value + actualValue := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_TARGET, glib.VARIANT_TYPE_STRING) + if expectedValue.Native() != actualValue.Native() { + t.Error("Expected", expectedValue.Native(), "got", actualValue.Native()) + } + + // Check action value + actualAction := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_ACTION, glib.VARIANT_TYPE_STRING).GetString() + if expected != actualAction { + t.Error("Expected", expected, "got", actualAction) + } + }) + t.Run("Action, Null Value", func(t *testing.T) { + expected := "act2" + menuItem.SetActionAndTargetValue(expected, nil) + + // Check target value + actualValue := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_TARGET, glib.VARIANT_TYPE_STRING) + if actualValue != nil { + t.Error("Expected nil value got", actualValue.Native()) + } + + // Check action value + actualAction := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_ACTION, glib.VARIANT_TYPE_STRING).GetString() + if expected != actualAction { + t.Error("Expected", expected, "got", actualAction) + } + }) +} + +func TestUnsetAction(t *testing.T) { + menuItem := glib.MenuItemNew() + + initialValue := glib.VariantFromString("Hello!") + initial := "act1" + menuItem.SetActionAndTargetValue(initial, initialValue) + + menuItem.UnsetAction() + + // Check target value + actualValue := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_TARGET, glib.VARIANT_TYPE_STRING) + if actualValue != nil { + t.Error("Expected nil value got", actualValue.Native()) + } + + // Check action value + actualAction := menuItem.GetAttributeValue(glib.MENU_ATTRIBUTE_ACTION, glib.VARIANT_TYPE_STRING) + if actualAction != nil { + t.Error("Expected nil action got", actualAction.Native()) + } +} diff --git a/vendor/github.com/gotk3/gotk3/glib/notifications.go b/vendor/github.com/gotk3/gotk3/glib/notifications.go new file mode 100644 index 0000000..f1a8c74 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/notifications.go @@ -0,0 +1,94 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// Notification is a representation of GNotification. +type Notification struct { + *Object +} + +// native() returns a pointer to the underlying GNotification. +func (v *Notification) native() *C.GNotification { + if v == nil || v.GObject == nil { + return nil + } + return C.toGNotification(unsafe.Pointer(v.GObject)) +} + +func (v *Notification) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalNotification(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapNotification(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapNotification(obj *Object) *Notification { + return &Notification{obj} +} + +// NotificationNew is a wrapper around g_notification_new(). +func NotificationNew(title string) *Notification { + cstr1 := (*C.gchar)(C.CString(title)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.g_notification_new(cstr1) + if c == nil { + return nil + } + return wrapNotification(wrapObject(unsafe.Pointer(c))) +} + +// SetTitle is a wrapper around g_notification_set_title(). +func (v *Notification) SetTitle(title string) { + cstr1 := (*C.gchar)(C.CString(title)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_notification_set_title(v.native(), cstr1) +} + +// SetBody is a wrapper around g_notification_set_body(). +func (v *Notification) SetBody(body string) { + cstr1 := (*C.gchar)(C.CString(body)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_notification_set_body(v.native(), cstr1) +} + +// SetDefaultAction is a wrapper around g_notification_set_default_action(). +func (v *Notification) SetDefaultAction(detailedAction string) { + cstr1 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_notification_set_default_action(v.native(), cstr1) +} + +// AddButton is a wrapper around g_notification_add_button(). +func (v *Notification) AddButton(label, detailedAction string) { + cstr1 := (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(detailedAction)) + defer C.free(unsafe.Pointer(cstr2)) + + C.g_notification_add_button(v.native(), cstr1, cstr2) +} + +// SetIcon is a wrapper around g_notification_set_icon(). +func (v *Notification) SetIcon(iconPath string) { + fileIcon := FileIconNew(iconPath) + + C.g_notification_set_icon(v.native(), (*C.GIcon)(fileIcon.native())) +} + +// void g_notification_set_default_action_and_target () // requires varargs +// void g_notification_set_default_action_and_target_value () // requires variant +// void g_notification_add_button_with_target () // requires varargs +// void g_notification_add_button_with_target_value () //requires variant +// void g_notification_set_urgent () // Deprecated, so not implemented diff --git a/vendor/github.com/gotk3/gotk3/glib/settings.go b/vendor/github.com/gotk3/gotk3/glib/settings.go new file mode 100644 index 0000000..1bca146 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings.go @@ -0,0 +1,304 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// Settings is a representation of GSettings. +type Settings struct { + *Object +} + +// native() returns a pointer to the underlying GSettings. +func (v *Settings) native() *C.GSettings { + if v == nil || v.GObject == nil { + return nil + } + return C.toGSettings(unsafe.Pointer(v.GObject)) +} + +func (v *Settings) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSettings(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSettings(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapSettings(obj *Object) *Settings { + return &Settings{obj} +} + +func wrapFullSettings(obj *C.GSettings) *Settings { + if obj == nil { + return nil + } + return wrapSettings(wrapObject(unsafe.Pointer(obj))) +} + +// SettingsNew is a wrapper around g_settings_new(). +func SettingsNew(schemaID string) *Settings { + cstr := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr)) + + return wrapFullSettings(C.g_settings_new(cstr)) +} + +// SettingsNewWithPath is a wrapper around g_settings_new_with_path(). +func SettingsNewWithPath(schemaID, path string) *Settings { + cstr1 := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr2)) + + return wrapFullSettings(C.g_settings_new_with_path(cstr1, cstr2)) +} + +// SettingsNewWithBackend is a wrapper around g_settings_new_with_backend(). +func SettingsNewWithBackend(schemaID string, backend *SettingsBackend) *Settings { + cstr1 := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr1)) + + return wrapFullSettings(C.g_settings_new_with_backend(cstr1, backend.native())) +} + +// SettingsNewWithBackendAndPath is a wrapper around g_settings_new_with_backend_and_path(). +func SettingsNewWithBackendAndPath(schemaID string, backend *SettingsBackend, path string) *Settings { + cstr1 := (*C.gchar)(C.CString(schemaID)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr2)) + + return wrapFullSettings(C.g_settings_new_with_backend_and_path(cstr1, backend.native(), cstr2)) +} + +// SettingsNewFull is a wrapper around g_settings_new_full(). +func SettingsNewFull(schema *SettingsSchema, backend *SettingsBackend, path string) *Settings { + cstr1 := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr1)) + + return wrapFullSettings(C.g_settings_new_full(schema.native(), backend.native(), cstr1)) +} + +// SettingsSync is a wrapper around g_settings_sync(). +func SettingsSync() { + C.g_settings_sync() +} + +// IsWritable is a wrapper around g_settings_is_writable(). +func (v *Settings) IsWritable(name string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_is_writable(v.native(), cstr1)) +} + +// Delay is a wrapper around g_settings_delay(). +func (v *Settings) Delay() { + C.g_settings_delay(v.native()) +} + +// Apply is a wrapper around g_settings_apply(). +func (v *Settings) Apply() { + C.g_settings_apply(v.native()) +} + +// Revert is a wrapper around g_settings_revert(). +func (v *Settings) Revert() { + C.g_settings_revert(v.native()) +} + +// GetHasUnapplied is a wrapper around g_settings_get_has_unapplied(). +func (v *Settings) GetHasUnapplied() bool { + return gobool(C.g_settings_get_has_unapplied(v.native())) +} + +// GetChild is a wrapper around g_settings_get_child(). +func (v *Settings) GetChild(name string) *Settings { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return wrapFullSettings(C.g_settings_get_child(v.native(), cstr1)) +} + +// Reset is a wrapper around g_settings_reset(). +func (v *Settings) Reset(name string) { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + C.g_settings_reset(v.native(), cstr1) +} + +// ListChildren is a wrapper around g_settings_list_children(). +func (v *Settings) ListChildren() []string { + return toGoStringArray(C.g_settings_list_children(v.native())) +} + +// GetBoolean is a wrapper around g_settings_get_boolean(). +func (v *Settings) GetBoolean(name string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_get_boolean(v.native(), cstr1)) +} + +// SetBoolean is a wrapper around g_settings_set_boolean(). +func (v *Settings) SetBoolean(name string, value bool) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_boolean(v.native(), cstr1, gbool(value))) +} + +// GetInt is a wrapper around g_settings_get_int(). +func (v *Settings) GetInt(name string) int { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return int(C.g_settings_get_int(v.native(), cstr1)) +} + +// SetInt is a wrapper around g_settings_set_int(). +func (v *Settings) SetInt(name string, value int) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_int(v.native(), cstr1, C.gint(value))) +} + +// GetUInt is a wrapper around g_settings_get_uint(). +func (v *Settings) GetUInt(name string) uint { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return uint(C.g_settings_get_uint(v.native(), cstr1)) +} + +// SetUInt is a wrapper around g_settings_set_uint(). +func (v *Settings) SetUInt(name string, value uint) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_uint(v.native(), cstr1, C.guint(value))) +} + +// GetDouble is a wrapper around g_settings_get_double(). +func (v *Settings) GetDouble(name string) float64 { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return float64(C.g_settings_get_double(v.native(), cstr1)) +} + +// SetDouble is a wrapper around g_settings_set_double(). +func (v *Settings) SetDouble(name string, value float64) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_double(v.native(), cstr1, C.gdouble(value))) +} + +// GetString is a wrapper around g_settings_get_string(). +func (v *Settings) GetString(name string) string { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return C.GoString((*C.char)(C.g_settings_get_string(v.native(), cstr1))) +} + +// SetString is a wrapper around g_settings_set_string(). +func (v *Settings) SetString(name string, value string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(value)) + defer C.free(unsafe.Pointer(cstr2)) + + return gobool(C.g_settings_set_string(v.native(), cstr1, cstr2)) +} + +// GetEnum is a wrapper around g_settings_get_enum(). +func (v *Settings) GetEnum(name string) int { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return int(C.g_settings_get_enum(v.native(), cstr1)) +} + +// GetStrv is a wrapper around g_settings_get_strv(). +func (v *Settings) GetStrv(name string) []string { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + return toGoStringArray(C.g_settings_get_strv(v.native(), cstr1)) +} + +// SetStrv is a wrapper around g_settings_set_strv(). +func (v *Settings) SetStrv(name string, values []string) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + cvalues := make([]*C.gchar, len(values)) + for i, accel := range values { + cvalues[i] = (*C.gchar)(C.CString(accel)) + defer C.free(unsafe.Pointer(cvalues[i])) + } + cvalues = append(cvalues, nil) + + return gobool(C.g_settings_set_strv(v.native(), cstr1, &cvalues[0])) +} + +// SetEnum is a wrapper around g_settings_set_enum(). +func (v *Settings) SetEnum(name string, value int) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_enum(v.native(), cstr1, C.gint(value))) +} + +// GetFlags is a wrapper around g_settings_get_flags(). +func (v *Settings) GetFlags(name string) uint { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return uint(C.g_settings_get_flags(v.native(), cstr1)) +} + +// SetFlags is a wrapper around g_settings_set_flags(). +func (v *Settings) SetFlags(name string, value uint) bool { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + return gobool(C.g_settings_set_flags(v.native(), cstr1, C.guint(value))) +} + +func (v *Settings) GetValue(name string) *Variant { + cstr := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr)) + return newVariant(C.g_settings_get_value(v.native(), cstr)) +} + +// GVariant * g_settings_get_value () +// gboolean g_settings_set_value () +// GVariant * g_settings_get_user_value () +// GVariant * g_settings_get_default_value () +// const gchar * const * g_settings_list_schemas () +// const gchar * const * g_settings_list_relocatable_schemas () +// gchar ** g_settings_list_keys () +// GVariant * g_settings_get_range () +// gboolean g_settings_range_check () +// void g_settings_get () +// gboolean g_settings_set () +// gpointer g_settings_get_mapped () +// void g_settings_bind () +// void g_settings_bind_with_mapping () +// void g_settings_bind_writable () +// void g_settings_unbind () +// gaction * g_settings_create_action () +// gchar ** g_settings_get_strv () +// gboolean g_settings_set_strv () diff --git a/vendor/github.com/gotk3/gotk3/glib/settings_backend.go b/vendor/github.com/gotk3/gotk3/glib/settings_backend.go new file mode 100644 index 0000000..3579ee4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings_backend.go @@ -0,0 +1,70 @@ +package glib + +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SettingsBackend is a representation of GSettingsBackend. +type SettingsBackend struct { + *Object +} + +// native() returns a pointer to the underlying GSettingsBackend. +func (v *SettingsBackend) native() *C.GSettingsBackend { + if v == nil || v.GObject == nil { + return nil + } + return C.toGSettingsBackend(unsafe.Pointer(v.GObject)) +} + +func (v *SettingsBackend) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalSettingsBackend(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSettingsBackend(wrapObject(unsafe.Pointer(c))), nil +} + +func wrapSettingsBackend(obj *Object) *SettingsBackend { + return &SettingsBackend{obj} +} + +// SettingsBackendGetDefault is a wrapper around g_settings_backend_get_default(). +func SettingsBackendGetDefault() *SettingsBackend { + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_settings_backend_get_default()))) +} + +// KeyfileSettingsBackendNew is a wrapper around g_keyfile_settings_backend_new(). +func KeyfileSettingsBackendNew(filename, rootPath, rootGroup string) *SettingsBackend { + cstr1 := (*C.gchar)(C.CString(filename)) + defer C.free(unsafe.Pointer(cstr1)) + + cstr2 := (*C.gchar)(C.CString(rootPath)) + defer C.free(unsafe.Pointer(cstr2)) + + cstr3 := (*C.gchar)(C.CString(rootGroup)) + defer C.free(unsafe.Pointer(cstr3)) + + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_keyfile_settings_backend_new(cstr1, cstr2, cstr3)))) +} + +// MemorySettingsBackendNew is a wrapper around g_memory_settings_backend_new(). +func MemorySettingsBackendNew() *SettingsBackend { + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_memory_settings_backend_new()))) +} + +// NullSettingsBackendNew is a wrapper around g_null_settings_backend_new(). +func NullSettingsBackendNew() *SettingsBackend { + return wrapSettingsBackend(wrapObject(unsafe.Pointer(C.g_null_settings_backend_new()))) +} + +// void g_settings_backend_changed () +// void g_settings_backend_path_changed () +// void g_settings_backend_keys_changed () +// void g_settings_backend_path_writable_changed () +// void g_settings_backend_writable_changed () +// void g_settings_backend_changed_tree () +// void g_settings_backend_flatten_tree () diff --git a/vendor/github.com/gotk3/gotk3/glib/settings_schema.go b/vendor/github.com/gotk3/gotk3/glib/settings_schema.go new file mode 100644 index 0000000..41839b1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings_schema.go @@ -0,0 +1,95 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SettingsSchema is a representation of GSettingsSchema. +type SettingsSchema struct { + schema *C.GSettingsSchema +} + +func wrapSettingsSchema(obj *C.GSettingsSchema) *SettingsSchema { + if obj == nil { + return nil + } + return &SettingsSchema{obj} +} + +func (v *SettingsSchema) Native() uintptr { + return uintptr(unsafe.Pointer(v.schema)) +} + +func (v *SettingsSchema) native() *C.GSettingsSchema { + if v == nil || v.schema == nil { + return nil + } + return v.schema +} + +// Ref() is a wrapper around g_settings_schema_ref(). +func (v *SettingsSchema) Ref() *SettingsSchema { + return wrapSettingsSchema(C.g_settings_schema_ref(v.native())) +} + +// Unref() is a wrapper around g_settings_schema_unref(). +func (v *SettingsSchema) Unref() { + C.g_settings_schema_unref(v.native()) +} + +// GetID() is a wrapper around g_settings_schema_get_id(). +func (v *SettingsSchema) GetID() string { + return C.GoString((*C.char)(C.g_settings_schema_get_id(v.native()))) +} + +// GetPath() is a wrapper around g_settings_schema_get_path(). +func (v *SettingsSchema) GetPath() string { + return C.GoString((*C.char)(C.g_settings_schema_get_path(v.native()))) +} + +// HasKey() is a wrapper around g_settings_schema_has_key(). +func (v *SettingsSchema) HasKey(v1 string) bool { + cstr := (*C.gchar)(C.CString(v1)) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.g_settings_schema_has_key(v.native(), cstr)) +} + +func toGoStringArray(c **C.gchar) []string { + var strs []string + originalc := c + defer C.g_strfreev(originalc) + + for *c != nil { + strs = append(strs, C.GoString((*C.char)(*c))) + c = C.next_gcharptr(c) + } + + return strs + +} + +// // ListChildren() is a wrapper around g_settings_schema_list_children(). +// func (v *SettingsSchema) ListChildren() []string { +// return toGoStringArray(C.g_settings_schema_list_children(v.native())) +// } + +// // ListKeys() is a wrapper around g_settings_schema_list_keys(). +// func (v *SettingsSchema) ListKeys() []string { +// return toGoStringArray(C.g_settings_schema_list_keys(v.native())) +// } + +// const GVariantType * g_settings_schema_key_get_value_type () +// GVariant * g_settings_schema_key_get_default_value () +// GVariant * g_settings_schema_key_get_range () +// gboolean g_settings_schema_key_range_check () +// const gchar * g_settings_schema_key_get_name () +// const gchar * g_settings_schema_key_get_summary () +// const gchar * g_settings_schema_key_get_description () + +// GSettingsSchemaKey * g_settings_schema_get_key () +// GSettingsSchemaKey * g_settings_schema_key_ref () +// void g_settings_schema_key_unref () diff --git a/vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go b/vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go new file mode 100644 index 0000000..a66a4c1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/settings_schema_source.go @@ -0,0 +1,69 @@ +package glib + +// #include +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SettingsSchemaSource is a representation of GSettingsSchemaSource. +type SettingsSchemaSource struct { + source *C.GSettingsSchemaSource +} + +func wrapSettingsSchemaSource(obj *C.GSettingsSchemaSource) *SettingsSchemaSource { + if obj == nil { + return nil + } + return &SettingsSchemaSource{obj} +} + +func (v *SettingsSchemaSource) Native() uintptr { + return uintptr(unsafe.Pointer(v.source)) +} + +func (v *SettingsSchemaSource) native() *C.GSettingsSchemaSource { + if v == nil || v.source == nil { + return nil + } + return v.source +} + +// SettingsSchemaSourceGetDefault is a wrapper around g_settings_schema_source_get_default(). +func SettingsSchemaSourceGetDefault() *SettingsSchemaSource { + return wrapSettingsSchemaSource(C.g_settings_schema_source_get_default()) +} + +// Ref() is a wrapper around g_settings_schema_source_ref(). +func (v *SettingsSchemaSource) Ref() *SettingsSchemaSource { + return wrapSettingsSchemaSource(C.g_settings_schema_source_ref(v.native())) +} + +// Unref() is a wrapper around g_settings_schema_source_unref(). +func (v *SettingsSchemaSource) Unref() { + C.g_settings_schema_source_unref(v.native()) +} + +// SettingsSchemaSourceNewFromDirectory() is a wrapper around g_settings_schema_source_new_from_directory(). +func SettingsSchemaSourceNewFromDirectory(dir string, parent *SettingsSchemaSource, trusted bool) *SettingsSchemaSource { + cstr := (*C.gchar)(C.CString(dir)) + defer C.free(unsafe.Pointer(cstr)) + + return wrapSettingsSchemaSource(C.g_settings_schema_source_new_from_directory(cstr, parent.native(), gbool(trusted), nil)) +} + +// Lookup() is a wrapper around g_settings_schema_source_lookup(). +func (v *SettingsSchemaSource) Lookup(schema string, recursive bool) *SettingsSchema { + cstr := (*C.gchar)(C.CString(schema)) + defer C.free(unsafe.Pointer(cstr)) + + return wrapSettingsSchema(C.g_settings_schema_source_lookup(v.native(), cstr, gbool(recursive))) +} + +// ListSchemas is a wrapper around g_settings_schema_source_list_schemas(). +func (v *SettingsSchemaSource) ListSchemas(recursive bool) (nonReolcatable, relocatable []string) { + var nonRel, rel **C.gchar + C.g_settings_schema_source_list_schemas(v.native(), gbool(recursive), &nonRel, &rel) + return toGoStringArray(nonRel), toGoStringArray(rel) +} diff --git a/vendor/github.com/gotk3/gotk3/glib/slist.go b/vendor/github.com/gotk3/gotk3/glib/slist.go new file mode 100644 index 0000000..2b3a6d8 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/glib/slist.go @@ -0,0 +1,159 @@ +package glib + +// #include +// #include +// #include "glib.go.h" +import "C" +import "unsafe" + +// SList is a representation of Glib's GSList. A SList must be manually freed +// by either calling Free() or FreeFull() +type SList struct { + list *C.struct__GSList + // If set, dataWrap is called every time Data() + // is called to wrap raw underlying + // value into appropriate type. + dataWrap func(unsafe.Pointer) interface{} +} + +func WrapSList(obj uintptr) *SList { + return wrapSList((*C.struct__GSList)(unsafe.Pointer(obj))) +} + +func wrapSList(obj *C.struct__GSList) *SList { + if obj == nil { + return nil + } + + //NOTE a list should be freed by calling either + //g_slist_free() or g_slist_free_full(). However, it's not possible to use a + //finalizer for this. + return &SList{list: obj} +} + +func (v *SList) wrapNewHead(obj *C.struct__GSList) *SList { + if obj == nil { + return nil + } + return &SList{ + list: obj, + dataWrap: v.dataWrap, + } +} + +func (v *SList) Native() uintptr { + return uintptr(unsafe.Pointer(v.list)) +} + +func (v *SList) native() *C.struct__GSList { + if v == nil || v.list == nil { + return nil + } + return v.list +} + +// DataWapper sets wrap functions, which is called during NthData() +// and Data(). It's used to cast raw C data into appropriate +// Go structures and types every time that data is retreived. +func (v *SList) DataWrapper(fn func(unsafe.Pointer) interface{}) { + if v == nil { + return + } + v.dataWrap = fn +} + +func (v *SList) Append(data uintptr) *SList { + ret := C.g_slist_append(v.native(), C.gpointer(data)) + if ret == v.native() { + return v + } + + return wrapSList(ret) +} + +// Length is a wrapper around g_slist_length(). +func (v *SList) Length() uint { + return uint(C.g_slist_length(v.native())) +} + +// Next is a wrapper around the next struct field +func (v *SList) Next() *SList { + n := v.native() + if n == nil { + return nil + } + + return wrapSList(n.next) +} + +// dataRaw is a wrapper around the data struct field +func (v *SList) dataRaw() unsafe.Pointer { + n := v.native() + if n == nil { + return nil + } + return unsafe.Pointer(n.data) +} + +// DataRaw is a wrapper around the data struct field +func (v *SList) DataRaw() unsafe.Pointer { + n := v.native() + if n == nil { + return nil + } + return unsafe.Pointer(n.data) +} + +// Data acts the same as data struct field, but it returns raw unsafe.Pointer as interface. +// TODO: Align with List struct and add member + logic for `dataWrap func(unsafe.Pointer) interface{}`? +func (v *SList) Data() interface{} { + ptr := v.dataRaw() + if v.dataWrap != nil { + return v.dataWrap(ptr) + } + return ptr +} + +// Foreach acts the same as g_slist_foreach(). +// No user_data argument is implemented because of Go clojure capabilities. +func (v *SList) Foreach(fn func(item interface{})) { + for l := v; l != nil; l = l.Next() { + fn(l.Data()) + } +} + +// Free is a wrapper around g_slist_free(). +func (v *SList) Free() { + C.g_slist_free(v.native()) +} + +// FreeFull is a wrapper around g_slist_free_full(). +func (v *SList) FreeFull() { + //TODO implement GDestroyNotify callback + C.g_slist_free_full(v.native(), nil) +} + +// GSList * g_slist_alloc () +// GSList * g_slist_prepend () +// GSList * g_slist_insert () +// GSList * g_slist_insert_before () +// GSList * g_slist_insert_sorted () +// GSList * g_slist_remove () +// GSList * g_slist_remove_link () +// GSList * g_slist_delete_link () +// GSList * g_slist_remove_all () +// void g_slist_free_1 () +// GSList * g_slist_copy () +// GSList * g_slist_copy_deep () +// GSList * g_slist_reverse () +// GSList * g_slist_insert_sorted_with_data () +// GSList * g_slist_sort () +// GSList * g_slist_sort_with_data () +// GSList * g_slist_concat () +// GSList * g_slist_last () +// GSList * g_slist_nth () +// gpointer g_slist_nth_data () +// GSList * g_slist_find () +// GSList * g_slist_find_custom () +// gint g_slist_position () +// gint g_slist_index () diff --git a/vendor/github.com/gotk3/gotk3/gtk/aboutdialog.go b/vendor/github.com/gotk3/gotk3/gtk/aboutdialog.go new file mode 100644 index 0000000..a805e59 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/aboutdialog.go @@ -0,0 +1,328 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_about_dialog_get_type()), marshalAboutDialog}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkAboutDialog"] = wrapAboutDialog +} + +/* + * GtkAboutDialog + */ + +// AboutDialog is a representation of GTK's GtkAboutDialog. +type AboutDialog struct { + Dialog +} + +// native returns a pointer to the underlying GtkAboutDialog. +func (v *AboutDialog) native() *C.GtkAboutDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAboutDialog(p) +} + +func marshalAboutDialog(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAboutDialog(obj), nil +} + +func wrapAboutDialog(obj *glib.Object) *AboutDialog { + if obj == nil { + return nil + } + + return &AboutDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} +} + +// AboutDialogNew is a wrapper around gtk_about_dialog_new(). +func AboutDialogNew() (*AboutDialog, error) { + c := C.gtk_about_dialog_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAboutDialog(obj), nil +} + +// GetComments is a wrapper around gtk_about_dialog_get_comments(). +func (v *AboutDialog) GetComments() string { + c := C.gtk_about_dialog_get_comments(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetComments is a wrapper around gtk_about_dialog_set_comments(). +func (v *AboutDialog) SetComments(comments string) { + cstr := C.CString(comments) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_comments(v.native(), (*C.gchar)(cstr)) +} + +// GetCopyright is a wrapper around gtk_about_dialog_get_copyright(). +func (v *AboutDialog) GetCopyright() string { + c := C.gtk_about_dialog_get_copyright(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetCopyright is a wrapper around gtk_about_dialog_set_copyright(). +func (v *AboutDialog) SetCopyright(copyright string) { + cstr := C.CString(copyright) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_copyright(v.native(), (*C.gchar)(cstr)) +} + +// GetLicense is a wrapper around gtk_about_dialog_get_license(). +func (v *AboutDialog) GetLicense() string { + c := C.gtk_about_dialog_get_license(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetLicense is a wrapper around gtk_about_dialog_set_license(). +func (v *AboutDialog) SetLicense(license string) { + cstr := C.CString(license) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_license(v.native(), (*C.gchar)(cstr)) +} + +// GetLicenseType is a wrapper around gtk_about_dialog_get_license_type(). +func (v *AboutDialog) GetLicenseType() License { + c := C.gtk_about_dialog_get_license_type(v.native()) + return License(c) +} + +// SetLicenseType is a wrapper around gtk_about_dialog_set_license_type(). +func (v *AboutDialog) SetLicenseType(license License) { + C.gtk_about_dialog_set_license_type(v.native(), C.GtkLicense(license)) +} + +// GetLogo is a wrapper around gtk_about_dialog_get_logo(). +func (v *AboutDialog) GetLogo() (*gdk.Pixbuf, error) { + c := C.gtk_about_dialog_get_logo(v.native()) + if c == nil { + return nil, nilPtrErr + } + + p := &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))} + return p, nil +} + +// SetLogo is a wrapper around gtk_about_dialog_set_logo(). +func (v *AboutDialog) SetLogo(logo *gdk.Pixbuf) { + logoPtr := (*C.GdkPixbuf)(unsafe.Pointer(logo.Native())) + C.gtk_about_dialog_set_logo(v.native(), logoPtr) +} + +// GetLogoIconName is a wrapper around gtk_about_dialog_get_logo_icon_name(). +func (v *AboutDialog) GetLogoIconName() string { + c := C.gtk_about_dialog_get_logo_icon_name(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetLogoIconName is a wrapper around gtk_about_dialog_set_logo_icon_name(). +func (v *AboutDialog) SetLogoIconName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_logo_icon_name(v.native(), (*C.gchar)(cstr)) +} + +// GetProgramName is a wrapper around gtk_about_dialog_get_program_name(). +func (v *AboutDialog) GetProgramName() string { + c := C.gtk_about_dialog_get_program_name(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetProgramName is a wrapper around gtk_about_dialog_set_program_name(). +func (v *AboutDialog) SetProgramName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_program_name(v.native(), (*C.gchar)(cstr)) +} + +// GetAuthors is a wrapper around gtk_about_dialog_get_authors(). +func (v *AboutDialog) GetAuthors() []string { + var authors []string + cauthors := C.gtk_about_dialog_get_authors(v.native()) + if cauthors == nil { + return nil + } + for { + if *cauthors == nil { + break + } + authors = append(authors, C.GoString((*C.char)(*cauthors))) + cauthors = nextgcharptr(cauthors) + } + return authors +} + +// SetAuthors is a wrapper around gtk_about_dialog_set_authors(). +func (v *AboutDialog) SetAuthors(authors []string) { + cauthors := C.make_strings(C.int(len(authors) + 1)) + for i, author := range authors { + cstr := C.CString(author) + defer C.free(unsafe.Pointer(cstr)) + C.set_string(cauthors, C.int(i), (*C.gchar)(cstr)) + } + + C.set_string(cauthors, C.int(len(authors)), nil) + C.gtk_about_dialog_set_authors(v.native(), cauthors) + C.destroy_strings(cauthors) +} + +// GetArtists is a wrapper around gtk_about_dialog_get_artists(). +func (v *AboutDialog) GetArtists() []string { + var artists []string + cartists := C.gtk_about_dialog_get_artists(v.native()) + if cartists == nil { + return nil + } + for { + if *cartists == nil { + break + } + artists = append(artists, C.GoString((*C.char)(*cartists))) + cartists = nextgcharptr(cartists) + } + return artists +} + +// SetArtists is a wrapper around gtk_about_dialog_set_artists(). +func (v *AboutDialog) SetArtists(artists []string) { + cartists := C.make_strings(C.int(len(artists) + 1)) + for i, artist := range artists { + cstr := C.CString(artist) + defer C.free(unsafe.Pointer(cstr)) + C.set_string(cartists, C.int(i), (*C.gchar)(cstr)) + } + + C.set_string(cartists, C.int(len(artists)), nil) + C.gtk_about_dialog_set_artists(v.native(), cartists) + C.destroy_strings(cartists) +} + +// GetDocumenters is a wrapper around gtk_about_dialog_get_documenters(). +func (v *AboutDialog) GetDocumenters() []string { + var documenters []string + cdocumenters := C.gtk_about_dialog_get_documenters(v.native()) + if cdocumenters == nil { + return nil + } + for { + if *cdocumenters == nil { + break + } + documenters = append(documenters, C.GoString((*C.char)(*cdocumenters))) + cdocumenters = nextgcharptr(cdocumenters) + } + return documenters +} + +// SetDocumenters is a wrapper around gtk_about_dialog_set_documenters(). +func (v *AboutDialog) SetDocumenters(documenters []string) { + cdocumenters := C.make_strings(C.int(len(documenters) + 1)) + for i, doc := range documenters { + cstr := C.CString(doc) + defer C.free(unsafe.Pointer(cstr)) + C.set_string(cdocumenters, C.int(i), (*C.gchar)(cstr)) + } + + C.set_string(cdocumenters, C.int(len(documenters)), nil) + C.gtk_about_dialog_set_documenters(v.native(), cdocumenters) + C.destroy_strings(cdocumenters) +} + +// GetTranslatorCredits is a wrapper around gtk_about_dialog_get_translator_credits(). +func (v *AboutDialog) GetTranslatorCredits() string { + c := C.gtk_about_dialog_get_translator_credits(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetTranslatorCredits is a wrapper around gtk_about_dialog_set_translator_credits(). +func (v *AboutDialog) SetTranslatorCredits(translatorCredits string) { + cstr := C.CString(translatorCredits) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_translator_credits(v.native(), (*C.gchar)(cstr)) +} + +// GetVersion is a wrapper around gtk_about_dialog_get_version(). +func (v *AboutDialog) GetVersion() string { + c := C.gtk_about_dialog_get_version(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetVersion is a wrapper around gtk_about_dialog_set_version(). +func (v *AboutDialog) SetVersion(version string) { + cstr := C.CString(version) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_version(v.native(), (*C.gchar)(cstr)) +} + +// GetWebsite is a wrapper around gtk_about_dialog_get_website(). +func (v *AboutDialog) GetWebsite() string { + c := C.gtk_about_dialog_get_website(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetWebsite is a wrapper around gtk_about_dialog_set_website(). +func (v *AboutDialog) SetWebsite(website string) { + cstr := C.CString(website) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_website(v.native(), (*C.gchar)(cstr)) +} + +// GetWebsiteLabel is a wrapper around gtk_about_dialog_get_website_label(). +func (v *AboutDialog) GetWebsiteLabel() string { + c := C.gtk_about_dialog_get_website_label(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetWebsiteLabel is a wrapper around gtk_about_dialog_set_website_label(). +func (v *AboutDialog) SetWebsiteLabel(websiteLabel string) { + cstr := C.CString(websiteLabel) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_about_dialog_set_website_label(v.native(), (*C.gchar)(cstr)) +} + +// GetWrapLicense is a wrapper around gtk_about_dialog_get_wrap_license(). +func (v *AboutDialog) GetWrapLicense() bool { + return gobool(C.gtk_about_dialog_get_wrap_license(v.native())) +} + +// SetWrapLicense is a wrapper around gtk_about_dialog_set_wrap_license(). +func (v *AboutDialog) SetWrapLicense(wrapLicense bool) { + C.gtk_about_dialog_set_wrap_license(v.native(), gbool(wrapLicense)) +} + +// AddCreditSection is a wrapper around gtk_about_dialog_add_credit_section(). +func (v *AboutDialog) AddCreditSection(sectionName string, people []string) { + cname := (*C.gchar)(C.CString(sectionName)) + defer C.free(unsafe.Pointer(cname)) + + cpeople := C.make_strings(C.int(len(people)) + 1) + defer C.destroy_strings(cpeople) + for i, p := range people { + cp := (*C.gchar)(C.CString(p)) + defer C.free(unsafe.Pointer(cp)) + C.set_string(cpeople, C.int(i), cp) + } + C.set_string(cpeople, C.int(len(people)), nil) + + C.gtk_about_dialog_add_credit_section(v.native(), cname, cpeople) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/accel.go b/vendor/github.com/gotk3/gotk3/gtk/accel.go new file mode 100644 index 0000000..1780602 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/accel.go @@ -0,0 +1,447 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +// AccelFlags is a representation of GTK's GtkAccelFlags +type AccelFlags int + +const ( + ACCEL_VISIBLE AccelFlags = C.GTK_ACCEL_VISIBLE + ACCEL_LOCKED AccelFlags = C.GTK_ACCEL_LOCKED + ACCEL_MASK AccelFlags = C.GTK_ACCEL_MASK +) + +func marshalAccelFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return AccelFlags(c), nil +} + +// AcceleratorName is a wrapper around gtk_accelerator_name(). +func AcceleratorName(key uint, mods gdk.ModifierType) string { + c := C.gtk_accelerator_name(C.guint(key), C.GdkModifierType(mods)) + defer C.free(unsafe.Pointer(c)) + return C.GoString((*C.char)(c)) +} + +// AcceleratorValid is a wrapper around gtk_accelerator_valid(). +func AcceleratorValid(key uint, mods gdk.ModifierType) bool { + return gobool(C.gtk_accelerator_valid(C.guint(key), C.GdkModifierType(mods))) +} + +// AcceleratorGetDefaultModMask is a wrapper around gtk_accelerator_get_default_mod_mask(). +func AcceleratorGetDefaultModMask() gdk.ModifierType { + return gdk.ModifierType(C.gtk_accelerator_get_default_mod_mask()) +} + +// AcceleratorParse is a wrapper around gtk_accelerator_parse(). +func AcceleratorParse(acc string) (key uint, mods gdk.ModifierType) { + cstr := C.CString(acc) + defer C.free(unsafe.Pointer(cstr)) + + k := C.guint(0) + m := C.GdkModifierType(0) + + C.gtk_accelerator_parse((*C.gchar)(cstr), &k, &m) + return uint(k), gdk.ModifierType(m) +} + +// AcceleratorGetLabel is a wrapper around gtk_accelerator_get_label(). +func AcceleratorGetLabel(key uint, mods gdk.ModifierType) string { + c := C.gtk_accelerator_get_label(C.guint(key), C.GdkModifierType(mods)) + defer C.free(unsafe.Pointer(c)) + return C.GoString((*C.char)(c)) +} + +// AcceleratorSetDefaultModMask is a wrapper around gtk_accelerator_set_default_mod_mask(). +func AcceleratorSetDefaultModMask(mods gdk.ModifierType) { + C.gtk_accelerator_set_default_mod_mask(C.GdkModifierType(mods)) +} + +/* + * GtkAccelLabel + */ + +// TODO: +// gtk_accel_label_new(). +// gtk_accel_label_set_accel_closure(). +// gtk_accel_label_get_accel_widget(). +// gtk_accel_label_set_accel_widget(). +// gtk_accel_label_get_accel_width(). +// gtk_accel_label_set_accel(). since GTK 3.6 +// gtk_accel_label_get_accel(). since GTK 3.12 +// gtk_accel_label_refetch(). + +/* + * GtkAccelGroup + */ + +// AccelGroup is a representation of GTK's GtkAccelGroup. +type AccelGroup struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkAccelGroup. +func (v *AccelGroup) native() *C.GtkAccelGroup { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAccelGroup(p) +} + +func marshalAccelGroup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAccelGroup(obj), nil +} + +func wrapAccelGroup(obj *glib.Object) *AccelGroup { + if obj == nil { + return nil + } + + return &AccelGroup{obj} +} + +// AccelGroup is a wrapper around gtk_accel_group_new(). +func AccelGroupNew() (*AccelGroup, error) { + c := C.gtk_accel_group_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAccelGroup(obj), nil +} + +// Connect is a wrapper around gtk_accel_group_connect(). +func (v *AccelGroup) Connect(key uint, mods gdk.ModifierType, flags AccelFlags, f interface{}) { + closure := glib.ClosureNew(f) + cl := (*C.struct__GClosure)(unsafe.Pointer(closure)) + C.gtk_accel_group_connect( + v.native(), + C.guint(key), + C.GdkModifierType(mods), + C.GtkAccelFlags(flags), + cl) +} + +// ConnectByPath is a wrapper around gtk_accel_group_connect_by_path(). +func (v *AccelGroup) ConnectByPath(path string, f interface{}) { + closure := glib.ClosureNew(f) + cl := (*C.struct__GClosure)(unsafe.Pointer(closure)) + + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_group_connect_by_path( + v.native(), + (*C.gchar)(cstr), + cl) +} + +// Disconnect is a wrapper around gtk_accel_group_disconnect(). +func (v *AccelGroup) Disconnect(f interface{}) { + closure := glib.ClosureNew(f) + cl := (*C.struct__GClosure)(unsafe.Pointer(closure)) + C.gtk_accel_group_disconnect(v.native(), cl) +} + +// DisconnectKey is a wrapper around gtk_accel_group_disconnect_key(). +func (v *AccelGroup) DisconnectKey(key uint, mods gdk.ModifierType) { + C.gtk_accel_group_disconnect_key(v.native(), C.guint(key), C.GdkModifierType(mods)) +} + +// Lock is a wrapper around gtk_accel_group_lock(). +func (v *AccelGroup) Lock() { + C.gtk_accel_group_lock(v.native()) +} + +// Unlock is a wrapper around gtk_accel_group_unlock(). +func (v *AccelGroup) Unlock() { + C.gtk_accel_group_unlock(v.native()) +} + +// IsLocked is a wrapper around gtk_accel_group_get_is_locked(). +func (v *AccelGroup) IsLocked() bool { + return gobool(C.gtk_accel_group_get_is_locked(v.native())) +} + +// AccelGroupFromClosure is a wrapper around gtk_accel_group_from_accel_closure(). +func AccelGroupFromClosure(f interface{}) *AccelGroup { + closure := glib.ClosureNew(f) + cl := (*C.struct__GClosure)(unsafe.Pointer(closure)) + c := C.gtk_accel_group_from_accel_closure(cl) + if c == nil { + return nil + } + return wrapAccelGroup(glib.Take(unsafe.Pointer(c))) +} + +// GetModifierMask is a wrapper around gtk_accel_group_get_modifier_mask(). +func (v *AccelGroup) GetModifierMask() gdk.ModifierType { + return gdk.ModifierType(C.gtk_accel_group_get_modifier_mask(v.native())) +} + +// AccelGroupsActivate is a wrapper around gtk_accel_groups_activate(). +func AccelGroupsActivate(obj *glib.Object, key uint, mods gdk.ModifierType) bool { + return gobool(C.gtk_accel_groups_activate((*C.GObject)(unsafe.Pointer(obj.Native())), C.guint(key), C.GdkModifierType(mods))) +} + +// Activate is a wrapper around gtk_accel_group_activate(). +func (v *AccelGroup) Activate(quark glib.Quark, acceleratable *glib.Object, key uint, mods gdk.ModifierType) bool { + return gobool(C.gtk_accel_group_activate(v.native(), C.GQuark(quark), (*C.GObject)(unsafe.Pointer(acceleratable.Native())), C.guint(key), C.GdkModifierType(mods))) +} + +// AccelGroupsFromObject is a wrapper around gtk_accel_groups_from_object(). +func AccelGroupsFromObject(obj *glib.Object) *glib.SList { + res := C.gtk_accel_groups_from_object((*C.GObject)(unsafe.Pointer(obj.Native()))) + if res == nil { + return nil + } + + // TODO: call DataWrapper on SList and wrap them to gtk.AccelGroup + + return (*glib.SList)(unsafe.Pointer(res)) +} + +/* + * GtkAccelMap + */ + +// AccelMap is a representation of GTK's GtkAccelMap. +type AccelMap struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkAccelMap. +func (v *AccelMap) native() *C.GtkAccelMap { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAccelMap(p) +} + +func marshalAccelMap(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAccelMap(obj), nil +} + +func wrapAccelMap(obj *glib.Object) *AccelMap { + if obj == nil { + return nil + } + + return &AccelMap{obj} +} + +// AccelMapAddEntry is a wrapper around gtk_accel_map_add_entry(). +func AccelMapAddEntry(path string, key uint, mods gdk.ModifierType) { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_map_add_entry((*C.gchar)(cstr), C.guint(key), C.GdkModifierType(mods)) +} + +type AccelKey C.GtkAccelKey + +func (v *AccelKey) native() *C.GtkAccelKey { + if v == nil { + return nil + } + return (*C.GtkAccelKey)(v) +} + +// AccelMapLookupEntry is a wrapper around gtk_accel_map_lookup_entry(). +func AccelMapLookupEntry(path string) *AccelKey { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + var v = new(AccelKey) + + C.gtk_accel_map_lookup_entry((*C.gchar)(cstr), v.native()) + return v +} + +// AccelMapChangeEntry is a wrapper around gtk_accel_map_change_entry(). +func AccelMapChangeEntry(path string, key uint, mods gdk.ModifierType, replace bool) bool { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.gtk_accel_map_change_entry((*C.gchar)(cstr), C.guint(key), C.GdkModifierType(mods), gbool(replace))) +} + +// AccelMapLoad is a wrapper around gtk_accel_map_load(). +func AccelMapLoad(fileName string) { + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_map_load((*C.gchar)(cstr)) +} + +// AccelMapSave is a wrapper around gtk_accel_map_save(). +func AccelMapSave(fileName string) { + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_map_save((*C.gchar)(cstr)) +} + +// AccelMapLoadFD is a wrapper around gtk_accel_map_load_fd(). +func AccelMapLoadFD(fd int) { + C.gtk_accel_map_load_fd(C.gint(fd)) +} + +// AccelMapSaveFD is a wrapper around gtk_accel_map_save_fd(). +func AccelMapSaveFD(fd int) { + C.gtk_accel_map_save_fd(C.gint(fd)) +} + +// AccelMapAddFilter is a wrapper around gtk_accel_map_add_filter(). +func AccelMapAddFilter(filter string) { + cstr := C.CString(filter) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_map_add_filter((*C.gchar)(cstr)) +} + +// AccelMapGet is a wrapper around gtk_accel_map_get(). +func AccelMapGet() *AccelMap { + c := C.gtk_accel_map_get() + if c == nil { + return nil + } + return wrapAccelMap(glib.Take(unsafe.Pointer(c))) +} + +// AccelMapLockPath is a wrapper around gtk_accel_map_lock_path(). +func AccelMapLockPath(path string) { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_map_lock_path((*C.gchar)(cstr)) +} + +// AccelMapUnlockPath is a wrapper around gtk_accel_map_unlock_path(). +func AccelMapUnlockPath(path string) { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_accel_map_unlock_path((*C.gchar)(cstr)) +} + +// SetAccelGroup is a wrapper around gtk_menu_set_accel_group(). +func (v *Menu) SetAccelGroup(accelGroup *AccelGroup) { + C.gtk_menu_set_accel_group(v.native(), accelGroup.native()) +} + +// GetAccelGroup is a wrapper around gtk_menu_get_accel_group(). +func (v *Menu) GetAccelGroup() *AccelGroup { + c := C.gtk_menu_get_accel_group(v.native()) + if c == nil { + return nil + } + return wrapAccelGroup(glib.Take(unsafe.Pointer(c))) +} + +// SetAccelPath is a wrapper around gtk_menu_set_accel_path(). +func (v *Menu) SetAccelPath(path string) { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_menu_set_accel_path(v.native(), (*C.gchar)(cstr)) +} + +// GetAccelPath is a wrapper around gtk_menu_get_accel_path(). +func (v *Menu) GetAccelPath() string { + c := C.gtk_menu_get_accel_path(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetAccelPath is a wrapper around gtk_menu_item_set_accel_path(). +func (v *MenuItem) SetAccelPath(path string) { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_menu_item_set_accel_path(v.native(), (*C.gchar)(cstr)) +} + +// GetAccelPath is a wrapper around gtk_menu_item_get_accel_path(). +func (v *MenuItem) GetAccelPath() string { + c := C.gtk_menu_item_get_accel_path(v.native()) + return C.GoString((*C.char)(c)) +} + +// AddAccelerator is a wrapper around gtk_widget_add_accelerator(). +func (v *Widget) AddAccelerator(signal string, group *AccelGroup, key uint, mods gdk.ModifierType, flags AccelFlags) { + csignal := (*C.gchar)(C.CString(signal)) + defer C.free(unsafe.Pointer(csignal)) + + C.gtk_widget_add_accelerator(v.native(), + csignal, + group.native(), + C.guint(key), + C.GdkModifierType(mods), + C.GtkAccelFlags(flags)) +} + +// RemoveAccelerator is a wrapper around gtk_widget_remove_accelerator(). +func (v *Widget) RemoveAccelerator(group *AccelGroup, key uint, mods gdk.ModifierType) bool { + return gobool(C.gtk_widget_remove_accelerator(v.native(), + group.native(), + C.guint(key), + C.GdkModifierType(mods))) +} + +// SetAccelPath is a wrapper around gtk_widget_set_accel_path(). +func (v *Widget) SetAccelPath(path string, group *AccelGroup) { + cstr := (*C.gchar)(C.CString(path)) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_widget_set_accel_path(v.native(), cstr, group.native()) +} + +// CanActivateAccel is a wrapper around gtk_widget_can_activate_accel(). +func (v *Widget) CanActivateAccel(signalId uint) bool { + return gobool(C.gtk_widget_can_activate_accel(v.native(), C.guint(signalId))) +} + +// AddAccelGroup() is a wrapper around gtk_window_add_accel_group(). +func (v *Window) AddAccelGroup(accelGroup *AccelGroup) { + C.gtk_window_add_accel_group(v.native(), accelGroup.native()) +} + +// RemoveAccelGroup() is a wrapper around gtk_window_remove_accel_group(). +func (v *Window) RemoveAccelGroup(accelGroup *AccelGroup) { + C.gtk_window_remove_accel_group(v.native(), accelGroup.native()) +} + +// These three functions are for system level access - thus not as high priority to implement +// TODO: void gtk_accelerator_parse_with_keycode () +// TODO: gchar * gtk_accelerator_name_with_keycode () +// TODO: gchar * gtk_accelerator_get_label_with_keycode () + +// TODO: GtkAccelKey * gtk_accel_group_find () - this function uses a function type - I don't know how to represent it in cgo +// TODO: gtk_accel_map_foreach_unfiltered - can't be done without a function type +// TODO: gtk_accel_map_foreach - can't be done without a function type + +// TODO: gtk_accel_map_load_scanner + +/* + * GtkWidget + */ + +// TODO: +// gtk_widget_list_accel_closures diff --git a/vendor/github.com/gotk3/gotk3/gtk/accel_test.go b/vendor/github.com/gotk3/gotk3/gtk/accel_test.go new file mode 100644 index 0000000..938fd22 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/accel_test.go @@ -0,0 +1,34 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +import "testing" + +func Test_AccelGroup_Locking(t *testing.T) { + ag, _ := AccelGroupNew() + if ag.IsLocked() { + t.Error("A newly created AccelGroup should not be locked") + } + + ag.Lock() + + if !ag.IsLocked() { + t.Error("A locked AccelGroup should report being locked") + } + + ag.Unlock() + + if ag.IsLocked() { + t.Error("An unlocked AccelGroup should report being unlocked") + } +} + +func Test_AcceleratorParse(t *testing.T) { + l, r := AcceleratorParse("F1") + if l != 65470 { + t.Errorf("Expected parsed key to equal %d but was %d", 65470, l) + } + if r != 9 { + t.Errorf("Expected parsed mods to equal %d but was %d", 9, r) + } +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/actionable.go b/vendor/github.com/gotk3/gotk3/gtk/actionable.go new file mode 100644 index 0000000..2dff2f2 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/actionable.go @@ -0,0 +1,121 @@ +package gtk + +// #include +// #include "gtk.go.h" +// #include "actionable.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_actionable_get_type()), marshalActionable}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkActionable"] = marshalActionable +} + +// IActionable is a representation of the GtkActionable GInterface, +// used to avoid duplication when embedding the type in a wrapper of another GObject-based type. +// The non-Interface version should only be used Actionable is used if the concrete type is not known. +type IActionable interface { + Native() uintptr + toActionable() *C.GtkActionable + + SetActionName(name string) + GetActionName() (string, error) + // SetActionTargetValue(value *glib.Variant) + // GetActionTargetValue() (*glib.Variant, error) + // SetActionTarget(string, params...) + SetDetailedActionName(name string) +} + +// Actionable is a representation of the GtkActionable GInterface. +// Do not embed this concrete type in implementing structs but rather use IActionable +// (see Button wrapper for an example) +type Actionable struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkActionable. +func (v *Actionable) native() *C.GtkActionable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkActionable(p) +} + +func marshalActionable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapActionable(obj), nil +} + +func wrapActionable(obj *glib.Object) *Actionable { + if obj == nil { + return nil + } + + return &Actionable{obj} +} + +func (v *Actionable) toActionable() *C.GtkActionable { + if v == nil { + return nil + } + return v.native() +} + +// SetActionName is a wrapper around gtk_actionable_set_action_name(). +// Since 3.4 +func (v *Actionable) SetActionName(action_name string) { + cstr := C.CString(action_name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_actionable_set_action_name(v.native(), (*C.gchar)(cstr)) +} + +// GetActionName is a wrapper around gtk_actionable_set_action_name(). +// Since 3.4 +func (v *Actionable) GetActionName() (string, error) { + c := C.gtk_actionable_get_action_name(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// SetDetailedActionName is a wrapper around gtk_actionable_set_detailed_action_name(). +// Since 3.4 +func (v *Actionable) SetDetailedActionName(detailed_action_name string) { + cstr := C.CString(detailed_action_name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_actionable_set_detailed_action_name(v.native(), (*C.gchar)(cstr)) +} + +// SetActionTargetValue is a wrapper around gtk_actionable_set_action_target_value(). +// Since 3.4 +/*func (v *Actionable) SetActionTargetValue(value *glib.Variant) { + // FIXME ToGVariant does not work here + C.gtk_actionable_set_action_target_value(v.native(), value.ToGVariant()) +}*/ + +// GetActionTargetValue is a wrapper around gtk_actionable_get_action_target_value(). +// Since 3.4 +/*func (v *Actionable) GetActionTargetValue() (*glib.Variant, error) { + // FIXME: newVariant is not exported from glib + return newVariant(C.gtk_actionable_get_action_target_value(v.native(), cstr)) +}*/ + +/* +// Since 3.4 +void +gtk_actionable_set_action_target (GtkActionable *actionable, + const gchar *format_string, + ...); +*/ diff --git a/vendor/github.com/gotk3/gotk3/gtk/actionable.go.h b/vendor/github.com/gotk3/gotk3/gtk/actionable.go.h new file mode 100644 index 0000000..24846f7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/actionable.go.h @@ -0,0 +1 @@ +static GtkActionable *toGtkActionable(void *p) { return (GTK_ACTIONABLE(p)); } diff --git a/vendor/github.com/gotk3/gotk3/gtk/actionable_test.go b/vendor/github.com/gotk3/gotk3/gtk/actionable_test.go new file mode 100644 index 0000000..5a572a9 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/actionable_test.go @@ -0,0 +1,35 @@ +package gtk + +import "testing" + +func TestActionableImplementsIActionable(t *testing.T) { + var cut interface{} + cut = &Actionable{} + _, ok := cut.(IActionable) + + if !ok { + t.Error("Actionable does not implement IActionable") + return + } +} + +// TestGetSetActionName tests the getter and setter for action name +// using a button, as we need an actual instance implementing Actionable. +func TestGetSetActionName(t *testing.T) { + cut, err := ButtonNew() + if err != nil { + t.Fatal("Error creating button", err.Error()) + } + + expected := "app.stuff" + cut.SetActionName(expected) + + actual, err := cut.GetActionName() + if err != nil { + t.Fatal("Error getting action name", err.Error()) + } + + if expected != actual { + t.Fatalf("Expected %s got %s", expected, actual) + } +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go new file mode 100644 index 0000000..7f21262 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go @@ -0,0 +1,109 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols included since GTK 3.12, and +// and should not be included in a build intended to target any older GTK +// versions. To target an older build, such as 3.10, use +// 'go build -tags gtk_3_10'. Otherwise, if no build tags are used, GTK 3.12 +// is assumed and this file is built. +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +package gtk + +// #include +// #include "actionbar_since_3_12.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_action_bar_get_type()), marshalActionBar}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkActionBar"] = wrapActionBar +} + +// ActionBar is a representation of GtkActionBar +type ActionBar struct { + Bin +} + +func (v *ActionBar) native() *C.GtkActionBar { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkActionBar(p) +} + +func marshalActionBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapActionBar(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapActionBar(obj *glib.Object) *ActionBar { + if obj == nil { + return nil + } + + return &ActionBar{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// ActionBarNew is a wrapper around gtk_action_bar_new() +func ActionBarNew() (*ActionBar, error) { + c := C.gtk_action_bar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapActionBar(glib.Take(unsafe.Pointer(c))), nil +} + +// PackStart is a wrapper around gtk_action_bar_pack_start(). +func (a *ActionBar) PackStart(child IWidget) { + C.gtk_action_bar_pack_start(a.native(), child.toWidget()) +} + +// PackEnd is a wrapper around gtk_action_bar_pack_end(). +func (a *ActionBar) PackEnd(child IWidget) { + C.gtk_action_bar_pack_end(a.native(), child.toWidget()) +} + +// SetCenterWidget is a wrapper around gtk_action_bar_set_center_widget(). +func (a *ActionBar) SetCenterWidget(child IWidget) { + if child == nil { + C.gtk_action_bar_set_center_widget(a.native(), nil) + } else { + C.gtk_action_bar_set_center_widget(a.native(), child.toWidget()) + } +} + +// GetCenterWidget is a wrapper around gtk_action_bar_get_center_widget(). +func (a *ActionBar) GetCenterWidget() (IWidget, error) { + w := C.gtk_action_bar_get_center_widget(a.native()) + if w == nil { + return nil, nil + } + return castWidget(w) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h new file mode 100644 index 0000000..4b5cd89 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/actionbar_since_3_12.go.h @@ -0,0 +1,21 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +static GtkActionBar *toGtkActionBar(void *p) { return (GTK_ACTION_BAR(p)); } diff --git a/vendor/github.com/gotk3/gotk3/gtk/app_chooser.go b/vendor/github.com/gotk3/gotk3/gtk/app_chooser.go new file mode 100644 index 0000000..b7ab8dd --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/app_chooser.go @@ -0,0 +1,408 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_app_chooser_get_type()), marshalAppChooser}, + {glib.Type(C.gtk_app_chooser_button_get_type()), marshalAppChooserButton}, + {glib.Type(C.gtk_app_chooser_widget_get_type()), marshalAppChooserWidget}, + {glib.Type(C.gtk_app_chooser_dialog_get_type()), marshalAppChooserDialog}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkAppChooser"] = wrapAppChooser + WrapMap["GtkAppChooserButton"] = wrapAppChooserButton + WrapMap["GtkAppChooserWidget"] = wrapAppChooserWidget + WrapMap["GtkAppChooserDialog"] = wrapAppChooserDialog +} + +/* + * GtkAppChooser + */ + +// AppChooser is a representation of GTK's GtkAppChooser GInterface. +type AppChooser struct { + *glib.Object +} + +// IAppChooser is an interface type implemented by all structs +// embedding an AppChooser. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkAppChooser. +type IAppChooser interface { + toAppChooser() *C.GtkAppChooser +} + +// native returns a pointer to the underlying GtkAppChooser. +func (v *AppChooser) native() *C.GtkAppChooser { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAppChooser(p) +} + +func marshalAppChooser(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAppChooser(obj), nil +} + +func wrapAppChooser(obj *glib.Object) *AppChooser { + if obj == nil { + return nil + } + + return &AppChooser{obj} +} + +func (v *AppChooser) toAppChooser() *C.GtkAppChooser { + if v == nil { + return nil + } + return v.native() +} + +// TODO: Needs gio/GAppInfo implementation first +// gtk_app_chooser_get_app_info () + +// GetContentType is a wrapper around gtk_app_chooser_get_content_type(). +func (v *AppChooser) GetContentType() string { + cstr := C.gtk_app_chooser_get_content_type(v.native()) + defer C.free(unsafe.Pointer(cstr)) + return C.GoString((*C.char)(cstr)) +} + +// Refresh is a wrapper around gtk_app_chooser_refresh(). +func (v *AppChooser) Refresh() { + C.gtk_app_chooser_refresh(v.native()) +} + +/* + * GtkAppChooserButton + */ + +// AppChooserButton is a representation of GTK's GtkAppChooserButton. +type AppChooserButton struct { + ComboBox + + // Interfaces + AppChooser +} + +// native returns a pointer to the underlying GtkAppChooserButton. +func (v *AppChooserButton) native() *C.GtkAppChooserButton { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkAppChooserButton(p) +} + +func marshalAppChooserButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapAppChooserButton(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapAppChooserButton(obj *glib.Object) *AppChooserButton { + if obj == nil { + return nil + } + + cl := wrapCellLayout(obj) + ce := wrapCellEditable(obj) + ac := wrapAppChooser(obj) + return &AppChooserButton{ComboBox{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, *cl, *ce}, *ac} +} + +// AppChooserButtonNew() is a wrapper around gtk_app_chooser_button_new(). +func AppChooserButtonNew(content_type string) (*AppChooserButton, error) { + cstr := C.CString(content_type) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_app_chooser_button_new((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapAppChooserButton(glib.Take(unsafe.Pointer(c))), nil +} + +// TODO: Needs gio/GIcon implemented first +// gtk_app_chooser_button_append_custom_item () + +// AppendSeparator() is a wrapper around gtk_app_chooser_button_append_separator(). +func (v *AppChooserButton) AppendSeparator() { + C.gtk_app_chooser_button_append_separator(v.native()) +} + +// SetActiveCustomItem() is a wrapper around gtk_app_chooser_button_set_active_custom_item(). +func (v *AppChooserButton) SetActiveCustomItem(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_app_chooser_button_set_active_custom_item(v.native(), (*C.gchar)(cstr)) +} + +// GetShowDefaultItem() is a wrapper around gtk_app_chooser_button_get_show_default_item(). +func (v *AppChooserButton) GetShowDefaultItem() bool { + return gobool(C.gtk_app_chooser_button_get_show_default_item(v.native())) +} + +// SetShowDefaultItem() is a wrapper around gtk_app_chooser_button_set_show_default_item(). +func (v *AppChooserButton) SetShowDefaultItem(setting bool) { + C.gtk_app_chooser_button_set_show_default_item(v.native(), gbool(setting)) +} + +// GetShowDialogItem() is a wrapper around gtk_app_chooser_button_get_show_dialog_item(). +func (v *AppChooserButton) GetShowDialogItem() bool { + return gobool(C.gtk_app_chooser_button_get_show_dialog_item(v.native())) +} + +// SetShowDialogItem() is a wrapper around gtk_app_chooser_button_set_show_dialog_item(). +func (v *AppChooserButton) SetShowDialogItem(setting bool) { + C.gtk_app_chooser_button_set_show_dialog_item(v.native(), gbool(setting)) +} + +// GetHeading() is a wrapper around gtk_app_chooser_button_get_heading(). +// In case when gtk_app_chooser_button_get_heading() returns a nil string, +// GetHeading() returns a non-nil error. +func (v *AppChooserButton) GetHeading() (string, error) { + cstr := C.gtk_app_chooser_button_get_heading(v.native()) + if cstr == nil { + return "", nilPtrErr + } + defer C.free(unsafe.Pointer(cstr)) + return C.GoString((*C.char)(cstr)), nil +} + +// SetHeading() is a wrapper around gtk_app_chooser_button_set_heading(). +func (v *AppChooserButton) SetHeading(heading string) { + cstr := C.CString(heading) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_app_chooser_button_set_heading(v.native(), (*C.gchar)(cstr)) +} + +/* + * GtkAppChooserWidget + */ + +// AppChooserWidget is a representation of GTK's GtkAppChooserWidget. +type AppChooserWidget struct { + Box + + // Interfaces + AppChooser +} + +// native returns a pointer to the underlying GtkAppChooserWidget. +func (v *AppChooserWidget) native() *C.GtkAppChooserWidget { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkAppChooserWidget(p) +} + +func marshalAppChooserWidget(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapAppChooserWidget(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapAppChooserWidget(obj *glib.Object) *AppChooserWidget { + if obj == nil { + return nil + } + + box := wrapBox(obj) + ac := wrapAppChooser(obj) + return &AppChooserWidget{*box, *ac} +} + +// AppChooserWidgetNew() is a wrapper around gtk_app_chooser_widget_new(). +func AppChooserWidgetNew(content_type string) (*AppChooserWidget, error) { + cstr := C.CString(content_type) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_app_chooser_widget_new((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapAppChooserWidget(glib.Take(unsafe.Pointer(c))), nil +} + +// GetShowDefault() is a wrapper around gtk_app_chooser_widget_get_show_default(). +func (v *AppChooserWidget) GetShowDefault() bool { + return gobool(C.gtk_app_chooser_widget_get_show_default(v.native())) +} + +// SetShowDefault() is a wrapper around gtk_app_chooser_widget_set_show_default(). +func (v *AppChooserWidget) SetShowDefault(setting bool) { + C.gtk_app_chooser_widget_set_show_default(v.native(), gbool(setting)) +} + +// GetShowRecommended() is a wrapper around gtk_app_chooser_widget_get_show_recommended(). +func (v *AppChooserWidget) GetShowRecommended() bool { + return gobool(C.gtk_app_chooser_widget_get_show_recommended(v.native())) +} + +// SetShowRecommended() is a wrapper around gtk_app_chooser_widget_set_show_recommended(). +func (v *AppChooserWidget) SetShowRecommended(setting bool) { + C.gtk_app_chooser_widget_set_show_recommended(v.native(), gbool(setting)) +} + +// GetShowFallback() is a wrapper around gtk_app_chooser_widget_get_show_fallback(). +func (v *AppChooserWidget) GetShowFallback() bool { + return gobool(C.gtk_app_chooser_widget_get_show_fallback(v.native())) +} + +// SetShowFallback() is a wrapper around gtk_app_chooser_widget_set_show_fallback(). +func (v *AppChooserWidget) SetShowFallback(setting bool) { + C.gtk_app_chooser_widget_set_show_fallback(v.native(), gbool(setting)) +} + +// GetShowOther() is a wrapper around gtk_app_chooser_widget_get_show_other(). +func (v *AppChooserWidget) GetShowOther() bool { + return gobool(C.gtk_app_chooser_widget_get_show_other(v.native())) +} + +// SetShowOther() is a wrapper around gtk_app_chooser_widget_set_show_other(). +func (v *AppChooserWidget) SetShowOther(setting bool) { + C.gtk_app_chooser_widget_set_show_other(v.native(), gbool(setting)) +} + +// GetShowAll() is a wrapper around gtk_app_chooser_widget_get_show_all(). +func (v *AppChooserWidget) GetShowAll() bool { + return gobool(C.gtk_app_chooser_widget_get_show_all(v.native())) +} + +// SetShowAll() is a wrapper around gtk_app_chooser_widget_set_show_all(). +func (v *AppChooserWidget) SetShowAll(setting bool) { + C.gtk_app_chooser_widget_set_show_all(v.native(), gbool(setting)) +} + +// GetDefaultText() is a wrapper around gtk_app_chooser_widget_get_default_text(). +// In case when gtk_app_chooser_widget_get_default_text() returns a nil string, +// GetDefaultText() returns a non-nil error. +func (v *AppChooserWidget) GetDefaultText() (string, error) { + cstr := C.gtk_app_chooser_widget_get_default_text(v.native()) + if cstr == nil { + return "", nilPtrErr + } + defer C.free(unsafe.Pointer(cstr)) + return C.GoString((*C.char)(cstr)), nil +} + +// SetDefaultText() is a wrapper around gtk_app_chooser_widget_set_default_text(). +func (v *AppChooserWidget) SetDefaultText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_app_chooser_widget_set_default_text(v.native(), (*C.gchar)(cstr)) +} + +/* + * GtkAppChooserDialog + */ + +// AppChooserDialog is a representation of GTK's GtkAppChooserDialog. +type AppChooserDialog struct { + Dialog + + // Interfaces + AppChooser +} + +// native returns a pointer to the underlying GtkAppChooserButton. +func (v *AppChooserDialog) native() *C.GtkAppChooserDialog { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkAppChooserDialog(p) +} + +func marshalAppChooserDialog(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapAppChooserDialog(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapAppChooserDialog(obj *glib.Object) *AppChooserDialog { + if obj == nil { + return nil + } + + dialog := wrapDialog(obj) + ac := wrapAppChooser(obj) + return &AppChooserDialog{*dialog, *ac} +} + +// AppChooserDialogNew is a wrapper around gtk_app_chooser_dialog_new(). +func AppChooserDialogNew(parent IWindow, flags DialogFlags, file *glib.File) (*AppChooserDialog, error) { + + var gfile *C.GFile + if file != nil { + gfile = (*C.GFile)(unsafe.Pointer(file.Native())) + } + + var pw *C.GtkWindow = nil + if parent != nil { + pw = parent.toWindow() + } + + c := C.gtk_app_chooser_dialog_new(pw, C.GtkDialogFlags(flags), gfile) + if c == nil { + return nil, nilPtrErr + } + return wrapAppChooserDialog(glib.Take(unsafe.Pointer(c))), nil +} + +// AppChooserDialogNewForContentType() is a wrapper around gtk_app_chooser_dialog_new_for_content_type(). +func AppChooserDialogNewForContentType(parent IWindow, flags DialogFlags, content_type string) (*AppChooserDialog, error) { + + cstr := C.CString(content_type) + defer C.free(unsafe.Pointer(cstr)) + + var pw *C.GtkWindow = nil + if parent != nil { + pw = parent.toWindow() + } + + c := C.gtk_app_chooser_dialog_new_for_content_type(pw, C.GtkDialogFlags(flags), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapAppChooserDialog(glib.Take(unsafe.Pointer(c))), nil +} + +// GetWidget() is a wrapper around gtk_app_chooser_dialog_get_widget(). +func (v *AppChooserDialog) GetWidget() *AppChooserWidget { + c := C.gtk_app_chooser_dialog_get_widget(v.native()) + return wrapAppChooserWidget(glib.Take(unsafe.Pointer(c))) +} + +// GetHeading() is a wrapper around gtk_app_chooser_dialog_get_heading(). +// In case when gtk_app_chooser_dialog_get_heading() returns a nil string, +// GetHeading() returns a non-nil error. +func (v *AppChooserDialog) GetHeading() (string, error) { + cstr := C.gtk_app_chooser_dialog_get_heading(v.native()) + if cstr == nil { + return "", nilPtrErr + } + defer C.free(unsafe.Pointer(cstr)) + return C.GoString((*C.char)(cstr)), nil +} + +// SetHeading() is a wrapper around gtk_app_chooser_dialog_set_heading(). +func (v *AppChooserDialog) SetHeading(heading string) { + cstr := C.CString(heading) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_app_chooser_dialog_set_heading(v.native(), (*C.gchar)(cstr)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/application.go b/vendor/github.com/gotk3/gotk3/gtk/application.go new file mode 100644 index 0000000..7e39156 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/application.go @@ -0,0 +1,172 @@ +// Same copyright and license as the rest of the files in this project +// This file contains style related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// ApplicationInhibitFlags is a representation of GTK's GtkApplicationInhibitFlags. +type ApplicationInhibitFlags int + +const ( + APPLICATION_INHIBIT_LOGOUT ApplicationInhibitFlags = C.GTK_APPLICATION_INHIBIT_LOGOUT + APPLICATION_INHIBIT_SWITCH ApplicationInhibitFlags = C.GTK_APPLICATION_INHIBIT_SWITCH + APPLICATION_INHIBIT_SUSPEND ApplicationInhibitFlags = C.GTK_APPLICATION_INHIBIT_SUSPEND + APPLICATION_INHIBIT_IDLE ApplicationInhibitFlags = C.GTK_APPLICATION_INHIBIT_IDLE +) + +/* + * GtkApplication + */ + +// Application is a representation of GTK's GtkApplication. +type Application struct { + glib.Application +} + +// native returns a pointer to the underlying GtkApplication. +func (v *Application) native() *C.GtkApplication { + if v == nil || v.GObject == nil { + return nil + } + return C.toGtkApplication(unsafe.Pointer(v.GObject)) +} + +func marshalApplication(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapApplication(obj), nil +} + +func wrapApplication(obj *glib.Object) *Application { + if obj == nil { + return nil + } + + am := &glib.ActionMap{obj} + ag := &glib.ActionGroup{obj} + return &Application{glib.Application{obj, am, ag}} +} + +// ApplicationNew is a wrapper around gtk_application_new(). +func ApplicationNew(appId string, flags glib.ApplicationFlags) (*Application, error) { + cstr := (*C.gchar)(C.CString(appId)) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_application_new(cstr, C.GApplicationFlags(flags)) + if c == nil { + return nil, nilPtrErr + } + return wrapApplication(glib.Take(unsafe.Pointer(c))), nil +} + +// AddWindow is a wrapper around gtk_application_add_window(). +func (v *Application) AddWindow(w IWindow) { + C.gtk_application_add_window(v.native(), w.toWindow()) +} + +// RemoveWindow is a wrapper around gtk_application_remove_window(). +func (v *Application) RemoveWindow(w IWindow) { + C.gtk_application_remove_window(v.native(), w.toWindow()) +} + +// GetWindowByID is a wrapper around gtk_application_get_window_by_id(). +func (v *Application) GetWindowByID(id uint) *Window { + c := C.gtk_application_get_window_by_id(v.native(), C.guint(id)) + if c == nil { + return nil + } + return wrapWindow(glib.Take(unsafe.Pointer(c))) +} + +// GetActiveWindow is a wrapper around gtk_application_get_active_window(). +func (v *Application) GetActiveWindow() *Window { + c := C.gtk_application_get_active_window(v.native()) + if c == nil { + return nil + } + return wrapWindow(glib.Take(unsafe.Pointer(c))) +} + +// Uninhibit is a wrapper around gtk_application_uninhibit(). +func (v *Application) Uninhibit(cookie uint) { + C.gtk_application_uninhibit(v.native(), C.guint(cookie)) +} + +// GetAppMenu is a wrapper around gtk_application_get_app_menu(). +func (v *Application) GetAppMenu() *glib.MenuModel { + c := C.gtk_application_get_app_menu(v.native()) + if c == nil { + return nil + } + return &glib.MenuModel{glib.Take(unsafe.Pointer(c))} +} + +// SetAppMenu is a wrapper around gtk_application_set_app_menu(). +func (v *Application) SetAppMenu(m *glib.MenuModel) { + mptr := (*C.GMenuModel)(unsafe.Pointer(m.Native())) + C.gtk_application_set_app_menu(v.native(), mptr) +} + +// GetMenubar is a wrapper around gtk_application_get_menubar(). +func (v *Application) GetMenubar() *glib.MenuModel { + c := C.gtk_application_get_menubar(v.native()) + if c == nil { + return nil + } + return &glib.MenuModel{glib.Take(unsafe.Pointer(c))} +} + +// SetMenubar is a wrapper around gtk_application_set_menubar(). +func (v *Application) SetMenubar(m *glib.MenuModel) { + mptr := (*C.GMenuModel)(unsafe.Pointer(m.Native())) + C.gtk_application_set_menubar(v.native(), mptr) +} + +// IsInhibited is a wrapper around gtk_application_is_inhibited(). +func (v *Application) IsInhibited(flags ApplicationInhibitFlags) bool { + return gobool(C.gtk_application_is_inhibited(v.native(), C.GtkApplicationInhibitFlags(flags))) +} + +// Inhibited is a wrapper around gtk_application_inhibit(). +func (v *Application) Inhibited(window IWindow, flags ApplicationInhibitFlags, reason string) uint { + + cstr1 := (*C.gchar)(C.CString(reason)) + defer C.free(unsafe.Pointer(cstr1)) + + var w *C.GtkWindow = nil + if window != nil { + w = window.toWindow() + } + + return uint(C.gtk_application_inhibit(v.native(), w, C.GtkApplicationInhibitFlags(flags), cstr1)) +} + +// void gtk_application_add_accelerator () // deprecated and uses a gvariant paramater +// void gtk_application_remove_accelerator () // deprecated and uses a gvariant paramater + +// GetWindows is a wrapper around gtk_application_get_windows(). +// Returned list is wrapped to return *gtk.Window elements. +func (v *Application) GetWindows() *glib.List { + clist := C.gtk_application_get_windows(v.native()) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapWindow(glib.Take(ptr)) + }) + runtime.SetFinalizer(glist, func(l *glib.List) { + l.Free() + }) + return glist +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/application_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_12.go new file mode 100644 index 0000000..478505e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_12.go @@ -0,0 +1,62 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +// See: https://developer.gnome.org/gtk3/3.12/api-index-3-12.html + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import "unsafe" + +// GetAccelsForAction is a wrapper around gtk_application_get_accels_for_action(). +func (v *Application) GetAccelsForAction(act string) []string { + cstr1 := (*C.gchar)(C.CString(act)) + defer C.free(unsafe.Pointer(cstr1)) + + var descs []string + c := C.gtk_application_get_accels_for_action(v.native(), cstr1) + originalc := c + defer C.g_strfreev(originalc) + + for *c != nil { + descs = append(descs, C.GoString((*C.char)(*c))) + c = nextgcharptr(c) + } + + return descs +} + +// SetAccelsForAction is a wrapper around gtk_application_set_accels_for_action(). +func (v *Application) SetAccelsForAction(act string, accels []string) { + cstr1 := (*C.gchar)(C.CString(act)) + defer C.free(unsafe.Pointer(cstr1)) + + caccels := C.make_strings(C.int(len(accels) + 1)) + defer C.destroy_strings(caccels) + + for i, accel := range accels { + cstr := C.CString(accel) + defer C.free(unsafe.Pointer(cstr)) + C.set_string(caccels, C.int(i), (*C.gchar)(cstr)) + } + + C.set_string(caccels, C.int(len(accels)), nil) + + C.gtk_application_set_accels_for_action(v.native(), cstr1, caccels) +} + +// ListActionDescriptions is a wrapper around gtk_application_list_action_descriptions(). +func (v *Application) ListActionDescriptions() []string { + var descs []string + c := C.gtk_application_list_action_descriptions(v.native()) + originalc := c + defer C.g_strfreev(originalc) + + for *c != nil { + descs = append(descs, C.GoString((*C.char)(*c))) + c = nextgcharptr(c) + } + + return descs +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/application_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_14.go new file mode 100644 index 0000000..9c749c5 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/application_since_3_14.go @@ -0,0 +1,49 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +// See: https://developer.gnome.org/gtk3/3.14/api-index-3-14.html + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// PrefersAppMenu is a wrapper around gtk_application_prefers_app_menu(). +func (v *Application) PrefersAppMenu() bool { + return gobool(C.gtk_application_prefers_app_menu(v.native())) +} + +// GetActionsForAccel is a wrapper around gtk_application_get_actions_for_accel(). +func (v *Application) GetActionsForAccel(acc string) []string { + cstr1 := (*C.gchar)(C.CString(acc)) + defer C.free(unsafe.Pointer(cstr1)) + + var acts []string + c := C.gtk_application_get_actions_for_accel(v.native(), cstr1) + originalc := c + defer C.g_strfreev(originalc) + + for *c != nil { + acts = append(acts, C.GoString((*C.char)(*c))) + c = nextgcharptr(c) + } + + return acts +} + +// GetMenuByID is a wrapper around gtk_application_get_menu_by_id(). +func (v *Application) GetMenuByID(id string) *glib.Menu { + cstr1 := (*C.gchar)(C.CString(id)) + defer C.free(unsafe.Pointer(cstr1)) + + c := C.gtk_application_get_menu_by_id(v.native(), cstr1) + if c == nil { + return nil + } + return &glib.Menu{glib.MenuModel{glib.Take(unsafe.Pointer(c))}} +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/application_window.go b/vendor/github.com/gotk3/gotk3/gtk/application_window.go new file mode 100644 index 0000000..f5bc2c0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/application_window.go @@ -0,0 +1,75 @@ +// Same copyright and license as the rest of the files in this project +// This file contains style related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkApplicationWindow + */ + +// ApplicationWindow is a representation of GTK's GtkApplicationWindow. +type ApplicationWindow struct { + Window + + // Interfaces + glib.IActionMap + glib.IActionGroup +} + +// native returns a pointer to the underlying GtkApplicationWindow. +func (v *ApplicationWindow) native() *C.GtkApplicationWindow { + if v == nil || v.Window.GObject == nil { // v.Window is necessary because v.GObject would be ambiguous + return nil + } + p := unsafe.Pointer(v.Window.GObject) + return C.toGtkApplicationWindow(p) +} + +func marshalApplicationWindow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapApplicationWindow(obj), nil +} + +func wrapApplicationWindow(obj *glib.Object) *ApplicationWindow { + if obj == nil { + return nil + } + + am := &glib.ActionMap{obj} + ag := &glib.ActionGroup{obj} + return &ApplicationWindow{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}, am, ag} +} + +// ApplicationWindowNew is a wrapper around gtk_application_window_new(). +func ApplicationWindowNew(app *Application) (*ApplicationWindow, error) { + c := C.gtk_application_window_new(app.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapApplicationWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// SetShowMenubar is a wrapper around gtk_application_window_set_show_menubar(). +func (v *ApplicationWindow) SetShowMenubar(b bool) { + C.gtk_application_window_set_show_menubar(v.native(), gbool(b)) +} + +// GetShowMenubar is a wrapper around gtk_application_window_get_show_menubar(). +func (v *ApplicationWindow) GetShowMenubar() bool { + return gobool(C.gtk_application_window_get_show_menubar(v.native())) +} + +// GetID is a wrapper around gtk_application_window_get_id(). +func (v *ApplicationWindow) GetID() uint { + return uint(C.gtk_application_window_get_id(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/application_window_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/application_window_since_3_20.go new file mode 100644 index 0000000..e8553b2 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/application_window_since_3_20.go @@ -0,0 +1,28 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18 + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// SetHelpOverlay is a wrapper around gtk_application_window_set_help_overlay(). +func (v *ApplicationWindow) SetHelpOverlay(helpOverlay *ShortcutsWindow) { + C.gtk_application_window_set_help_overlay(v.native(), helpOverlay.native()) +} + +// GetHelpOverlay is a wrapper around gtk_application_window_get_help_overlay(). +func (v *ApplicationWindow) GetHelpOverlay() *ShortcutsWindow { + c := C.gtk_application_window_get_help_overlay(v.native()) + if c == nil { + return nil + } + return wrapShortcutsWindow(glib.Take(unsafe.Pointer(c))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/box_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/box_since_3_12.go new file mode 100644 index 0000000..cc140ca --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/box_since_3_12.go @@ -0,0 +1,48 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols included since GTK 3.12, and +// and should not be included in a build intended to target any older GTK +// versions. To target an older build, such as 3.10, use +// 'go build -tags gtk_3_10'. Otherwise, if no build tags are used, GTK 3.12 +// is assumed and this file is built. +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +// SetCenterWidget is a wrapper around gtk_box_set_center_widget(). +func (a *Box) SetCenterWidget(child IWidget) { + if child == nil { + C.gtk_box_set_center_widget(a.native(), nil) + } else { + C.gtk_box_set_center_widget(a.native(), child.toWidget()) + } +} + +// GetCenterWidget is a wrapper around gtk_box_get_center_widget(). +func (a *Box) GetCenterWidget() (IWidget, error) { + w := C.gtk_box_get_center_widget(a.native()) + if w == nil { + return nil, nil + } + return castWidget(w) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/button_box.go b/vendor/github.com/gotk3/gotk3/gtk/button_box.go new file mode 100644 index 0000000..2d082f4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/button_box.go @@ -0,0 +1,98 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +type ButtonBoxStyle int + +const ( + BUTTONBOX_SPREAD ButtonBoxStyle = C.GTK_BUTTONBOX_SPREAD + BUTTONBOX_EDGE ButtonBoxStyle = C.GTK_BUTTONBOX_EDGE + BUTTONBOX_START ButtonBoxStyle = C.GTK_BUTTONBOX_START + BUTTONBOX_END ButtonBoxStyle = C.GTK_BUTTONBOX_END + BUTTONBOX_CENTER ButtonBoxStyle = C.GTK_BUTTONBOX_CENTER +) + +/* + * GtkButtonBox + */ + +// ButtonBox is a representation of GTK's GtkButtonBox. +type ButtonBox struct { + Box +} + +// native returns a pointer to the underlying GtkButtonBox. +func (v *ButtonBox) native() *C.GtkButtonBox { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkButtonBox(p) +} + +func marshalButtonBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapButtonBox(obj), nil +} + +func wrapButtonBox(obj *glib.Object) *ButtonBox { + if obj == nil { + return nil + } + + return &ButtonBox{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// ButtonBoxNew is a wrapper around gtk_button_box_new(). +func ButtonBoxNew(o Orientation) (*ButtonBox, error) { + c := C.gtk_button_box_new(C.GtkOrientation(o)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapButtonBox(obj), nil +} + +// GetLayout() is a wrapper around gtk_button_box_get_layout(). +func (v *ButtonBox) GetLayout() ButtonBoxStyle { + c := C.gtk_button_box_get_layout(v.native()) + return ButtonBoxStyle(c) +} + +// GetChildSecondary() is a wrapper around gtk_button_box_get_child_secondary(). +func (v *ButtonBox) GetChildSecondary(child IWidget) bool { + c := C.gtk_button_box_get_child_secondary(v.native(), child.toWidget()) + return gobool(c) +} + +// GetChildNonHomogeneous() is a wrapper around gtk_button_box_get_child_non_homogeneous(). +func (v *ButtonBox) GetChildNonHomogeneous(child IWidget) bool { + c := C.gtk_button_box_get_child_non_homogeneous(v.native(), child.toWidget()) + return gobool(c) +} + +// SetLayout() is a wrapper around gtk_button_box_set_layout(). +func (v *ButtonBox) SetLayout(style ButtonBoxStyle) { + C.gtk_button_box_set_layout(v.native(), C.GtkButtonBoxStyle(style)) +} + +// SetChildSecondary() is a wrapper around gtk_button_box_set_child_secondary(). +func (v *ButtonBox) SetChildSecondary(child IWidget, isSecondary bool) { + C.gtk_button_box_set_child_secondary(v.native(), child.toWidget(), gbool(isSecondary)) +} + +// SetChildNonHomogeneous() is a wrapper around gtk_button_box_set_child_non_homogeneous(). +func (v *ButtonBox) SetChildNonHomogeneous(child IWidget, nonHomogeneous bool) { + C.gtk_button_box_set_child_non_homogeneous(v.native(), child.toWidget(), gbool(nonHomogeneous)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/cell_area.go b/vendor/github.com/gotk3/gotk3/gtk/cell_area.go new file mode 100644 index 0000000..c7a6418 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/cell_area.go @@ -0,0 +1,580 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "fmt" + "unsafe" + + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkCellArea + */ + +// TODO: macro +// GTK_CELL_AREA_WARN_INVALID_CELL_PROPERTY_ID(object, property_id, pspec) +// object - the GObject on which set_cell_property() or get_cell_property() was called +// property_id - the numeric id of the property +// pspec - the GParamSpec of the property +// C.GTK_CELL_AREA_WARN_INVALID_CELL_PROPERTY_ID + +// CellArea is a representation of GTK's GtkCellArea. +type CellArea struct { + glib.InitiallyUnowned +} + +type ICellArea interface { + toCellArea() *C.GtkCellArea + ToCellArea() *CellArea +} + +// native returns a pointer to the underlying GtkCellArea. +func (v *CellArea) native() *C.GtkCellArea { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellArea(p) +} + +func (v *CellArea) toCellArea() *C.GtkCellArea { + if v == nil { + return nil + } + return v.native() +} + +// ToCellArea is a helper getter, in case you use the interface gtk.ICellArea in your program. +// It returns e.g. *gtk.CellAreaBox as a *gtk.CellArea. +func (v *CellArea) ToCellArea() *CellArea { + return v +} + +func marshalCellArea(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellArea(obj), nil +} + +func wrapCellArea(obj *glib.Object) *CellArea { + if obj == nil { + return nil + } + + return &CellArea{glib.InitiallyUnowned{obj}} +} + +// Add is a wrapper around gtk_cell_area_add(). +func (v *CellArea) Add(renderer ICellRenderer) { + C.gtk_cell_area_add(v.native(), renderer.toCellRenderer()) +} + +// Remove is a wrapper around gtk_cell_area_remove(). +func (v *CellArea) Remove(renderer ICellRenderer) { + C.gtk_cell_area_remove(v.native(), renderer.toCellRenderer()) +} + +// HasRenderer is a wrapper around gtk_cell_area_has_renderer(). +func (v *CellArea) HasRenderer(renderer ICellRenderer) bool { + return gobool(C.gtk_cell_area_has_renderer(v.native(), renderer.toCellRenderer())) +} + +// TODO: +// depends on GtkCellCallback +// Foreach is a wrapper around gtk_cell_area_foreach(). +// func (v *CellArea) Foreach(cb CellCallback, callbackData interface{}) { +// } + +// TODO: +// depends on GtkCellAllocCallback +// ForeachAlloc is a wrapper around gtk_cell_area_foreach_alloc(). +// func (v *CellArea) ForeachAlloc(context *CellAreaContext, widget IWidget, cellArea, backgroundArea *gdk.Rectangle, cb CellAllocCallback, callbackData interface{}) { +// } + +// AreaEvent is a wrapper around gtk_cell_area_event(). +func (v *CellArea) AreaEvent(context *CellAreaContext, widget IWidget, + event *gdk.Event, cellArea *gdk.Rectangle, flags CellRendererState) int { + + e := (*C.GdkEvent)(unsafe.Pointer(event.Native())) + c := C.gtk_cell_area_event(v.native(), context.native(), widget.toWidget(), + e, nativeGdkRectangle(*cellArea), C.GtkCellRendererState(flags)) + + return int(c) +} + +// Render is a wrapper around gtk_cell_area_render(). +func (v *CellArea) Render(context *CellAreaContext, widget IWidget, cr *cairo.Context, + backgroundArea, cellArea *gdk.Rectangle, flags CellRendererState, paintFocus bool) { + + cairoContext := (*C.cairo_t)(unsafe.Pointer(cr.Native())) + + C.gtk_cell_area_render(v.native(), context.native(), widget.toWidget(), cairoContext, + nativeGdkRectangle(*backgroundArea), nativeGdkRectangle(*cellArea), + C.GtkCellRendererState(flags), gbool(paintFocus)) +} + +// GetCellAllocation is a wrapper around gtk_cell_area_get_cell_allocation(). +func (v *CellArea) GetCellAllocation(context *CellAreaContext, widget IWidget, + renderer ICellRenderer, cellArea *gdk.Rectangle) *gdk.Rectangle { + + var cRect *C.GdkRectangle + C.gtk_cell_area_get_cell_allocation(v.native(), context.native(), widget.toWidget(), + renderer.toCellRenderer(), nativeGdkRectangle(*cellArea), cRect) + allocation := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return allocation + +} + +// GetCellAtPosition is a wrapper around gtk_cell_area_get_cell_at_position(). +func (v *CellArea) GetCellAtPosition(context *CellAreaContext, widget IWidget, + cellArea *gdk.Rectangle, x, y int) (ICellRenderer, *gdk.Rectangle, error) { + + var cRect *C.GdkRectangle + + renderer := C.gtk_cell_area_get_cell_at_position(v.native(), context.native(), widget.toWidget(), + nativeGdkRectangle(*cellArea), C.gint(x), C.gint(y), cRect) + + var allocation *gdk.Rectangle + + if cRect != nil { + allocation = gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + } + + r, err := castCellRenderer(renderer) + + return r, allocation, err +} + +// CreateContext is a wrapper around gtk_cell_area_create_context(). +func (v *CellArea) CreateContext() (*CellAreaContext, error) { + c := C.gtk_cell_area_create_context(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapCellAreaContext(glib.Take(unsafe.Pointer(c))), nil +} + +// CopyContext is a wrapper around gtk_cell_area_copy_context(). +func (v *CellArea) CopyContext(context *CellAreaContext) (*CellAreaContext, error) { + c := C.gtk_cell_area_copy_context(v.native(), context.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapCellAreaContext(glib.Take(unsafe.Pointer(c))), nil +} + +// TODO: +// depends on GtkSizeRequestMode +// gtk_cell_area_get_request_mode + +// GetPreferredWidth is a wrapper around gtk_cell_area_get_preferred_width(). +func (v *CellArea) GetPreferredWidth(context *CellAreaContext, widget IWidget) (int, int) { + var minWidth C.gint + var naturalWidth C.gint + C.gtk_cell_area_get_preferred_width(v.native(), context.native(), widget.toWidget(), + &minWidth, &naturalWidth) + + return int(minWidth), int(naturalWidth) +} + +// GetPreferredHeightForWidth is a wrapper around gtk_cell_area_get_preferred_height_for_width(). +func (v *CellArea) GetPreferredHeightForWidth(context *CellAreaContext, widget IWidget, width int) (int, int) { + var minHeight C.gint + var naturalHeight C.gint + C.gtk_cell_area_get_preferred_height_for_width(v.native(), context.native(), widget.toWidget(), + C.gint(width), &minHeight, &naturalHeight) + + return int(minHeight), int(naturalHeight) +} + +// GetPreferredHeight is a wrapper around gtk_cell_area_get_preferred_height(). +func (v *CellArea) GetPreferredHeight(context *CellAreaContext, widget IWidget) (int, int) { + var minHeight C.gint + var naturalHeight C.gint + C.gtk_cell_area_get_preferred_height(v.native(), context.native(), widget.toWidget(), + &minHeight, &naturalHeight) + + return int(minHeight), int(naturalHeight) +} + +// GetPreferredWidthForHeight is a wrapper around gtk_cell_area_get_preferred_width_for_height(). +func (v *CellArea) GetPreferredWidthForHeight(context *CellAreaContext, widget IWidget, height int) (int, int) { + var minWidth C.gint + var naturalWidth C.gint + C.gtk_cell_area_get_preferred_width_for_height(v.native(), context.native(), widget.toWidget(), + C.gint(height), &minWidth, &naturalWidth) + + return int(minWidth), int(naturalWidth) +} + +// GetCurrentPathString is a wrapper around gtk_cell_area_get_current_path_string(). +func (v *CellArea) GetCurrentPathString() string { + c := C.gtk_cell_area_get_current_path_string(v.native()) + // This string belongs to the area and should not be freed. + return goString(c) +} + +// ApplyAttributes is a wrapper around gtk_cell_area_apply_attributes(). +func (v *CellArea) ApplyAttributes(model ITreeModel, iter *TreeIter, isExpander, isExpanded bool) { + C.gtk_cell_area_apply_attributes(v.native(), model.toTreeModel(), iter.native(), + gbool(isExpander), gbool(isExpanded)) +} + +// AttributeConnect is a wrapper around gtk_cell_area_attribute_connect(). +func (v *CellArea) AttributeConnect(renderer ICellRenderer, attribute string, column int) { + cstr := C.CString(attribute) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_cell_area_attribute_connect(v.native(), renderer.toCellRenderer(), (*C.gchar)(cstr), C.gint(column)) +} + +// AttributeDisconnect is a wrapper around gtk_cell_area_attribute_disconnect(). +func (v *CellArea) AttributeDisconnect(renderer ICellRenderer, attribute string) { + cstr := C.CString(attribute) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_cell_area_attribute_disconnect(v.native(), renderer.toCellRenderer(), (*C.gchar)(cstr)) +} + +// TODO: +// gtk_cell_area_class_install_cell_property // depends on GParamSpec +// gtk_cell_area_class_find_cell_property // depends on GParamSpec +// gtk_cell_area_class_list_cell_properties // depends on GParamSpec +// gtk_cell_area_add_with_properties +// gtk_cell_area_cell_set +// gtk_cell_area_cell_get +// gtk_cell_area_cell_set_valist +// gtk_cell_area_cell_get_valist + +// CellSetProperty is a wrapper around gtk_cell_area_cell_set_property(). +func (v *CellArea) CellSetProperty(renderer ICellRenderer, propertyName string, value interface{}) error { + gval, err := glib.GValue(value) + if err != nil { + return err + } + cstr := C.CString(propertyName) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_cell_area_cell_set_property(v.native(), renderer.toCellRenderer(), (*C.gchar)(cstr), + (*C.GValue)(unsafe.Pointer(gval.Native()))) + return nil +} + +// CellGetProperty is a wrapper around gtk_cell_area_cell_get_property(). +func (v *CellArea) CellGetProperty(renderer ICellRenderer, propertyName string) (interface{}, error) { + cstr := C.CString(propertyName) + defer C.free(unsafe.Pointer(cstr)) + + var gval C.GValue + C.gtk_cell_area_cell_get_property(v.native(), renderer.toCellRenderer(), (*C.gchar)(cstr), &gval) + value := glib.ValueFromNative(unsafe.Pointer(&gval)) + return value.GoValue() +} + +// IsActivatable is a wrapper around gtk_cell_area_is_activatable(). +func (v *CellArea) IsActivatable() bool { + return gobool(C.gtk_cell_area_is_activatable(v.native())) +} + +// Activate is a wrapper around gtk_cell_area_activate(). +func (v *CellArea) Activate(context *CellAreaContext, widget IWidget, + cellArea *gdk.Rectangle, flags CellRendererState, editOnly bool) { + + C.gtk_cell_area_activate(v.native(), context.native(), widget.toWidget(), + nativeGdkRectangle(*cellArea), C.GtkCellRendererState(flags), gbool(editOnly)) +} + +// Focus is a wrapper around gtk_cell_area_focus(). +func (v *CellArea) Focus(direction DirectionType) bool { + return gobool(C.gtk_cell_area_focus(v.native(), C.GtkDirectionType(direction))) +} + +// SetFocusCell is a wrapper around gtk_cell_area_set_focus_cell(). +func (v *CellArea) SetFocusCell(renderer ICellRenderer) { + C.gtk_cell_area_set_focus_cell(v.native(), renderer.toCellRenderer()) +} + +// GetFocusCell is a wrapper around gtk_cell_area_get_focus_cell(). +func (v *CellArea) GetFocusCell() (ICellRenderer, error) { + c := C.gtk_cell_area_get_focus_cell(v.native()) + return castCellRenderer(c) +} + +// AddFocusSibling is a wrapper around gtk_cell_area_add_focus_sibling(). +func (v *CellArea) AddFocusSibling(renderer, sibling ICellRenderer) { + C.gtk_cell_area_add_focus_sibling(v.native(), renderer.toCellRenderer(), sibling.toCellRenderer()) +} + +// RemoveFocusSibling is a wrapper around gtk_cell_area_remove_focus_sibling(). +func (v *CellArea) RemoveFocusSibling(renderer, sibling ICellRenderer) { + C.gtk_cell_area_remove_focus_sibling(v.native(), renderer.toCellRenderer(), sibling.toCellRenderer()) +} + +// IsFocusSibling is a wrapper around gtk_cell_area_is_focus_sibling(). +func (v *CellArea) IsFocusSibling(renderer, sibling ICellRenderer) bool { + return gobool(C.gtk_cell_area_is_focus_sibling(v.native(), renderer.toCellRenderer(), sibling.toCellRenderer())) +} + +// GetFocusSiblings is a wrapper around gtk_cell_area_get_focus_siblings(). +func (v *CellArea) GetFocusSiblings(renderer ICellRenderer) ([]ICellRenderer, error) { + clist := C.gtk_cell_area_get_focus_siblings(v.native(), renderer.toCellRenderer()) + if clist == nil { + return nil, nilPtrErr + } + + // The returned list is internal and should not be freed. + var cellRendererList []ICellRenderer + wlist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + for ; wlist.Data() != nil; wlist = wlist.Next() { + w, ok := wlist.Data().(*CellRenderer) + if !ok { + return nil, fmt.Errorf("element is not of type *CellRenderer, got %T", w) + } + cRenderer, err := castCellRenderer(w.toCellRenderer()) + if err != nil { + return nil, err + } + cellRendererList = append(cellRendererList, cRenderer) + } + + return cellRendererList, nil +} + +// GetFocusFromSibling is a wrapper around gtk_cell_area_get_focus_from_sibling(). +func (v *CellArea) GetFocusFromSibling(renderer ICellRenderer) (ICellRenderer, error) { + c := C.gtk_cell_area_get_focus_from_sibling(v.native(), renderer.toCellRenderer()) + return castCellRenderer(c) +} + +// GetEditedCell is a wrapper around gtk_cell_area_get_edited_cell(). +func (v *CellArea) GetEditedCell() (ICellRenderer, error) { + c := C.gtk_cell_area_get_edited_cell(v.native()) + return castCellRenderer(c) +} + +// GetEditWidget is a wrapper around gtk_cell_area_get_edit_widget(). +func (v *CellArea) GetEditWidget() (ICellEditable, error) { + c := C.gtk_cell_area_get_edit_widget(v.native()) + return castCellEditable(c) +} + +// ActivateCell is a wrapper around gtk_cell_area_activate_cell(). +func (v *CellArea) ActivateCell(widget IWidget, renderer ICellRenderer, + event *gdk.Event, cellArea *gdk.Rectangle, flags CellRendererState) bool { + + e := (*C.GdkEvent)(unsafe.Pointer(event.Native())) + c := C.gtk_cell_area_activate_cell(v.native(), widget.toWidget(), renderer.toCellRenderer(), + e, nativeGdkRectangle(*cellArea), C.GtkCellRendererState(flags)) + + return gobool(c) +} + +// StopEditing is a wrapper around gtk_cell_area_stop_editing(). +func (v *CellArea) StopEditing(cancelled bool) { + C.gtk_cell_area_stop_editing(v.native(), gbool(cancelled)) +} + +// InnerCellArea is a wrapper around gtk_cell_area_inner_cell_area(). +func (v *CellArea) InnerCellArea(widget IWidget, cellArea *gdk.Rectangle) *gdk.Rectangle { + var cRect *C.GdkRectangle + C.gtk_cell_area_inner_cell_area(v.native(), widget.toWidget(), nativeGdkRectangle(*cellArea), cRect) + innerArea := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return innerArea +} + +// RequestRenderer is a wrapper around gtk_cell_area_request_renderer(). +func (v *CellArea) RequestRenderer(renderer ICellRenderer, orientation Orientation, + widget IWidget, forSize int) (int, int) { + + var minSize C.gint + var naturalSize C.gint + + C.gtk_cell_area_request_renderer(v.native(), renderer.toCellRenderer(), C.GtkOrientation(orientation), + widget.toWidget(), C.gint(forSize), &minSize, &naturalSize) + + return int(minSize), int(naturalSize) +} + +/* + * GtkCellAreaContext + */ + +type CellAreaContext struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkCellAreaContext. +func (v *CellAreaContext) native() *C.GtkCellAreaContext { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellAreaContext(p) +} + +func (v *CellAreaContext) toCellAreaContext() *C.GtkCellAreaContext { + if v == nil { + return nil + } + return v.native() +} + +func marshalCellAreaContext(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellAreaContext(obj), nil +} + +func wrapCellAreaContext(obj *glib.Object) *CellAreaContext { + if obj == nil { + return nil + } + + return &CellAreaContext{obj} +} + +// GetArea is a wrapper around gtk_cell_area_context_get_area(). +func (v *CellAreaContext) GetArea() (*CellArea, error) { + c := C.gtk_cell_area_context_get_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapCellArea(glib.Take(unsafe.Pointer(c))), nil +} + +// Allocate is a wrapper around gtk_cell_area_context_allocate(). +func (v *CellAreaContext) Allocate(width, height int) { + C.gtk_cell_area_context_allocate(v.native(), C.gint(width), C.gint(height)) +} + +// Reset is a wrapper around gtk_cell_area_context_reset(). +func (v *CellAreaContext) Reset(width, height int) { + C.gtk_cell_area_context_reset(v.native()) +} + +// GetPreferredWidth is a wrapper around gtk_cell_area_context_get_preferred_width(). +func (v *CellAreaContext) GetPreferredWidth() (int, int) { + var minWidth C.gint + var naturalWidth C.gint + C.gtk_cell_area_context_get_preferred_width(v.native(), &minWidth, &naturalWidth) + return int(minWidth), int(naturalWidth) +} + +// GetPreferredHeight is a wrapper around gtk_cell_area_context_get_preferred_height(). +func (v *CellAreaContext) GetPreferredHeight() (int, int) { + var minHeight C.gint + var naturalHeight C.gint + C.gtk_cell_area_context_get_preferred_height(v.native(), &minHeight, &naturalHeight) + return int(minHeight), int(naturalHeight) +} + +// GetPreferredHeightForWidth is a wrapper around gtk_cell_area_context_get_preferred_height_for_width(). +func (v *CellAreaContext) GetPreferredHeightForWidth(width int) (int, int) { + var minHeight C.gint + var naturalHeight C.gint + C.gtk_cell_area_context_get_preferred_height_for_width(v.native(), C.gint(width), &minHeight, &naturalHeight) + return int(minHeight), int(naturalHeight) +} + +// GetPreferredWidthForHeight is a wrapper around gtk_cell_area_context_get_preferred_width_for_height(). +func (v *CellAreaContext) GetPreferredWidthForHeight(height int) (int, int) { + var minWidth C.gint + var naturalWidth C.gint + C.gtk_cell_area_context_get_preferred_width_for_height(v.native(), C.gint(height), &minWidth, &naturalWidth) + return int(minWidth), int(naturalWidth) +} + +// GetAllocation is a wrapper around gtk_cell_area_context_get_allocation(). +func (v *CellAreaContext) GetAllocation() (int, int) { + var height C.gint + var width C.gint + C.gtk_cell_area_context_get_allocation(v.native(), &height, &width) + return int(height), int(width) +} + +// PushPreferredWidth is a wrapper around gtk_cell_area_context_push_preferred_width(). +func (v *CellAreaContext) PushPreferredWidth(minWidth, naturalWidth int) { + C.gtk_cell_area_context_push_preferred_width(v.native(), C.gint(minWidth), C.gint(naturalWidth)) +} + +// PushPreferredHeight is a wrapper around gtk_cell_area_context_push_preferred_height(). +func (v *CellAreaContext) PushPreferredHeight(minHeight, naturalHeight int) { + C.gtk_cell_area_context_push_preferred_height(v.native(), C.gint(minHeight), C.gint(naturalHeight)) +} + +/* + * GtkCellAreaBox + */ + +// CellAreaBox is a representation of GTK's GtkCellAreaBox. +type CellAreaBox struct { + CellArea + + // Interfaces + Orientable +} + +// native returns a pointer to the underlying GtkCellAreaBox. +func (v *CellAreaBox) native() *C.GtkCellAreaBox { + if v == nil || v.CellArea.GObject == nil { + return nil + } + p := unsafe.Pointer(v.CellArea.GObject) + return C.toGtkCellAreaBox(p) +} + +func (v *CellArea) toOrientable() *C.GtkOrientable { + if v == nil { + return nil + } + return C.toGtkOrientable(unsafe.Pointer(v.GObject)) +} + +func marshalCellAreaBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellAreaBox(obj), nil +} + +func wrapCellAreaBox(obj *glib.Object) *CellAreaBox { + if obj == nil { + return nil + } + + cellArea := wrapCellArea(obj) + o := wrapOrientable(obj) + return &CellAreaBox{*cellArea, *o} +} + +// CellAreaBoxNew is a wrapper around gtk_cell_area_box_new(). +func CellAreaBoxNew() (*CellAreaBox, error) { + c := C.gtk_cell_area_box_new() + if c == nil { + return nil, nilPtrErr + } + return wrapCellAreaBox(glib.Take(unsafe.Pointer(c))), nil +} + +// PackStart is a wrapper around gtk_cell_area_box_pack_start(). +func (v *CellAreaBox) PackStart(renderer ICellRenderer, expand, align, fixed bool) { + C.gtk_cell_area_box_pack_start(v.native(), renderer.toCellRenderer(), gbool(expand), gbool(align), gbool(fixed)) +} + +// PackEnd is a wrapper around gtk_cell_area_box_pack_end(). +func (v *CellAreaBox) PackEnd(renderer ICellRenderer, expand, align, fixed bool) { + C.gtk_cell_area_box_pack_end(v.native(), renderer.toCellRenderer(), gbool(expand), gbool(align), gbool(fixed)) +} + +// GetSpacing is a wrapper around gtk_cell_area_box_get_spacing(). +func (v *CellAreaBox) GetSpacing() int { + return int(C.gtk_cell_area_box_get_spacing(v.native())) +} + +// SetSpacing is a wrapper around gtk_cell_area_box_set_spacing(). +func (v *CellAreaBox) SetSpacing(spacing int) { + C.gtk_cell_area_box_set_spacing(v.native(), C.gint(spacing)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/cell_area_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/cell_area_since_3_14.go new file mode 100644 index 0000000..b987631 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/cell_area_since_3_14.go @@ -0,0 +1,23 @@ +// Same copyright and license as the rest of the files in this project +// See: https://developer.gnome.org/gtk3/3.14/api-index-3-14.html + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import "unsafe" + +/* + * GtkCellArea + */ + +// AttributeGetColumn is a wrapper around gtk_cell_area_attribute_get_column(). +func (v *CellArea) AttributeGetColumn(renderer ICellRenderer, attribute string) int { + cstr := C.CString(attribute) + defer C.free(unsafe.Pointer(cstr)) + column := C.gtk_cell_area_attribute_get_column(v.native(), renderer.toCellRenderer(), (*C.gchar)(cstr)) + return int(column) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/color_chooser.go b/vendor/github.com/gotk3/gotk3/gtk/color_chooser.go new file mode 100644 index 0000000..28e824e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/color_chooser.go @@ -0,0 +1,170 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_color_chooser_get_type()), marshalColorChooser}, + {glib.Type(C.gtk_color_chooser_dialog_get_type()), marshalColorChooserDialog}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkColorChooser"] = wrapColorChooser + WrapMap["GtkColorChooserDialog"] = wrapColorChooserDialog +} + +/* + * GtkColorChooser + */ + +// ColorChooser is a representation of GTK's GtkColorChooser GInterface. +type ColorChooser struct { + *glib.Object +} + +// IColorChooser is an interface type implemented by all structs +// embedding an ColorChooser. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkColorChooser. +type IColorChooser interface { + toColorChooser() *C.GtkColorChooser +} + +// native returns a pointer to the underlying GtkColorChooser. +func (v *ColorChooser) native() *C.GtkColorChooser { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkColorChooser(p) +} + +func marshalColorChooser(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapColorChooser(obj), nil +} + +func wrapColorChooser(obj *glib.Object) *ColorChooser { + if obj == nil { + return nil + } + + return &ColorChooser{obj} +} + +func (v *ColorChooser) toColorChooser() *C.GtkColorChooser { + if v == nil { + return nil + } + return v.native() +} + +// GetRGBA() is a wrapper around gtk_color_chooser_get_rgba(). +func (v *ColorChooser) GetRGBA() *gdk.RGBA { + gdkColor := gdk.NewRGBA() + C.gtk_color_chooser_get_rgba(v.native(), (*C.GdkRGBA)(unsafe.Pointer(gdkColor.Native()))) + return gdkColor +} + +// SetRGBA() is a wrapper around gtk_color_chooser_set_rgba(). +func (v *ColorChooser) SetRGBA(gdkColor *gdk.RGBA) { + C.gtk_color_chooser_set_rgba(v.native(), (*C.GdkRGBA)(unsafe.Pointer(gdkColor.Native()))) +} + +// GetUseAlpha() is a wrapper around gtk_color_chooser_get_use_alpha(). +func (v *ColorChooser) GetUseAlpha() bool { + return gobool(C.gtk_color_chooser_get_use_alpha(v.native())) +} + +// SetUseAlpha() is a wrapper around gtk_color_chooser_set_use_alpha(). +func (v *ColorChooser) SetUseAlpha(use_alpha bool) { + C.gtk_color_chooser_set_use_alpha(v.native(), gbool(use_alpha)) +} + +// AddPalette() is a wrapper around gtk_color_chooser_add_palette(). +func (v *ColorChooser) AddPalette(orientation Orientation, colors_per_line int, colors []*gdk.RGBA) { + n_colors := len(colors) + var c_colors []C.GdkRGBA + for _, c := range colors { + c_colors = append(c_colors, *(*C.GdkRGBA)(unsafe.Pointer(c.Native()))) + } + C.gtk_color_chooser_add_palette( + v.native(), + C.GtkOrientation(orientation), + C.gint(colors_per_line), + C.gint(n_colors), + &c_colors[0], + ) +} + +/* + * GtkColorChooserDialog + */ + +// ColorChooserDialog is a representation of GTK's GtkColorChooserDialog. +type ColorChooserDialog struct { + Dialog + + // Interfaces + ColorChooser +} + +// native returns a pointer to the underlying GtkColorChooserButton. +func (v *ColorChooserDialog) native() *C.GtkColorChooserDialog { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkColorChooserDialog(p) +} + +func marshalColorChooserDialog(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapColorChooserDialog(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapColorChooserDialog(obj *glib.Object) *ColorChooserDialog { + if obj == nil { + return nil + } + + dialog := wrapDialog(obj) + cc := wrapColorChooser(obj) + return &ColorChooserDialog{*dialog, *cc} +} + +// ColorChooserDialogNew() is a wrapper around gtk_color_chooser_dialog_new(). +func ColorChooserDialogNew(title string, parent IWindow) (*ColorChooserDialog, error) { + + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + c := C.gtk_color_chooser_dialog_new((*C.gchar)(cstr), w) + if c == nil { + return nil, nilPtrErr + } + return wrapColorChooserDialog(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkColorChooserWidget + */ + +// TODO: +// gtk_color_chooser_widget_new(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/combo_box.go b/vendor/github.com/gotk3/gotk3/gtk/combo_box.go new file mode 100644 index 0000000..a5200a0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/combo_box.go @@ -0,0 +1,413 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "errors" + "fmt" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_combo_box_get_type()), marshalComboBox}, + {glib.Type(C.gtk_combo_box_text_get_type()), marshalComboBoxText}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkComboBox"] = wrapComboBox + WrapMap["GtkComboBoxText"] = wrapComboBoxText +} + +/* + * GtkComboBox + */ + +// ComboBox is a representation of GTK's GtkComboBox. +type ComboBox struct { + Bin + + // Interfaces + CellLayout + CellEditable +} + +// native returns a pointer to the underlying GtkComboBox. +func (v *ComboBox) native() *C.GtkComboBox { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkComboBox(p) +} + +func (v *ComboBox) toCellLayout() *C.GtkCellLayout { + if v == nil { + return nil + } + return C.toGtkCellLayout(unsafe.Pointer(v.GObject)) +} + +func marshalComboBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBox(obj), nil +} + +func wrapComboBox(obj *glib.Object) *ComboBox { + if obj == nil { + return nil + } + + cl := wrapCellLayout(obj) + ce := wrapCellEditable(obj) + return &ComboBox{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, *cl, *ce} +} + +// ComboBoxNew is a wrapper around gtk_combo_box_new(). +func ComboBoxNew() (*ComboBox, error) { + c := C.gtk_combo_box_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBox(obj), nil +} + +// ComboBoxNewWithEntry is a wrapper around gtk_combo_box_new_with_entry(). +func ComboBoxNewWithEntry() (*ComboBox, error) { + c := C.gtk_combo_box_new_with_entry() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBox(obj), nil +} + +// ComboBoxNewWithModel is a wrapper around gtk_combo_box_new_with_model(). +func ComboBoxNewWithModel(model ITreeModel) (*ComboBox, error) { + c := C.gtk_combo_box_new_with_model(model.toTreeModel()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBox(obj), nil +} + +// is a wrapper around gtk_combo_box_new_with_model_and_entry(). +func ComboBoxNewWithModelAndEntry(model ITreeModel) (*ComboBox, error) { + c := C.gtk_combo_box_new_with_model_and_entry(model.toTreeModel()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBox(obj), nil +} + +// GetWrapWidth is a wrapper around gtk_combo_box_get_wrap_width(). +func (v *ComboBox) GetWrapWidth() int { + c := C.gtk_combo_box_get_wrap_width(v.native()) + return int(c) +} + +// SetWrapWidth is a wrapper around gtk_combo_box_set_wrap_width(). +func (v *ComboBox) SetWrapWidth(wrapWidth int) { + C.gtk_combo_box_set_wrap_width(v.native(), C.gint(wrapWidth)) +} + +// GetRowSpanColumn is a wrapper around gtk_combo_box_get_row_span_column(). +func (v *ComboBox) GetRowSpanColumn() int { + c := C.gtk_combo_box_get_row_span_column(v.native()) + return int(c) +} + +// SetRowSpanColumn is a wrapper around gtk_combo_box_set_row_span_column(). +func (v *ComboBox) SetRowSpanColumn(rowSpan int) { + C.gtk_combo_box_set_row_span_column(v.native(), C.gint(rowSpan)) +} + +// GetColumnSpanColumn is a wrapper around gtk_combo_box_get_column_span_column(). +func (v *ComboBox) GetColumnSpanColumn() int { + c := C.gtk_combo_box_get_column_span_column(v.native()) + return int(c) +} + +// SetColumnSpanColumn is a wrapper around gtk_combo_box_set_column_span_column(). +func (v *ComboBox) SetColumnSpanColumn(wrapWidth int) { + C.gtk_combo_box_set_column_span_column(v.native(), C.gint(wrapWidth)) +} + +// GetActive is a wrapper around gtk_combo_box_get_active(). +func (v *ComboBox) GetActive() int { + c := C.gtk_combo_box_get_active(v.native()) + return int(c) +} + +// SetActive is a wrapper around gtk_combo_box_set_active(). +func (v *ComboBox) SetActive(index int) { + C.gtk_combo_box_set_active(v.native(), C.gint(index)) +} + +// GetActiveIter is a wrapper around gtk_combo_box_get_active_iter(). +func (v *ComboBox) GetActiveIter() (*TreeIter, error) { + var cIter C.GtkTreeIter + c := C.gtk_combo_box_get_active_iter(v.native(), &cIter) + if !gobool(c) { + return nil, errors.New("unable to get active iter") + } + return &TreeIter{cIter}, nil +} + +// SetActiveIter is a wrapper around gtk_combo_box_set_active_iter(). +func (v *ComboBox) SetActiveIter(iter *TreeIter) { + var cIter *C.GtkTreeIter + if iter != nil { + cIter = &iter.GtkTreeIter + } + C.gtk_combo_box_set_active_iter(v.native(), cIter) +} + +// GetIDColumn is a wrapper around gtk_combo_box_get_id_column() +func (v *ComboBox) GetIDColumn() int { + c := C.gtk_combo_box_get_id_column(v.native()) + return int(c) +} + +// SetIDColumn is a wrapper around gtk_combo_box_set_id_column() +func (v *ComboBox) SetIDColumn(idColumn int) { + C.gtk_combo_box_set_id_column(v.native(), C.gint(idColumn)) +} + +// GetActiveID is a wrapper around gtk_combo_box_get_active_id(). +func (v *ComboBox) GetActiveID() string { + c := C.gtk_combo_box_get_active_id(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetActiveID is a wrapper around gtk_combo_box_set_active_id(). +func (v *ComboBox) SetActiveID(id string) bool { + cid := C.CString(id) + defer C.free(unsafe.Pointer(cid)) + c := C.gtk_combo_box_set_active_id(v.native(), (*C.gchar)(cid)) + return gobool(c) +} + +// GetModel is a wrapper around gtk_combo_box_get_model(). +func (v *ComboBox) GetModel() (ITreeModel, error) { + c := C.gtk_combo_box_get_model(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castTreeModel(c) +} + +// SetModel is a wrapper around gtk_combo_box_set_model(). +func (v *ComboBox) SetModel(model ITreeModel) { + var mptr *C.GtkTreeModel + if model != nil { + mptr = model.toTreeModel() + } + C.gtk_combo_box_set_model(v.native(), mptr) +} + +// PopupForDevice is a wrapper around gtk_combo_box_popup_for_device() +func (v *ComboBox) PopupForDevice(device *gdk.Device) { + var devicePtr *C.GdkDevice + if device != nil { + devicePtr = (*C.GdkDevice)(unsafe.Pointer(device.Native())) + } + C.gtk_combo_box_popup_for_device(v.native(), devicePtr) +} + +// Popup is a wrapper around gtk_combo_box_popup(). +func (v *ComboBox) Popup() { + C.gtk_combo_box_popup(v.native()) +} + +// Popdown is a wrapper around gtk_combo_box_popdown(). +func (v *ComboBox) Popdown() { + C.gtk_combo_box_popdown(v.native()) +} + +// GetHasEntry is a wrapper around gtk_combo_box_get_has_entry(). +func (v *ComboBox) GetHasEntry() bool { + c := C.gtk_combo_box_get_has_entry(v.native()) + return gobool(c) +} + +// SetEntryTextColumn is a wrapper around gtk_combo_box_set_entry_text_column(). +func (v *ComboBox) SetEntryTextColumn(textColumn int) { + C.gtk_combo_box_set_entry_text_column(v.native(), C.gint(textColumn)) +} + +// GetEntryTextColumn is a wrapper around gtk_combo_box_get_entry_text_column(). +func (v *ComboBox) GetEntryTextColumn() int { + c := C.gtk_combo_box_get_entry_text_column(v.native()) + return int(c) +} + +// SetPopupFixedWidth is a wrapper around gtk_combo_box_set_popup_fixed_width +func (v *ComboBox) SetPopupFixedWidth(fixedWidth bool) { + C.gtk_combo_box_set_popup_fixed_width(v.native(), gbool(fixedWidth)) +} + +// GetPopupFixedWidth is a wrapper around gtk_combo_box_get_popup_fixed_width +func (v *ComboBox) GetPopupFixedWidth() bool { + c := C.gtk_combo_box_get_popup_fixed_width(v.native()) + return gobool(c) +} + +// GetEntry is a convenience func to get the Entry within the ComboBox. +// If the Combobox does not contain an Entry, an error is returned. +func (v *ComboBox) GetEntry() (*Entry, error) { + hasEntry := C.gtk_combo_box_get_has_entry(v.native()) + if hasEntry == C.FALSE { + return nil, errors.New("combobox has no entry") + } + bin := &v.Bin + widget, err := bin.GetChild() + if err != nil { + return nil, err + } + entry, ok := widget.(*Entry) + if !ok { + return nil, fmt.Errorf("expected child to be of type *gtk.Entry, got %T", widget) + } + return entry, nil +} + +/* + * GtkComboBoxText + */ + +// ComboBoxText is a representation of GTK's GtkComboBoxText. +type ComboBoxText struct { + ComboBox +} + +// native returns a pointer to the underlying GtkComboBoxText. +func (v *ComboBoxText) native() *C.GtkComboBoxText { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkComboBoxText(p) +} + +func marshalComboBoxText(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBoxText(obj), nil +} + +func wrapComboBoxText(obj *glib.Object) *ComboBoxText { + if obj == nil { + return nil + } + + return &ComboBoxText{*wrapComboBox(obj)} +} + +// ComboBoxTextNew is a wrapper around gtk_combo_box_text_new(). +func ComboBoxTextNew() (*ComboBoxText, error) { + c := C.gtk_combo_box_text_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBoxText(obj), nil +} + +// ComboBoxTextNewWithEntry is a wrapper around gtk_combo_box_text_new_with_entry(). +func ComboBoxTextNewWithEntry() (*ComboBoxText, error) { + c := C.gtk_combo_box_text_new_with_entry() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapComboBoxText(obj), nil +} + +// Append is a wrapper around gtk_combo_box_text_append(). +func (v *ComboBoxText) Append(id, text string) { + cid := C.CString(id) + ctext := C.CString(text) + defer C.free(unsafe.Pointer(cid)) + defer C.free(unsafe.Pointer(ctext)) + C.gtk_combo_box_text_append(v.native(), (*C.gchar)(cid), (*C.gchar)(ctext)) +} + +// Prepend is a wrapper around gtk_combo_box_text_prepend(). +func (v *ComboBoxText) Prepend(id, text string) { + cid := C.CString(id) + ctext := C.CString(text) + defer C.free(unsafe.Pointer(cid)) + defer C.free(unsafe.Pointer(ctext)) + C.gtk_combo_box_text_prepend(v.native(), (*C.gchar)(cid), (*C.gchar)(ctext)) +} + +// Insert is a wrapper around gtk_combo_box_text_insert(). +func (v *ComboBoxText) Insert(position int, id, text string) { + cid := C.CString(id) + ctext := C.CString(text) + defer C.free(unsafe.Pointer(cid)) + defer C.free(unsafe.Pointer(ctext)) + C.gtk_combo_box_text_insert(v.native(), C.gint(position), (*C.gchar)(cid), (*C.gchar)(ctext)) +} + +// AppendText is a wrapper around gtk_combo_box_text_append_text(). +func (v *ComboBoxText) AppendText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_combo_box_text_append_text(v.native(), (*C.gchar)(cstr)) +} + +// PrependText is a wrapper around gtk_combo_box_text_prepend_text(). +func (v *ComboBoxText) PrependText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_combo_box_text_prepend_text(v.native(), (*C.gchar)(cstr)) +} + +// InsertText is a wrapper around gtk_combo_box_text_insert_text(). +func (v *ComboBoxText) InsertText(position int, text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_combo_box_text_insert_text(v.native(), C.gint(position), (*C.gchar)(cstr)) +} + +// Remove is a wrapper around gtk_combo_box_text_remove(). +func (v *ComboBoxText) Remove(position int) { + C.gtk_combo_box_text_remove(v.native(), C.gint(position)) +} + +// RemoveAll is a wrapper around gtk_combo_box_text_remove_all(). +func (v *ComboBoxText) RemoveAll() { + C.gtk_combo_box_text_remove_all(v.native()) +} + +// GetActiveText is a wrapper around gtk_combo_box_text_get_active_text(). +func (v *ComboBoxText) GetActiveText() string { + c := (*C.char)(C.gtk_combo_box_text_get_active_text(v.native())) + defer C.free(unsafe.Pointer(c)) + return C.GoString(c) +} + +// gtk_combo_box_new_with_area, requires GtkCellArea +// gtk_combo_box_new_with_area_and_entry, requires GtkCellArea +// gtk_combo_box_get_row_separator_func, requires GtkTreeViewRowSeparatorFunc +// gtk_combo_box_set_row_separator_func, requires GtkTreeViewRowSeparatorFunc +// gtk_combo_box_get_popup_accessible, requires AtkObject +// gtk_combo_box_set_add_tearoffs, deprecated since 3.10 +// gtk_combo_box_get_add_tearoffs, deprecated since 3.10 +// gtk_combo_box_set_title, deprecated since 3.10 +// gtk_combo_box_get_title, deprecated since 3.10 +// gtk_combo_box_set_focus_on_click, deprecated since 3.20 +// gtk_combo_box_get_focus_on_click, deprecated since 3.20 +// gtk_combo_box_set_button_sensitivity, requires GtkSensitivityType +// gtk_combo_box_get_button_sensitivity, requires GtkSensitivityType diff --git a/vendor/github.com/gotk3/gotk3/gtk/fixed.go b/vendor/github.com/gotk3/gotk3/gtk/fixed.go new file mode 100644 index 0000000..ace0670 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/fixed.go @@ -0,0 +1,72 @@ +package gtk + +// #include +// #include "gtk.go.h" +// #include "fixed.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_fixed_get_type()), marshalFixed}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkFixed"] = wrapFixed +} + +/* + * GtkFixed + */ + +// Fixed is a representation of GTK's GtkFixed. +type Fixed struct { + Container +} + +func (v *Fixed) native() *C.GtkFixed { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFixed(p) +} + +func marshalFixed(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFixed(obj), nil +} + +func wrapFixed(obj *glib.Object) *Fixed { + if obj == nil { + return nil + } + + return &Fixed{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// FixedNew is a wrapper around gtk_fixed_new(). +func FixedNew() (*Fixed, error) { + c := C.gtk_fixed_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFixed(obj), nil +} + +// Put is a wrapper around gtk_fixed_put(). +func (v *Fixed) Put(w IWidget, x, y int) { + C.gtk_fixed_put(v.native(), w.toWidget(), C.gint(x), C.gint(y)) +} + +// Move is a wrapper around gtk_fixed_move(). +func (v *Fixed) Move(w IWidget, x, y int) { + C.gtk_fixed_move(v.native(), w.toWidget(), C.gint(x), C.gint(y)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/fixed.go.h b/vendor/github.com/gotk3/gotk3/gtk/fixed.go.h new file mode 100644 index 0000000..76cee7e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/fixed.go.h @@ -0,0 +1 @@ +static GtkFixed *toGtkFixed(void *p) { return (GTK_FIXED(p)); } \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/gtk/font_chooser.go b/vendor/github.com/gotk3/gotk3/gtk/font_chooser.go new file mode 100644 index 0000000..622e986 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/font_chooser.go @@ -0,0 +1,221 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_font_chooser_get_type()), marshalFontChooser}, + {glib.Type(C.gtk_font_button_get_type()), marshalFontButton}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkFontChooser"] = wrapFontChooser + WrapMap["GtkFontButton"] = wrapFontButton + +} + +/* + * GtkFontChooser + */ + +// FontChooser is a representation of GTK's GtkFontChooser GInterface. +type FontChooser struct { + *glib.Object +} + +// IFontChooser is an interface type implemented by all structs +// embedding an FontChooser. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkFontChooser. +type IFontChooser interface { + toFontChooser() *C.GtkFontChooser +} + +// native returns a pointer to the underlying GtkFontChooser. +func (v *FontChooser) native() *C.GtkFontChooser { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFontChooser(p) +} + +func marshalFontChooser(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFontChooser(obj), nil +} + +func wrapFontChooser(obj *glib.Object) *FontChooser { + if obj == nil { + return nil + } + + return &FontChooser{obj} +} + +func (v *FontChooser) toFontChooser() *C.GtkFontChooser { + if v == nil { + return nil + } + return v.native() +} + +// GetFont is a wrapper around gtk_font_chooser_get_font(). +func (v *FontChooser) GetFont() string { + c := C.gtk_font_chooser_get_font(v.native()) + return goString(c) +} + +// SetFont is a wrapper around gtk_font_chooser_set_font(). +func (v *FontChooser) SetFont(font string) { + cstr := C.CString(font) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_font_chooser_set_font(v.native(), (*C.gchar)(cstr)) +} + +//PangoFontFamily * gtk_font_chooser_get_font_family () +//PangoFontFace * gtk_font_chooser_get_font_face () +//gint gtk_font_chooser_get_font_size () +//PangoFontDescription * gtk_font_chooser_get_font_desc () +//void gtk_font_chooser_set_font_desc () +//gchar * gtk_font_chooser_get_preview_text () +//void gtk_font_chooser_set_preview_text () +//gboolean gtk_font_chooser_get_show_preview_entry () +//void gtk_font_chooser_set_show_preview_entry () +//gboolean (*GtkFontFilterFunc) () +//void gtk_font_chooser_set_filter_func () +//void gtk_font_chooser_set_font_map () +//PangoFontMap * gtk_font_chooser_get_font_map () + +/* + * GtkFontButton + */ + +// FontButton is a representation of GTK's GtkFontButton. +type FontButton struct { + Button + + // Interfaces + FontChooser +} + +// native returns a pointer to the underlying GtkFontButton. +func (v *FontButton) native() *C.GtkFontButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFontButton(p) +} + +func marshalFontButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFontButton(obj), nil +} + +func wrapFontButton(obj *glib.Object) *FontButton { + if obj == nil { + return nil + } + + button := wrapButton(obj) + fc := wrapFontChooser(obj) + return &FontButton{*button, *fc} +} + +// FontButtonNew is a wrapper around gtk_font_button_new(). +func FontButtonNew() (*FontButton, error) { + c := C.gtk_font_button_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFontButton(obj), nil +} + +// FontButtonNewWithFont is a wrapper around gtk_font_button_new_with_font(). +func FontButtonNewWithFont(fontname string) (*FontButton, error) { + cstr := C.CString(fontname) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_font_button_new_with_font((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFontButton(obj), nil +} + +// SetShowStyle is a wrapper around gtk_font_button_set_show_style(). +func (v *FontButton) SetShowStyle(showStyle bool) { + C.gtk_font_button_set_show_style(v.native(), gbool(showStyle)) +} + +// GetShowStyle is a wrapper around gtk_font_button_get_show_style(). +func (v *FontButton) GetShowStyle() bool { + c := C.gtk_font_button_get_show_style(v.native()) + return gobool(c) +} + +// SetShowSize is a wrapper around gtk_font_button_set_show_size(). +func (v *FontButton) SetShowSize(showSize bool) { + C.gtk_font_button_set_show_size(v.native(), gbool(showSize)) +} + +// GetShowSize is a wrapper around gtk_font_button_get_show_size(). +func (v *FontButton) GetShowSize() bool { + c := C.gtk_font_button_get_show_size(v.native()) + return gobool(c) +} + +// SetUseFont is a wrapper around gtk_font_button_set_use_font(). +func (v *FontButton) SetUseFont(useFont bool) { + C.gtk_font_button_set_use_font(v.native(), gbool(useFont)) +} + +// GetUseFont is a wrapper around gtk_font_button_get_use_font(). +func (v *FontButton) GetUseFont() bool { + c := C.gtk_font_button_get_use_font(v.native()) + return gobool(c) +} + +// SetUseSize is a wrapper around gtk_font_button_set_use_size(). +func (v *FontButton) SetUseSize(useSize bool) { + C.gtk_font_button_set_use_size(v.native(), gbool(useSize)) +} + +// GetUseSize is a wrapper around gtk_font_button_get_use_size(). +func (v *FontButton) GetUseSize() bool { + c := C.gtk_font_button_get_use_size(v.native()) + return gobool(c) +} + +// SetTitle is a wrapper around gtk_font_button_set_title(). +func (v *FontButton) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_font_button_set_title(v.native(), (*C.gchar)(cstr)) +} + +// GetTitle is a wrapper around gtk_font_button_get_title(). +func (v *FontButton) GetTitle() string { + c := C.gtk_font_button_get_title(v.native()) + defer C.free(unsafe.Pointer(c)) + return goString(c) +} + +/* + * GtkFontChooserWidget + */ + +// TODO: +// gtk_font_chooser_widget_new(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/gdk.go b/vendor/github.com/gotk3/gotk3/gtk/gdk.go new file mode 100644 index 0000000..8bf6579 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gdk.go @@ -0,0 +1,41 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import "github.com/gotk3/gotk3/gdk" + +func nativeGdkRectangle(rect gdk.Rectangle) *C.GdkRectangle { + // Note: Here we can't use rect.GdkRectangle because it would return + // C type prefixed with gdk package. A ways how to resolve this Go + // issue with same C structs in different Go packages is documented + // here https://github.com/golang/go/issues/13467 . + // This is the easiest way how to resolve the problem. + return &C.GdkRectangle{ + x: C.int(rect.GetX()), + y: C.int(rect.GetY()), + width: C.int(rect.GetWidth()), + height: C.int(rect.GetHeight()), + } +} + +func nativeGdkGeometry(geom gdk.Geometry) *C.GdkGeometry { + // Note: Here we can't use geom.GdkGeometry because it would return + // C type prefixed with gdk package. A ways how to resolve this Go + // issue with same C structs in different Go packages is documented + // here https://github.com/golang/go/issues/13467 . + // This is the easiest way how to resolve the problem. + return &C.GdkGeometry{ + min_width: C.gint(geom.GetMinWidth()), + min_height: C.gint(geom.GetMinHeight()), + max_width: C.gint(geom.GetMaxWidth()), + max_height: C.gint(geom.GetMaxHeight()), + base_width: C.gint(geom.GetBaseWidth()), + base_height: C.gint(geom.GetBaseHeight()), + width_inc: C.gint(geom.GetWidthInc()), + height_inc: C.gint(geom.GetHeightInc()), + min_aspect: C.gdouble(geom.GetMinAspect()), + max_aspect: C.gdouble(geom.GetMaxAspect()), + win_gravity: C.GdkGravity(geom.GetWinGravity()), + } +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/glarea.go b/vendor/github.com/gotk3/gotk3/gtk/glarea.go new file mode 100644 index 0000000..845a8dc --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/glarea.go @@ -0,0 +1,183 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 +// Supports building with gtk 3.16+ + +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gtk + +// #include +// #include "gtk_since_3_16.go.h" +import "C" +import ( + "errors" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_gl_area_get_type()), marshalGLArea}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkGLArea"] = wrapGLArea +} + +/* + * GtkGLArea + */ + +// GLArea is a representation of GTK's GtkGLArea. +type GLArea struct { + Widget +} + +// native returns a pointer to the underlying GtkGLArea. +func (v *GLArea) native() *C.GtkGLArea { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkGLArea(p) +} + +func marshalGLArea(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapGLArea(obj), nil +} + +func wrapGLArea(obj *glib.Object) *GLArea { + if obj == nil { + return nil + } + + return &GLArea{Widget{glib.InitiallyUnowned{obj}}} +} + +func WidgetToGLArea(widget *Widget) (*GLArea, error) { + obj := glib.Take(unsafe.Pointer(widget.GObject)) + return wrapGLArea(obj), nil +} + +// GLAreaNew is a wrapper around gtk_gl_area_new(). +func GLAreaNew() (*GLArea, error) { + c := C.gtk_gl_area_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + + return wrapGLArea(obj), nil +} + +// MajorVersion is a representation of OpenGL major version. +type MajorVersion int + +// MinorVersion is a representation of OpenGL minor version. +type MinorVersion int + +// GetRequiredVersion is a wrapper around gtk_gl_area_get_required_version(). +func (v *GLArea) GetRequiredVersion() (MajorVersion, MinorVersion) { + var major, minor int + C.gtk_gl_area_get_required_version(v.native(), + (*C.gint)(unsafe.Pointer(&major)), (*C.gint)(unsafe.Pointer(&minor))) + + return MajorVersion(major), MinorVersion(minor) +} + +// SetRequiredVersion is a wrapper around gtk_gl_area_set_required_version(). +func (v *GLArea) SetRequiredVersion(major, minor int) { + C.gtk_gl_area_set_required_version(v.native(), (C.gint)(major), (C.gint)(minor)) +} + +// TODO: +// void gtk_gl_area_set_error (GtkGLArea *area, const GError *error); +// gtk_gl_area_set_has_alpha(). +// gtk_gl_area_get_has_alpha(). + +// HasDepthBuffer is a wrapper around gtk_gl_area_get_has_depth_buffer(). +func (v *GLArea) HasDepthBuffer() bool { + return gobool(C.gtk_gl_area_get_has_depth_buffer(v.native())) +} + +// SetHasDepthBuffer is a wrapper around gtk_gl_area_set_has_depth_buffer(). +func (v *GLArea) SetHasDepthBuffer(hasDepthBuffer bool) { + C.gtk_gl_area_set_has_depth_buffer(v.native(), gbool(hasDepthBuffer)) +} + +// HasStencilBuffer is a wrapper around gtk_gl_area_get_has_stencil_buffer(). +func (v *GLArea) HasStencilBuffer() bool { + return gobool(C.gtk_gl_area_get_has_stencil_buffer(v.native())) +} + +// SetHasStencilBuffer is a wrapper around gtk_gl_area_set_has_stencil_buffer(). +func (v *GLArea) SetHasStencilBuffer(hasStencilBuffer bool) { + C.gtk_gl_area_set_has_stencil_buffer(v.native(), gbool(hasStencilBuffer)) +} + +// GetAutoRender is a wrapper around gtk_gl_area_get_auto_render(). +func (v *GLArea) GetAutoRender() bool { + return gobool(C.gtk_gl_area_get_auto_render(v.native())) +} + +// SetAutoRender is a wrapper around gtk_gl_area_set_auto_render(). +func (v *GLArea) SetAutoRender(autoRender bool) { + C.gtk_gl_area_set_auto_render(v.native(), gbool(autoRender)) +} + +// QueueRender is a wrapper around gtk_gl_area_queue_render(). +func (v *GLArea) QueueRender() { + C.gtk_gl_area_queue_render(v.native()) +} + +// GetContext is a wrapper around gtk_gl_area_get_context(). +func (v *GLArea) GetContext() (*gdk.GLContext, error) { + c := C.gtk_gl_area_get_context(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + return &(gdk.GLContext{obj}), nil +} + +// MakeCurrent is a wrapper around gtk_gl_area_make_current(). +func (v *GLArea) MakeCurrent() { + C.gtk_gl_area_make_current(v.native()) +} + +// AttachBuffers is a wrapper around gtk_gl_area_attach_buffers(). +func (v *GLArea) AttachBuffers() { + C.gtk_gl_area_attach_buffers(v.native()) +} + +// GError* gtk_gl_area_get_error (GtkGLArea *area); +func (v *GLArea) GetError() error { + var err *C.GError = nil + err = C.gtk_gl_area_get_error(v.native()) + if err != nil { + defer C.g_error_free(err) + return errors.New(goString(err.message)) + } + return nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/glarea_since_3_22.go b/vendor/github.com/gotk3/gotk3/gtk/glarea_since_3_22.go new file mode 100644 index 0000000..4d19667 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/glarea_since_3_22.go @@ -0,0 +1,17 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18,!gtk_3_20 +// Supports building with gtk 3.22+ + +package gtk + +// #include +import "C" + +// GetUseES is a wrapper around gtk_gl_area_get_use_es(). +func (v *GLArea) GetUseES() bool { + return gobool(C.gtk_gl_area_get_use_es(v.native())) +} + +// SetUseES is a wrapper around gtk_gl_area_set_use_es(). +func (v *GLArea) SetUseES(es bool) { + C.gtk_gl_area_set_use_es(v.native(), gbool(es)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/glib.go b/vendor/github.com/gotk3/gotk3/gtk/glib.go new file mode 100644 index 0000000..6a7e0f5 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/glib.go @@ -0,0 +1,20 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func nativeGPermission(permission *glib.Permission) *C.GPermission { + // Note: would return C type prefixed with glib package. + // Go issue: here https://github.com/golang/go/issues/13467. + var perm *C.GPermission + if permission != nil { + perm = (*C.GPermission)(unsafe.Pointer(permission.Native())) + } + return perm +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk.go b/vendor/github.com/gotk3/gotk3/gtk/gtk.go new file mode 100644 index 0000000..9f3e140 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk.go @@ -0,0 +1,11983 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// Go bindings for GTK+ 3. Supports version 3.6 and later. +// +// Functions use the same names as the native C function calls, but use +// CamelCase. In cases where native GTK uses pointers to values to +// simulate multiple return values, Go's native multiple return values +// are used instead. Whenever a native GTK call could return an +// unexpected NULL pointer, an additional error is returned in the Go +// binding. +// +// GTK's C API documentation can be very useful for understanding how the +// functions in this package work and what each type is for. This +// documentation can be found at https://developer.gnome.org/gtk3/. +// +// In addition to Go versions of the C GTK functions, every struct type +// includes a method named Native (either by direct implementation, or +// by means of struct embedding). These methods return a uintptr of the +// native C object the binding type represents. These pointers may be +// type switched to a native C pointer using unsafe and used with cgo +// function calls outside this package. +// +// Memory management is handled in proper Go fashion, using runtime +// finalizers to properly free memory when it is no longer needed. Each +// time a Go type is created with a pointer to a GObject, a reference is +// added for Go, sinking the floating reference when necessary. After +// going out of scope and the next time Go's garbage collector is run, a +// finalizer is run to remove Go's reference to the GObject. When this +// reference count hits zero (when neither Go nor GTK holds ownership) +// the object will be freed internally by GTK. +package gtk + +// #cgo pkg-config: gdk-3.0 gio-2.0 glib-2.0 gobject-2.0 gtk+-3.0 +// #include +// #include +// #include "gtk.go.h" +import "C" +import ( + "errors" + "fmt" + "reflect" + "runtime" + "sync" + "unsafe" + + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" + "github.com/gotk3/gotk3/pango" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gtk_align_get_type()), marshalAlign}, + {glib.Type(C.gtk_accel_flags_get_type()), marshalAccelFlags}, + {glib.Type(C.gtk_accel_group_get_type()), marshalAccelGroup}, + {glib.Type(C.gtk_accel_map_get_type()), marshalAccelMap}, + {glib.Type(C.gtk_arrow_placement_get_type()), marshalArrowPlacement}, + {glib.Type(C.gtk_arrow_type_get_type()), marshalArrowType}, + {glib.Type(C.gtk_assistant_page_type_get_type()), marshalAssistantPageType}, + {glib.Type(C.gtk_buttons_type_get_type()), marshalButtonsType}, + {glib.Type(C.gtk_calendar_display_options_get_type()), marshalCalendarDisplayOptions}, + {glib.Type(C.gtk_cell_renderer_accel_mode_get_type()), marshalCellRendererAccelMode}, + {glib.Type(C.gtk_cell_renderer_mode_get_type()), marshalCellRendererMode}, + {glib.Type(C.gtk_cell_renderer_state_get_type()), marshalCellRendererState}, + {glib.Type(C.gtk_corner_type_get_type()), marshalCornerType}, + {glib.Type(C.gtk_dest_defaults_get_type()), marshalDestDefaults}, + {glib.Type(C.gtk_dialog_flags_get_type()), marshalDialogFlags}, + {glib.Type(C.gtk_entry_icon_position_get_type()), marshalEntryIconPosition}, + {glib.Type(C.gtk_file_chooser_action_get_type()), marshalFileChooserAction}, + {glib.Type(C.gtk_icon_lookup_flags_get_type()), marshalSortType}, + {glib.Type(C.gtk_icon_size_get_type()), marshalIconSize}, + {glib.Type(C.gtk_image_type_get_type()), marshalImageType}, + {glib.Type(C.gtk_input_hints_get_type()), marshalInputHints}, + {glib.Type(C.gtk_input_purpose_get_type()), marshalInputPurpose}, + {glib.Type(C.gtk_direction_type_get_type()), marshalDirectionType}, + {glib.Type(C.gtk_justification_get_type()), marshalJustification}, + {glib.Type(C.gtk_license_get_type()), marshalLicense}, + {glib.Type(C.gtk_message_type_get_type()), marshalMessageType}, + {glib.Type(C.gtk_orientation_get_type()), marshalOrientation}, + {glib.Type(C.gtk_pack_type_get_type()), marshalPackType}, + {glib.Type(C.gtk_path_type_get_type()), marshalPathType}, + {glib.Type(C.gtk_policy_type_get_type()), marshalPolicyType}, + {glib.Type(C.gtk_position_type_get_type()), marshalPositionType}, + {glib.Type(C.gtk_relief_style_get_type()), marshalReliefStyle}, + {glib.Type(C.gtk_response_type_get_type()), marshalResponseType}, + {glib.Type(C.gtk_selection_mode_get_type()), marshalSelectionMode}, + {glib.Type(C.gtk_scroll_type_get_type()), marshalScrollType}, + {glib.Type(C.gtk_scroll_step_get_type()), marshalScrollStep}, + {glib.Type(C.gtk_sensitivity_type_get_type()), marshalSensitivityType}, + {glib.Type(C.gtk_shadow_type_get_type()), marshalShadowType}, + {glib.Type(C.gtk_sort_type_get_type()), marshalSortType}, + {glib.Type(C.gtk_spin_button_update_policy_get_type()), marshalSpinButtonUpdatePolicy}, + {glib.Type(C.gtk_spin_type_get_type()), marshalSpinType}, + {glib.Type(C.gtk_state_flags_get_type()), marshalStateFlags}, + {glib.Type(C.gtk_target_flags_get_type()), marshalTargetFlags}, + {glib.Type(C.gtk_text_direction_get_type()), marshalTextDirection}, + {glib.Type(C.gtk_text_search_flags_get_type()), marshalTextSearchFlags}, + {glib.Type(C.gtk_toolbar_style_get_type()), marshalToolbarStyle}, + {glib.Type(C.gtk_tree_model_flags_get_type()), marshalTreeModelFlags}, + {glib.Type(C.gtk_window_position_get_type()), marshalWindowPosition}, + {glib.Type(C.gtk_window_type_get_type()), marshalWindowType}, + {glib.Type(C.gtk_wrap_mode_get_type()), marshalWrapMode}, + + // Objects/Interfaces + {glib.Type(C.gtk_accel_group_get_type()), marshalAccelGroup}, + {glib.Type(C.gtk_accel_map_get_type()), marshalAccelMap}, + {glib.Type(C.gtk_adjustment_get_type()), marshalAdjustment}, + {glib.Type(C.gtk_application_get_type()), marshalApplication}, + {glib.Type(C.gtk_application_window_get_type()), marshalApplicationWindow}, + {glib.Type(C.gtk_assistant_get_type()), marshalAssistant}, + {glib.Type(C.gtk_bin_get_type()), marshalBin}, + {glib.Type(C.gtk_builder_get_type()), marshalBuilder}, + {glib.Type(C.gtk_button_get_type()), marshalButton}, + {glib.Type(C.gtk_button_box_get_type()), marshalButtonBox}, + {glib.Type(C.gtk_box_get_type()), marshalBox}, + {glib.Type(C.gtk_calendar_get_type()), marshalCalendar}, + {glib.Type(C.gtk_cell_layout_get_type()), marshalCellLayout}, + {glib.Type(C.gtk_cell_editable_get_type()), marshalCellEditable}, + {glib.Type(C.gtk_cell_renderer_get_type()), marshalCellRenderer}, + {glib.Type(C.gtk_cell_renderer_spinner_get_type()), marshalCellRendererSpinner}, + {glib.Type(C.gtk_cell_renderer_pixbuf_get_type()), marshalCellRendererPixbuf}, + {glib.Type(C.gtk_cell_renderer_text_get_type()), marshalCellRendererText}, + {glib.Type(C.gtk_cell_renderer_progress_get_type()), marshalCellRendererProgress}, + {glib.Type(C.gtk_cell_renderer_toggle_get_type()), marshalCellRendererToggle}, + {glib.Type(C.gtk_cell_renderer_combo_get_type()), marshalCellRendererCombo}, + {glib.Type(C.gtk_cell_renderer_accel_get_type()), marshalCellRendererAccel}, + {glib.Type(C.gtk_cell_renderer_spin_get_type()), marshalCellRendererSpin}, + {glib.Type(C.gtk_check_button_get_type()), marshalCheckButton}, + {glib.Type(C.gtk_check_menu_item_get_type()), marshalCheckMenuItem}, + {glib.Type(C.gtk_clipboard_get_type()), marshalClipboard}, + {glib.Type(C.gtk_container_get_type()), marshalContainer}, + {glib.Type(C.gtk_dialog_get_type()), marshalDialog}, + {glib.Type(C.gtk_drawing_area_get_type()), marshalDrawingArea}, + {glib.Type(C.gtk_editable_get_type()), marshalEditable}, + {glib.Type(C.gtk_entry_get_type()), marshalEntry}, + {glib.Type(C.gtk_entry_buffer_get_type()), marshalEntryBuffer}, + {glib.Type(C.gtk_entry_completion_get_type()), marshalEntryCompletion}, + {glib.Type(C.gtk_event_box_get_type()), marshalEventBox}, + {glib.Type(C.gtk_expander_get_type()), marshalExpander}, + {glib.Type(C.gtk_file_chooser_get_type()), marshalFileChooser}, + {glib.Type(C.gtk_file_chooser_button_get_type()), marshalFileChooserButton}, + {glib.Type(C.gtk_file_chooser_dialog_get_type()), marshalFileChooserDialog}, + {glib.Type(C.gtk_file_chooser_widget_get_type()), marshalFileChooserWidget}, + {glib.Type(C.gtk_frame_get_type()), marshalFrame}, + {glib.Type(C.gtk_aspect_frame_get_type()), marshalAspectFrame}, + {glib.Type(C.gtk_grid_get_type()), marshalGrid}, + {glib.Type(C.gtk_icon_view_get_type()), marshalIconView}, + {glib.Type(C.gtk_image_get_type()), marshalImage}, + {glib.Type(C.gtk_label_get_type()), marshalLabel}, + {glib.Type(C.gtk_link_button_get_type()), marshalLinkButton}, + {glib.Type(C.gtk_lock_button_get_type()), marshalLockButton}, + {glib.Type(C.gtk_layout_get_type()), marshalLayout}, + {glib.Type(C.gtk_tree_model_sort_get_type()), marshalTreeModelSort}, + {glib.Type(C.gtk_list_store_get_type()), marshalListStore}, + {glib.Type(C.gtk_menu_get_type()), marshalMenu}, + {glib.Type(C.gtk_menu_bar_get_type()), marshalMenuBar}, + {glib.Type(C.gtk_menu_button_get_type()), marshalMenuButton}, + {glib.Type(C.gtk_menu_item_get_type()), marshalMenuItem}, + {glib.Type(C.gtk_menu_shell_get_type()), marshalMenuShell}, + {glib.Type(C.gtk_message_dialog_get_type()), marshalMessageDialog}, + {glib.Type(C.gtk_notebook_get_type()), marshalNotebook}, + {glib.Type(C.gtk_offscreen_window_get_type()), marshalOffscreenWindow}, + {glib.Type(C.gtk_orientable_get_type()), marshalOrientable}, + {glib.Type(C.gtk_overlay_get_type()), marshalOverlay}, + {glib.Type(C.gtk_paned_get_type()), marshalPaned}, + {glib.Type(C.gtk_progress_bar_get_type()), marshalProgressBar}, + {glib.Type(C.gtk_radio_button_get_type()), marshalRadioButton}, + {glib.Type(C.gtk_radio_menu_item_get_type()), marshalRadioMenuItem}, + {glib.Type(C.gtk_range_get_type()), marshalRange}, + {glib.Type(C.gtk_scale_button_get_type()), marshalScaleButton}, + {glib.Type(C.gtk_scale_get_type()), marshalScale}, + {glib.Type(C.gtk_scrollbar_get_type()), marshalScrollbar}, + {glib.Type(C.gtk_scrolled_window_get_type()), marshalScrolledWindow}, + {glib.Type(C.gtk_search_entry_get_type()), marshalSearchEntry}, + {glib.Type(C.gtk_selection_data_get_type()), marshalSelectionData}, + {glib.Type(C.gtk_separator_get_type()), marshalSeparator}, + {glib.Type(C.gtk_separator_menu_item_get_type()), marshalSeparatorMenuItem}, + {glib.Type(C.gtk_separator_tool_item_get_type()), marshalSeparatorToolItem}, + {glib.Type(C.gtk_spin_button_get_type()), marshalSpinButton}, + {glib.Type(C.gtk_spinner_get_type()), marshalSpinner}, + {glib.Type(C.gtk_statusbar_get_type()), marshalStatusbar}, + {glib.Type(C.gtk_switch_get_type()), marshalSwitch}, + {glib.Type(C.gtk_text_view_get_type()), marshalTextView}, + {glib.Type(C.gtk_text_tag_get_type()), marshalTextTag}, + {glib.Type(C.gtk_text_tag_table_get_type()), marshalTextTagTable}, + {glib.Type(C.gtk_text_buffer_get_type()), marshalTextBuffer}, + {glib.Type(C.gtk_toggle_button_get_type()), marshalToggleButton}, + {glib.Type(C.gtk_toolbar_get_type()), marshalToolbar}, + {glib.Type(C.gtk_tool_button_get_type()), marshalToolButton}, + {glib.Type(C.gtk_toggle_tool_button_get_type()), marshalToggleToolButton}, + {glib.Type(C.gtk_tool_item_get_type()), marshalToolItem}, + {glib.Type(C.gtk_tooltip_get_type()), marshalTooltip}, + {glib.Type(C.gtk_tree_model_get_type()), marshalTreeModel}, + {glib.Type(C.gtk_tree_sortable_get_type()), marshalTreeSortable}, + {glib.Type(C.gtk_tree_selection_get_type()), marshalTreeSelection}, + {glib.Type(C.gtk_tree_store_get_type()), marshalTreeStore}, + {glib.Type(C.gtk_tree_view_get_type()), marshalTreeView}, + {glib.Type(C.gtk_tree_view_column_get_type()), marshalTreeViewColumn}, + {glib.Type(C.gtk_cell_area_get_type()), marshalCellArea}, + {glib.Type(C.gtk_cell_area_context_get_type()), marshalCellAreaContext}, + {glib.Type(C.gtk_cell_area_box_get_type()), marshalCellAreaBox}, + {glib.Type(C.gtk_volume_button_get_type()), marshalVolumeButton}, + {glib.Type(C.gtk_widget_get_type()), marshalWidget}, + {glib.Type(C.gtk_window_get_type()), marshalWindow}, + {glib.Type(C.gtk_window_group_get_type()), marshalWindowGroup}, + + // Boxed + {glib.Type(C.gtk_target_entry_get_type()), marshalTargetEntry}, + {glib.Type(C.gtk_text_iter_get_type()), marshalTextIter}, + {glib.Type(C.gtk_text_mark_get_type()), marshalTextMark}, + {glib.Type(C.gtk_tree_iter_get_type()), marshalTreeIter}, + {glib.Type(C.gtk_tree_path_get_type()), marshalTreePath}, + } + glib.RegisterGValueMarshalers(tm) +} + +/* + * Callback helpers + */ + +//export gotk3_callbackDelete +func gotk3_callbackDelete(callbackID C.gpointer) { + callback.Delete(uintptr(callbackID)) +} + +/* + * Type conversions + */ + +func gbool(b bool) C.gboolean { + if b { + return C.gboolean(1) + } + return C.gboolean(0) +} + +func gobool(b C.gboolean) bool { + return b != C.FALSE +} + +func cGSList(clist *glib.SList) *C.GSList { + if clist == nil { + return nil + } + return (*C.GSList)(unsafe.Pointer(clist.Native())) +} + +func free(str ...interface{}) { + for _, s := range str { + switch x := s.(type) { + case *C.char: + C.free(unsafe.Pointer(x)) + case []*C.char: + for _, cp := range x { + C.free(unsafe.Pointer(cp)) + } + /* + case C.gpointer: + C.g_free(C.gpointer(c)) + */ + default: + fmt.Printf("utils.go free(): Unknown type: %T\n", x) + } + + } +} + +// nextguchar increments guchar by 1. Hopefully, this could be inlined by the Go +// compiler. +func nextguchar(guchar *C.guchar) *C.guchar { + return (*C.guchar)(unsafe.Pointer(uintptr(unsafe.Pointer(guchar)) + 1)) +} + +// ucharString returns a copy of the given guchar pointer. The pointer guchar +// array is assumed to have valid UTF-8. +func ucharString(guchar *C.guchar) string { + // Seek and find the string length. + var strlen int + for ptr := guchar; *ptr != 0; ptr = nextguchar(ptr) { + strlen++ + } + + // Array of unsigned char means GoString is unavailable, so maybe this is + // fine. + var data []byte + sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data)) + sliceHeader.Len = strlen + sliceHeader.Cap = strlen + sliceHeader.Data = uintptr(unsafe.Pointer(guchar)) + + // Return a copy of the string. + return string(data) +} + +// nextgcharptr increments gcharptr by 1. Hopefully, this could be inlined by +// the Go compiler. +func nextgcharptr(gcharptr **C.gchar) **C.gchar { + return (**C.gchar)(unsafe.Pointer(uintptr(unsafe.Pointer(gcharptr)) + 1)) +} + +func goString(cstr *C.gchar) string { + return C.GoString((*C.char)(cstr)) +} + +// same implementation as package glib +func toGoStringArray(c **C.gchar) []string { + if c == nil { + return nil + } + + // free when done + defer C.g_strfreev(c) + + strsLen := 0 + for scan := c; *scan != nil; scan = nextgcharptr(scan) { + strsLen++ + } + + strs := make([]string, strsLen) + for i := range strs { + strs[i] = C.GoString((*C.char)(*c)) + c = nextgcharptr(c) + } + + return strs +} + +// Wrapper function for TestBoolConvs since cgo can't be used with +// testing package +func testBoolConvs() error { + b := gobool(gbool(true)) + if b != true { + return errors.New("Unexpected bool conversion result") + } + + cb := gbool(gobool(C.gboolean(0))) + if cb != C.gboolean(0) { + return errors.New("Unexpected bool conversion result") + } + + return nil +} + +/* + * Unexported vars + */ + +var nilPtrErr = errors.New("cgo returned unexpected nil pointer") + +/* + * Constants + */ + +// Align is a representation of GTK's GtkAlign. +type Align int + +const ( + ALIGN_FILL Align = C.GTK_ALIGN_FILL + ALIGN_START Align = C.GTK_ALIGN_START + ALIGN_END Align = C.GTK_ALIGN_END + ALIGN_CENTER Align = C.GTK_ALIGN_CENTER +) + +func marshalAlign(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Align(c), nil +} + +// ArrowPlacement is a representation of GTK's GtkArrowPlacement. +type ArrowPlacement int + +const ( + ARROWS_BOTH ArrowPlacement = C.GTK_ARROWS_BOTH + ARROWS_START ArrowPlacement = C.GTK_ARROWS_START + ARROWS_END ArrowPlacement = C.GTK_ARROWS_END +) + +func marshalArrowPlacement(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ArrowPlacement(c), nil +} + +// ArrowType is a representation of GTK's GtkArrowType. +type ArrowType int + +const ( + ARROW_UP ArrowType = C.GTK_ARROW_UP + ARROW_DOWN ArrowType = C.GTK_ARROW_DOWN + ARROW_LEFT ArrowType = C.GTK_ARROW_LEFT + ARROW_RIGHT ArrowType = C.GTK_ARROW_RIGHT + ARROW_NONE ArrowType = C.GTK_ARROW_NONE +) + +func marshalArrowType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ArrowType(c), nil +} + +// AssistantPageType is a representation of GTK's GtkAssistantPageType. +type AssistantPageType int + +const ( + ASSISTANT_PAGE_CONTENT AssistantPageType = C.GTK_ASSISTANT_PAGE_CONTENT + ASSISTANT_PAGE_INTRO AssistantPageType = C.GTK_ASSISTANT_PAGE_INTRO + ASSISTANT_PAGE_CONFIRM AssistantPageType = C.GTK_ASSISTANT_PAGE_CONFIRM + ASSISTANT_PAGE_SUMMARY AssistantPageType = C.GTK_ASSISTANT_PAGE_SUMMARY + ASSISTANT_PAGE_PROGRESS AssistantPageType = C.GTK_ASSISTANT_PAGE_PROGRESS + ASSISTANT_PAGE_CUSTOM AssistantPageType = C.GTK_ASSISTANT_PAGE_CUSTOM +) + +func marshalAssistantPageType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return AssistantPageType(c), nil +} + +// ButtonsType is a representation of GTK's GtkButtonsType. +type ButtonsType int + +const ( + BUTTONS_NONE ButtonsType = C.GTK_BUTTONS_NONE + BUTTONS_OK ButtonsType = C.GTK_BUTTONS_OK + BUTTONS_CLOSE ButtonsType = C.GTK_BUTTONS_CLOSE + BUTTONS_CANCEL ButtonsType = C.GTK_BUTTONS_CANCEL + BUTTONS_YES_NO ButtonsType = C.GTK_BUTTONS_YES_NO + BUTTONS_OK_CANCEL ButtonsType = C.GTK_BUTTONS_OK_CANCEL +) + +func marshalButtonsType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ButtonsType(c), nil +} + +// SensitivityType is a representation of GTK's GtkSensitivityType +type SensitivityType int + +const ( + SENSITIVITY_AUTO SensitivityType = C.GTK_SENSITIVITY_AUTO + SENSITIVITY_ON SensitivityType = C.GTK_SENSITIVITY_ON + SENSITIVITY_OFF SensitivityType = C.GTK_SENSITIVITY_OFF +) + +func marshalSensitivityType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SensitivityType(c), nil +} + +// CalendarDisplayOptions is a representation of GTK's GtkCalendarDisplayOptions +type CalendarDisplayOptions int + +const ( + CALENDAR_SHOW_HEADING CalendarDisplayOptions = C.GTK_CALENDAR_SHOW_HEADING + CALENDAR_SHOW_DAY_NAMES CalendarDisplayOptions = C.GTK_CALENDAR_SHOW_DAY_NAMES + CALENDAR_NO_MONTH_CHANGE CalendarDisplayOptions = C.GTK_CALENDAR_NO_MONTH_CHANGE + CALENDAR_SHOW_WEEK_NUMBERS CalendarDisplayOptions = C.GTK_CALENDAR_SHOW_WEEK_NUMBERS + CALENDAR_SHOW_DETAILS CalendarDisplayOptions = C.GTK_CALENDAR_SHOW_DETAILS +) + +func marshalCalendarDisplayOptions(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return CalendarDisplayOptions(c), nil +} + +// DestDefaults is a representation of GTK's GtkDestDefaults. +type DestDefaults int + +const ( + DEST_DEFAULT_MOTION DestDefaults = C.GTK_DEST_DEFAULT_MOTION + DEST_DEFAULT_HIGHLIGHT DestDefaults = C.GTK_DEST_DEFAULT_HIGHLIGHT + DEST_DEFAULT_DROP DestDefaults = C.GTK_DEST_DEFAULT_DROP + DEST_DEFAULT_ALL DestDefaults = C.GTK_DEST_DEFAULT_ALL +) + +func marshalDestDefaults(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return DestDefaults(c), nil +} + +// DialogFlags is a representation of GTK's GtkDialogFlags. +type DialogFlags int + +const ( + DIALOG_MODAL DialogFlags = C.GTK_DIALOG_MODAL + DIALOG_DESTROY_WITH_PARENT DialogFlags = C.GTK_DIALOG_DESTROY_WITH_PARENT +) + +func marshalDialogFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return DialogFlags(c), nil +} + +// EntryIconPosition is a representation of GTK's GtkEntryIconPosition. +type EntryIconPosition int + +const ( + ENTRY_ICON_PRIMARY EntryIconPosition = C.GTK_ENTRY_ICON_PRIMARY + ENTRY_ICON_SECONDARY EntryIconPosition = C.GTK_ENTRY_ICON_SECONDARY +) + +func marshalEntryIconPosition(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return EntryIconPosition(c), nil +} + +// FileChooserAction is a representation of GTK's GtkFileChooserAction. +type FileChooserAction int + +const ( + FILE_CHOOSER_ACTION_OPEN FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_OPEN + FILE_CHOOSER_ACTION_SAVE FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_SAVE + FILE_CHOOSER_ACTION_SELECT_FOLDER FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + FILE_CHOOSER_ACTION_CREATE_FOLDER FileChooserAction = C.GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER +) + +func marshalFileChooserAction(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return FileChooserAction(c), nil +} + +// IconLookupFlags is a representation of GTK's GtkIconLookupFlags. +type IconLookupFlags int + +const ( + ICON_LOOKUP_NO_SVG IconLookupFlags = C.GTK_ICON_LOOKUP_NO_SVG + ICON_LOOKUP_FORCE_SVG IconLookupFlags = C.GTK_ICON_LOOKUP_FORCE_SVG + ICON_LOOKUP_USE_BUILTIN IconLookupFlags = C.GTK_ICON_LOOKUP_USE_BUILTIN + ICON_LOOKUP_GENERIC_FALLBACK IconLookupFlags = C.GTK_ICON_LOOKUP_GENERIC_FALLBACK + ICON_LOOKUP_FORCE_SIZE IconLookupFlags = C.GTK_ICON_LOOKUP_FORCE_SIZE +) + +func marshalIconLookupFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return IconLookupFlags(c), nil +} + +// IconSize is a representation of GTK's GtkIconSize. +type IconSize int + +const ( + ICON_SIZE_INVALID IconSize = C.GTK_ICON_SIZE_INVALID + ICON_SIZE_MENU IconSize = C.GTK_ICON_SIZE_MENU + ICON_SIZE_SMALL_TOOLBAR IconSize = C.GTK_ICON_SIZE_SMALL_TOOLBAR + ICON_SIZE_LARGE_TOOLBAR IconSize = C.GTK_ICON_SIZE_LARGE_TOOLBAR + ICON_SIZE_BUTTON IconSize = C.GTK_ICON_SIZE_BUTTON + ICON_SIZE_DND IconSize = C.GTK_ICON_SIZE_DND + ICON_SIZE_DIALOG IconSize = C.GTK_ICON_SIZE_DIALOG +) + +func marshalIconSize(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return IconSize(c), nil +} + +// ImageType is a representation of GTK's GtkImageType. +type ImageType int + +const ( + IMAGE_EMPTY ImageType = C.GTK_IMAGE_EMPTY + IMAGE_PIXBUF ImageType = C.GTK_IMAGE_PIXBUF + IMAGE_STOCK ImageType = C.GTK_IMAGE_STOCK + IMAGE_ICON_SET ImageType = C.GTK_IMAGE_ICON_SET + IMAGE_ANIMATION ImageType = C.GTK_IMAGE_ANIMATION + IMAGE_ICON_NAME ImageType = C.GTK_IMAGE_ICON_NAME + IMAGE_GICON ImageType = C.GTK_IMAGE_GICON +) + +// TODO: add GTK_IMAGE_SURFACE for GTK 3.10 + +func marshalImageType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ImageType(c), nil +} + +// InputHints is a representation of GTK's GtkInputHints. +type InputHints int + +const ( + INPUT_HINT_NONE InputHints = C.GTK_INPUT_HINT_NONE + INPUT_HINT_SPELLCHECK InputHints = C.GTK_INPUT_HINT_SPELLCHECK + INPUT_HINT_NO_SPELLCHECK InputHints = C.GTK_INPUT_HINT_NO_SPELLCHECK + INPUT_HINT_WORD_COMPLETION InputHints = C.GTK_INPUT_HINT_WORD_COMPLETION + INPUT_HINT_LOWERCASE InputHints = C.GTK_INPUT_HINT_LOWERCASE + INPUT_HINT_UPPERCASE_CHARS InputHints = C.GTK_INPUT_HINT_UPPERCASE_CHARS + INPUT_HINT_UPPERCASE_WORDS InputHints = C.GTK_INPUT_HINT_UPPERCASE_WORDS + INPUT_HINT_UPPERCASE_SENTENCES InputHints = C.GTK_INPUT_HINT_UPPERCASE_SENTENCES + INPUT_HINT_INHIBIT_OSK InputHints = C.GTK_INPUT_HINT_INHIBIT_OSK +) + +// TODO: +// GTK_INPUT_HINT_VERTICAL_WRITING Since 3.18 +// GTK_INPUT_HINT_EMOJI Since 3.22.20 +// GTK_INPUT_HINT_NO_EMOJI Since 3.22.20 + +func marshalInputHints(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return InputHints(c), nil +} + +// InputPurpose is a representation of GTK's GtkInputPurpose. +type InputPurpose int + +const ( + INPUT_PURPOSE_FREE_FORM InputPurpose = C.GTK_INPUT_PURPOSE_FREE_FORM + INPUT_PURPOSE_ALPHA InputPurpose = C.GTK_INPUT_PURPOSE_ALPHA + INPUT_PURPOSE_DIGITS InputPurpose = C.GTK_INPUT_PURPOSE_DIGITS + INPUT_PURPOSE_NUMBER InputPurpose = C.GTK_INPUT_PURPOSE_NUMBER + INPUT_PURPOSE_PHONE InputPurpose = C.GTK_INPUT_PURPOSE_PHONE + INPUT_PURPOSE_URL InputPurpose = C.GTK_INPUT_PURPOSE_URL + INPUT_PURPOSE_EMAIL InputPurpose = C.GTK_INPUT_PURPOSE_EMAIL + INPUT_PURPOSE_NAME InputPurpose = C.GTK_INPUT_PURPOSE_NAME + INPUT_PURPOSE_PASSWORD InputPurpose = C.GTK_INPUT_PURPOSE_PASSWORD + INPUT_PURPOSE_PIN InputPurpose = C.GTK_INPUT_PURPOSE_PIN +) + +func marshalInputPurpose(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return InputPurpose(c), nil +} + +// TODO: +// GtkBaselinePosition +// GtkDeleteType + +// DirectionType is a representation of GTK's GtkDirectionType. +type DirectionType int + +const ( + DIR_TAB_FORWARD DirectionType = C.GTK_DIR_TAB_FORWARD + DIR_TAB_BACKWARD DirectionType = C.GTK_DIR_TAB_BACKWARD + DIR_UP DirectionType = C.GTK_DIR_UP + DIR_DOWN DirectionType = C.GTK_DIR_DOWN + DIR_LEFT DirectionType = C.GTK_DIR_LEFT + DIR_RIGHT DirectionType = C.GTK_DIR_RIGHT +) + +func marshalDirectionType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return DirectionType(c), nil +} + +// Justification is a representation of GTK's GtkJustification. +type Justification int + +const ( + JUSTIFY_LEFT Justification = C.GTK_JUSTIFY_LEFT + JUSTIFY_RIGHT Justification = C.GTK_JUSTIFY_RIGHT + JUSTIFY_CENTER Justification = C.GTK_JUSTIFY_CENTER + JUSTIFY_FILL Justification = C.GTK_JUSTIFY_FILL +) + +func marshalJustification(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Justification(c), nil +} + +// License is a representation of GTK's GtkLicense. +type License int + +const ( + LICENSE_UNKNOWN License = C.GTK_LICENSE_UNKNOWN + LICENSE_CUSTOM License = C.GTK_LICENSE_CUSTOM + LICENSE_GPL_2_0 License = C.GTK_LICENSE_GPL_2_0 + LICENSE_GPL_3_0 License = C.GTK_LICENSE_GPL_3_0 + LICENSE_LGPL_2_1 License = C.GTK_LICENSE_LGPL_2_1 + LICENSE_LGPL_3_0 License = C.GTK_LICENSE_LGPL_3_0 + LICENSE_BSD License = C.GTK_LICENSE_BSD + LICENSE_MIT_X11 License = C.GTK_LICENSE_MIT_X11 + LICENSE_GTK_ARTISTIC License = C.GTK_LICENSE_ARTISTIC +) + +func marshalLicense(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return License(c), nil +} + +// MessageType is a representation of GTK's GtkMessageType. +type MessageType int + +const ( + MESSAGE_INFO MessageType = C.GTK_MESSAGE_INFO + MESSAGE_WARNING MessageType = C.GTK_MESSAGE_WARNING + MESSAGE_QUESTION MessageType = C.GTK_MESSAGE_QUESTION + MESSAGE_ERROR MessageType = C.GTK_MESSAGE_ERROR + MESSAGE_OTHER MessageType = C.GTK_MESSAGE_OTHER +) + +func marshalMessageType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return MessageType(c), nil +} + +// TODO: +// GtkMovementStep + +// Orientation is a representation of GTK's GtkOrientation. +type Orientation int + +const ( + ORIENTATION_HORIZONTAL Orientation = C.GTK_ORIENTATION_HORIZONTAL + ORIENTATION_VERTICAL Orientation = C.GTK_ORIENTATION_VERTICAL +) + +func marshalOrientation(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Orientation(c), nil +} + +// PackType is a representation of GTK's GtkPackType. +type PackType int + +const ( + PACK_START PackType = C.GTK_PACK_START + PACK_END PackType = C.GTK_PACK_END +) + +func marshalPackType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PackType(c), nil +} + +// PathType is a representation of GTK's GtkPathType. +type PathType int + +const ( + PATH_WIDGET PathType = C.GTK_PATH_WIDGET + PATH_WIDGET_CLASS PathType = C.GTK_PATH_WIDGET_CLASS + PATH_CLASS PathType = C.GTK_PATH_CLASS +) + +func marshalPathType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PathType(c), nil +} + +// PolicyType is a representation of GTK's GtkPolicyType. +type PolicyType int + +const ( + POLICY_ALWAYS PolicyType = C.GTK_POLICY_ALWAYS + POLICY_AUTOMATIC PolicyType = C.GTK_POLICY_AUTOMATIC + POLICY_NEVER PolicyType = C.GTK_POLICY_NEVER +) + +func marshalPolicyType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PolicyType(c), nil +} + +// SpinButtonUpdatePolicy is a representation of GTK's GtkSpinButtonUpdatePolicy. +type SpinButtonUpdatePolicy int + +const ( + UPDATE_ALWAYS SpinButtonUpdatePolicy = C.GTK_UPDATE_ALWAYS + UPDATE_IF_VALID SpinButtonUpdatePolicy = C.GTK_UPDATE_IF_VALID +) + +func marshalSpinButtonUpdatePolicy(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SpinButtonUpdatePolicy(c), nil +} + +// SpinType is a representation of GTK's GtkSpinType. +type SpinType int + +const ( + SPIN_STEP_FORWARD SpinType = C.GTK_SPIN_STEP_FORWARD + SPIN_STEP_BACKWARD SpinType = C.GTK_SPIN_STEP_BACKWARD + SPIN_PAGE_BACKWARD SpinType = C.GTK_SPIN_PAGE_BACKWARD + SPIN_HOME SpinType = C.GTK_SPIN_HOME + SPIN_END SpinType = C.GTK_SPIN_END + SPIN_USER_DEFINED SpinType = C.GTK_SPIN_USER_DEFINED +) + +func marshalSpinType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SpinType(c), nil +} + +// TreeViewGridLine is a representation of GTK's GtkTreeViewGridLines. +type TreeViewGridLines int + +const ( + TREE_VIEW_GRID_LINES_NONE TreeViewGridLines = C.GTK_TREE_VIEW_GRID_LINES_NONE + TREE_VIEW_GRID_LINES_HORIZONTAL TreeViewGridLines = C.GTK_TREE_VIEW_GRID_LINES_HORIZONTAL + TREE_VIEW_GRID_LINES_VERTICAL TreeViewGridLines = C.GTK_TREE_VIEW_GRID_LINES_VERTICAL + TREE_VIEW_GRID_LINES_BOTH TreeViewGridLines = C.GTK_TREE_VIEW_GRID_LINES_BOTH +) + +// CellRendererAccelMode is a representation of GtkCellRendererAccelMode +type CellRendererAccelMode int + +const ( + // CELL_RENDERER_ACCEL_MODE_GTK is documented as GTK+ accelerators mode + CELL_RENDERER_ACCEL_MODE_GTK CellRendererAccelMode = C.GTK_CELL_RENDERER_ACCEL_MODE_GTK + // CELL_RENDERER_ACCEL_MODE_OTHER is documented as Other accelerator mode + CELL_RENDERER_ACCEL_MODE_OTHER CellRendererAccelMode = C.GTK_CELL_RENDERER_ACCEL_MODE_OTHER +) + +func marshalCellRendererAccelMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return CellRendererAccelMode(c), nil +} + +// CellRendererState is a representation of GTK's GtkCellRendererState +type CellRendererState int + +const ( + CELL_RENDERER_SELECTED CellRendererState = C.GTK_CELL_RENDERER_SELECTED + CELL_RENDERER_PRELIT CellRendererState = C.GTK_CELL_RENDERER_PRELIT + CELL_RENDERER_INSENSITIVE CellRendererState = C.GTK_CELL_RENDERER_INSENSITIVE + CELL_RENDERER_SORTED CellRendererState = C.GTK_CELL_RENDERER_SORTED + CELL_RENDERER_FOCUSED CellRendererState = C.GTK_CELL_RENDERER_FOCUSED + CELL_RENDERER_EXPANDABLE CellRendererState = C.GTK_CELL_RENDERER_EXPANDABLE // since 3.4 + CELL_RENDERER_EXPANDED CellRendererState = C.GTK_CELL_RENDERER_EXPANDED // since 3.4 +) + +func marshalCellRendererState(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return CellRendererState(c), nil +} + +// CellRendererMode is a representation of GTK's GtkCellRendererMode +type CellRendererMode int + +const ( + CELL_RENDERER_MODE_INERT CellRendererMode = C.GTK_CELL_RENDERER_MODE_INERT + CELL_RENDERER_MODE_ACTIVATABLE CellRendererMode = C.GTK_CELL_RENDERER_MODE_ACTIVATABLE + CELL_RENDERER_MODE_EDITABLE CellRendererMode = C.GTK_CELL_RENDERER_MODE_EDITABLE +) + +func marshalCellRendererMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return CellRendererMode(c), nil +} + +// PositionType is a representation of GTK's GtkPositionType. +type PositionType int + +const ( + POS_LEFT PositionType = C.GTK_POS_LEFT + POS_RIGHT PositionType = C.GTK_POS_RIGHT + POS_TOP PositionType = C.GTK_POS_TOP + POS_BOTTOM PositionType = C.GTK_POS_BOTTOM +) + +func marshalPositionType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PositionType(c), nil +} + +// ReliefStyle is a representation of GTK's GtkReliefStyle. +type ReliefStyle int + +const ( + RELIEF_NORMAL ReliefStyle = C.GTK_RELIEF_NORMAL + RELIEF_HALF ReliefStyle = C.GTK_RELIEF_HALF + RELIEF_NONE ReliefStyle = C.GTK_RELIEF_NONE +) + +func marshalReliefStyle(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ReliefStyle(c), nil +} + +// ResponseType is a representation of GTK's GtkResponseType. +type ResponseType int + +const ( + RESPONSE_NONE ResponseType = C.GTK_RESPONSE_NONE + RESPONSE_REJECT ResponseType = C.GTK_RESPONSE_REJECT + RESPONSE_ACCEPT ResponseType = C.GTK_RESPONSE_ACCEPT + RESPONSE_DELETE_EVENT ResponseType = C.GTK_RESPONSE_DELETE_EVENT + RESPONSE_OK ResponseType = C.GTK_RESPONSE_OK + RESPONSE_CANCEL ResponseType = C.GTK_RESPONSE_CANCEL + RESPONSE_CLOSE ResponseType = C.GTK_RESPONSE_CLOSE + RESPONSE_YES ResponseType = C.GTK_RESPONSE_YES + RESPONSE_NO ResponseType = C.GTK_RESPONSE_NO + RESPONSE_APPLY ResponseType = C.GTK_RESPONSE_APPLY + RESPONSE_HELP ResponseType = C.GTK_RESPONSE_HELP +) + +func marshalResponseType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ResponseType(c), nil +} + +// ScrollType is a representation of GTK's GtkScrollType. +type ScrollType int + +const ( + SCROLL_NONE ScrollType = C.GTK_SCROLL_NONE + SCROLL_JUMP ScrollType = C.GTK_SCROLL_JUMP + SCROLL_STEP_BACKWARD ScrollType = C.GTK_SCROLL_STEP_BACKWARD + SCROLL_STEP_FORWARD ScrollType = C.GTK_SCROLL_STEP_FORWARD + SCROLL_PAGE_BACKWARD ScrollType = C.GTK_SCROLL_PAGE_BACKWARD + SCROLL_PAGE_FORWARD ScrollType = C.GTK_SCROLL_PAGE_FORWARD + SCROLL_STEP_UP ScrollType = C.GTK_SCROLL_STEP_UP + SCROLL_STEP_DOWN ScrollType = C.GTK_SCROLL_STEP_DOWN + SCROLL_PAGE_UP ScrollType = C.GTK_SCROLL_PAGE_UP + SCROLL_PAGE_DOWN ScrollType = C.GTK_SCROLL_PAGE_DOWN + SCROLL_STEP_LEFT ScrollType = C.GTK_SCROLL_STEP_LEFT + SCROLL_STEP_RIGHT ScrollType = C.GTK_SCROLL_STEP_RIGHT + SCROLL_PAGE_LEFT ScrollType = C.GTK_SCROLL_PAGE_LEFT + SCROLL_PAGE_RIGHT ScrollType = C.GTK_SCROLL_PAGE_RIGHT + SCROLL_START ScrollType = C.GTK_SCROLL_START + SCROLL_END ScrollType = C.GTK_SCROLL_END +) + +func marshalScrollType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ScrollType(c), nil +} + +// ScrollStep is a representation of GTK's GtkScrollStep. +type ScrollStep int + +const ( + SCROLL_STEPS ScrollStep = C.GTK_SCROLL_STEPS + SCROLL_PAGES ScrollStep = C.GTK_SCROLL_PAGES + SCROLL_ENDS ScrollStep = C.GTK_SCROLL_ENDS + SCROLL_HORIZONTAL_STEPS ScrollStep = C.GTK_SCROLL_HORIZONTAL_STEPS + SCROLL_HORIZONTAL_PAGES ScrollStep = C.GTK_SCROLL_HORIZONTAL_PAGES + SCROLL_HORIZONTAL_ENDS ScrollStep = C.GTK_SCROLL_HORIZONTAL_ENDS +) + +func marshalScrollStep(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ScrollStep(c), nil +} + +// SelectionMode is a representation of GTK's GtkSelectionMode. +type SelectionMode int + +const ( + SELECTION_NONE SelectionMode = C.GTK_SELECTION_NONE + SELECTION_SINGLE SelectionMode = C.GTK_SELECTION_SINGLE + SELECTION_BROWSE SelectionMode = C.GTK_SELECTION_BROWSE + SELECTION_MULTIPLE SelectionMode = C.GTK_SELECTION_MULTIPLE +) + +func marshalSelectionMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SelectionMode(c), nil +} + +// ShadowType is a representation of GTK's GtkShadowType. +type ShadowType int + +const ( + SHADOW_NONE ShadowType = C.GTK_SHADOW_NONE + SHADOW_IN ShadowType = C.GTK_SHADOW_IN + SHADOW_OUT ShadowType = C.GTK_SHADOW_OUT + SHADOW_ETCHED_IN ShadowType = C.GTK_SHADOW_ETCHED_IN + SHADOW_ETCHED_OUT ShadowType = C.GTK_SHADOW_ETCHED_OUT +) + +func marshalShadowType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ShadowType(c), nil +} + +// SizeGroupMode is a representation of GTK's GtkSizeGroupMode +type SizeGroupMode int + +const ( + SIZE_GROUP_NONE SizeGroupMode = C.GTK_SIZE_GROUP_NONE + SIZE_GROUP_HORIZONTAL SizeGroupMode = C.GTK_SIZE_GROUP_HORIZONTAL + SIZE_GROUP_VERTICAL SizeGroupMode = C.GTK_SIZE_GROUP_VERTICAL + SIZE_GROUP_BOTH SizeGroupMode = C.GTK_SIZE_GROUP_BOTH +) + +func marshalSizeGroupMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SizeGroupMode(c), nil +} + +// SortType is a representation of GTK's GtkSortType. +type SortType int + +const ( + SORT_ASCENDING SortType = C.GTK_SORT_ASCENDING + SORT_DESCENDING = C.GTK_SORT_DESCENDING +) + +// Use as column id in SetSortColumnId to specify ListStore sorted +// by default column or unsorted +const ( + SORT_COLUMN_DEFAULT int = -1 + SORT_COLUMN_UNSORTED int = -2 +) + +func marshalSortType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SortType(c), nil +} + +// StateFlags is a representation of GTK's GtkStateFlags. +type StateFlags int + +const ( + STATE_FLAG_NORMAL StateFlags = C.GTK_STATE_FLAG_NORMAL + STATE_FLAG_ACTIVE StateFlags = C.GTK_STATE_FLAG_ACTIVE + STATE_FLAG_PRELIGHT StateFlags = C.GTK_STATE_FLAG_PRELIGHT + STATE_FLAG_SELECTED StateFlags = C.GTK_STATE_FLAG_SELECTED + STATE_FLAG_INSENSITIVE StateFlags = C.GTK_STATE_FLAG_INSENSITIVE + STATE_FLAG_INCONSISTENT StateFlags = C.GTK_STATE_FLAG_INCONSISTENT + STATE_FLAG_FOCUSED StateFlags = C.GTK_STATE_FLAG_FOCUSED + STATE_FLAG_BACKDROP StateFlags = C.GTK_STATE_FLAG_BACKDROP +) + +func marshalStateFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return StateFlags(c), nil +} + +// TextDirection is a representation of GTK's GtkTextDirection. +type TextDirection int + +const ( + TEXT_DIR_NONE TextDirection = C.GTK_TEXT_DIR_NONE + TEXT_DIR_LTR TextDirection = C.GTK_TEXT_DIR_LTR + TEXT_DIR_RTL TextDirection = C.GTK_TEXT_DIR_RTL +) + +func marshalTextDirection(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TextDirection(c), nil +} + +// TargetFlags is a representation of GTK's GtkTargetFlags. +type TargetFlags int + +const ( + TARGET_SAME_APP TargetFlags = C.GTK_TARGET_SAME_APP + TARGET_SAME_WIDGET TargetFlags = C.GTK_TARGET_SAME_WIDGET + TARGET_OTHER_APP TargetFlags = C.GTK_TARGET_OTHER_APP + TARGET_OTHER_WIDGET TargetFlags = C.GTK_TARGET_OTHER_WIDGET +) + +func marshalTargetFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TargetFlags(c), nil +} + +// ToolbarStyle is a representation of GTK's GtkToolbarStyle. +type ToolbarStyle int + +const ( + TOOLBAR_ICONS ToolbarStyle = C.GTK_TOOLBAR_ICONS + TOOLBAR_TEXT ToolbarStyle = C.GTK_TOOLBAR_TEXT + TOOLBAR_BOTH ToolbarStyle = C.GTK_TOOLBAR_BOTH + TOOLBAR_BOTH_HORIZ ToolbarStyle = C.GTK_TOOLBAR_BOTH_HORIZ +) + +func marshalToolbarStyle(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ToolbarStyle(c), nil +} + +// TreeModelFlags is a representation of GTK's GtkTreeModelFlags. +type TreeModelFlags int + +const ( + TREE_MODEL_ITERS_PERSIST TreeModelFlags = C.GTK_TREE_MODEL_ITERS_PERSIST + TREE_MODEL_LIST_ONLY TreeModelFlags = C.GTK_TREE_MODEL_LIST_ONLY +) + +func marshalTreeModelFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TreeModelFlags(c), nil +} + +// WindowPosition is a representation of GTK's GtkWindowPosition. +type WindowPosition int + +const ( + WIN_POS_NONE WindowPosition = C.GTK_WIN_POS_NONE + WIN_POS_CENTER WindowPosition = C.GTK_WIN_POS_CENTER + WIN_POS_MOUSE WindowPosition = C.GTK_WIN_POS_MOUSE + WIN_POS_CENTER_ALWAYS WindowPosition = C.GTK_WIN_POS_CENTER_ALWAYS + WIN_POS_CENTER_ON_PARENT WindowPosition = C.GTK_WIN_POS_CENTER_ON_PARENT +) + +func marshalWindowPosition(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return WindowPosition(c), nil +} + +// WindowType is a representation of GTK's GtkWindowType. +type WindowType int + +const ( + WINDOW_TOPLEVEL WindowType = C.GTK_WINDOW_TOPLEVEL + WINDOW_POPUP WindowType = C.GTK_WINDOW_POPUP +) + +func marshalWindowType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return WindowType(c), nil +} + +// WrapMode is a representation of GTK's GtkWrapMode. +type WrapMode int + +const ( + WRAP_NONE WrapMode = C.GTK_WRAP_NONE + WRAP_CHAR WrapMode = C.GTK_WRAP_CHAR + WRAP_WORD WrapMode = C.GTK_WRAP_WORD + WRAP_WORD_CHAR WrapMode = C.GTK_WRAP_WORD_CHAR +) + +func marshalWrapMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return WrapMode(c), nil +} + +// TextSearchFlags is a representation of GTK's GtkTextSearchFlags. +type TextSearchFlags int + +const ( + TEXT_SEARCH_VISIBLE_ONLY TextSearchFlags = C.GTK_TEXT_SEARCH_VISIBLE_ONLY + TEXT_SEARCH_TEXT_ONLY TextSearchFlags = C.GTK_TEXT_SEARCH_TEXT_ONLY + TEXT_SEARCH_CASE_INSENSITIVE TextSearchFlags = C.GTK_TEXT_SEARCH_CASE_INSENSITIVE +) + +func marshalTextSearchFlags(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TextSearchFlags(c), nil +} + +// CornerType is a representation of GTK's GtkCornerType. +type CornerType int + +const ( + CORNER_TOP_LEFT CornerType = C.GTK_CORNER_TOP_LEFT + CORNER_BOTTOM_LEFT CornerType = C.GTK_CORNER_BOTTOM_LEFT + CORNER_TOP_RIGHT CornerType = C.GTK_CORNER_TOP_RIGHT + CORNER_BOTTOM_RIGHT CornerType = C.GTK_CORNER_BOTTOM_RIGHT +) + +func marshalCornerType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return CornerType(c), nil +} + +/* + * Init and main event loop + */ + +/* +Init() is a wrapper around gtk_init() and must be called before any +other GTK calls and is used to initialize everything necessary. + +In addition to setting up GTK for usage, a pointer to a slice of +strings may be passed in to parse standard GTK command line arguments. +args will be modified to remove any flags that were handled. +Alternatively, nil may be passed in to not perform any command line +parsing. +*/ +func Init(args *[]string) { + if args != nil { + argc := C.int(len(*args)) + argv := C.make_strings(argc) + defer C.destroy_strings(argv) + + for i, arg := range *args { + cstr := C.CString(arg) + C.set_string(argv, C.int(i), (*C.gchar)(cstr)) + } + + C.gtk_init((*C.int)(unsafe.Pointer(&argc)), + (***C.char)(unsafe.Pointer(&argv))) + + unhandled := make([]string, argc) + for i := 0; i < int(argc); i++ { + cstr := C.get_string(argv, C.int(i)) + unhandled[i] = goString(cstr) + C.free(unsafe.Pointer(cstr)) + } + *args = unhandled + } else { + C.gtk_init(nil, nil) + } +} + +/* +InitCheck() is a wrapper around gtk_init_check() and works exactly like Init() +only that it doesn't terminate the program if initialization fails. +*/ +func InitCheck(args *[]string) error { + success := false + if args != nil { + argc := C.int(len(*args)) + argv := C.make_strings(argc) + defer C.destroy_strings(argv) + + for i, arg := range *args { + cstr := C.CString(arg) + C.set_string(argv, C.int(i), (*C.gchar)(cstr)) + } + + success = gobool(C.gtk_init_check((*C.int)(unsafe.Pointer(&argc)), + (***C.char)(unsafe.Pointer(&argv)))) + + unhandled := make([]string, argc) + for i := 0; i < int(argc); i++ { + cstr := C.get_string(argv, C.int(i)) + unhandled[i] = goString(cstr) + C.free(unsafe.Pointer(cstr)) + } + *args = unhandled + } else { + success = gobool(C.gtk_init_check(nil, nil)) + } + if success { + return nil + } else { + return errors.New("Unable to initialize GTK") + } +} + +// Main() is a wrapper around gtk_main() and runs the GTK main loop, +// blocking until MainQuit() is called. +func Main() { + C.gtk_main() +} + +// MainIteration is a wrapper around gtk_main_iteration. +func MainIteration() bool { + return gobool(C.gtk_main_iteration()) +} + +// MainIterationDo is a wrapper around gtk_main_iteration_do. +func MainIterationDo(blocking bool) bool { + return gobool(C.gtk_main_iteration_do(gbool(blocking))) +} + +// EventsPending is a wrapper around gtk_events_pending. +func EventsPending() bool { + return gobool(C.gtk_events_pending()) +} + +// MainQuit() is a wrapper around gtk_main_quit() is used to terminate +// the GTK main loop (started by Main()). +func MainQuit() { + C.gtk_main_quit() +} + +/* + * GtkAdjustment + */ + +// Adjustment is a representation of GTK's GtkAdjustment. +type Adjustment struct { + glib.InitiallyUnowned +} + +// native returns a pointer to the underlying GtkAdjustment. +func (v *Adjustment) native() *C.GtkAdjustment { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAdjustment(p) +} + +func marshalAdjustment(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAdjustment(obj), nil +} + +func wrapAdjustment(obj *glib.Object) *Adjustment { + if obj == nil { + return nil + } + + return &Adjustment{glib.InitiallyUnowned{obj}} +} + +// AdjustmentNew is a wrapper around gtk_adjustment_new(). +func AdjustmentNew(value, lower, upper, stepIncrement, pageIncrement, pageSize float64) (*Adjustment, error) { + c := C.gtk_adjustment_new(C.gdouble(value), + C.gdouble(lower), + C.gdouble(upper), + C.gdouble(stepIncrement), + C.gdouble(pageIncrement), + C.gdouble(pageSize)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAdjustment(obj), nil +} + +// GetValue is a wrapper around gtk_adjustment_get_value(). +func (v *Adjustment) GetValue() float64 { + c := C.gtk_adjustment_get_value(v.native()) + return float64(c) +} + +// SetValue is a wrapper around gtk_adjustment_set_value(). +func (v *Adjustment) SetValue(value float64) { + C.gtk_adjustment_set_value(v.native(), C.gdouble(value)) +} + +// GetLower is a wrapper around gtk_adjustment_get_lower(). +func (v *Adjustment) GetLower() float64 { + c := C.gtk_adjustment_get_lower(v.native()) + return float64(c) +} + +// GetPageSize is a wrapper around gtk_adjustment_get_page_size(). +func (v *Adjustment) GetPageSize() float64 { + return float64(C.gtk_adjustment_get_page_size(v.native())) +} + +// SetPageSize is a wrapper around gtk_adjustment_set_page_size(). +func (v *Adjustment) SetPageSize(value float64) { + C.gtk_adjustment_set_page_size(v.native(), C.gdouble(value)) +} + +// Configure is a wrapper around gtk_adjustment_configure(). +func (v *Adjustment) Configure(value, lower, upper, stepIncrement, pageIncrement, pageSize float64) { + C.gtk_adjustment_configure(v.native(), C.gdouble(value), + C.gdouble(lower), C.gdouble(upper), C.gdouble(stepIncrement), + C.gdouble(pageIncrement), C.gdouble(pageSize)) +} + +// SetLower is a wrapper around gtk_adjustment_set_lower(). +func (v *Adjustment) SetLower(value float64) { + C.gtk_adjustment_set_lower(v.native(), C.gdouble(value)) +} + +// GetUpper is a wrapper around gtk_adjustment_get_upper(). +func (v *Adjustment) GetUpper() float64 { + c := C.gtk_adjustment_get_upper(v.native()) + return float64(c) +} + +// SetUpper is a wrapper around gtk_adjustment_set_upper(). +func (v *Adjustment) SetUpper(value float64) { + C.gtk_adjustment_set_upper(v.native(), C.gdouble(value)) +} + +// GetPageIncrement is a wrapper around gtk_adjustment_get_page_increment(). +func (v *Adjustment) GetPageIncrement() float64 { + c := C.gtk_adjustment_get_page_increment(v.native()) + return float64(c) +} + +// SetPageIncrement is a wrapper around gtk_adjustment_set_page_increment(). +func (v *Adjustment) SetPageIncrement(value float64) { + C.gtk_adjustment_set_page_increment(v.native(), C.gdouble(value)) +} + +// GetStepIncrement is a wrapper around gtk_adjustment_get_step_increment(). +func (v *Adjustment) GetStepIncrement() float64 { + c := C.gtk_adjustment_get_step_increment(v.native()) + return float64(c) +} + +// SetStepIncrement is a wrapper around gtk_adjustment_set_step_increment(). +func (v *Adjustment) SetStepIncrement(value float64) { + C.gtk_adjustment_set_step_increment(v.native(), C.gdouble(value)) +} + +// GetMinimumIncrement is a wrapper around gtk_adjustment_get_minimum_increment(). +func (v *Adjustment) GetMinimumIncrement() float64 { + c := C.gtk_adjustment_get_minimum_increment(v.native()) + return float64(c) +} + +/* +void gtk_adjustment_clamp_page () +void gtk_adjustment_changed () +void gtk_adjustment_value_changed () +void gtk_adjustment_configure () +*/ + +/* + * GtkAssistant + */ + +// Assistant is a representation of GTK's GtkAssistant. +type Assistant struct { + Window +} + +// native returns a pointer to the underlying GtkAssistant. +func (v *Assistant) native() *C.GtkAssistant { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAssistant(p) +} + +func marshalAssistant(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAssistant(obj), nil +} + +func wrapAssistant(obj *glib.Object) *Assistant { + if obj == nil { + return nil + } + + return &Assistant{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// AssistantNew is a wrapper around gtk_assistant_new(). +func AssistantNew() (*Assistant, error) { + c := C.gtk_assistant_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAssistant(obj), nil +} + +// GetCurrentPage is a wrapper around gtk_assistant_get_current_page(). +func (v *Assistant) GetCurrentPage() int { + c := C.gtk_assistant_get_current_page(v.native()) + return int(c) +} + +// SetCurrentPage is a wrapper around gtk_assistant_set_current_page(). +func (v *Assistant) SetCurrentPage(pageNum int) { + C.gtk_assistant_set_current_page(v.native(), C.gint(pageNum)) +} + +// GetNPages is a wrapper around gtk_assistant_get_n_pages(). +func (v *Assistant) GetNPages() int { + c := C.gtk_assistant_get_n_pages(v.native()) + return int(c) +} + +// GetNthPage is a wrapper around gtk_assistant_get_nth_page(). +func (v *Assistant) GetNthPage(pageNum int) (IWidget, error) { + c := C.gtk_assistant_get_nth_page(v.native(), C.gint(pageNum)) + if c == nil { + return nil, fmt.Errorf("page %d is out of bounds", pageNum) + } + return castWidget(c) +} + +// PrependPage is a wrapper around gtk_assistant_prepend_page(). +func (v *Assistant) PrependPage(page IWidget) int { + c := C.gtk_assistant_prepend_page(v.native(), page.toWidget()) + return int(c) +} + +// AppendPage is a wrapper around gtk_assistant_append_page(). +func (v *Assistant) AppendPage(page IWidget) int { + c := C.gtk_assistant_append_page(v.native(), page.toWidget()) + return int(c) +} + +// InsertPage is a wrapper around gtk_assistant_insert_page(). +func (v *Assistant) InsertPage(page IWidget, position int) int { + c := C.gtk_assistant_insert_page(v.native(), page.toWidget(), + C.gint(position)) + return int(c) +} + +// RemovePage is a wrapper around gtk_assistant_remove_page(). +func (v *Assistant) RemovePage(pageNum int) { + C.gtk_assistant_remove_page(v.native(), C.gint(pageNum)) +} + +// TODO: gtk_assistant_set_forward_page_func + +// SetPageType is a wrapper around gtk_assistant_set_page_type(). +func (v *Assistant) SetPageType(page IWidget, ptype AssistantPageType) { + C.gtk_assistant_set_page_type(v.native(), page.toWidget(), + C.GtkAssistantPageType(ptype)) +} + +// GetPageType is a wrapper around gtk_assistant_get_page_type(). +func (v *Assistant) GetPageType(page IWidget) AssistantPageType { + c := C.gtk_assistant_get_page_type(v.native(), page.toWidget()) + return AssistantPageType(c) +} + +// SetPageTitle is a wrapper around gtk_assistant_set_page_title(). +func (v *Assistant) SetPageTitle(page IWidget, title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_assistant_set_page_title(v.native(), page.toWidget(), + (*C.gchar)(cstr)) +} + +// GetPageTitle is a wrapper around gtk_assistant_get_page_title(). +func (v *Assistant) GetPageTitle(page IWidget) string { + return goString(C.gtk_assistant_get_page_title(v.native(), page.toWidget())) +} + +// SetPageComplete is a wrapper around gtk_assistant_set_page_complete(). +func (v *Assistant) SetPageComplete(page IWidget, complete bool) { + C.gtk_assistant_set_page_complete(v.native(), page.toWidget(), + gbool(complete)) +} + +// GetPageComplete is a wrapper around gtk_assistant_get_page_complete(). +func (v *Assistant) GetPageComplete(page IWidget) bool { + c := C.gtk_assistant_get_page_complete(v.native(), page.toWidget()) + return gobool(c) +} + +// AddActionWidget is a wrapper around gtk_assistant_add_action_widget(). +func (v *Assistant) AddActionWidget(child IWidget) { + C.gtk_assistant_add_action_widget(v.native(), child.toWidget()) +} + +// RemoveActionWidget is a wrapper around gtk_assistant_remove_action_widget(). +func (v *Assistant) RemoveActionWidget(child IWidget) { + C.gtk_assistant_remove_action_widget(v.native(), child.toWidget()) +} + +// UpdateButtonsState is a wrapper around gtk_assistant_update_buttons_state(). +func (v *Assistant) UpdateButtonsState() { + C.gtk_assistant_update_buttons_state(v.native()) +} + +// Commit is a wrapper around gtk_assistant_commit(). +func (v *Assistant) Commit() { + C.gtk_assistant_commit(v.native()) +} + +// NextPage is a wrapper around gtk_assistant_next_page(). +func (v *Assistant) NextPage() { + C.gtk_assistant_next_page(v.native()) +} + +// PreviousPage is a wrapper around gtk_assistant_previous_page(). +func (v *Assistant) PreviousPage() { + C.gtk_assistant_previous_page(v.native()) +} + +/* + * GtkBin + */ + +// Bin is a representation of GTK's GtkBin. +type Bin struct { + Container +} + +// native returns a pointer to the underlying GtkBin. +func (v *Bin) native() *C.GtkBin { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkBin(p) +} + +func marshalBin(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapBin(obj), nil +} + +func wrapBin(obj *glib.Object) *Bin { + if obj == nil { + return nil + } + + return &Bin{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// GetChild is a wrapper around gtk_bin_get_child(). +func (v *Bin) GetChild() (IWidget, error) { + c := C.gtk_bin_get_child(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +/* + * GtkBuilder + */ + +// Builder is a representation of GTK's GtkBuilder. +type Builder struct { + *glib.Object +} + +// native() returns a pointer to the underlying GtkBuilder. +func (b *Builder) native() *C.GtkBuilder { + if b == nil || b.GObject == nil { + return nil + } + p := unsafe.Pointer(b.GObject) + return C.toGtkBuilder(p) +} + +func marshalBuilder(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return &Builder{obj}, nil +} + +// BuilderNew is a wrapper around gtk_builder_new(). +func BuilderNew() (*Builder, error) { + c := C.gtk_builder_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return &Builder{obj}, nil +} + +// AddFromFile is a wrapper around gtk_builder_add_from_file(). +func (b *Builder) AddFromFile(filename string) error { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + res := C.gtk_builder_add_from_file(b.native(), (*C.gchar)(cstr), &err) + if res == 0 { + defer C.g_error_free(err) + return errors.New(goString(err.message)) + } + return nil +} + +// AddFromResource is a wrapper around gtk_builder_add_from_resource(). +func (b *Builder) AddFromResource(path string) error { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + res := C.gtk_builder_add_from_resource(b.native(), (*C.gchar)(cstr), &err) + if res == 0 { + defer C.g_error_free(err) + return errors.New(goString(err.message)) + } + return nil +} + +// AddFromString is a wrapper around gtk_builder_add_from_string(). +func (b *Builder) AddFromString(str string) error { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + length := (C.gsize)(len(str)) + var err *C.GError = nil + res := C.gtk_builder_add_from_string(b.native(), (*C.gchar)(cstr), length, &err) + if res == 0 { + defer C.g_error_free(err) + return errors.New(goString(err.message)) + } + return nil +} + +// GetObject is a wrapper around gtk_builder_get_object(). The returned result +// is an IObject, so it will need to be type-asserted to the appropriate type before +// being used. For example, to get an object and type assert it as a window: +// +// obj, err := builder.GetObject("window") +// if err != nil { +// // object not found +// return +// } +// if w, ok := obj.(*gtk.Window); ok { +// // do stuff with w here +// } else { +// // not a *gtk.Window +// } +// +func (b *Builder) GetObject(name string) (glib.IObject, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_builder_get_object(b.native(), (*C.gchar)(cstr)) + if c == nil { + return nil, errors.New("object '" + name + "' not found") + } + obj, err := cast(c) + if err != nil { + return nil, err + } + return obj, nil +} + +var ( + builderSignals = struct { + sync.RWMutex + m map[*C.GtkBuilder]map[string]interface{} + }{ + m: make(map[*C.GtkBuilder]map[string]interface{}), + } +) + +// ConnectSignals is a wrapper around gtk_builder_connect_signals_full(). +func (b *Builder) ConnectSignals(signals map[string]interface{}) { + builderSignals.Lock() + builderSignals.m[b.native()] = signals + builderSignals.Unlock() + + C._gtk_builder_connect_signals_full(b.native()) +} + +/* + * GtkBuildable + */ + +// TODO: +// GtkBuildableIface +// gtk_buildable_set_name(). +// gtk_buildable_get_name(). +// gtk_buildable_add_child(). +// gtk_buildable_set_buildable_property(). +// gtk_buildable_construct_child(). +// gtk_buildable_custom_tag_start(). +// gtk_buildable_custom_tag_end(). +// gtk_buildable_custom_finished(). +// gtk_buildable_parser_finished(). +// gtk_buildable_get_internal_child(). + +/* + * GtkButton + */ + +// Button is a representation of GTK's GtkButton. +type Button struct { + Bin + + // Interfaces + IActionable +} + +// native() returns a pointer to the underlying GtkButton. +func (v *Button) native() *C.GtkButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkButton(p) +} + +func marshalButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapButton(obj), nil +} + +func wrapButton(obj *glib.Object) *Button { + if obj == nil { + return nil + } + + actionable := &Actionable{obj} + return &Button{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, actionable} +} + +// ButtonNew() is a wrapper around gtk_button_new(). +func ButtonNew() (*Button, error) { + c := C.gtk_button_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapButton(obj), nil +} + +// ButtonNewWithLabel() is a wrapper around gtk_button_new_with_label(). +func ButtonNewWithLabel(label string) (*Button, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_button_new_with_label((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapButton(obj), nil +} + +// ButtonNewWithMnemonic() is a wrapper around gtk_button_new_with_mnemonic(). +func ButtonNewWithMnemonic(label string) (*Button, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_button_new_with_mnemonic((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapButton(obj), nil +} + +// Clicked() is a wrapper around gtk_button_clicked(). +func (v *Button) Clicked() { + C.gtk_button_clicked(v.native()) +} + +// SetRelief() is a wrapper around gtk_button_set_relief(). +func (v *Button) SetRelief(newStyle ReliefStyle) { + C.gtk_button_set_relief(v.native(), C.GtkReliefStyle(newStyle)) +} + +// GetRelief() is a wrapper around gtk_button_get_relief(). +func (v *Button) GetRelief() ReliefStyle { + c := C.gtk_button_get_relief(v.native()) + return ReliefStyle(c) +} + +// SetLabel() is a wrapper around gtk_button_set_label(). +func (v *Button) SetLabel(label string) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_button_set_label(v.native(), (*C.gchar)(cstr)) +} + +// GetLabel() is a wrapper around gtk_button_get_label(). +func (v *Button) GetLabel() (string, error) { + c := C.gtk_button_get_label(v.native()) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// SetUseUnderline() is a wrapper around gtk_button_set_use_underline(). +func (v *Button) SetUseUnderline(useUnderline bool) { + C.gtk_button_set_use_underline(v.native(), gbool(useUnderline)) +} + +// GetUseUnderline() is a wrapper around gtk_button_get_use_underline(). +func (v *Button) GetUseUnderline() bool { + c := C.gtk_button_get_use_underline(v.native()) + return gobool(c) +} + +// SetImage() is a wrapper around gtk_button_set_image(). +func (v *Button) SetImage(image IWidget) { + C.gtk_button_set_image(v.native(), image.toWidget()) +} + +// GetImage() is a wrapper around gtk_button_get_image(). +func (v *Button) GetImage() (IWidget, error) { + c := C.gtk_button_get_image(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetImagePosition() is a wrapper around gtk_button_set_image_position(). +func (v *Button) SetImagePosition(position PositionType) { + C.gtk_button_set_image_position(v.native(), C.GtkPositionType(position)) +} + +// GetImagePosition() is a wrapper around gtk_button_get_image_position(). +func (v *Button) GetImagePosition() PositionType { + c := C.gtk_button_get_image_position(v.native()) + return PositionType(c) +} + +// SetAlwaysShowImage() is a wrapper around gtk_button_set_always_show_image(). +func (v *Button) SetAlwaysShowImage(alwaysShow bool) { + C.gtk_button_set_always_show_image(v.native(), gbool(alwaysShow)) +} + +// GetAlwaysShowImage() is a wrapper around gtk_button_get_always_show_image(). +func (v *Button) GetAlwaysShowImage() bool { + c := C.gtk_button_get_always_show_image(v.native()) + return gobool(c) +} + +// GetEventWindow() is a wrapper around gtk_button_get_event_window(). +func (v *Button) GetEventWindow() (*gdk.Window, error) { + c := C.gtk_button_get_event_window(v.native()) + if c == nil { + return nil, nilPtrErr + } + + w := &gdk.Window{glib.Take(unsafe.Pointer(c))} + return w, nil +} + +/* + * GtkColorButton + */ + +// ColorButton is a representation of GTK's GtkColorButton. +type ColorButton struct { + Button + + // Interfaces + ColorChooser +} + +// Native returns a pointer to the underlying GtkColorButton. +func (v *ColorButton) native() *C.GtkColorButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkColorButton(p) +} + +func wrapColorButton(obj *glib.Object) *ColorButton { + if obj == nil { + return nil + } + + cc := wrapColorChooser(obj) + actionable := wrapActionable(obj) + return &ColorButton{Button{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}, actionable}, *cc} +} + +// ColorButtonNew is a wrapper around gtk_color_button_new(). +func ColorButtonNew() (*ColorButton, error) { + c := C.gtk_color_button_new() + if c == nil { + return nil, nilPtrErr + } + return wrapColorButton(glib.Take(unsafe.Pointer(c))), nil +} + +// ColorButtonNewWithRGBA is a wrapper around gtk_color_button_new_with_rgba(). +func ColorButtonNewWithRGBA(gdkColor *gdk.RGBA) (*ColorButton, error) { + c := C.gtk_color_button_new_with_rgba((*C.GdkRGBA)(unsafe.Pointer(gdkColor.Native()))) + if c == nil { + return nil, nilPtrErr + } + return wrapColorButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SetTitle is a wrapper around gtk_color_button_set_title(). +func (v *ColorButton) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_color_button_set_title(v.native(), (*C.gchar)(cstr)) +} + +// GetTitle is a wrapper around gtk_color_button_get_title(). +func (v *ColorButton) GetTitle() string { + c := C.gtk_color_button_get_title(v.native()) + defer C.free(unsafe.Pointer(c)) + return goString(c) +} + +/* + * GtkBox + */ + +// Box is a representation of GTK's GtkBox. +type Box struct { + Container +} + +// native() returns a pointer to the underlying GtkBox. +func (v *Box) native() *C.GtkBox { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkBox(p) +} + +func marshalBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapBox(obj), nil +} + +func wrapBox(obj *glib.Object) *Box { + if obj == nil { + return nil + } + + return &Box{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +func (v *Box) toOrientable() *C.GtkOrientable { + if v == nil { + return nil + } + return C.toGtkOrientable(unsafe.Pointer(v.GObject)) +} + +// GetOrientation() is a wrapper around C.gtk_orientable_get_orientation() for a GtkBox +func (v *Box) GetOrientation() Orientation { + return Orientation(C.gtk_orientable_get_orientation(v.toOrientable())) +} + +// SetOrientation() is a wrapper around C.gtk_orientable_set_orientation() for a GtkBox +func (v *Box) SetOrientation(o Orientation) { + C.gtk_orientable_set_orientation(v.toOrientable(), C.GtkOrientation(o)) +} + +// BoxNew() is a wrapper around gtk_box_new(). +func BoxNew(orientation Orientation, spacing int) (*Box, error) { + c := C.gtk_box_new(C.GtkOrientation(orientation), C.gint(spacing)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapBox(obj), nil +} + +// PackStart() is a wrapper around gtk_box_pack_start(). +func (v *Box) PackStart(child IWidget, expand, fill bool, padding uint) { + C.gtk_box_pack_start(v.native(), child.toWidget(), gbool(expand), + gbool(fill), C.guint(padding)) +} + +// PackEnd() is a wrapper around gtk_box_pack_end(). +func (v *Box) PackEnd(child IWidget, expand, fill bool, padding uint) { + C.gtk_box_pack_end(v.native(), child.toWidget(), gbool(expand), + gbool(fill), C.guint(padding)) +} + +// GetHomogeneous() is a wrapper around gtk_box_get_homogeneous(). +func (v *Box) GetHomogeneous() bool { + c := C.gtk_box_get_homogeneous(v.native()) + return gobool(c) +} + +// SetHomogeneous() is a wrapper around gtk_box_set_homogeneous(). +func (v *Box) SetHomogeneous(homogeneous bool) { + C.gtk_box_set_homogeneous(v.native(), gbool(homogeneous)) +} + +// GetSpacing() is a wrapper around gtk_box_get_spacing(). +func (v *Box) GetSpacing() int { + c := C.gtk_box_get_spacing(v.native()) + return int(c) +} + +// SetSpacing() is a wrapper around gtk_box_set_spacing() +func (v *Box) SetSpacing(spacing int) { + C.gtk_box_set_spacing(v.native(), C.gint(spacing)) +} + +// ReorderChild() is a wrapper around gtk_box_reorder_child(). +func (v *Box) ReorderChild(child IWidget, position int) { + C.gtk_box_reorder_child(v.native(), child.toWidget(), C.gint(position)) +} + +// QueryChildPacking() is a wrapper around gtk_box_query_child_packing(). +func (v *Box) QueryChildPacking(child IWidget) (expand, fill bool, padding uint, packType PackType) { + var cexpand, cfill C.gboolean + var cpadding C.guint + var cpackType C.GtkPackType + + C.gtk_box_query_child_packing(v.native(), child.toWidget(), &cexpand, + &cfill, &cpadding, &cpackType) + return gobool(cexpand), gobool(cfill), uint(cpadding), PackType(cpackType) +} + +// SetChildPacking() is a wrapper around gtk_box_set_child_packing(). +func (v *Box) SetChildPacking(child IWidget, expand, fill bool, padding uint, packType PackType) { + C.gtk_box_set_child_packing(v.native(), child.toWidget(), gbool(expand), + gbool(fill), C.guint(padding), C.GtkPackType(packType)) +} + +/* + * GtkCalendar + */ + +// Calendar is a representation of GTK's GtkCalendar. +type Calendar struct { + Widget +} + +// native() returns a pointer to the underlying GtkCalendar. +func (v *Calendar) native() *C.GtkCalendar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCalendar(p) +} + +func marshalCalendar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCalendar(obj), nil +} + +func wrapCalendar(obj *glib.Object) *Calendar { + if obj == nil { + return nil + } + + return &Calendar{Widget{glib.InitiallyUnowned{obj}}} +} + +// TODO: +// GtkCalendarDetailFunc + +// CalendarNew is a wrapper around gtk_calendar_new(). +func CalendarNew() (*Calendar, error) { + c := C.gtk_calendar_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCalendar(obj), nil +} + +// SelectMonth is a wrapper around gtk_calendar_select_month(). +func (v *Calendar) SelectMonth(month, year uint) { + C.gtk_calendar_select_month(v.native(), C.guint(month), C.guint(year)) +} + +// SelectDay is a wrapper around gtk_calendar_select_day(). +func (v *Calendar) SelectDay(day uint) { + C.gtk_calendar_select_day(v.native(), C.guint(day)) +} + +// MarkDay is a wrapper around gtk_calendar_mark_day(). +func (v *Calendar) MarkDay(day uint) { + C.gtk_calendar_mark_day(v.native(), C.guint(day)) +} + +// UnmarkDay is a wrapper around gtk_calendar_unmark_day(). +func (v *Calendar) UnmarkDay(day uint) { + C.gtk_calendar_unmark_day(v.native(), C.guint(day)) +} + +// GetDayIsMarked is a wrapper around gtk_calendar_get_day_is_marked(). +func (v *Calendar) GetDayIsMarked(day uint) bool { + c := C.gtk_calendar_get_day_is_marked(v.native(), C.guint(day)) + return gobool(c) +} + +// ClearMarks is a wrapper around gtk_calendar_clear_marks(). +func (v *Calendar) ClearMarks() { + C.gtk_calendar_clear_marks(v.native()) +} + +// GetDisplayOptions is a wrapper around gtk_calendar_get_display_options(). +func (v *Calendar) GetDisplayOptions() CalendarDisplayOptions { + c := C.gtk_calendar_get_display_options(v.native()) + return CalendarDisplayOptions(c) +} + +// SetDisplayOptions is a wrapper around gtk_calendar_set_display_options(). +func (v *Calendar) SetDisplayOptions(flags CalendarDisplayOptions) { + C.gtk_calendar_set_display_options(v.native(), + C.GtkCalendarDisplayOptions(flags)) +} + +// GetDate is a wrapper around gtk_calendar_get_date(). +func (v *Calendar) GetDate() (year, month, day uint) { + var cyear, cmonth, cday C.guint + C.gtk_calendar_get_date(v.native(), &cyear, &cmonth, &cday) + return uint(cyear), uint(cmonth), uint(cday) +} + +// TODO: +// gtk_calendar_set_detail_func(). + +// GetDetailWidthChars is a wrapper around gtk_calendar_get_detail_width_chars(). +func (v *Calendar) GetDetailWidthChars() int { + c := C.gtk_calendar_get_detail_width_chars(v.native()) + return int(c) +} + +// SetDetailWidthChars is a wrapper around gtk_calendar_set_detail_width_chars(). +func (v *Calendar) SetDetailWidthChars(chars int) { + C.gtk_calendar_set_detail_width_chars(v.native(), C.gint(chars)) +} + +// GetDetailHeightRows is a wrapper around gtk_calendar_get_detail_height_rows(). +func (v *Calendar) GetDetailHeightRows() int { + c := C.gtk_calendar_get_detail_height_rows(v.native()) + return int(c) +} + +// SetDetailHeightRows is a wrapper around gtk_calendar_set_detail_height_rows(). +func (v *Calendar) SetDetailHeightRows(rows int) { + C.gtk_calendar_set_detail_height_rows(v.native(), C.gint(rows)) +} + +/* + * GtkCellLayout + */ + +// CellLayout is a representation of GTK's GtkCellLayout GInterface. +type CellLayout struct { + *glib.Object +} + +// ICellLayout is an interface type implemented by all structs +// embedding a CellLayout. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkCellLayout. +type ICellLayout interface { + toCellLayout() *C.GtkCellLayout +} + +// native() returns a pointer to the underlying GObject as a GtkCellLayout. +func (v *CellLayout) native() *C.GtkCellLayout { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellLayout(p) +} + +func marshalCellLayout(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellLayout(obj), nil +} + +func wrapCellLayout(obj *glib.Object) *CellLayout { + if obj == nil { + return nil + } + + return &CellLayout{obj} +} + +func (v *CellLayout) toCellLayout() *C.GtkCellLayout { + if v == nil { + return nil + } + return v.native() +} + +// PackStart is a wrapper around gtk_cell_layout_pack_start(). +func (v *CellLayout) PackStart(cell ICellRenderer, expand bool) { + C.gtk_cell_layout_pack_start(v.native(), cell.toCellRenderer(), + gbool(expand)) +} + +// AddAttribute is a wrapper around gtk_cell_layout_add_attribute(). +func (v *CellLayout) AddAttribute(cell ICellRenderer, attribute string, column int) { + cstr := C.CString(attribute) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_cell_layout_add_attribute(v.native(), cell.toCellRenderer(), + (*C.gchar)(cstr), C.gint(column)) +} + +// ClearAttributes is a wrapper around gtk_cell_layout_clear_attributes() +func (v *CellLayout) ClearAttributes(cell ICellRenderer) { + C.gtk_cell_layout_clear_attributes(v.native(), cell.toCellRenderer()) +} + +/* + * GtkCellView + */ + +// TODO: +// GtkCellView +// gtk_cell_view_new(). +// gtk_cell_view_new_with_context(). +// gtk_cell_view_new_with_text(). +// gtk_cell_view_new_with_markup(). +// gtk_cell_view_new_with_pixbuf(). +// gtk_cell_view_set_model(). +// gtk_cell_view_get_model(). +// gtk_cell_view_set_displayed_row(). +// gtk_cell_view_get_displayed_row(). +// gtk_cell_view_set_background_rgba(). +// gtk_cell_view_set_draw_sensitive(). +// gtk_cell_view_get_draw_sensitive(). +// gtk_cell_view_set_fit_model(). +// gtk_cell_view_get_fit_model(). + +/* + * GtkCellEditable + */ + +// CellEditable is a representation of GTK's GtkCellEditable GInterface. +type CellEditable struct { + glib.InitiallyUnowned + // Widget +} + +// ICellEditable is an interface type implemented by all structs +// embedding an CellEditable. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkCellEditable. +type ICellEditable interface { + toCellEditable() *C.GtkCellEditable + ToEntry() *Entry +} + +// native() returns a pointer to the underlying GObject as a GtkCellEditable. +func (v *CellEditable) native() *C.GtkCellEditable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellEditable(p) +} + +func marshalCellEditable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellEditable(obj), nil +} + +func wrapCellEditable(obj *glib.Object) *CellEditable { + if obj == nil { + return nil + } + + // return &CellEditable{Widget{glib.InitiallyUnowned{obj}}} + return &CellEditable{glib.InitiallyUnowned{obj}} +} + +func (v *CellEditable) toCellEditable() *C.GtkCellEditable { + if v == nil { + return nil + } + return v.native() +} + +// ToEntry is a helper tool, e.g: it returns *gtk.CellEditable as a *gtk.Entry +// that embedding this CellEditable instance, then it can be used with +// CellRendererText to adding EntryCompletion tools or intercepting EntryBuffer, +// (to bypass "canceled" signal for example) then record entry, and much more. +func (v *CellEditable) ToEntry() *Entry { + return &Entry{Widget{glib.InitiallyUnowned{v.Object}}, + Editable{v.Object}, + *v} +} + +// StartEditing is a wrapper around gtk_cell_editable_start_editing(). +func (v *CellEditable) StartEditing(event *gdk.Event) { + C.gtk_cell_editable_start_editing(v.native(), + (*C.GdkEvent)(unsafe.Pointer(event.Native()))) +} + +// EditingDone is a wrapper around gtk_cell_editable_editing_done(). +func (v *CellEditable) EditingDone() { + C.gtk_cell_editable_editing_done(v.native()) +} + +// RemoveWidget is a wrapper around gtk_cell_editable_remove_widget(). +func (v *CellEditable) RemoveWidget() { + C.gtk_cell_editable_remove_widget(v.native()) +} + +/* + * GtkCellRenderer + */ + +// CellRenderer is a representation of GTK's GtkCellRenderer. +type CellRenderer struct { + glib.InitiallyUnowned +} + +// ICellRenderer is an interface type implemented by all structs +// embedding a CellRenderer. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkCellRenderer. +type ICellRenderer interface { + toCellRenderer() *C.GtkCellRenderer +} + +// native returns a pointer to the underlying GtkCellRenderer. +func (v *CellRenderer) native() *C.GtkCellRenderer { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRenderer(p) +} + +func (v *CellRenderer) toCellRenderer() *C.GtkCellRenderer { + if v == nil { + return nil + } + return v.native() +} + +func marshalCellRenderer(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRenderer(obj), nil +} + +func wrapCellRenderer(obj *glib.Object) *CellRenderer { + if obj == nil { + return nil + } + + return &CellRenderer{glib.InitiallyUnowned{obj}} +} + +// Activate is a wrapper around gtk_cell_renderer_activate(). +func (v *CellRenderer) Activate(event *gdk.Event, widget IWidget, path string, + backgroundArea, cellArea *gdk.Rectangle, flags CellRendererState) bool { + + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + e := (*C.GdkEvent)(unsafe.Pointer(event.Native())) + + c := C.gtk_cell_renderer_activate(v.native(), e, widget.toWidget(), + (*C.gchar)(cstr), nativeGdkRectangle(*backgroundArea), + nativeGdkRectangle(*cellArea), C.GtkCellRendererState(flags)) + + return gobool(c) +} + +// StartEditing is a wrapper around gtk_cell_renderer_start_editing(). +func (v *CellRenderer) StartEditing(event *gdk.Event, widget IWidget, path string, + backgroundArea, cellArea *gdk.Rectangle, flags CellRendererState) (ICellEditable, error) { + + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + e := (*C.GdkEvent)(unsafe.Pointer(event.Native())) + + c := C.gtk_cell_renderer_start_editing(v.native(), e, widget.toWidget(), + (*C.gchar)(cstr), nativeGdkRectangle(*backgroundArea), + nativeGdkRectangle(*cellArea), C.GtkCellRendererState(flags)) + + return castCellEditable(c) +} + +// StopEditing is a wrapper around gtk_cell_renderer_stop_editing(). +func (v *CellRenderer) StopEditing(canceled bool) { + C.gtk_cell_renderer_stop_editing(v.native(), gbool(canceled)) +} + +// GetVisible is a wrapper around gtk_cell_renderer_get_visible(). +func (v *CellRenderer) GetVisible() bool { + return gobool(C.gtk_cell_renderer_get_visible(v.native())) +} + +// SetVisible is a wrapper around gtk_cell_renderer_set_visible(). +func (v *CellRenderer) SetVisible(visible bool) { + C.gtk_cell_renderer_set_visible(v.native(), gbool(visible)) +} + +// GetSensitive is a wrapper around gtk_cell_renderer_get_sensitive(). +func (v *CellRenderer) GetSensitive() bool { + return gobool(C.gtk_cell_renderer_get_sensitive(v.native())) +} + +// SetSentitive is a wrapper around gtk_cell_renderer_set_sensitive(). +func (v *CellRenderer) SetSentitive(sensitive bool) { + C.gtk_cell_renderer_set_sensitive(v.native(), gbool(sensitive)) +} + +// IsActivatable is a wrapper around gtk_cell_renderer_is_activatable(). +func (v *CellRenderer) IsActivatable() bool { + return gobool(C.gtk_cell_renderer_is_activatable(v.native())) +} + +// GetState is a wrapper around gtk_cell_renderer_get_state(). +func (v *CellRenderer) GetState(widget IWidget, + flags CellRendererState) StateFlags { + + return StateFlags(C.gtk_cell_renderer_get_state(v.native(), + widget.toWidget(), + C.GtkCellRendererState(flags))) +} + +// SetAlignment is a wrapper around gtk_tree_view_column_set_alignment(). +func (v *CellRenderer) SetAlignment(xalign float64, yalign float64) { + C.gtk_cell_renderer_set_alignment(v.native(), C.gfloat(xalign), C.gfloat(yalign)) +} + +// TODO: gtk_cell_renderer_get_aligned_area +// TODO: gtk_cell_renderer_get_size +// TODO: gtk_cell_renderer_render +// TODO: gtk_cell_renderer_activate +// TODO: gtk_cell_renderer_start_editing +// TODO: gtk_cell_renderer_stop_editing +// TODO: gtk_cell_renderer_get_fixed_size +// TODO: gtk_cell_renderer_set_fixed_size +// TODO: gtk_cell_renderer_get_visible +// TODO: gtk_cell_renderer_set_visible +// TODO: gtk_cell_renderer_get_sensitive +// TODO: gtk_cell_renderer_set_sensitive +// TODO: gtk_cell_renderer_get_alignment +// TODO: gtk_cell_renderer_set_alignment +// TODO: gtk_cell_renderer_get_padding +// TODO: gtk_cell_renderer_set_padding +// TODO: gtk_cell_renderer_get_state +// TODO: gtk_cell_renderer_is_activatable +// TODO: gtk_cell_renderer_get_preferred_height +// TODO: gtk_cell_renderer_get_preferred_height_for_width +// TODO: gtk_cell_renderer_get_preferred_size +// TODO: gtk_cell_renderer_get_preferred_width +// TODO: gtk_cell_renderer_get_preferred_width_for_height +// TODO: gtk_cell_renderer_get_request_mode + +/* + * GtkCellRendererSpinner + */ + +// CellRendererSpinner is a representation of GTK's GtkCellRendererSpinner. +type CellRendererSpinner struct { + CellRenderer +} + +// native returns a pointer to the underlying GtkCellRendererSpinner. +func (v *CellRendererSpinner) native() *C.GtkCellRendererSpinner { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererSpinner(p) +} + +func marshalCellRendererSpinner(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererSpinner(obj), nil +} + +func wrapCellRendererSpinner(obj *glib.Object) *CellRendererSpinner { + if obj == nil { + return nil + } + + return &CellRendererSpinner{CellRenderer{glib.InitiallyUnowned{obj}}} +} + +// CellRendererSpinnerNew is a wrapper around gtk_cell_renderer_spinner_new(). +func CellRendererSpinnerNew() (*CellRendererSpinner, error) { + c := C.gtk_cell_renderer_spinner_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererSpinner(obj), nil +} + +/* + * GtkCellRendererPixbuf + */ + +// CellRendererPixbuf is a representation of GTK's GtkCellRendererPixbuf. +type CellRendererPixbuf struct { + CellRenderer +} + +// native returns a pointer to the underlying GtkCellRendererPixbuf. +func (v *CellRendererPixbuf) native() *C.GtkCellRendererPixbuf { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererPixbuf(p) +} + +func marshalCellRendererPixbuf(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererPixbuf(obj), nil +} + +func wrapCellRendererPixbuf(obj *glib.Object) *CellRendererPixbuf { + if obj == nil { + return nil + } + + return &CellRendererPixbuf{CellRenderer{glib.InitiallyUnowned{obj}}} +} + +// CellRendererPixbufNew is a wrapper around gtk_cell_renderer_pixbuf_new(). +func CellRendererPixbufNew() (*CellRendererPixbuf, error) { + c := C.gtk_cell_renderer_pixbuf_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererPixbuf(obj), nil +} + +/* + * GtkCellRendererProgress + */ + +// CellRendererProgress is a representation of GTK's GtkCellRendererProgress. +type CellRendererProgress struct { + CellRenderer +} + +// native returns a pointer to the underlying GtkCellRendererProgress. +func (v *CellRendererProgress) native() *C.GtkCellRendererProgress { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererProgress(p) +} + +func marshalCellRendererProgress(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererProgress(obj), nil +} + +func wrapCellRendererProgress(obj *glib.Object) *CellRendererProgress { + if obj == nil { + return nil + } + + return &CellRendererProgress{CellRenderer{glib.InitiallyUnowned{obj}}} +} + +// CellRendererProgressNew is a wrapper around gtk_cell_renderer_progress_new(). +func CellRendererProgressNew() (*CellRendererProgress, error) { + c := C.gtk_cell_renderer_progress_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererProgress(obj), nil +} + +/* + * GtkCellRendererText + */ + +// CellRendererText is a representation of GTK's GtkCellRendererText. +type CellRendererText struct { + CellRenderer +} + +// native returns a pointer to the underlying GtkCellRendererText. +func (v *CellRendererText) native() *C.GtkCellRendererText { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererText(p) +} + +func marshalCellRendererText(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererText(obj), nil +} + +func wrapCellRendererText(obj *glib.Object) *CellRendererText { + if obj == nil { + return nil + } + + return &CellRendererText{CellRenderer{glib.InitiallyUnowned{obj}}} +} + +// CellRendererTextNew is a wrapper around gtk_cell_renderer_text_new(). +func CellRendererTextNew() (*CellRendererText, error) { + c := C.gtk_cell_renderer_text_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererText(obj), nil +} + +// SetFixedHeightFromFont is a wrapper around gtk_cell_renderer_text_set_fixed_height_from_font +func (v *CellRendererText) SetFixedHeightFromFont(numberOfRows int) { + C.gtk_cell_renderer_text_set_fixed_height_from_font(v.native(), C.gint(numberOfRows)) +} + +/* + * GtkCellRendererToggle + */ + +// CellRendererToggle is a representation of GTK's GtkCellRendererToggle. +type CellRendererToggle struct { + CellRenderer +} + +// native returns a pointer to the underlying GtkCellRendererToggle. +func (v *CellRendererToggle) native() *C.GtkCellRendererToggle { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererToggle(p) +} + +func (v *CellRendererToggle) toCellRenderer() *C.GtkCellRenderer { + if v == nil { + return nil + } + return v.CellRenderer.native() +} + +func marshalCellRendererToggle(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererToggle(obj), nil +} + +func wrapCellRendererToggle(obj *glib.Object) *CellRendererToggle { + if obj == nil { + return nil + } + + return &CellRendererToggle{CellRenderer{glib.InitiallyUnowned{obj}}} +} + +// CellRendererToggleNew is a wrapper around gtk_cell_renderer_toggle_new(). +func CellRendererToggleNew() (*CellRendererToggle, error) { + c := C.gtk_cell_renderer_toggle_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererToggle(obj), nil +} + +// SetRadio is a wrapper around gtk_cell_renderer_toggle_set_radio(). +func (v *CellRendererToggle) SetRadio(set bool) { + C.gtk_cell_renderer_toggle_set_radio(v.native(), gbool(set)) +} + +// GetRadio is a wrapper around gtk_cell_renderer_toggle_get_radio(). +func (v *CellRendererToggle) GetRadio() bool { + c := C.gtk_cell_renderer_toggle_get_radio(v.native()) + return gobool(c) +} + +// SetActive is a wrapper around gtk_cell_renderer_toggle_set_active(). +func (v *CellRendererToggle) SetActive(active bool) { + C.gtk_cell_renderer_toggle_set_active(v.native(), gbool(active)) +} + +// GetActive is a wrapper around gtk_cell_renderer_toggle_get_active(). +func (v *CellRendererToggle) GetActive() bool { + c := C.gtk_cell_renderer_toggle_get_active(v.native()) + return gobool(c) +} + +// SetActivatable is a wrapper around gtk_cell_renderer_toggle_set_activatable(). +func (v *CellRendererToggle) SetActivatable(activatable bool) { + C.gtk_cell_renderer_toggle_set_activatable(v.native(), + gbool(activatable)) +} + +// GetActivatable is a wrapper around gtk_cell_renderer_toggle_get_activatable(). +func (v *CellRendererToggle) GetActivatable() bool { + c := C.gtk_cell_renderer_toggle_get_activatable(v.native()) + return gobool(c) +} + +/* + * GtkCellRendererAccel + */ + +// CellRendererAccel is a representation of GtkCellRendererAccel. +type CellRendererAccel struct { + CellRendererText +} + +// native returns a pointer to the underlying GtkCellRendererAccel. +func (v *CellRendererAccel) native() *C.GtkCellRendererAccel { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererAccel(p) +} + +func marshalCellRendererAccel(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererAccel(obj), nil +} + +func wrapCellRendererAccel(obj *glib.Object) *CellRendererAccel { + if obj == nil { + return nil + } + + return &CellRendererAccel{CellRendererText{CellRenderer{glib.InitiallyUnowned{obj}}}} +} + +// CellRendererAccelNew is a wrapper around gtk_cell_renderer_accel_new(). +func CellRendererAccelNew() (*CellRendererAccel, error) { + c := C.gtk_cell_renderer_accel_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererAccel(obj), nil +} + +/* + * GtkCellRendererCombo + */ + +// CellRendererCombo is a representation of GtkCellRendererCombo. +type CellRendererCombo struct { + CellRendererText +} + +// native returns a pointer to the underlying GtkCellRendererCombo. +func (v *CellRendererCombo) native() *C.GtkCellRendererCombo { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererCombo(p) +} + +func marshalCellRendererCombo(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererCombo(obj), nil +} + +func wrapCellRendererCombo(obj *glib.Object) *CellRendererCombo { + if obj == nil { + return nil + } + + return &CellRendererCombo{CellRendererText{CellRenderer{glib.InitiallyUnowned{obj}}}} +} + +// CellRendererComboNew is a wrapper around gtk_cell_renderer_combo_new(). +func CellRendererComboNew() (*CellRendererCombo, error) { + c := C.gtk_cell_renderer_combo_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererCombo(obj), nil +} + +/* + * GtkCellRendererSpin + */ + +// CellRendererSpin is a representation of GtkCellRendererSpin. +type CellRendererSpin struct { + CellRendererText +} + +// native returns a pointer to the underlying GtkCellRendererSpin. +func (v *CellRendererSpin) native() *C.GtkCellRendererSpin { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCellRendererSpin(p) +} + +func marshalCellRendererSpin(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererSpin(obj), nil +} + +func wrapCellRendererSpin(obj *glib.Object) *CellRendererSpin { + if obj == nil { + return nil + } + + return &CellRendererSpin{CellRendererText{CellRenderer{glib.InitiallyUnowned{obj}}}} +} + +// CellRendererSpinNew is a wrapper around gtk_cell_renderer_spin_new(). +func CellRendererSpinNew() (*CellRendererSpin, error) { + c := C.gtk_cell_renderer_spin_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCellRendererSpin(obj), nil +} + +/* + * GtkCheckButton + */ + +// CheckButton is a wrapper around GTK's GtkCheckButton. +type CheckButton struct { + ToggleButton +} + +// native returns a pointer to the underlying GtkCheckButton. +func (v *CheckButton) native() *C.GtkCheckButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCheckButton(p) +} + +func marshalCheckButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckButton(obj), nil +} + +func wrapCheckButton(obj *glib.Object) *CheckButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &CheckButton{ToggleButton{Button{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}, actionable}}} +} + +// CheckButtonNew is a wrapper around gtk_check_button_new(). +func CheckButtonNew() (*CheckButton, error) { + c := C.gtk_check_button_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckButton(obj), nil +} + +// CheckButtonNewWithLabel is a wrapper around +// gtk_check_button_new_with_label(). +func CheckButtonNewWithLabel(label string) (*CheckButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_check_button_new_with_label((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapCheckButton(glib.Take(unsafe.Pointer(c))), nil +} + +// CheckButtonNewWithMnemonic is a wrapper around +// gtk_check_button_new_with_mnemonic(). +func CheckButtonNewWithMnemonic(label string) (*CheckButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_check_button_new_with_mnemonic((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckButton(obj), nil +} + +/* + * GtkCheckMenuItem + */ + +type CheckMenuItem struct { + MenuItem +} + +// native returns a pointer to the underlying GtkCheckMenuItem. +func (v *CheckMenuItem) native() *C.GtkCheckMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCheckMenuItem(p) +} + +func marshalCheckMenuItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckMenuItem(obj), nil +} + +func wrapCheckMenuItem(obj *glib.Object) *CheckMenuItem { + if obj == nil { + return nil + } + + return &CheckMenuItem{MenuItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}} +} + +// CheckMenuItemNew is a wrapper around gtk_check_menu_item_new(). +func CheckMenuItemNew() (*CheckMenuItem, error) { + c := C.gtk_check_menu_item_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckMenuItem(obj), nil +} + +// CheckMenuItemNewWithLabel is a wrapper around gtk_check_menu_item_new_with_label(). +func CheckMenuItemNewWithLabel(label string) (*CheckMenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_check_menu_item_new_with_label((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckMenuItem(obj), nil +} + +// CheckMenuItemNewWithMnemonic is a wrapper around gtk_check_menu_item_new_with_mnemonic(). +func CheckMenuItemNewWithMnemonic(label string) (*CheckMenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_check_menu_item_new_with_mnemonic((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCheckMenuItem(obj), nil +} + +// GetActive is a wrapper around gtk_check_menu_item_get_active(). +func (v *CheckMenuItem) GetActive() bool { + c := C.gtk_check_menu_item_get_active(v.native()) + return gobool(c) +} + +// SetActive is a wrapper around gtk_check_menu_item_set_active(). +func (v *CheckMenuItem) SetActive(isActive bool) { + C.gtk_check_menu_item_set_active(v.native(), gbool(isActive)) +} + +// Toggled is a wrapper around gtk_check_menu_item_toggled(). +func (v *CheckMenuItem) Toggled() { + C.gtk_check_menu_item_toggled(v.native()) +} + +// GetInconsistent is a wrapper around gtk_check_menu_item_get_inconsistent(). +func (v *CheckMenuItem) GetInconsistent() bool { + c := C.gtk_check_menu_item_get_inconsistent(v.native()) + return gobool(c) +} + +// SetInconsistent is a wrapper around gtk_check_menu_item_set_inconsistent(). +func (v *CheckMenuItem) SetInconsistent(setting bool) { + C.gtk_check_menu_item_set_inconsistent(v.native(), gbool(setting)) +} + +// SetDrawAsRadio is a wrapper around gtk_check_menu_item_set_draw_as_radio(). +func (v *CheckMenuItem) SetDrawAsRadio(drawAsRadio bool) { + C.gtk_check_menu_item_set_draw_as_radio(v.native(), gbool(drawAsRadio)) +} + +// GetDrawAsRadio is a wrapper around gtk_check_menu_item_get_draw_as_radio(). +func (v *CheckMenuItem) GetDrawAsRadio() bool { + c := C.gtk_check_menu_item_get_draw_as_radio(v.native()) + return gobool(c) +} + +/* + * GtkClipboard + */ + +// Clipboard is a wrapper around GTK's GtkClipboard. +type Clipboard struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkClipboard. +func (v *Clipboard) native() *C.GtkClipboard { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkClipboard(p) +} + +func marshalClipboard(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapClipboard(obj), nil +} + +func wrapClipboard(obj *glib.Object) *Clipboard { + if obj == nil { + return nil + } + + return &Clipboard{obj} +} + +// Store is a wrapper around gtk_clipboard_store +func (v *Clipboard) Store() { + C.gtk_clipboard_store(v.native()) +} + +// ClipboardGet() is a wrapper around gtk_clipboard_get(). +func ClipboardGet(atom gdk.Atom) (*Clipboard, error) { + c := C.gtk_clipboard_get(C.GdkAtom(unsafe.Pointer(atom))) + if c == nil { + return nil, nilPtrErr + } + + cb := &Clipboard{glib.Take(unsafe.Pointer(c))} + return cb, nil +} + +// ClipboardGetForDisplay() is a wrapper around gtk_clipboard_get_for_display(). +func ClipboardGetForDisplay(display *gdk.Display, atom gdk.Atom) (*Clipboard, error) { + displayPtr := (*C.GdkDisplay)(unsafe.Pointer(display.Native())) + c := C.gtk_clipboard_get_for_display(displayPtr, + C.GdkAtom(unsafe.Pointer(atom))) + if c == nil { + return nil, nilPtrErr + } + + cb := &Clipboard{glib.Take(unsafe.Pointer(c))} + return cb, nil +} + +// WaitIsTextAvailable is a wrapper around gtk_clipboard_wait_is_text_available +func (v *Clipboard) WaitIsTextAvailable() bool { + c := C.gtk_clipboard_wait_is_text_available(v.native()) + return gobool(c) +} + +// WaitForText is a wrapper around gtk_clipboard_wait_for_text +func (v *Clipboard) WaitForText() (string, error) { + c := C.gtk_clipboard_wait_for_text(v.native()) + if c == nil { + return "", nilPtrErr + } + defer C.g_free(C.gpointer(c)) + return goString(c), nil +} + +// SetText() is a wrapper around gtk_clipboard_set_text(). +func (v *Clipboard) SetText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_clipboard_set_text(v.native(), (*C.gchar)(cstr), + C.gint(len(text))) +} + +// WaitIsRichTextAvailable is a wrapper around gtk_clipboard_wait_is_rich_text_available +func (v *Clipboard) WaitIsRichTextAvailable(buf *TextBuffer) bool { + c := C.gtk_clipboard_wait_is_rich_text_available(v.native(), buf.native()) + return gobool(c) +} + +// WaitIsUrisAvailable is a wrapper around gtk_clipboard_wait_is_uris_available +func (v *Clipboard) WaitIsUrisAvailable() bool { + c := C.gtk_clipboard_wait_is_uris_available(v.native()) + return gobool(c) +} + +// WaitIsImageAvailable is a wrapper around gtk_clipboard_wait_is_image_available +func (v *Clipboard) WaitIsImageAvailable() bool { + c := C.gtk_clipboard_wait_is_image_available(v.native()) + return gobool(c) +} + +// SetImage is a wrapper around gtk_clipboard_set_image +func (v *Clipboard) SetImage(pixbuf *gdk.Pixbuf) { + C.gtk_clipboard_set_image(v.native(), (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native()))) +} + +// WaitForImage is a wrapper around gtk_clipboard_wait_for_image +func (v *Clipboard) WaitForImage() (*gdk.Pixbuf, error) { + c := C.gtk_clipboard_wait_for_image(v.native()) + if c == nil { + return nil, nilPtrErr + } + + p := &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))} + return p, nil +} + +// WaitIsTargetAvailable is a wrapper around gtk_clipboard_wait_is_target_available +func (v *Clipboard) WaitIsTargetAvailable(target gdk.Atom) bool { + c := C.gtk_clipboard_wait_is_target_available(v.native(), C.GdkAtom(unsafe.Pointer(target))) + return gobool(c) +} + +// WaitForContents is a wrapper around gtk_clipboard_wait_for_contents +func (v *Clipboard) WaitForContents(target gdk.Atom) (*SelectionData, error) { + c := C.gtk_clipboard_wait_for_contents(v.native(), C.GdkAtom(unsafe.Pointer(target))) + if c == nil { + return nil, nilPtrErr + } + p := &SelectionData{c} + runtime.SetFinalizer(p, (*SelectionData).free) + return p, nil +} + +/* + * GtkContainer + */ + +// Container is a representation of GTK's GtkContainer. +type Container struct { + Widget +} + +// native returns a pointer to the underlying GtkContainer. +func (v *Container) native() *C.GtkContainer { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkContainer(p) +} + +func marshalContainer(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapContainer(obj), nil +} + +func wrapContainer(obj *glib.Object) *Container { + if obj == nil { + return nil + } + + return &Container{Widget{glib.InitiallyUnowned{obj}}} +} + +// Add is a wrapper around gtk_container_add(). +func (v *Container) Add(w IWidget) { + C.gtk_container_add(v.native(), w.toWidget()) +} + +// Remove is a wrapper around gtk_container_remove(). +func (v *Container) Remove(w IWidget) { + C.gtk_container_remove(v.native(), w.toWidget()) +} + +// TODO: gtk_container_add_with_properties + +// CheckResize is a wrapper around gtk_container_check_resize(). +func (v *Container) CheckResize() { + C.gtk_container_check_resize(v.native()) +} + +// TODO: gtk_container_foreach + +// GetChildren is a wrapper around gtk_container_get_children(). +func (v *Container) GetChildren() *glib.List { + clist := C.gtk_container_get_children(v.native()) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapWidget(glib.Take(ptr)) + }) + + return glist +} + +// TODO: gtk_container_get_path_for_child + +// GetFocusChild is a wrapper around gtk_container_get_focus_child(). +func (v *Container) GetFocusChild() (IWidget, error) { + c := C.gtk_container_get_focus_child(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetFocusChild is a wrapper around gtk_container_set_focus_child(). +func (v *Container) SetFocusChild(child IWidget) { + C.gtk_container_set_focus_child(v.native(), child.toWidget()) +} + +// GetFocusVAdjustment is a wrapper around gtk_container_get_focus_vadjustment(). +func (v *Container) GetFocusVAdjustment() *Adjustment { + c := C.gtk_container_get_focus_vadjustment(v.native()) + if c == nil { + return nil + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAdjustment(obj) +} + +// SetFocusVAdjustment is a wrapper around gtk_container_set_focus_vadjustment(). +func (v *Container) SetFocusVAdjustment(adjustment *Adjustment) { + C.gtk_container_set_focus_vadjustment(v.native(), adjustment.native()) +} + +// GetFocusHAdjustment is a wrapper around gtk_container_get_focus_hadjustment(). +func (v *Container) GetFocusHAdjustment() *Adjustment { + c := C.gtk_container_get_focus_hadjustment(v.native()) + if c == nil { + return nil + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAdjustment(obj) +} + +// SetFocusHAdjustment is a wrapper around gtk_container_set_focus_hadjustment(). +func (v *Container) SetFocusHAdjustment(adjustment *Adjustment) { + C.gtk_container_set_focus_hadjustment(v.native(), adjustment.native()) +} + +// ChildType is a wrapper around gtk_container_child_type(). +func (v *Container) ChildType() glib.Type { + c := C.gtk_container_child_type(v.native()) + return glib.Type(c) +} + +// TODO: +// gtk_container_child_get(). +// gtk_container_child_set(). + +// ChildNotify is a wrapper around gtk_container_child_notify(). +func (v *Container) ChildNotify(child IWidget, childProperty string) { + cstr := C.CString(childProperty) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_container_child_notify(v.native(), child.toWidget(), + (*C.gchar)(cstr)) +} + +// ChildGetProperty is a wrapper around gtk_container_child_get_property(). +func (v *Container) ChildGetProperty(child IWidget, name string, valueType glib.Type) (interface{}, error) { + gv, e := glib.ValueInit(valueType) + if e != nil { + return nil, e + } + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_container_child_get_property(v.native(), child.toWidget(), (*C.gchar)(cstr), (*C.GValue)(unsafe.Pointer(gv.Native()))) + return gv.GoValue() +} + +// ChildSetProperty is a wrapper around gtk_container_child_set_property(). +func (v *Container) ChildSetProperty(child IWidget, name string, value interface{}) error { + gv, e := glib.GValue(value) + if e != nil { + return e + } + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_container_child_set_property(v.native(), child.toWidget(), (*C.gchar)(cstr), (*C.GValue)(unsafe.Pointer(gv.Native()))) + return nil +} + +// TODO: +// gtk_container_child_get_valist(). +// gtk_container_child_set_valist(). +// gtk_container_child_notify_by_pspec(). +// gtk_container_forall(). + +// GetBorderWidth is a wrapper around gtk_container_get_border_width(). +func (v *Container) GetBorderWidth() uint { + c := C.gtk_container_get_border_width(v.native()) + return uint(c) +} + +// SetBorderWidth is a wrapper around gtk_container_set_border_width(). +func (v *Container) SetBorderWidth(borderWidth uint) { + C.gtk_container_set_border_width(v.native(), C.guint(borderWidth)) +} + +// PropagateDraw is a wrapper around gtk_container_propagate_draw(). +func (v *Container) PropagateDraw(child IWidget, cr *cairo.Context) { + context := (*C.cairo_t)(unsafe.Pointer(cr.Native())) + C.gtk_container_propagate_draw(v.native(), child.toWidget(), context) +} + +// TODO: +// gtk_container_class_find_child_property(). +// gtk_container_class_install_child_property(). +// gtk_container_class_install_child_properties(). +// gtk_container_class_list_child_properties(). +// gtk_container_class_handle_border_width(). +// GtkResizeMode + +// GdkCairoSetSourcePixBuf() is a wrapper around gdk_cairo_set_source_pixbuf(). +func GdkCairoSetSourcePixBuf(cr *cairo.Context, pixbuf *gdk.Pixbuf, pixbufX, pixbufY float64) { + context := (*C.cairo_t)(unsafe.Pointer(cr.Native())) + ptr := (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native())) + C.gdk_cairo_set_source_pixbuf(context, ptr, C.gdouble(pixbufX), C.gdouble(pixbufY)) +} + +/* + * GtkCssProvider + */ + +// CssProvider is a representation of GTK's GtkCssProvider. +type CssProvider struct { + *glib.Object +} + +func (v *CssProvider) toStyleProvider() *C.GtkStyleProvider { + if v == nil { + return nil + } + return C.toGtkStyleProvider(unsafe.Pointer(v.native())) +} + +// native returns a pointer to the underlying GtkCssProvider. +func (v *CssProvider) native() *C.GtkCssProvider { + if v == nil || v.Object == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkCssProvider(p) +} + +func wrapCssProvider(obj *glib.Object) *CssProvider { + if obj == nil { + return nil + } + + return &CssProvider{obj} +} + +// CssProviderNew is a wrapper around gtk_css_provider_new(). +func CssProviderNew() (*CssProvider, error) { + c := C.gtk_css_provider_new() + if c == nil { + return nil, nilPtrErr + } + + return wrapCssProvider(glib.Take(unsafe.Pointer(c))), nil +} + +// LoadFromPath is a wrapper around gtk_css_provider_load_from_path(). +func (v *CssProvider) LoadFromPath(path string) error { + cpath := C.CString(path) + defer C.free(unsafe.Pointer(cpath)) + var gerr *C.GError + if C.gtk_css_provider_load_from_path(v.native(), (*C.gchar)(cpath), &gerr) == 0 { + defer C.g_error_free(gerr) + return errors.New(goString(gerr.message)) + } + return nil +} + +// LoadFromData is a wrapper around gtk_css_provider_load_from_data(). +func (v *CssProvider) LoadFromData(data string) error { + cdata := C.CString(data) + defer C.free(unsafe.Pointer(cdata)) + var gerr *C.GError + if C.gtk_css_provider_load_from_data(v.native(), (*C.gchar)(unsafe.Pointer(cdata)), C.gssize(len(data)), &gerr) == 0 { + defer C.g_error_free(gerr) + return errors.New(goString(gerr.message)) + } + return nil +} + +// ToString is a wrapper around gtk_css_provider_to_string(). +func (v *CssProvider) ToString() (string, error) { + c := C.gtk_css_provider_to_string(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString(c), nil +} + +// CssProviderGetNamed is a wrapper around gtk_css_provider_get_named(). +func CssProviderGetNamed(name string, variant string) (*CssProvider, error) { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + cvariant := C.CString(variant) + defer C.free(unsafe.Pointer(cvariant)) + + c := C.gtk_css_provider_get_named((*C.gchar)(cname), (*C.gchar)(cvariant)) + if c == nil { + return nil, nilPtrErr + } + + obj := glib.Take(unsafe.Pointer(c)) + return wrapCssProvider(obj), nil +} + +/* + * GtkDialog + */ + +// Dialog is a representation of GTK's GtkDialog. +type Dialog struct { + Window +} + +// native returns a pointer to the underlying GtkDialog. +func (v *Dialog) native() *C.GtkDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkDialog(p) +} + +func marshalDialog(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapDialog(obj), nil +} + +func wrapDialog(obj *glib.Object) *Dialog { + if obj == nil { + return nil + } + + return &Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// DialogNew() is a wrapper around gtk_dialog_new(). +func DialogNew() (*Dialog, error) { + c := C.gtk_dialog_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapDialog(obj), nil +} + +// Run() is a wrapper around gtk_dialog_run(). +func (v *Dialog) Run() ResponseType { + c := C.gtk_dialog_run(v.native()) + return ResponseType(c) +} + +// Response() is a wrapper around gtk_dialog_response(). +func (v *Dialog) Response(response ResponseType) { + C.gtk_dialog_response(v.native(), C.gint(response)) +} + +// AddButton() is a wrapper around gtk_dialog_add_button(). text may +// be either the literal button text, or if using GTK 3.8 or earlier, a +// Stock type converted to a string. +func (v *Dialog) AddButton(text string, id ResponseType) (*Button, error) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_dialog_add_button(v.native(), (*C.gchar)(cstr), C.gint(id)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapButton(obj), nil +} + +// TODO: +// gtk_dialog_add_buttons(). + +// AddActionWidget() is a wrapper around gtk_dialog_add_action_widget(). +func (v *Dialog) AddActionWidget(child IWidget, id ResponseType) { + C.gtk_dialog_add_action_widget(v.native(), child.toWidget(), C.gint(id)) +} + +// SetDefaultResponse() is a wrapper around gtk_dialog_set_default_response(). +func (v *Dialog) SetDefaultResponse(id ResponseType) { + C.gtk_dialog_set_default_response(v.native(), C.gint(id)) +} + +// SetResponseSensitive() is a wrapper around gtk_dialog_set_response_sensitive(). +func (v *Dialog) SetResponseSensitive(id ResponseType, setting bool) { + C.gtk_dialog_set_response_sensitive(v.native(), C.gint(id), + gbool(setting)) +} + +// GetResponseForWidget is a wrapper around gtk_dialog_get_response_for_widget(). +func (v *Dialog) GetResponseForWidget(widget IWidget) ResponseType { + c := C.gtk_dialog_get_response_for_widget(v.native(), widget.toWidget()) + return ResponseType(c) +} + +// GetWidgetForResponse is a wrapper around gtk_dialog_get_widget_for_response(). +func (v *Dialog) GetWidgetForResponse(id ResponseType) (IWidget, error) { + c := C.gtk_dialog_get_widget_for_response(v.native(), C.gint(id)) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetContentArea() is a wrapper around gtk_dialog_get_content_area(). +func (v *Dialog) GetContentArea() (*Box, error) { + c := C.gtk_dialog_get_content_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + b := &Box{Container{Widget{glib.InitiallyUnowned{obj}}}} + return b, nil +} + +// DialogNewWithButtons() is a wrapper around gtk_dialog_new_with_buttons(). +// i.e: []interface{}{"Accept", gtk.RESPONSE_ACCEPT}. +func DialogNewWithButtons(title string, parent IWindow, flags DialogFlags, buttons ...[]interface{}) (dialog *Dialog, err error) { + cstr := (*C.gchar)(C.CString(title)) + defer C.free(unsafe.Pointer(cstr)) + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + var cbutton *C.gchar = nil + c := C._gtk_dialog_new_with_buttons(cstr, w, C.GtkDialogFlags(flags), cbutton) + if c == nil { + return nil, nilPtrErr + } + dialog = wrapDialog(glib.Take(unsafe.Pointer(c))) + + for idx := 0; idx < len(buttons); idx++ { + cbutton = (*C.gchar)(C.CString(buttons[idx][0].(string))) + defer C.free(unsafe.Pointer(cbutton)) + + if C.gtk_dialog_add_button(dialog.native(), cbutton, C.gint(buttons[idx][1].(ResponseType))) == nil { + return nil, nilPtrErr + } + } + return +} + +/* + * GtkDrawingArea + */ + +// DrawingArea is a representation of GTK's GtkDrawingArea. +type DrawingArea struct { + Widget +} + +// native returns a pointer to the underlying GtkDrawingArea. +func (v *DrawingArea) native() *C.GtkDrawingArea { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkDrawingArea(p) +} + +func marshalDrawingArea(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapDrawingArea(obj), nil +} + +func wrapDrawingArea(obj *glib.Object) *DrawingArea { + if obj == nil { + return nil + } + + return &DrawingArea{Widget{glib.InitiallyUnowned{obj}}} +} + +// DrawingAreaNew is a wrapper around gtk_drawing_area_new(). +func DrawingAreaNew() (*DrawingArea, error) { + c := C.gtk_drawing_area_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapDrawingArea(obj), nil +} + +/* + * GtkEditable + */ + +// Editable is a representation of GTK's GtkEditable GInterface. +type Editable struct { + *glib.Object +} + +// IEditable is an interface type implemented by all structs +// embedding an Editable. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkEditable. +type IEditable interface { + toEditable() *C.GtkEditable +} + +// native() returns a pointer to the underlying GObject as a GtkEditable. +func (v *Editable) native() *C.GtkEditable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkEditable(p) +} + +func marshalEditable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapEditable(obj), nil +} + +func wrapEditable(obj *glib.Object) *Editable { + if obj == nil { + return nil + } + + return &Editable{obj} +} + +func (v *Editable) toEditable() *C.GtkEditable { + if v == nil { + return nil + } + return v.native() +} + +// SelectRegion is a wrapper around gtk_editable_select_region(). +func (v *Editable) SelectRegion(startPos, endPos int) { + C.gtk_editable_select_region(v.native(), C.gint(startPos), + C.gint(endPos)) +} + +// GetSelectionBounds is a wrapper around gtk_editable_get_selection_bounds(). +func (v *Editable) GetSelectionBounds() (start, end int, nonEmpty bool) { + var cstart, cend C.gint + c := C.gtk_editable_get_selection_bounds(v.native(), &cstart, &cend) + return int(cstart), int(cend), gobool(c) +} + +// InsertText is a wrapper around gtk_editable_insert_text(). The returned +// int is the position after the inserted text. +func (v *Editable) InsertText(newText string, position int) int { + cstr := C.CString(newText) + defer C.free(unsafe.Pointer(cstr)) + pos := new(C.gint) + *pos = C.gint(position) + C.gtk_editable_insert_text(v.native(), (*C.gchar)(cstr), + C.gint(len(newText)), pos) + return int(*pos) +} + +// DeleteText is a wrapper around gtk_editable_delete_text(). +func (v *Editable) DeleteText(startPos, endPos int) { + C.gtk_editable_delete_text(v.native(), C.gint(startPos), C.gint(endPos)) +} + +// GetChars is a wrapper around gtk_editable_get_chars(). +func (v *Editable) GetChars(startPos, endPos int) string { + c := C.gtk_editable_get_chars(v.native(), C.gint(startPos), + C.gint(endPos)) + defer C.free(unsafe.Pointer(c)) + return goString(c) +} + +// CutClipboard is a wrapper around gtk_editable_cut_clipboard(). +func (v *Editable) CutClipboard() { + C.gtk_editable_cut_clipboard(v.native()) +} + +// CopyClipboard is a wrapper around gtk_editable_copy_clipboard(). +func (v *Editable) CopyClipboard() { + C.gtk_editable_copy_clipboard(v.native()) +} + +// PasteClipboard is a wrapper around gtk_editable_paste_clipboard(). +func (v *Editable) PasteClipboard() { + C.gtk_editable_paste_clipboard(v.native()) +} + +// DeleteSelection is a wrapper around gtk_editable_delete_selection(). +func (v *Editable) DeleteSelection() { + C.gtk_editable_delete_selection(v.native()) +} + +// SetPosition is a wrapper around gtk_editable_set_position(). +func (v *Editable) SetPosition(position int) { + C.gtk_editable_set_position(v.native(), C.gint(position)) +} + +// GetPosition is a wrapper around gtk_editable_get_position(). +func (v *Editable) GetPosition() int { + c := C.gtk_editable_get_position(v.native()) + return int(c) +} + +// SetEditable is a wrapper around gtk_editable_set_editable(). +func (v *Editable) SetEditable(isEditable bool) { + C.gtk_editable_set_editable(v.native(), gbool(isEditable)) +} + +// GetEditable is a wrapper around gtk_editable_get_editable(). +func (v *Editable) GetEditable() bool { + c := C.gtk_editable_get_editable(v.native()) + return gobool(c) +} + +/* + * GtkEntry + */ + +// Entry is a representation of GTK's GtkEntry. +type Entry struct { + Widget + + // Interfaces + Editable + CellEditable +} + +type IEntry interface { + toEntry() *C.GtkEntry +} + +func (v *Entry) toEntry() *C.GtkEntry { + return v.native() +} + +// native returns a pointer to the underlying GtkEntry. +func (v *Entry) native() *C.GtkEntry { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkEntry(p) +} + +func marshalEntry(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapEntry(obj), nil +} + +func wrapEntry(obj *glib.Object) *Entry { + if obj == nil { + return nil + } + + e := wrapEditable(obj) + ce := wrapCellEditable(obj) + return &Entry{Widget{glib.InitiallyUnowned{obj}}, *e, *ce} +} + +// EntryNew() is a wrapper around gtk_entry_new(). +func EntryNew() (*Entry, error) { + c := C.gtk_entry_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapEntry(obj), nil +} + +// EntryNewWithBuffer() is a wrapper around gtk_entry_new_with_buffer(). +func EntryNewWithBuffer(buffer *EntryBuffer) (*Entry, error) { + c := C.gtk_entry_new_with_buffer(buffer.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapEntry(obj), nil +} + +// GetBuffer() is a wrapper around gtk_entry_get_buffer(). +func (v *Entry) GetBuffer() (*EntryBuffer, error) { + c := C.gtk_entry_get_buffer(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return &EntryBuffer{obj}, nil +} + +// SetBuffer() is a wrapper around gtk_entry_set_buffer(). +func (v *Entry) SetBuffer(buffer *EntryBuffer) { + C.gtk_entry_set_buffer(v.native(), buffer.native()) +} + +// SetText() is a wrapper around gtk_entry_set_text(). +func (v *Entry) SetText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_entry_set_text(v.native(), (*C.gchar)(cstr)) +} + +// GetText() is a wrapper around gtk_entry_get_text(). +func (v *Entry) GetText() (string, error) { + c := C.gtk_entry_get_text(v.native()) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// GetTextLength() is a wrapper around gtk_entry_get_text_length(). +func (v *Entry) GetTextLength() uint16 { + c := C.gtk_entry_get_text_length(v.native()) + return uint16(c) +} + +// GetTextArea is a wrapper around gtk_entry_get_text_area(). +func (v *Entry) GetTextArea() *gdk.Rectangle { + var cRect *C.GdkRectangle + C.gtk_entry_get_text_area(v.native(), cRect) + textArea := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return textArea +} + +// SetVisibility is a wrapper around gtk_entry_set_visibility(). +func (v *Entry) SetVisibility(visible bool) { + C.gtk_entry_set_visibility(v.native(), gbool(visible)) +} + +// SetInvisibleChar is a wrapper around gtk_entry_set_invisible_char(). +func (v *Entry) SetInvisibleChar(ch rune) { + C.gtk_entry_set_invisible_char(v.native(), C.gunichar(ch)) +} + +// UnsetInvisibleChar is a wrapper around gtk_entry_unset_invisible_char(). +func (v *Entry) UnsetInvisibleChar() { + C.gtk_entry_unset_invisible_char(v.native()) +} + +// SetMaxLength is a wrapper around gtk_entry_set_max_length(). +func (v *Entry) SetMaxLength(len int) { + C.gtk_entry_set_max_length(v.native(), C.gint(len)) +} + +// GetActivatesDefault is a wrapper around gtk_entry_get_activates_default(). +func (v *Entry) GetActivatesDefault() bool { + c := C.gtk_entry_get_activates_default(v.native()) + return gobool(c) +} + +// GetHasFrame is a wrapper around gtk_entry_get_has_frame(). +func (v *Entry) GetHasFrame() bool { + c := C.gtk_entry_get_has_frame(v.native()) + return gobool(c) +} + +// GetWidthChars is a wrapper around gtk_entry_get_width_chars(). +func (v *Entry) GetWidthChars() int { + c := C.gtk_entry_get_width_chars(v.native()) + return int(c) +} + +// SetActivatesDefault is a wrapper around gtk_entry_set_activates_default(). +func (v *Entry) SetActivatesDefault(setting bool) { + C.gtk_entry_set_activates_default(v.native(), gbool(setting)) +} + +// SetHasFrame is a wrapper around gtk_entry_set_has_frame(). +func (v *Entry) SetHasFrame(setting bool) { + C.gtk_entry_set_has_frame(v.native(), gbool(setting)) +} + +// SetWidthChars is a wrapper around gtk_entry_set_width_chars(). +func (v *Entry) SetWidthChars(nChars int) { + C.gtk_entry_set_width_chars(v.native(), C.gint(nChars)) +} + +// GetInvisibleChar is a wrapper around gtk_entry_get_invisible_char(). +func (v *Entry) GetInvisibleChar() rune { + c := C.gtk_entry_get_invisible_char(v.native()) + return rune(c) +} + +// SetAlignment is a wrapper around gtk_entry_set_alignment(). +func (v *Entry) SetAlignment(xalign float32) { + C.gtk_entry_set_alignment(v.native(), C.gfloat(xalign)) +} + +// GetAlignment is a wrapper around gtk_entry_get_alignment(). +func (v *Entry) GetAlignment() float32 { + c := C.gtk_entry_get_alignment(v.native()) + return float32(c) +} + +// SetPlaceholderText is a wrapper around gtk_entry_set_placeholder_text(). +func (v *Entry) SetPlaceholderText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_entry_set_placeholder_text(v.native(), (*C.gchar)(cstr)) +} + +// GetPlaceholderText is a wrapper around gtk_entry_get_placeholder_text(). +func (v *Entry) GetPlaceholderText() (string, error) { + c := C.gtk_entry_get_placeholder_text(v.native()) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// SetOverwriteMode is a wrapper around gtk_entry_set_overwrite_mode(). +func (v *Entry) SetOverwriteMode(overwrite bool) { + C.gtk_entry_set_overwrite_mode(v.native(), gbool(overwrite)) +} + +// GetOverwriteMode is a wrapper around gtk_entry_get_overwrite_mode(). +func (v *Entry) GetOverwriteMode() bool { + c := C.gtk_entry_get_overwrite_mode(v.native()) + return gobool(c) +} + +// GetLayout is a wrapper around gtk_entry_get_layout(). +func (v *Entry) GetLayout() *pango.Layout { + c := C.gtk_entry_get_layout(v.native()) + return pango.WrapLayout(uintptr(unsafe.Pointer(c))) +} + +// GetLayoutOffsets is a wrapper around gtk_entry_get_layout_offsets(). +func (v *Entry) GetLayoutOffsets() (x, y int) { + var gx, gy C.gint + C.gtk_entry_get_layout_offsets(v.native(), &gx, &gy) + return int(gx), int(gy) +} + +// LayoutIndexToTextIndex is a wrapper around gtk_entry_layout_index_to_text_index(). +func (v *Entry) LayoutIndexToTextIndex(layoutIndex int) int { + c := C.gtk_entry_layout_index_to_text_index(v.native(), + C.gint(layoutIndex)) + return int(c) +} + +// TextIndexToLayoutIndex is a wrapper around gtk_entry_text_index_to_layout_index(). +func (v *Entry) TextIndexToLayoutIndex(textIndex int) int { + c := C.gtk_entry_text_index_to_layout_index(v.native(), + C.gint(textIndex)) + return int(c) +} + +// TODO: depends on PandoAttrList +// SetAttributes is a wrapper around gtk_entry_set_attributes(). +// func (v *Entry) SetAttributes(attrList *pango.AttrList) { +// C.gtk_entry_set_attributes(v.native(), (*C.PangoAttrList)(unsafe.Pointer(attrList.Native()))) +// } + +// TODO: depends on PandoAttrList +// GetAttributes is a wrapper around gtk_entry_get_attributes(). +// func (v *Entry) GetAttributes() (*pango.AttrList, error) { +// c := C.gtk_entry_get_attributes(v.native()) +// if c == nil { +// return nil, nilPtrErr +// } +// return &pango.AttrList{unsafe.Pointer(c)}, nil +// } + +// GetMaxLength is a wrapper around gtk_entry_get_max_length(). +func (v *Entry) GetMaxLength() int { + c := C.gtk_entry_get_max_length(v.native()) + return int(c) +} + +// GetVisibility is a wrapper around gtk_entry_get_visibility(). +func (v *Entry) GetVisibility() bool { + c := C.gtk_entry_get_visibility(v.native()) + return gobool(c) +} + +// SetCompletion is a wrapper around gtk_entry_set_completion(). +func (v *Entry) SetCompletion(completion *EntryCompletion) { + C.gtk_entry_set_completion(v.native(), completion.native()) +} + +// GetCompletion is a wrapper around gtk_entry_get_completion(). +func (v *Entry) GetCompletion() (*EntryCompletion, error) { + c := C.gtk_entry_get_completion(v.native()) + if c == nil { + return nil, nilPtrErr + } + + e := &EntryCompletion{glib.Take(unsafe.Pointer(c))} + return e, nil +} + +// SetCursorHAdjustment is a wrapper around gtk_entry_set_cursor_hadjustment(). +func (v *Entry) SetCursorHAdjustment(adjustment *Adjustment) { + C.gtk_entry_set_cursor_hadjustment(v.native(), adjustment.native()) +} + +// GetCursorHAdjustment is a wrapper around gtk_entry_get_cursor_hadjustment(). +func (v *Entry) GetCursorHAdjustment() (*Adjustment, error) { + c := C.gtk_entry_get_cursor_hadjustment(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return &Adjustment{glib.InitiallyUnowned{obj}}, nil +} + +// SetProgressFraction is a wrapper around gtk_entry_set_progress_fraction(). +func (v *Entry) SetProgressFraction(fraction float64) { + C.gtk_entry_set_progress_fraction(v.native(), C.gdouble(fraction)) +} + +// GetProgressFraction is a wrapper around gtk_entry_get_progress_fraction(). +func (v *Entry) GetProgressFraction() float64 { + c := C.gtk_entry_get_progress_fraction(v.native()) + return float64(c) +} + +// SetProgressPulseStep is a wrapper around gtk_entry_set_progress_pulse_step(). +func (v *Entry) SetProgressPulseStep(fraction float64) { + C.gtk_entry_set_progress_pulse_step(v.native(), C.gdouble(fraction)) +} + +// GetProgressPulseStep is a wrapper around gtk_entry_get_progress_pulse_step(). +func (v *Entry) GetProgressPulseStep() float64 { + c := C.gtk_entry_get_progress_pulse_step(v.native()) + return float64(c) +} + +// ProgressPulse is a wrapper around gtk_entry_progress_pulse(). +func (v *Entry) ProgressPulse() { + C.gtk_entry_progress_pulse(v.native()) +} + +// IMContextFilterKeypress is a wrapper around gtk_entry_im_context_filter_keypress(). +func (v *Entry) IMContextFilterKeypress(eventKey *gdk.EventKey) bool { + key := (*C.GdkEventKey)(unsafe.Pointer(eventKey.Native())) + c := C.gtk_entry_im_context_filter_keypress(v.native(), key) + return gobool(c) +} + +// ResetIMContext is a wrapper around gtk_entry_reset_im_context(). +func (v *Entry) ResetIMContext() { + C.gtk_entry_reset_im_context(v.native()) +} + +// SetIconFromPixbuf is a wrapper around gtk_entry_set_icon_from_pixbuf(). +func (v *Entry) SetIconFromPixbuf(iconPos EntryIconPosition, pixbuf *gdk.Pixbuf) { + var pb *C.GdkPixbuf + if pixbuf != nil { + pb = (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native())) + } + + C.gtk_entry_set_icon_from_pixbuf(v.native(), C.GtkEntryIconPosition(iconPos), pb) +} + +// SetIconFromIconName is a wrapper around gtk_entry_set_icon_from_icon_name(). +func (v *Entry) SetIconFromIconName(iconPos EntryIconPosition, name string) { + var icon *C.gchar + if name != "" { + n := C.CString(name) + defer C.free(unsafe.Pointer(n)) + icon = (*C.gchar)(n) + } + + C.gtk_entry_set_icon_from_icon_name(v.native(), C.GtkEntryIconPosition(iconPos), icon) +} + +// RemoveIcon is a convenience func to set a nil pointer to the icon name. +func (v *Entry) RemoveIcon(iconPos EntryIconPosition) { + C.gtk_entry_set_icon_from_icon_name(v.native(), C.GtkEntryIconPosition(iconPos), nil) +} + +// TODO: Needs gio/GIcon implemented first +// SetIconFromGIcon is a wrapper around gtk_entry_set_icon_from_gicon(). +func (v *Entry) SetIconFromGIcon(iconPos EntryIconPosition, icon *glib.Icon) { + C.gtk_entry_set_icon_from_gicon(v.native(), + C.GtkEntryIconPosition(iconPos), + (*C.GIcon)(icon.NativePrivate())) +} + +// GetIconStorageType is a wrapper around gtk_entry_get_icon_storage_type(). +func (v *Entry) GetIconStorageType(iconPos EntryIconPosition) ImageType { + c := C.gtk_entry_get_icon_storage_type(v.native(), C.GtkEntryIconPosition(iconPos)) + return ImageType(c) +} + +// GetIconPixbuf is a wrapper around gtk_entry_get_icon_pixbuf(). +func (v *Entry) GetIconPixbuf(iconPos EntryIconPosition) (*gdk.Pixbuf, error) { + c := C.gtk_entry_get_icon_pixbuf(v.native(), C.GtkEntryIconPosition(iconPos)) + if c == nil { + return nil, nilPtrErr + } + return &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetIconName is a wrapper around gtk_entry_get_icon_name(). +func (v *Entry) GetIconName(iconPos EntryIconPosition) (string, error) { + c := C.gtk_entry_get_icon_name(v.native(), C.GtkEntryIconPosition(iconPos)) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// GetIconGIcon is a wrapper around gtk_entry_get_icon_gicon(). +func (v *Entry) GetIconGIcon(iconPos EntryIconPosition) (*glib.Icon, error) { + c := C.gtk_entry_get_icon_gicon(v.native(), C.GtkEntryIconPosition(iconPos)) + if c == nil { + return nil, nilPtrErr + } + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + i := &glib.Icon{obj} + runtime.SetFinalizer(i, func(_ interface{}) { obj.Unref() }) + return i, nil +} + +// SetIconActivatable is a wrapper around gtk_entry_set_icon_activatable(). +func (v *Entry) SetIconActivatable(iconPos EntryIconPosition, activatable bool) { + C.gtk_entry_set_icon_activatable(v.native(), C.GtkEntryIconPosition(iconPos), gbool(activatable)) +} + +// GetIconActivatable is a wrapper around gtk_entry_get_icon_activatable(). +func (v *Entry) GetIconActivatable(iconPos EntryIconPosition) bool { + c := C.gtk_entry_get_icon_activatable(v.native(), C.GtkEntryIconPosition(iconPos)) + return gobool(c) +} + +// SetIconSensitive is a wrapper around gtk_entry_set_icon_sensitive(). +func (v *Entry) SetIconSensitive(iconPos EntryIconPosition, sensitive bool) { + C.gtk_entry_set_icon_sensitive(v.native(), C.GtkEntryIconPosition(iconPos), gbool(sensitive)) +} + +// GetIconSensitive is a wrapper around gtk_entry_get_icon_sensitive(). +func (v *Entry) GetIconSensitive(iconPos EntryIconPosition) bool { + c := C.gtk_entry_get_icon_sensitive(v.native(), C.GtkEntryIconPosition(iconPos)) + return gobool(c) +} + +// GetIconAtPos is a wrapper around gtk_entry_get_icon_at_pos(). +func (v *Entry) GetIconAtPos(x, y int) int { + c := C.gtk_entry_get_icon_at_pos(v.native(), C.gint(x), C.gint(y)) + return int(c) +} + +// SetIconTooltipText is a wrapper around gtk_entry_set_icon_tooltip_text(). +func (v *Entry) SetIconTooltipText(iconPos EntryIconPosition, tooltip string) { + var text *C.gchar + if tooltip != "" { + cstr := C.CString(tooltip) + defer C.free(unsafe.Pointer(cstr)) + text = cstr + } + + C.gtk_entry_set_icon_tooltip_text(v.native(), C.GtkEntryIconPosition(iconPos), text) +} + +// GetIconTooltipText is a wrapper around gtk_entry_get_icon_tooltip_text(). +func (v *Entry) GetIconTooltipText(iconPos EntryIconPosition) (string, error) { + c := C.gtk_entry_get_icon_tooltip_text(v.native(), + C.GtkEntryIconPosition(iconPos)) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// SetIconTooltipMarkup is a wrapper around gtk_entry_set_icon_tooltip_markup(). +func (v *Entry) SetIconTooltipMarkup(iconPos EntryIconPosition, tooltip string) { + var text *C.gchar + if tooltip != "" { + cstr := C.CString(tooltip) + defer C.free(unsafe.Pointer(cstr)) + text = cstr + } + + C.gtk_entry_set_icon_tooltip_markup(v.native(), C.GtkEntryIconPosition(iconPos), text) +} + +// GetIconTooltipMarkup is a wrapper around gtk_entry_get_icon_tooltip_markup(). +func (v *Entry) GetIconTooltipMarkup(iconPos EntryIconPosition) (string, error) { + c := C.gtk_entry_get_icon_tooltip_markup(v.native(), + C.GtkEntryIconPosition(iconPos)) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// TODO: depends on GtkTargetList +// SetIconDragSource is a wrapper around gtk_entry_set_icon_drag_source(). +// func (v *Entry) SetIconDragSource(iconPos EntryIconPosition, targetList *TargetList, action gdk.DragAction) { +// C.gtk_entry_set_icon_drag_source(v.native(), C.GtkEntryIconPosition(iconPos), +// targetList.native(), C.GdkDragAction(action)) +// } + +// GetCurrentIconDragSource is a wrapper around gtk_entry_get_current_icon_drag_source(). +func (v *Entry) GetCurrentIconDragSource() int { + c := C.gtk_entry_get_current_icon_drag_source(v.native()) + return int(c) +} + +// GetIconArea is a wrapper around gtk_entry_get_icon_area(). +func (v *Entry) GetIconArea(iconPos EntryIconPosition) *gdk.Rectangle { + var cRect *C.GdkRectangle + C.gtk_entry_get_icon_area(v.native(), C.GtkEntryIconPosition(iconPos), cRect) + iconArea := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return iconArea +} + +// SetInputPurpose is a wrapper around gtk_entry_set_input_purpose(). +func (v *Entry) SetInputPurpose(purpose InputPurpose) { + C.gtk_entry_set_input_purpose(v.native(), C.GtkInputPurpose(purpose)) +} + +// GetInputPurpose is a wrapper around gtk_entry_get_input_purpose(). +func (v *Entry) GetInputPurpose() InputPurpose { + c := C.gtk_entry_get_input_purpose(v.native()) + return InputPurpose(c) +} + +// SetInputHints is a wrapper around gtk_entry_set_input_hints(). +func (v *Entry) SetInputHints(hints InputHints) { + C.gtk_entry_set_input_hints(v.native(), C.GtkInputHints(hints)) +} + +// GetInputHints is a wrapper around gtk_entry_get_input_hints(). +func (v *Entry) GetInputHints() InputHints { + c := C.gtk_entry_get_input_hints(v.native()) + return InputHints(c) +} + +/* + * GtkEntryBuffer + */ + +// EntryBuffer is a representation of GTK's GtkEntryBuffer. +type EntryBuffer struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkEntryBuffer. +func (v *EntryBuffer) native() *C.GtkEntryBuffer { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkEntryBuffer(p) +} + +func marshalEntryBuffer(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapEntryBuffer(obj), nil +} + +func wrapEntryBuffer(obj *glib.Object) *EntryBuffer { + if obj == nil { + return nil + } + + return &EntryBuffer{obj} +} + +// EntryBufferNew() is a wrapper around gtk_entry_buffer_new(). +func EntryBufferNew(initialChars string, nInitialChars int) (*EntryBuffer, error) { + cstr := C.CString(initialChars) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_entry_buffer_new((*C.gchar)(cstr), C.gint(nInitialChars)) + if c == nil { + return nil, nilPtrErr + } + + e := wrapEntryBuffer(glib.Take(unsafe.Pointer(c))) + return e, nil +} + +// GetText() is a wrapper around gtk_entry_buffer_get_text(). A +// non-nil error is returned in the case that gtk_entry_buffer_get_text +// returns NULL to differentiate between NULL and an empty string. +func (v *EntryBuffer) GetText() (string, error) { + c := C.gtk_entry_buffer_get_text(v.native()) + if c == nil { + return "", nilPtrErr + } + return goString(c), nil +} + +// SetText() is a wrapper around gtk_entry_buffer_set_text(). +func (v *EntryBuffer) SetText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_entry_buffer_set_text(v.native(), (*C.gchar)(cstr), + C.gint(len(text))) +} + +// GetBytes() is a wrapper around gtk_entry_buffer_get_bytes(). +func (v *EntryBuffer) GetBytes() uint { + c := C.gtk_entry_buffer_get_bytes(v.native()) + return uint(c) +} + +// GetLength() is a wrapper around gtk_entry_buffer_get_length(). +func (v *EntryBuffer) GetLength() uint { + c := C.gtk_entry_buffer_get_length(v.native()) + return uint(c) +} + +// GetMaxLength() is a wrapper around gtk_entry_buffer_get_max_length(). +func (v *EntryBuffer) GetMaxLength() int { + c := C.gtk_entry_buffer_get_max_length(v.native()) + return int(c) +} + +// SetMaxLength() is a wrapper around gtk_entry_buffer_set_max_length(). +func (v *EntryBuffer) SetMaxLength(maxLength int) { + C.gtk_entry_buffer_set_max_length(v.native(), C.gint(maxLength)) +} + +// InsertText() is a wrapper around gtk_entry_buffer_insert_text(). +func (v *EntryBuffer) InsertText(position uint, text string) uint { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_entry_buffer_insert_text(v.native(), C.guint(position), + (*C.gchar)(cstr), C.gint(len(text))) + return uint(c) +} + +// DeleteText() is a wrapper around gtk_entry_buffer_delete_text(). +func (v *EntryBuffer) DeleteText(position uint, nChars int) uint { + c := C.gtk_entry_buffer_delete_text(v.native(), C.guint(position), + C.gint(nChars)) + return uint(c) +} + +// EmitDeletedText() is a wrapper around gtk_entry_buffer_emit_deleted_text(). +func (v *EntryBuffer) EmitDeletedText(pos, nChars uint) { + C.gtk_entry_buffer_emit_deleted_text(v.native(), C.guint(pos), + C.guint(nChars)) +} + +// EmitInsertedText() is a wrapper around gtk_entry_buffer_emit_inserted_text(). +func (v *EntryBuffer) EmitInsertedText(pos uint, text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_entry_buffer_emit_inserted_text(v.native(), C.guint(pos), + (*C.gchar)(cstr), C.guint(len(text))) +} + +/* + * GtkEntryCompletion + */ + +// EntryCompletion is a representation of GTK's GtkEntryCompletion. +type EntryCompletion struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkEntryCompletion. +func (v *EntryCompletion) native() *C.GtkEntryCompletion { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkEntryCompletion(p) +} + +func marshalEntryCompletion(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapEntryCompletion(obj), nil +} + +func wrapEntryCompletion(obj *glib.Object) *EntryCompletion { + if obj == nil { + return nil + } + + return &EntryCompletion{obj} +} + +// TODO: +// GtkEntryCompletionMatchFunc + +// EntryCompletionNew is a wrapper around gtk_entry_completion_new +func EntryCompletionNew() (*EntryCompletion, error) { + c := C.gtk_entry_completion_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapEntryCompletion(obj), nil +} + +// TODO: +// gtk_entry_completion_new_with_area(). +// gtk_entry_completion_get_entry(). + +// SetModel is a wrapper around gtk_entry_completion_set_model +func (v *EntryCompletion) SetModel(model ITreeModel) { + var mptr *C.GtkTreeModel + if model != nil { + mptr = model.toTreeModel() + } + C.gtk_entry_completion_set_model(v.native(), mptr) +} + +// GetModel is a wrapper around gtk_entry_completion_get_model +func (v *EntryCompletion) GetModel() (ITreeModel, error) { + c := C.gtk_entry_completion_get_model(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castTreeModel(c) +} + +// TODO: +// gtk_entry_completion_set_match_func(). + +// SetMinimumKeyLength is a wrapper around gtk_entry_completion_set_minimum_key_length +func (v *EntryCompletion) SetMinimumKeyLength(minimumLength int) { + C.gtk_entry_completion_set_minimum_key_length(v.native(), C.gint(minimumLength)) +} + +// GetMinimumKeyLength is a wrapper around gtk_entry_completion_get_minimum_key_length +func (v *EntryCompletion) GetMinimumKeyLength() int { + c := C.gtk_entry_completion_get_minimum_key_length(v.native()) + return int(c) +} + +// TODO: +// gtk_entry_completion_compute_prefix(). +// gtk_entry_completion_complete(). +// gtk_entry_completion_get_completion_prefix(). +// gtk_entry_completion_insert_prefix(). +// gtk_entry_completion_insert_action_text(). +// gtk_entry_completion_insert_action_markup(). +// gtk_entry_completion_delete_action(). + +// SetTextColumn is a wrapper around gtk_entry_completion_set_text_column +func (v *EntryCompletion) SetTextColumn(textColumn int) { + C.gtk_entry_completion_set_text_column(v.native(), C.gint(textColumn)) +} + +// GetTextColumn is a wrapper around gtk_entry_completion_get_text_column +func (v *EntryCompletion) GetTextColumn() int { + c := C.gtk_entry_completion_get_text_column(v.native()) + return int(c) +} + +// SetInlineCompletion is a wrapper around gtk_entry_completion_set_inline_completion +func (v *EntryCompletion) SetInlineCompletion(inlineCompletion bool) { + C.gtk_entry_completion_set_inline_completion(v.native(), gbool(inlineCompletion)) +} + +// GetInlineCompletion is a wrapper around gtk_entry_completion_get_inline_completion +func (v *EntryCompletion) GetInlineCompletion() bool { + c := C.gtk_entry_completion_get_inline_completion(v.native()) + return gobool(c) +} + +// TODO +// gtk_entry_completion_set_inline_selection(). +// gtk_entry_completion_get_inline_selection(). + +// SetPopupCompletion is a wrapper around gtk_entry_completion_set_popup_completion +func (v *EntryCompletion) SetPopupCompletion(popupCompletion bool) { + C.gtk_entry_completion_set_popup_completion(v.native(), gbool(popupCompletion)) +} + +// GetPopupCompletion is a wrapper around gtk_entry_completion_get_popup_completion +func (v *EntryCompletion) GetPopupCompletion() bool { + c := C.gtk_entry_completion_get_popup_completion(v.native()) + return gobool(c) +} + +// SetPopupSetWidth is a wrapper around gtk_entry_completion_set_popup_set_width +func (v *EntryCompletion) SetPopupSetWidth(popupSetWidth bool) { + C.gtk_entry_completion_set_popup_set_width(v.native(), gbool(popupSetWidth)) +} + +// GetPopupSetWidth is a wrapper around gtk_entry_completion_get_popup_set_width +func (v *EntryCompletion) GetPopupSetWidth() bool { + c := C.gtk_entry_completion_get_popup_set_width(v.native()) + return gobool(c) +} + +// TODO: +// gtk_entry_completion_set_popup_single_match(). +// gtk_entry_completion_get_popup_single_match(). + +/* + * GtkEventBox + */ + +// EventBox is a representation of GTK's GtkEventBox. +type EventBox struct { + Bin +} + +// native returns a pointer to the underlying GtkEventBox. +func (v *EventBox) native() *C.GtkEventBox { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkEventBox(p) +} + +func marshalEventBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapEventBox(obj), nil +} + +func wrapEventBox(obj *glib.Object) *EventBox { + if obj == nil { + return nil + } + + return &EventBox{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// EventBoxNew is a wrapper around gtk_event_box_new(). +func EventBoxNew() (*EventBox, error) { + c := C.gtk_event_box_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapEventBox(obj), nil +} + +// SetAboveChild is a wrapper around gtk_event_box_set_above_child(). +func (v *EventBox) SetAboveChild(aboveChild bool) { + C.gtk_event_box_set_above_child(v.native(), gbool(aboveChild)) +} + +// GetAboveChild is a wrapper around gtk_event_box_get_above_child(). +func (v *EventBox) GetAboveChild() bool { + c := C.gtk_event_box_get_above_child(v.native()) + return gobool(c) +} + +// SetVisibleWindow is a wrapper around gtk_event_box_set_visible_window(). +func (v *EventBox) SetVisibleWindow(visibleWindow bool) { + C.gtk_event_box_set_visible_window(v.native(), gbool(visibleWindow)) +} + +// GetVisibleWindow is a wrapper around gtk_event_box_get_visible_window(). +func (v *EventBox) GetVisibleWindow() bool { + c := C.gtk_event_box_get_visible_window(v.native()) + return gobool(c) +} + +/* + * GtkExpander + */ + +// Expander is a representation of GTK's GtkExpander. +type Expander struct { + Bin +} + +// native returns a pointer to the underlying GtkExpander. +func (v *Expander) native() *C.GtkExpander { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkExpander(p) +} + +func marshalExpander(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapExpander(obj), nil +} + +func wrapExpander(obj *glib.Object) *Expander { + if obj == nil { + return nil + } + + return &Expander{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// ExpanderNew is a wrapper around gtk_expander_new(). +func ExpanderNew(label string) (*Expander, error) { + var cstr *C.gchar + if label != "" { + cstr = (*C.gchar)(C.CString(label)) + defer C.free(unsafe.Pointer(cstr)) + } + c := C.gtk_expander_new(cstr) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapExpander(obj), nil +} + +// TODO: +// gtk_expander_new_with_mnemonic(). + +// SetExpanded is a wrapper around gtk_expander_set_expanded(). +func (v *Expander) SetExpanded(expanded bool) { + C.gtk_expander_set_expanded(v.native(), gbool(expanded)) +} + +// GetExpanded is a wrapper around gtk_expander_get_expanded(). +func (v *Expander) GetExpanded() bool { + c := C.gtk_expander_get_expanded(v.native()) + return gobool(c) +} + +// SetLabel is a wrapper around gtk_expander_set_label(). +func (v *Expander) SetLabel(label string) { + var cstr *C.char + if label != "" { + cstr = C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + } + C.gtk_expander_set_label(v.native(), (*C.gchar)(cstr)) +} + +// GetLabel is a wrapper around gtk_expander_get_label(). +func (v *Expander) GetLabel() string { + c := C.gtk_expander_get_label(v.native()) + return goString(c) +} + +// TODO: +// gtk_expander_set_use_underline(). +// gtk_expander_get_use_underline(). +// gtk_expander_set_use_markup(). +// gtk_expander_get_use_markup(). + +// SetLabelWidget is a wrapper around gtk_expander_set_label_widget(). +func (v *Expander) SetLabelWidget(widget IWidget) { + C.gtk_expander_set_label_widget(v.native(), widget.toWidget()) +} + +// TODO: +// gtk_expander_get_label_widget(). +// gtk_expander_set_label_fill(). +// gtk_expander_get_label_fill(). +// gtk_expander_set_resize_toplevel(). +// gtk_expander_get_resize_toplevel(). + +/* + * GtkFileChooser + */ + +// FileChoser is a representation of GTK's GtkFileChooser GInterface. +type FileChooser struct { + *glib.Object +} + +// native returns a pointer to the underlying GObject as a GtkFileChooser. +func (v *FileChooser) native() *C.GtkFileChooser { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooser(p) +} + +func marshalFileChooser(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooser(obj), nil +} + +func wrapFileChooser(obj *glib.Object) *FileChooser { + if obj == nil { + return nil + } + + return &FileChooser{obj} +} + +// SetFilename is a wrapper around gtk_file_chooser_set_filename(). +func (v *FileChooser) SetFilename(filename string) bool { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_file_chooser_set_filename(v.native(), cstr) + return gobool(c) +} + +// GetFilename is a wrapper around gtk_file_chooser_get_filename(). +func (v *FileChooser) GetFilename() string { + c := C.gtk_file_chooser_get_filename(v.native()) + s := goString(c) + defer C.g_free((C.gpointer)(c)) + return s +} + +// SelectFilename is a wrapper around gtk_file_chooser_select_filename(). +func (v *FileChooser) SelectFilename(filename string) bool { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_file_chooser_select_filename(v.native(), cstr) + return gobool(c) +} + +// UnselectFilename is a wrapper around gtk_file_chooser_unselect_filename(). +func (v *FileChooser) UnselectFilename(filename string) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_chooser_unselect_filename(v.native(), cstr) +} + +// SelectAll is a wrapper around gtk_file_chooser_select_all(). +func (v *FileChooser) SelectAll() { + C.gtk_file_chooser_select_all(v.native()) +} + +// UnselectAll is a wrapper around gtk_file_chooser_unselect_all(). +func (v *FileChooser) UnselectAll() { + C.gtk_file_chooser_unselect_all(v.native()) +} + +// GetFilenames is a wrapper around gtk_file_chooser_get_filenames(). +func (v *FileChooser) GetFilenames() ([]string, error) { + clist := C.gtk_file_chooser_get_filenames(v.native()) + if clist == nil { + return nil, nilPtrErr + } + + slist := glib.WrapSList(uintptr(unsafe.Pointer(clist))) + defer slist.Free() + + var filenames = make([]string, 0, slist.Length()) + for ; slist.DataRaw() != nil; slist = slist.Next() { + w := (*C.char)(slist.DataRaw()) + defer C.free(unsafe.Pointer(w)) + + filenames = append(filenames, C.GoString(w)) + } + + return filenames, nil +} + +// GetURIs is a wrapper around gtk_file_chooser_get_uris(). +func (v FileChooser) GetURIs() ([]string, error) { + // TODO: do the same as in (v *FileChooser) GetFilenames() + clist := C.gtk_file_chooser_get_uris(v.native()) + if clist == nil { + return nil, nilPtrErr + } + + slist := glib.WrapSList(uintptr(unsafe.Pointer(clist))) + defer slist.Free() + + var uris = make([]string, 0, slist.Length()) + for ; slist.DataRaw() != nil; slist = slist.Next() { + w := (*C.char)(slist.DataRaw()) + defer C.free(unsafe.Pointer(w)) + + uris = append(uris, C.GoString(w)) + } + + return uris, nil +} + +// SetDoOverwriteConfirmation is a wrapper around gtk_file_chooser_set_do_overwrite_confirmation(). +func (v *FileChooser) SetDoOverwriteConfirmation(value bool) { + C.gtk_file_chooser_set_do_overwrite_confirmation(v.native(), gbool(value)) +} + +// GetDoOverwriteConfirmation is a wrapper around gtk_file_chooser_get_do_overwrite_confirmation(). +func (v *FileChooser) GetDoOverwriteConfirmation() bool { + c := C.gtk_file_chooser_get_do_overwrite_confirmation(v.native()) + return gobool(c) +} + +// SetCreateFolders is a wrapper around gtk_file_chooser_set_create_folders(). +func (v *FileChooser) SetCreateFolders(value bool) { + C.gtk_file_chooser_set_create_folders(v.native(), gbool(value)) +} + +// GetCreateFolders is a wrapper around gtk_file_chooser_get_create_folders(). +func (v *FileChooser) GetCreateFolders() bool { + c := C.gtk_file_chooser_get_create_folders(v.native()) + return gobool(c) +} + +// SetCurrentName is a wrapper around gtk_file_chooser_set_current_name(). +func (v *FileChooser) SetCurrentName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_chooser_set_current_name(v.native(), (*C.gchar)(cstr)) + return +} + +// SetCurrentFolder is a wrapper around gtk_file_chooser_set_current_folder(). +func (v *FileChooser) SetCurrentFolder(folder string) bool { + cstr := C.CString(folder) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_file_chooser_set_current_folder(v.native(), (*C.gchar)(cstr)) + return gobool(c) +} + +// GetCurrentFolder is a wrapper around gtk_file_chooser_get_current_folder(). +func (v *FileChooser) GetCurrentFolder() (string, error) { + c := C.gtk_file_chooser_get_current_folder(v.native()) + if c == nil { + return "", nilPtrErr + } + defer C.free(unsafe.Pointer(c)) + return goString(c), nil +} + +// SetPreviewWidget is a wrapper around gtk_file_chooser_set_preview_widget(). +func (v *FileChooser) SetPreviewWidget(widget IWidget) { + C.gtk_file_chooser_set_preview_widget(v.native(), widget.toWidget()) +} + +// SetPreviewWidgetActive is a wrapper around gtk_file_chooser_set_preview_widget_active(). +func (v *FileChooser) SetPreviewWidgetActive(active bool) { + C.gtk_file_chooser_set_preview_widget_active(v.native(), gbool(active)) +} + +// GetPreviewFilename is a wrapper around gtk_file_chooser_get_preview_filename(). +func (v *FileChooser) GetPreviewFilename() string { + c := C.gtk_file_chooser_get_preview_filename(v.native()) + defer C.free(unsafe.Pointer(c)) + return C.GoString(c) +} + +// GetURI is a wrapper around gtk_file_chooser_get_uri(). +func (v *FileChooser) GetURI() string { + c := C.gtk_file_chooser_get_uri(v.native()) + s := goString(c) + defer C.g_free((C.gpointer)(c)) + return s +} + +// AddFilter is a wrapper around gtk_file_chooser_add_filter(). +func (v *FileChooser) AddFilter(filter *FileFilter) { + C.gtk_file_chooser_add_filter(v.native(), filter.native()) +} + +// RemoveFilter is a wrapper around gtk_file_chooser_remove_filter(). +func (v *FileChooser) RemoveFilter(filter *FileFilter) { + C.gtk_file_chooser_remove_filter(v.native(), filter.native()) +} + +// SetFilter is a wrapper around gtk_file_chooser_set_filter(). +func (v *FileChooser) SetFilter(filter *FileFilter) { + C.gtk_file_chooser_set_filter(v.native(), filter.native()) +} + +// AddShortcutFolder is a wrapper around gtk_file_chooser_add_shortcut_folder(). +func (v *FileChooser) AddShortcutFolder(folder string) bool { + cstr := C.CString(folder) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_file_chooser_add_shortcut_folder(v.native(), cstr, nil) + return gobool(c) +} + +// SetLocalOnly is a wrapper around gtk_file_chooser_set_local_only(). +func (v *FileChooser) SetLocalOnly(value bool) { + C.gtk_file_chooser_set_local_only(v.native(), gbool(value)) +} + +// GetLocalOnly is a wrapper around gtk_file_chooser_get_local_only(). +func (v *FileChooser) GetLocalOnly() bool { + c := C.gtk_file_chooser_get_local_only(v.native()) + return gobool(c) +} + +// SetSelectMultiple is a wrapper around gtk_file_chooser_set_select_multiple(). +func (v *FileChooser) SetSelectMultiple(value bool) { + C.gtk_file_chooser_set_select_multiple(v.native(), gbool(value)) +} + +// GetSelectMultiple is a wrapper around gtk_file_chooser_get_select_multiple(). +func (v *FileChooser) GetSelectMultiple() bool { + c := C.gtk_file_chooser_get_select_multiple(v.native()) + return gobool(c) +} + +/* + * GtkFileChooserButton + */ + +// FileChooserButton is a representation of GTK's GtkFileChooserButton. +type FileChooserButton struct { + Box + + // Interfaces + FileChooser +} + +// native returns a pointer to the underlying GtkFileChooserButton. +func (v *FileChooserButton) native() *C.GtkFileChooserButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooserButton(p) +} + +func marshalFileChooserButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserButton(obj), nil +} + +func wrapFileChooserButton(obj *glib.Object) *FileChooserButton { + if obj == nil { + return nil + } + + fc := wrapFileChooser(obj) + return &FileChooserButton{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}, *fc} +} + +// FileChooserButtonNew is a wrapper around gtk_file_chooser_button_new(). +func FileChooserButtonNew(title string, action FileChooserAction) (*FileChooserButton, error) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_file_chooser_button_new((*C.gchar)(cstr), + (C.GtkFileChooserAction)(action)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserButton(obj), nil +} + +// FileChooserButtonNewWithDialog is a wrapper around gtk_file_chooser_button_new_with_dialog(). +func FileChooserButtonNewWithDialog(dialog IWidget) (*FileChooserButton, error) { + c := C.gtk_file_chooser_button_new_with_dialog(dialog.toWidget()) + if c == nil { + return nil, nilPtrErr + } + return wrapFileChooserButton(glib.Take(unsafe.Pointer(c))), nil +} + +// GetTitle is a wrapper around gtk_file_chooser_button_get_title(). +func (v *FileChooserButton) GetTitle() string { + // docs say: The returned value should not be modified or freed. + return goString(C.gtk_file_chooser_button_get_title(v.native())) +} + +// SetTitle is a wrapper around gtk_file_chooser_button_set_title(). +func (v *FileChooserButton) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_chooser_button_set_title(v.native(), (*C.gchar)(cstr)) +} + +// GetWidthChars is a wrapper around gtk_file_chooser_button_get_width_chars(). +func (v *FileChooserButton) GetWidthChars() int { + return int(C.gtk_file_chooser_button_get_width_chars(v.native())) +} + +// SetWidthChars is a wrapper around gtk_file_chooser_button_set_width_chars(). +func (v *FileChooserButton) SetWidthChars(width int) { + C.gtk_file_chooser_button_set_width_chars(v.native(), C.gint(width)) +} + +/* + * GtkFileChooserDialog + */ + +// FileChooserDialog is a representation of GTK's GtkFileChooserDialog. +type FileChooserDialog struct { + Dialog + + // Interfaces + FileChooser +} + +// native returns a pointer to the underlying GtkFileChooserDialog. +func (v *FileChooserDialog) native() *C.GtkFileChooserDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooserDialog(p) +} + +func marshalFileChooserDialog(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserDialog(obj), nil +} + +func wrapFileChooserDialog(obj *glib.Object) *FileChooserDialog { + if obj == nil { + return nil + } + + fc := wrapFileChooser(obj) + return &FileChooserDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}, *fc} +} + +// FileChooserDialogNewWith1Button is a wrapper around gtk_file_chooser_dialog_new() with one button. +func FileChooserDialogNewWith1Button( + title string, + parent IWindow, + action FileChooserAction, + first_button_text string, + first_button_id ResponseType) (*FileChooserDialog, error) { + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + c_title := C.CString(title) + defer C.free(unsafe.Pointer(c_title)) + c_first_button_text := C.CString(first_button_text) + defer C.free(unsafe.Pointer(c_first_button_text)) + c := C.gtk_file_chooser_dialog_new_1( + (*C.gchar)(c_title), w, C.GtkFileChooserAction(action), + (*C.gchar)(c_first_button_text), C.int(first_button_id)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserDialog(obj), nil +} + +// FileChooserDialogNewWith2Buttons is a wrapper around gtk_file_chooser_dialog_new() with two buttons. +func FileChooserDialogNewWith2Buttons( + title string, + parent IWindow, + action FileChooserAction, + first_button_text string, + first_button_id ResponseType, + second_button_text string, + second_button_id ResponseType) (*FileChooserDialog, error) { + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + c_title := C.CString(title) + defer C.free(unsafe.Pointer(c_title)) + c_first_button_text := C.CString(first_button_text) + defer C.free(unsafe.Pointer(c_first_button_text)) + c_second_button_text := C.CString(second_button_text) + defer C.free(unsafe.Pointer(c_second_button_text)) + c := C.gtk_file_chooser_dialog_new_2( + (*C.gchar)(c_title), w, C.GtkFileChooserAction(action), + (*C.gchar)(c_first_button_text), C.int(first_button_id), + (*C.gchar)(c_second_button_text), C.int(second_button_id)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserDialog(obj), nil +} + +/* + * GtkFileChooserWidget + */ + +// FileChooserWidget is a representation of GTK's GtkFileChooserWidget. +type FileChooserWidget struct { + Box + + // Interfaces + FileChooser +} + +// native returns a pointer to the underlying GtkFileChooserWidget. +func (v *FileChooserWidget) native() *C.GtkFileChooserWidget { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooserWidget(p) +} + +func marshalFileChooserWidget(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserWidget(obj), nil +} + +func wrapFileChooserWidget(obj *glib.Object) *FileChooserWidget { + if obj == nil { + return nil + } + + fc := wrapFileChooser(obj) + return &FileChooserWidget{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}, *fc} +} + +// FileChooserWidgetNew is a wrapper around gtk_file_chooser_widget_new(). +func FileChooserWidgetNew(action FileChooserAction) (*FileChooserWidget, error) { + c := C.gtk_file_chooser_widget_new((C.GtkFileChooserAction)(action)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserWidget(obj), nil +} + +/* + * GtkFileFilter + */ + +// FileChoser is a representation of GTK's GtkFileFilter GInterface. +type FileFilter struct { + *glib.Object +} + +// native returns a pointer to the underlying GObject as a GtkFileFilter. +func (v *FileFilter) native() *C.GtkFileFilter { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileFilter(p) +} + +func marshalFileFilter(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileFilter(obj), nil +} + +func wrapFileFilter(obj *glib.Object) *FileFilter { + if obj == nil { + return nil + } + + return &FileFilter{obj} +} + +// FileFilterNew is a wrapper around gtk_file_filter_new(). +func FileFilterNew() (*FileFilter, error) { + c := C.gtk_file_filter_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileFilter(obj), nil +} + +// SetName is a wrapper around gtk_file_filter_set_name(). +func (v *FileFilter) SetName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_filter_set_name(v.native(), (*C.gchar)(cstr)) +} + +// GetName is a wrapper around gtk_file_filter_get_name(). +func (v *FileFilter) GetName() (name string) { + cstr := C.gtk_file_filter_get_name(v.native()) + if cstr != nil { + name = goString(cstr) + } + return +} + +// AddMimeType is a wrapper around gtk_file_filter_add_mime_type(). +func (v *FileFilter) AddMimeType(mimeType string) { + cstr := C.CString(mimeType) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_filter_add_mime_type(v.native(), (*C.gchar)(cstr)) +} + +// AddPattern is a wrapper around gtk_file_filter_add_pattern(). +func (v *FileFilter) AddPattern(pattern string) { + cstr := C.CString(pattern) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_filter_add_pattern(v.native(), (*C.gchar)(cstr)) +} + +// AddPixbufFormats is a wrapper around gtk_file_filter_add_pixbuf_formats(). +func (v *FileFilter) AddPixbufFormats() { + C.gtk_file_filter_add_pixbuf_formats(v.native()) +} + +/* + * GtkFrame + */ + +// Frame is a representation of GTK's GtkFrame. +type Frame struct { + Bin +} + +// native returns a pointer to the underlying GtkFrame. +func (v *Frame) native() *C.GtkFrame { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFrame(p) +} + +func marshalFrame(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFrame(obj), nil +} + +func wrapFrame(obj *glib.Object) *Frame { + if obj == nil { + return nil + } + + return &Frame{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// FrameNew is a wrapper around gtk_frame_new(). +func FrameNew(label string) (*Frame, error) { + var cstr *C.char + if label != "" { + cstr = C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + } + c := C.gtk_frame_new((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFrame(obj), nil +} + +// SetLabel is a wrapper around gtk_frame_set_label(). +func (v *Frame) SetLabel(label string) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_frame_set_label(v.native(), (*C.gchar)(cstr)) +} + +// SetLabelWidget is a wrapper around gtk_frame_set_label_widget(). +func (v *Frame) SetLabelWidget(labelWidget IWidget) { + C.gtk_frame_set_label_widget(v.native(), labelWidget.toWidget()) +} + +// SetLabelAlign is a wrapper around gtk_frame_set_label_align(). +func (v *Frame) SetLabelAlign(xAlign, yAlign float32) { + C.gtk_frame_set_label_align(v.native(), C.gfloat(xAlign), + C.gfloat(yAlign)) +} + +// SetShadowType is a wrapper around gtk_frame_set_shadow_type(). +func (v *Frame) SetShadowType(t ShadowType) { + C.gtk_frame_set_shadow_type(v.native(), C.GtkShadowType(t)) +} + +// GetLabel is a wrapper around gtk_frame_get_label(). +func (v *Frame) GetLabel() string { + c := C.gtk_frame_get_label(v.native()) + return goString(c) +} + +// GetLabelAlign is a wrapper around gtk_frame_get_label_align(). +func (v *Frame) GetLabelAlign() (xAlign, yAlign float32) { + var x, y C.gfloat + C.gtk_frame_get_label_align(v.native(), &x, &y) + return float32(x), float32(y) +} + +// GetLabelWidget is a wrapper around gtk_frame_get_label_widget(). +func (v *Frame) GetLabelWidget() (IWidget, error) { + c := C.gtk_frame_get_label_widget(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetShadowType is a wrapper around gtk_frame_get_shadow_type(). +func (v *Frame) GetShadowType() ShadowType { + c := C.gtk_frame_get_shadow_type(v.native()) + return ShadowType(c) +} + +/* + * GtkAspectFrame + */ + +// AspectFrame is a representation of GTK's GtkAspectFrame. +type AspectFrame struct { + Frame +} + +// native returns a pointer to the underlying GtkAspectFrame. +func (v *AspectFrame) native() *C.GtkAspectFrame { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAspectFrame(p) +} + +func marshalAspectFrame(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAspectFrame(obj), nil +} + +func wrapAspectFrame(obj *glib.Object) *AspectFrame { + if obj == nil { + return nil + } + + return &AspectFrame{Frame{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// AspectFrameNew is a wrapper around gtk_aspect_frame_new(). +func AspectFrameNew(label string, xalign, yalign, ratio float32, obeyChild bool) (*AspectFrame, error) { + var cstr *C.char + if label != "" { + cstr = C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + } + c := C.gtk_aspect_frame_new((*C.gchar)(cstr), (C.gfloat)(xalign), (C.gfloat)(yalign), (C.gfloat)(ratio), gbool(obeyChild)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAspectFrame(obj), nil +} + +// TODO: +// gtk_aspect_frame_set(). + +/* + * GtkGrid + */ + +// Grid is a representation of GTK's GtkGrid. +type Grid struct { + Container + + // Interfaces + Orientable +} + +// native returns a pointer to the underlying GtkGrid. +func (v *Grid) native() *C.GtkGrid { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkGrid(p) +} + +func (v *Grid) toOrientable() *C.GtkOrientable { + if v == nil { + return nil + } + return C.toGtkOrientable(unsafe.Pointer(v.GObject)) +} + +func marshalGrid(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapGrid(obj), nil +} + +func wrapGrid(obj *glib.Object) *Grid { + if obj == nil { + return nil + } + + o := wrapOrientable(obj) + return &Grid{Container{Widget{glib.InitiallyUnowned{obj}}}, *o} +} + +// GridNew() is a wrapper around gtk_grid_new(). +func GridNew() (*Grid, error) { + c := C.gtk_grid_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapGrid(obj), nil +} + +// Attach() is a wrapper around gtk_grid_attach(). +func (v *Grid) Attach(child IWidget, left, top, width, height int) { + C.gtk_grid_attach(v.native(), child.toWidget(), C.gint(left), + C.gint(top), C.gint(width), C.gint(height)) +} + +// AttachNextTo() is a wrapper around gtk_grid_attach_next_to(). +func (v *Grid) AttachNextTo(child, sibling IWidget, side PositionType, width, height int) { + C.gtk_grid_attach_next_to(v.native(), child.toWidget(), + sibling.toWidget(), C.GtkPositionType(side), C.gint(width), + C.gint(height)) +} + +// GetChildAt() is a wrapper around gtk_grid_get_child_at(). +func (v *Grid) GetChildAt(left, top int) (IWidget, error) { + c := C.gtk_grid_get_child_at(v.native(), C.gint(left), C.gint(top)) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// InsertRow() is a wrapper around gtk_grid_insert_row(). +func (v *Grid) InsertRow(position int) { + C.gtk_grid_insert_row(v.native(), C.gint(position)) +} + +// InsertColumn() is a wrapper around gtk_grid_insert_column(). +func (v *Grid) InsertColumn(position int) { + C.gtk_grid_insert_column(v.native(), C.gint(position)) +} + +// InsertNextTo() is a wrapper around gtk_grid_insert_next_to() +func (v *Grid) InsertNextTo(sibling IWidget, side PositionType) { + C.gtk_grid_insert_next_to(v.native(), sibling.toWidget(), + C.GtkPositionType(side)) +} + +// SetRowHomogeneous() is a wrapper around gtk_grid_set_row_homogeneous(). +func (v *Grid) SetRowHomogeneous(homogeneous bool) { + C.gtk_grid_set_row_homogeneous(v.native(), gbool(homogeneous)) +} + +// GetRowHomogeneous() is a wrapper around gtk_grid_get_row_homogeneous(). +func (v *Grid) GetRowHomogeneous() bool { + c := C.gtk_grid_get_row_homogeneous(v.native()) + return gobool(c) +} + +// SetRowSpacing() is a wrapper around gtk_grid_set_row_spacing(). +func (v *Grid) SetRowSpacing(spacing uint) { + C.gtk_grid_set_row_spacing(v.native(), C.guint(spacing)) +} + +// GetRowSpacing() is a wrapper around gtk_grid_get_row_spacing(). +func (v *Grid) GetRowSpacing() uint { + c := C.gtk_grid_get_row_spacing(v.native()) + return uint(c) +} + +// SetColumnHomogeneous() is a wrapper around gtk_grid_set_column_homogeneous(). +func (v *Grid) SetColumnHomogeneous(homogeneous bool) { + C.gtk_grid_set_column_homogeneous(v.native(), gbool(homogeneous)) +} + +// GetColumnHomogeneous() is a wrapper around gtk_grid_get_column_homogeneous(). +func (v *Grid) GetColumnHomogeneous() bool { + c := C.gtk_grid_get_column_homogeneous(v.native()) + return gobool(c) +} + +// SetColumnSpacing() is a wrapper around gtk_grid_set_column_spacing(). +func (v *Grid) SetColumnSpacing(spacing uint) { + C.gtk_grid_set_column_spacing(v.native(), C.guint(spacing)) +} + +// GetColumnSpacing() is a wrapper around gtk_grid_get_column_spacing(). +func (v *Grid) GetColumnSpacing() uint { + c := C.gtk_grid_get_column_spacing(v.native()) + return uint(c) +} + +/* + * GtkIconTheme + */ + +// IconTheme is a representation of GTK's GtkIconTheme +type IconTheme struct { + Theme *C.GtkIconTheme +} + +// IconThemeGetDefault is a wrapper around gtk_icon_theme_get_default(). +func IconThemeGetDefault() (*IconTheme, error) { + c := C.gtk_icon_theme_get_default() + if c == nil { + return nil, nilPtrErr + } + return &IconTheme{c}, nil +} + +// IconThemeGetForScreen is a wrapper around gtk_icon_theme_get_for_screen(). +func IconThemeGetForScreen(screen gdk.Screen) (*IconTheme, error) { + cScreen := (*C.GdkScreen)(unsafe.Pointer(screen.Native())) + c := C.gtk_icon_theme_get_for_screen(cScreen) + if c == nil { + return nil, nilPtrErr + } + return &IconTheme{c}, nil +} + +// LoadIcon is a wrapper around gtk_icon_theme_load_icon(). +func (v *IconTheme) LoadIcon(iconName string, size int, flags IconLookupFlags) (*gdk.Pixbuf, error) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + c := C.gtk_icon_theme_load_icon(v.Theme, (*C.gchar)(cstr), C.gint(size), C.GtkIconLookupFlags(flags), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(goString(err.message)) + } + return &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))}, nil +} + +// HasIcon is a wrapper around gtk_icon_theme_has_icon(). +func (v *IconTheme) HasIcon(iconName string) bool { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_icon_theme_has_icon(v.Theme, (*C.gchar)(cstr)) + return gobool(c) +} + +/* + * GtkImage + */ + +// Image is a representation of GTK's GtkImage. +type Image struct { + Widget +} + +// native returns a pointer to the underlying GtkImage. +func (v *Image) native() *C.GtkImage { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkImage(p) +} + +func marshalImage(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +func wrapImage(obj *glib.Object) *Image { + if obj == nil { + return nil + } + + return &Image{Widget{glib.InitiallyUnowned{obj}}} +} + +// ImageNew() is a wrapper around gtk_image_new(). +func ImageNew() (*Image, error) { + c := C.gtk_image_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// ImageNewFromFile() is a wrapper around gtk_image_new_from_file(). +func ImageNewFromFile(filename string) (*Image, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_image_new_from_file((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// ImageNewFromResource() is a wrapper around gtk_image_new_from_resource(). +func ImageNewFromResource(resourcePath string) (*Image, error) { + cstr := C.CString(resourcePath) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_image_new_from_resource((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// ImageNewFromPixbuf is a wrapper around gtk_image_new_from_pixbuf(). +func ImageNewFromPixbuf(pixbuf *gdk.Pixbuf) (*Image, error) { + c := C.gtk_image_new_from_pixbuf((*C.GdkPixbuf)(pixbuf.NativePrivate())) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// ImageNewFromIconName() is a wrapper around gtk_image_new_from_icon_name(). +func ImageNewFromIconName(iconName string, size IconSize) (*Image, error) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_image_new_from_icon_name((*C.gchar)(cstr), + C.GtkIconSize(size)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// ImageNewFromGIcon is a wrapper around gtk_image_new_from_gicon() +func ImageNewFromGIcon(icon *glib.Icon, size IconSize) (*Image, error) { + c := C.gtk_image_new_from_gicon( + (*C.GIcon)(icon.NativePrivate()), + C.GtkIconSize(size)) + + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// Clear() is a wrapper around gtk_image_clear(). +func (v *Image) Clear() { + C.gtk_image_clear(v.native()) +} + +// SetFromFile() is a wrapper around gtk_image_set_from_file(). +func (v *Image) SetFromFile(filename string) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_image_set_from_file(v.native(), (*C.gchar)(cstr)) +} + +// SetFromResource() is a wrapper around gtk_image_set_from_resource(). +func (v *Image) SetFromResource(resourcePath string) { + cstr := C.CString(resourcePath) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_image_set_from_resource(v.native(), (*C.gchar)(cstr)) +} + +// SetFromFixbuf is a wrapper around gtk_image_set_from_pixbuf(). +func (v *Image) SetFromPixbuf(pixbuf *gdk.Pixbuf) { + pbptr := (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native())) + C.gtk_image_set_from_pixbuf(v.native(), pbptr) +} + +// SetFromIconName() is a wrapper around gtk_image_set_from_icon_name(). +func (v *Image) SetFromIconName(iconName string, size IconSize) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_image_set_from_icon_name(v.native(), (*C.gchar)(cstr), + C.GtkIconSize(size)) +} + +// SetFromGIcon is a wrapper around gtk_image_set_from_gicon() +func (v *Image) SetFromGIcon(icon *glib.Icon, size IconSize) { + C.gtk_image_set_from_gicon( + v.native(), + (*C.GIcon)(icon.NativePrivate()), + C.GtkIconSize(size)) +} + +// SetPixelSize() is a wrapper around gtk_image_set_pixel_size(). +func (v *Image) SetPixelSize(pixelSize int) { + C.gtk_image_set_pixel_size(v.native(), C.gint(pixelSize)) +} + +// GetStorageType() is a wrapper around gtk_image_get_storage_type(). +func (v *Image) GetStorageType() ImageType { + c := C.gtk_image_get_storage_type(v.native()) + return ImageType(c) +} + +// GetPixbuf() is a wrapper around gtk_image_get_pixbuf(). +func (v *Image) GetPixbuf() *gdk.Pixbuf { + c := C.gtk_image_get_pixbuf(v.native()) + if c == nil { + return nil + } + + pb := &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))} + return pb +} + +// GetAnimation() is a wrapper around gtk_image_get_animation() +func (v *Image) GetAnimation() *gdk.PixbufAnimation { + c := C.gtk_image_get_animation(v.native()) + if c == nil { + return nil + } + return &gdk.PixbufAnimation{glib.Take(unsafe.Pointer(c))} +} + +// ImageNewFromAnimation() is a wrapper around gtk_image_new_from_animation() +func ImageNewFromAnimation(animation *gdk.PixbufAnimation) (*Image, error) { + c := C.gtk_image_new_from_animation((*C.GdkPixbufAnimation)(animation.NativePrivate())) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// SetFromAnimation is a wrapper around gtk_image_set_from_animation(). +func (v *Image) SetFromAnimation(animation *gdk.PixbufAnimation) { + pbaptr := (*C.GdkPixbufAnimation)(unsafe.Pointer(animation.NativePrivate())) + C.gtk_image_set_from_animation(v.native(), pbaptr) +} + +// GetIconName() is a wrapper around gtk_image_get_icon_name(). +func (v *Image) GetIconName() (string, IconSize) { + var iconName *C.gchar + var size C.GtkIconSize + C.gtk_image_get_icon_name(v.native(), &iconName, &size) + return goString(iconName), IconSize(size) +} + +// GetGIcon is a wrapper around gtk_image_get_gicon() +func (v *Image) GetGIcon() (*glib.Icon, IconSize, error) { + var gicon *C.GIcon + var size *C.GtkIconSize + C.gtk_image_get_gicon( + v.native(), + &gicon, + size) + + if gicon == nil { + return nil, ICON_SIZE_INVALID, nilPtrErr + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(gicon))} + i := &glib.Icon{obj} + + runtime.SetFinalizer(i, func(_ interface{}) { obj.Unref() }) + return i, IconSize(*size), nil +} + +// GetPixelSize() is a wrapper around gtk_image_get_pixel_size(). +func (v *Image) GetPixelSize() int { + c := C.gtk_image_get_pixel_size(v.native()) + return int(c) +} + +// added by terrak +/* + * GtkLayout + */ + +// Layout is a representation of GTK's GtkLayout. +type Layout struct { + Container +} + +// native returns a pointer to the underlying GtkDrawingArea. +func (v *Layout) native() *C.GtkLayout { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkLayout(p) +} + +func marshalLayout(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapLayout(obj), nil +} + +func wrapLayout(obj *glib.Object) *Layout { + if obj == nil { + return nil + } + + return &Layout{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// LayoutNew is a wrapper around gtk_layout_new(). +func LayoutNew(hadjustment, vadjustment *Adjustment) (*Layout, error) { + c := C.gtk_layout_new(hadjustment.native(), vadjustment.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapLayout(obj), nil +} + +// Layout.Put is a wrapper around gtk_layout_put(). +func (v *Layout) Put(w IWidget, x, y int) { + C.gtk_layout_put(v.native(), w.toWidget(), C.gint(x), C.gint(y)) +} + +// Layout.Move is a wrapper around gtk_layout_move(). +func (v *Layout) Move(w IWidget, x, y int) { + C.gtk_layout_move(v.native(), w.toWidget(), C.gint(x), C.gint(y)) +} + +// Layout.SetSize is a wrapper around gtk_layout_set_size +func (v *Layout) SetSize(width, height uint) { + C.gtk_layout_set_size(v.native(), C.guint(width), C.guint(height)) +} + +// Layout.GetSize is a wrapper around gtk_layout_get_size +func (v *Layout) GetSize() (width, height uint) { + var w, h C.guint + C.gtk_layout_get_size(v.native(), &w, &h) + return uint(w), uint(h) +} + +// TODO: +// gtk_layout_get_bin_window(). + +/* + * GtkLinkButton + */ + +// LinkButton is a representation of GTK's GtkLinkButton. +type LinkButton struct { + Button +} + +// native returns a pointer to the underlying GtkLinkButton. +func (v *LinkButton) native() *C.GtkLinkButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkLinkButton(p) +} + +func marshalLinkButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapLinkButton(obj), nil +} + +func wrapLinkButton(obj *glib.Object) *LinkButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &LinkButton{Button{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}, actionable}} +} + +// LinkButtonNew is a wrapper around gtk_link_button_new(). +func LinkButtonNew(label string) (*LinkButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_link_button_new((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapLinkButton(glib.Take(unsafe.Pointer(c))), nil +} + +// LinkButtonNewWithLabel is a wrapper around gtk_link_button_new_with_label(). +func LinkButtonNewWithLabel(uri, label string) (*LinkButton, error) { + curi := C.CString(uri) + defer C.free(unsafe.Pointer(curi)) + clabel := C.CString(label) + defer C.free(unsafe.Pointer(clabel)) + c := C.gtk_link_button_new_with_label((*C.gchar)(curi), (*C.gchar)(clabel)) + if c == nil { + return nil, nilPtrErr + } + return wrapLinkButton(glib.Take(unsafe.Pointer(c))), nil +} + +// GetUri is a wrapper around gtk_link_button_get_uri(). +func (v *LinkButton) GetUri() string { + c := C.gtk_link_button_get_uri(v.native()) + return goString(c) +} + +// SetUri is a wrapper around gtk_link_button_set_uri(). +func (v *LinkButton) SetUri(uri string) { + cstr := C.CString(uri) + C.gtk_link_button_set_uri(v.native(), (*C.gchar)(cstr)) +} + +// GetVisited is a wrapper around gtk_link_button_get_visited(). +func (v *LinkButton) GetVisited() bool { + c := C.gtk_link_button_get_visited(v.native()) + return gobool(c) +} + +// SetVisited is a wrapper around gtk_link_button_set_visited(). +func (v *LinkButton) SetVisited(visited bool) { + C.gtk_link_button_set_visited(v.native(), gbool(visited)) +} + +/* + * GtkLockButton + */ + +// LockButton is a representation of GTK's GtkLockButton. +type LockButton struct { + Button +} + +// native returns a pointer to the underlying GtkLockButton. +func (v *LockButton) native() *C.GtkLockButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkLockButton(p) +} + +func marshalLockButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapLockButton(obj), nil +} + +func wrapLockButton(obj *glib.Object) *LockButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &LockButton{Button{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}, actionable}} +} + +// LockButtonNew is a wrapper around gtk_lock_button_new(). +func LockButtonNew(permission *glib.Permission) (*LockButton, error) { + c := C.gtk_lock_button_new(nativeGPermission(permission)) + if c == nil { + return nil, nilPtrErr + } + return wrapLockButton(glib.Take(unsafe.Pointer(c))), nil +} + +// GetPermission is a wrapper around gtk_lock_button_get_permission(). +func (v *LockButton) GetPermission() *glib.Permission { + c := C.gtk_lock_button_get_permission(v.native()) + return glib.WrapPermission(unsafe.Pointer(c)) +} + +// SetPermission is a wrapper around gtk_lock_button_set_permission(). +func (v *LockButton) SetPermission(permission *glib.Permission) { + C.gtk_lock_button_set_permission(v.native(), nativeGPermission(permission)) +} + +/* + * GtkListStore + */ + +// ListStore is a representation of GTK's GtkListStore. +type ListStore struct { + *glib.Object + + // Interfaces + TreeModel + TreeSortable +} + +// native returns a pointer to the underlying GtkListStore. +func (v *ListStore) native() *C.GtkListStore { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkListStore(p) +} + +func marshalListStore(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapListStore(obj), nil +} + +func wrapListStore(obj *glib.Object) *ListStore { + if obj == nil { + return nil + } + + tm := wrapTreeModel(obj) + ts := wrapTreeSortable(obj) + return &ListStore{obj, *tm, *ts} +} + +func (v *ListStore) toTreeModel() *C.GtkTreeModel { + if v == nil { + return nil + } + return C.toGtkTreeModel(unsafe.Pointer(v.GObject)) +} + +func (v *ListStore) toTreeSortable() *C.GtkTreeSortable { + if v == nil { + return nil + } + return C.toGtkTreeSortable(unsafe.Pointer(v.GObject)) +} + +// ListStoreNew is a wrapper around gtk_list_store_newv(). +func ListStoreNew(types ...glib.Type) (*ListStore, error) { + gtypes := C.alloc_types(C.int(len(types))) + for n, val := range types { + C.set_type(gtypes, C.int(n), C.GType(val)) + } + defer C.g_free(C.gpointer(gtypes)) + c := C.gtk_list_store_newv(C.gint(len(types)), gtypes) + if c == nil { + return nil, nilPtrErr + } + + ls := wrapListStore(glib.Take(unsafe.Pointer(c))) + return ls, nil +} + +// Remove is a wrapper around gtk_list_store_remove(). +func (v *ListStore) Remove(iter *TreeIter) bool { + c := C.gtk_list_store_remove(v.native(), iter.native()) + return gobool(c) +} + +// SetColumnTypes is a wrapper around gtk_list_store_set_column_types(). +// The size of glib.Type must match the number of columns +func (v *ListStore) SetColumnTypes(types ...glib.Type) { + gtypes := C.alloc_types(C.int(len(types))) + for n, val := range types { + C.set_type(gtypes, C.int(n), C.GType(val)) + } + defer C.g_free(C.gpointer(gtypes)) + C.gtk_list_store_set_column_types(v.native(), C.gint(len(types)), gtypes) +} + +// Set() is a wrapper around gtk_list_store_set_value() but provides +// a function similar to gtk_list_store_set() in that multiple columns +// may be set by one call. The length of columns and values slices must +// match, or Set() will return a non-nil error. +// +// As an example, a call to: +// store.Set(iter, []int{0, 1}, []interface{}{"Foo", "Bar"}) +// is functionally equivalent to calling the native C GTK function: +// gtk_list_store_set(store, iter, 0, "Foo", 1, "Bar", -1); +func (v *ListStore) Set(iter *TreeIter, columns []int, values []interface{}) error { + if len(columns) != len(values) { + return errors.New("columns and values lengths do not match") + } + for i, val := range values { + v.SetValue(iter, columns[i], val) + } + return nil +} + +// SetValue is a wrapper around gtk_list_store_set_value(). +func (v *ListStore) SetValue(iter *TreeIter, column int, value interface{}) error { + switch value.(type) { + case *gdk.Pixbuf: + pix := value.(*gdk.Pixbuf) + C._gtk_list_store_set(v.native(), iter.native(), C.gint(column), unsafe.Pointer(pix.Native())) + + default: + gv, err := glib.GValue(value) + if err != nil { + return err + } + + C.gtk_list_store_set_value(v.native(), iter.native(), + C.gint(column), + (*C.GValue)(unsafe.Pointer(gv.Native()))) + } + + return nil +} + +// func (v *ListStore) Model(model ITreeModel) { +// obj := &glib.Object{glib.ToGObject(unsafe.Pointer(model.toTreeModel()))} +// v.TreeModel = *wrapTreeModel(obj) +//} + +func (v *ListStore) SetCols(iter *TreeIter, cols Cols) error { + for key, value := range cols { + err := v.SetValue(iter, key, value) + if err != nil { + return err + } + } + return nil +} + +// Convenient map for Columns and values (See ListStore, TreeStore) +type Cols map[int]interface{} + +// InsertWithValues() is a wrapper around gtk_list_store_insert_with_valuesv(). +func (v *ListStore) InsertWithValues(iter *TreeIter, position int, inColumns []int, inValues []interface{}) error { + length := len(inColumns) + if len(inValues) < length { + length = len(inValues) + } + + var cColumns []C.gint + var cValues []C.GValue + for i := 0; i < length; i++ { + cColumns = append(cColumns, C.gint(inColumns[i])) + + gv, err := glib.GValue(inValues[i]) + if err != nil { + return err + } + + var cvp *C.GValue = (*C.GValue)(unsafe.Pointer(gv.Native())) + cValues = append(cValues, *cvp) + } + var cColumnsPointer *C.gint + if len(cColumns) > 0 { + cColumnsPointer = &cColumns[0] + } + var cValuesPointer *C.GValue + if len(cValues) > 0 { + cValuesPointer = &cValues[0] + } + + C.gtk_list_store_insert_with_valuesv(v.native(), iter.native(), C.gint(position), cColumnsPointer, cValuesPointer, C.gint(length)) + + return nil +} + +// Insert() is a wrapper around gtk_list_store_insert(). +func (v *ListStore) Insert(position int) *TreeIter { + var ti C.GtkTreeIter + C.gtk_list_store_insert(v.native(), &ti, C.gint(position)) + iter := &TreeIter{ti} + return iter +} + +// InsertBefore() is a wrapper around gtk_list_store_insert_before(). +func (v *ListStore) InsertBefore(sibling *TreeIter) *TreeIter { + var ti C.GtkTreeIter + C.gtk_list_store_insert_before(v.native(), &ti, sibling.native()) + iter := &TreeIter{ti} + return iter +} + +// InsertAfter() is a wrapper around gtk_list_store_insert_after(). +func (v *ListStore) InsertAfter(sibling *TreeIter) *TreeIter { + var ti C.GtkTreeIter + C.gtk_list_store_insert_after(v.native(), &ti, sibling.native()) + iter := &TreeIter{ti} + return iter +} + +// Prepend() is a wrapper around gtk_list_store_prepend(). +func (v *ListStore) Prepend() *TreeIter { + var ti C.GtkTreeIter + C.gtk_list_store_prepend(v.native(), &ti) + iter := &TreeIter{ti} + return iter +} + +// Append() is a wrapper around gtk_list_store_append(). +func (v *ListStore) Append() *TreeIter { + var ti C.GtkTreeIter + C.gtk_list_store_append(v.native(), &ti) + iter := &TreeIter{ti} + return iter +} + +// Clear() is a wrapper around gtk_list_store_clear(). +func (v *ListStore) Clear() { + C.gtk_list_store_clear(v.native()) +} + +// IterIsValid() is a wrapper around gtk_list_store_iter_is_valid(). +func (v *ListStore) IterIsValid(iter *TreeIter) bool { + c := C.gtk_list_store_iter_is_valid(v.native(), iter.native()) + return gobool(c) +} + +// TODO(jrick) +/* +func (v *ListStore) Reorder(newOrder []int) { +} +*/ + +// Swap() is a wrapper around gtk_list_store_swap(). +func (v *ListStore) Swap(a, b *TreeIter) { + C.gtk_list_store_swap(v.native(), a.native(), b.native()) +} + +// MoveBefore() is a wrapper around gtk_list_store_move_before(). +func (v *ListStore) MoveBefore(iter, position *TreeIter) { + C.gtk_list_store_move_before(v.native(), iter.native(), + position.native()) +} + +// MoveAfter() is a wrapper around gtk_list_store_move_after(). +func (v *ListStore) MoveAfter(iter, position *TreeIter) { + C.gtk_list_store_move_after(v.native(), iter.native(), + position.native()) +} + +/* + * GtkMenuBar + */ + +// MenuBar is a representation of GTK's GtkMenuBar. +type MenuBar struct { + MenuShell +} + +// native() returns a pointer to the underlying GtkMenuBar. +func (v *MenuBar) native() *C.GtkMenuBar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMenuBar(p) +} + +func marshalMenuBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenuBar(obj), nil +} + +func wrapMenuBar(obj *glib.Object) *MenuBar { + if obj == nil { + return nil + } + + return &MenuBar{MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// MenuBarNew() is a wrapper around gtk_menu_bar_new(). +func MenuBarNew() (*MenuBar, error) { + c := C.gtk_menu_bar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapMenuBar(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkMenuButton + */ + +// MenuButton is a representation of GTK's GtkMenuButton. +type MenuButton struct { + ToggleButton +} + +// native returns a pointer to the underlying GtkMenuButton. +func (v *MenuButton) native() *C.GtkMenuButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMenuButton(p) +} + +func marshalMenuButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenuButton(obj), nil +} + +func wrapMenuButton(obj *glib.Object) *MenuButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &MenuButton{ToggleButton{Button{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}, actionable}}} +} + +// MenuButtonNew is a wrapper around gtk_menu_button_new(). +func MenuButtonNew() (*MenuButton, error) { + c := C.gtk_menu_button_new() + if c == nil { + return nil, nilPtrErr + } + return wrapMenuButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SetPopup is a wrapper around gtk_menu_button_set_popup(). +func (v *MenuButton) SetPopup(menu IMenu) { + C.gtk_menu_button_set_popup(v.native(), menu.toWidget()) +} + +// GetPopup is a wrapper around gtk_menu_button_get_popup(). +func (v *MenuButton) GetPopup() *Menu { + c := C.gtk_menu_button_get_popup(v.native()) + if c == nil { + return nil + } + return wrapMenu(glib.Take(unsafe.Pointer(c))) +} + +// SetMenuModel is a wrapper around gtk_menu_button_set_menu_model(). +func (v *MenuButton) SetMenuModel(menuModel *glib.MenuModel) { + C.gtk_menu_button_set_menu_model(v.native(), C.toGMenuModel(unsafe.Pointer(menuModel.Native()))) +} + +// GetMenuModel is a wrapper around gtk_menu_button_get_menu_model(). +func (v *MenuButton) GetMenuModel() *glib.MenuModel { + c := C.gtk_menu_button_get_menu_model(v.native()) + if c == nil { + return nil + } + return &glib.MenuModel{glib.Take(unsafe.Pointer(c))} +} + +// SetDirection is a wrapper around gtk_menu_button_set_direction(). +func (v *MenuButton) SetDirection(direction ArrowType) { + C.gtk_menu_button_set_direction(v.native(), C.GtkArrowType(direction)) +} + +// GetDirection is a wrapper around gtk_menu_button_get_direction(). +func (v *MenuButton) GetDirection() ArrowType { + c := C.gtk_menu_button_get_direction(v.native()) + return ArrowType(c) +} + +// SetAlignWidget is a wrapper around gtk_menu_button_set_align_widget(). +func (v *MenuButton) SetAlignWidget(alignWidget IWidget) { + C.gtk_menu_button_set_align_widget(v.native(), alignWidget.toWidget()) +} + +// GetAlignWidget is a wrapper around gtk_menu_button_get_align_widget(). +func (v *MenuButton) GetAlignWidget() (IWidget, error) { + c := C.gtk_menu_button_get_align_widget(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +/* + * GtkMenuItem + */ + +// MenuItem is a representation of GTK's GtkMenuItem. +type MenuItem struct { + Bin +} + +// IMenuItem is an interface type implemented by all structs +// embedding a MenuItem. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkMenuItem. +type IMenuItem interface { + toMenuItem() *C.GtkMenuItem + toWidget() *C.GtkWidget +} + +// native returns a pointer to the underlying GtkMenuItem. +func (v *MenuItem) native() *C.GtkMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMenuItem(p) +} + +func (v *MenuItem) toMenuItem() *C.GtkMenuItem { + if v == nil { + return nil + } + return v.native() +} + +func marshalMenuItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenuItem(obj), nil +} + +func wrapMenuItem(obj *glib.Object) *MenuItem { + if obj == nil { + return nil + } + + return &MenuItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// MenuItemNew() is a wrapper around gtk_menu_item_new(). +func MenuItemNew() (*MenuItem, error) { + c := C.gtk_menu_item_new() + if c == nil { + return nil, nilPtrErr + } + return wrapMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// MenuItemNewWithLabel() is a wrapper around gtk_menu_item_new_with_label(). +func MenuItemNewWithLabel(label string) (*MenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_menu_item_new_with_label((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// MenuItemNewWithMnemonic() is a wrapper around gtk_menu_item_new_with_mnemonic(). +func MenuItemNewWithMnemonic(label string) (*MenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_menu_item_new_with_mnemonic((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// SetSubmenu() is a wrapper around gtk_menu_item_set_submenu(). +func (v *MenuItem) SetSubmenu(submenu IWidget) { + C.gtk_menu_item_set_submenu(v.native(), submenu.toWidget()) +} + +// GetSubmenu is a wrapper around gtk_menu_item_get_submenu(). +func (v *MenuItem) GetSubmenu() (IMenu, error) { + c := C.gtk_menu_item_get_submenu(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenu(obj), nil +} + +// SetLabel is a wrapper around gtk_menu_item_set_label(). +func (v *MenuItem) SetLabel(label string) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_menu_item_set_label(v.native(), (*C.gchar)(cstr)) +} + +// GetLabel is a wrapper around gtk_menu_item_get_label(). +func (v *MenuItem) GetLabel() string { + l := C.gtk_menu_item_get_label(v.native()) + return goString(l) +} + +// SetUseUnderline() is a wrapper around gtk_menu_item_set_use_underline() +func (v *MenuItem) SetUseUnderline(settings bool) { + C.gtk_menu_item_set_use_underline(v.native(), gbool(settings)) +} + +// GetUseUnderline() is a wrapper around gtk_menu_item_get_use_underline() +func (v *MenuItem) GetUseUnderline() bool { + c := C.gtk_menu_item_get_use_underline(v.native()) + return gobool(c) +} + +// Select is a wrapper around gtk_menu_item_select() +func (v *MenuItem) Select() { + C.gtk_menu_item_select(v.native()) +} + +// Deselect is a wrapper around gtk_menu_item_deselect() +func (v *MenuItem) Deselect() { + C.gtk_menu_item_deselect(v.native()) +} + +// Activate is a wrapper around gtk_menu_item_activate() +func (v *MenuItem) Activate() { + C.gtk_menu_item_activate(v.native()) +} + +// ToggleSizeRequest is a wrapper around gtk_menu_item_toggle_size_request() +func (v *MenuItem) ToggleSizeRequest(requisition int) int { + cint := new(C.gint) + *cint = C.gint(requisition) + C.gtk_menu_item_toggle_size_request(v.native(), cint) + return int(*cint) +} + +// ToggleSizeAllocate is a wrapper around gtk_menu_item_toggle_size_allocate() +func (v *MenuItem) ToggleSizeAllocate(allocation int) { + C.gtk_menu_item_toggle_size_allocate(v.native(), C.gint(allocation)) +} + +// GetReserveIndicator is a wrapper around gtk_menu_item_get_reserve_indicator(). +func (v *MenuItem) GetReserveIndicator() bool { + return gobool(C.gtk_menu_item_get_reserve_indicator(v.native())) +} + +// SetReserveIndicator is a wrapper around gtk_menu_item_set_reserve_indicator(). +func (v *MenuItem) SetReserveIndicator(reserve bool) { + C.gtk_menu_item_set_reserve_indicator(v.native(), gbool(reserve)) +} + +/* + * GtkMessageDialog + */ + +// MessageDialog is a representation of GTK's GtkMessageDialog. +type MessageDialog struct { + Dialog +} + +// native returns a pointer to the underlying GtkMessageDialog. +func (v *MessageDialog) native() *C.GtkMessageDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMessageDialog(p) +} + +func marshalMessageDialog(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMessageDialog(obj), nil +} + +func wrapMessageDialog(obj *glib.Object) *MessageDialog { + if obj == nil { + return nil + } + + return &MessageDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}} +} + +// MessageDialogNew() is a wrapper around gtk_message_dialog_new(). +// The text is created and formatted by the format specifier and any +// additional arguments. +func MessageDialogNew(parent IWindow, flags DialogFlags, mType MessageType, buttons ButtonsType, format string, args ...interface{}) *MessageDialog { + s := fmt.Sprintf(format, args...) + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + c := C._gtk_message_dialog_new(w, + C.GtkDialogFlags(flags), C.GtkMessageType(mType), + C.GtkButtonsType(buttons), cstr) + return wrapMessageDialog(glib.Take(unsafe.Pointer(c))) +} + +// MessageDialogNewWithMarkup is a wrapper around +// gtk_message_dialog_new_with_markup(). +func MessageDialogNewWithMarkup(parent IWindow, flags DialogFlags, mType MessageType, buttons ButtonsType, format string, args ...interface{}) *MessageDialog { + s := fmt.Sprintf(format, args...) + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + c := C._gtk_message_dialog_new_with_markup(w, + C.GtkDialogFlags(flags), C.GtkMessageType(mType), + C.GtkButtonsType(buttons), cstr) + return wrapMessageDialog(glib.Take(unsafe.Pointer(c))) +} + +// SetMarkup is a wrapper around gtk_message_dialog_set_markup(). +func (v *MessageDialog) SetMarkup(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_message_dialog_set_markup(v.native(), (*C.gchar)(cstr)) +} + +// FormatSecondaryText is a wrapper around +// gtk_message_dialog_format_secondary_text(). +func (v *MessageDialog) FormatSecondaryText(format string, args ...interface{}) { + s := fmt.Sprintf(format, args...) + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + C._gtk_message_dialog_format_secondary_text(v.native(), + (*C.gchar)(cstr)) +} + +// FormatSecondaryMarkup is a wrapper around +// gtk_message_dialog_format_secondary_text(). +func (v *MessageDialog) FormatSecondaryMarkup(format string, args ...interface{}) { + s := fmt.Sprintf(format, args...) + cstr := C.CString(s) + defer C.free(unsafe.Pointer(cstr)) + C._gtk_message_dialog_format_secondary_markup(v.native(), + (*C.gchar)(cstr)) +} + +// GetMessageArea() is a wrapper around gtk_message_dialog_get_message_area(). +func (v *MessageDialog) GetMessageArea() (*Box, error) { + c := C.gtk_message_dialog_get_message_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + b := &Box{Container{Widget{glib.InitiallyUnowned{obj}}}} + return b, nil +} + +/* + * GtkNotebook + */ + +// Notebook is a representation of GTK's GtkNotebook. +type Notebook struct { + Container +} + +// native returns a pointer to the underlying GtkNotebook. +func (v *Notebook) native() *C.GtkNotebook { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkNotebook(p) +} + +func marshalNotebook(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapNotebook(obj), nil +} + +func wrapNotebook(obj *glib.Object) *Notebook { + if obj == nil { + return nil + } + + return &Notebook{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// NotebookNew() is a wrapper around gtk_notebook_new(). +func NotebookNew() (*Notebook, error) { + c := C.gtk_notebook_new() + if c == nil { + return nil, nilPtrErr + } + return wrapNotebook(glib.Take(unsafe.Pointer(c))), nil +} + +// AppendPage() is a wrapper around gtk_notebook_append_page(). +func (v *Notebook) AppendPage(child IWidget, tabLabel IWidget) int { + cTabLabel := nullableWidget(tabLabel) + c := C.gtk_notebook_append_page(v.native(), child.toWidget(), cTabLabel) + return int(c) +} + +// AppendPageMenu() is a wrapper around gtk_notebook_append_page_menu(). +func (v *Notebook) AppendPageMenu(child IWidget, tabLabel IWidget, menuLabel IWidget) int { + c := C.gtk_notebook_append_page_menu(v.native(), child.toWidget(), + tabLabel.toWidget(), menuLabel.toWidget()) + return int(c) +} + +// PrependPage() is a wrapper around gtk_notebook_prepend_page(). +func (v *Notebook) PrependPage(child IWidget, tabLabel IWidget) int { + cTabLabel := nullableWidget(tabLabel) + c := C.gtk_notebook_prepend_page(v.native(), child.toWidget(), cTabLabel) + return int(c) +} + +// PrependPageMenu() is a wrapper around gtk_notebook_prepend_page_menu(). +func (v *Notebook) PrependPageMenu(child IWidget, tabLabel IWidget, menuLabel IWidget) int { + c := C.gtk_notebook_prepend_page_menu(v.native(), child.toWidget(), + tabLabel.toWidget(), menuLabel.toWidget()) + return int(c) +} + +// InsertPage() is a wrapper around gtk_notebook_insert_page(). +func (v *Notebook) InsertPage(child IWidget, tabLabel IWidget, position int) int { + label := nullableWidget(tabLabel) + c := C.gtk_notebook_insert_page(v.native(), child.toWidget(), label, C.gint(position)) + + return int(c) +} + +// InsertPageMenu() is a wrapper around gtk_notebook_insert_page_menu(). +func (v *Notebook) InsertPageMenu(child IWidget, tabLabel IWidget, menuLabel IWidget, position int) int { + c := C.gtk_notebook_insert_page_menu(v.native(), child.toWidget(), + tabLabel.toWidget(), menuLabel.toWidget(), C.gint(position)) + return int(c) +} + +// RemovePage() is a wrapper around gtk_notebook_remove_page(). +func (v *Notebook) RemovePage(pageNum int) { + C.gtk_notebook_remove_page(v.native(), C.gint(pageNum)) +} + +// PageNum() is a wrapper around gtk_notebook_page_num(). +func (v *Notebook) PageNum(child IWidget) int { + c := C.gtk_notebook_page_num(v.native(), child.toWidget()) + return int(c) +} + +// NextPage() is a wrapper around gtk_notebook_next_page(). +func (v *Notebook) NextPage() { + C.gtk_notebook_next_page(v.native()) +} + +// PrevPage() is a wrapper around gtk_notebook_prev_page(). +func (v *Notebook) PrevPage() { + C.gtk_notebook_prev_page(v.native()) +} + +// ReorderChild() is a wrapper around gtk_notebook_reorder_child(). +func (v *Notebook) ReorderChild(child IWidget, position int) { + C.gtk_notebook_reorder_child(v.native(), child.toWidget(), + C.gint(position)) +} + +// SetTabPos() is a wrapper around gtk_notebook_set_tab_pos(). +func (v *Notebook) SetTabPos(pos PositionType) { + C.gtk_notebook_set_tab_pos(v.native(), C.GtkPositionType(pos)) +} + +// SetShowTabs() is a wrapper around gtk_notebook_set_show_tabs(). +func (v *Notebook) SetShowTabs(showTabs bool) { + C.gtk_notebook_set_show_tabs(v.native(), gbool(showTabs)) +} + +// SetShowBorder() is a wrapper around gtk_notebook_set_show_border(). +func (v *Notebook) SetShowBorder(showBorder bool) { + C.gtk_notebook_set_show_border(v.native(), gbool(showBorder)) +} + +// SetScrollable() is a wrapper around gtk_notebook_set_scrollable(). +func (v *Notebook) SetScrollable(scrollable bool) { + C.gtk_notebook_set_scrollable(v.native(), gbool(scrollable)) +} + +// PopupEnable() is a wrapper around gtk_notebook_popup_enable(). +func (v *Notebook) PopupEnable() { + C.gtk_notebook_popup_enable(v.native()) +} + +// PopupDisable() is a wrapper around gtk_notebook_popup_disable(). +func (v *Notebook) PopupDisable() { + C.gtk_notebook_popup_disable(v.native()) +} + +// GetCurrentPage() is a wrapper around gtk_notebook_get_current_page(). +func (v *Notebook) GetCurrentPage() int { + c := C.gtk_notebook_get_current_page(v.native()) + return int(c) +} + +// GetMenuLabel() is a wrapper around gtk_notebook_get_menu_label(). +func (v *Notebook) GetMenuLabel(child IWidget) (IWidget, error) { + c := C.gtk_notebook_get_menu_label(v.native(), child.toWidget()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetNthPage() is a wrapper around gtk_notebook_get_nth_page(). +func (v *Notebook) GetNthPage(pageNum int) (IWidget, error) { + c := C.gtk_notebook_get_nth_page(v.native(), C.gint(pageNum)) + if c == nil { + return nil, fmt.Errorf("page %d is out of bounds", pageNum) + } + return castWidget(c) +} + +// GetNPages() is a wrapper around gtk_notebook_get_n_pages(). +func (v *Notebook) GetNPages() int { + c := C.gtk_notebook_get_n_pages(v.native()) + return int(c) +} + +// GetTabLabel() is a wrapper around gtk_notebook_get_tab_label(). +func (v *Notebook) GetTabLabel(child IWidget) (IWidget, error) { + c := C.gtk_notebook_get_tab_label(v.native(), child.toWidget()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetMenuLabel() is a wrapper around gtk_notebook_set_menu_label(). +func (v *Notebook) SetMenuLabel(child, menuLabel IWidget) { + C.gtk_notebook_set_menu_label(v.native(), child.toWidget(), + menuLabel.toWidget()) +} + +// SetMenuLabelText() is a wrapper around gtk_notebook_set_menu_label_text(). +func (v *Notebook) SetMenuLabelText(child IWidget, menuText string) { + cstr := C.CString(menuText) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_notebook_set_menu_label_text(v.native(), child.toWidget(), + (*C.gchar)(cstr)) +} + +// SetTabLabel() is a wrapper around gtk_notebook_set_tab_label(). +func (v *Notebook) SetTabLabel(child, tabLabel IWidget) { + C.gtk_notebook_set_tab_label(v.native(), child.toWidget(), + tabLabel.toWidget()) +} + +// SetTabLabelText() is a wrapper around gtk_notebook_set_tab_label_text(). +func (v *Notebook) SetTabLabelText(child IWidget, tabText string) { + cstr := C.CString(tabText) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_notebook_set_tab_label_text(v.native(), child.toWidget(), + (*C.gchar)(cstr)) +} + +// SetTabReorderable() is a wrapper around gtk_notebook_set_tab_reorderable(). +func (v *Notebook) SetTabReorderable(child IWidget, reorderable bool) { + C.gtk_notebook_set_tab_reorderable(v.native(), child.toWidget(), + gbool(reorderable)) +} + +// SetTabDetachable() is a wrapper around gtk_notebook_set_tab_detachable(). +func (v *Notebook) SetTabDetachable(child IWidget, detachable bool) { + C.gtk_notebook_set_tab_detachable(v.native(), child.toWidget(), + gbool(detachable)) +} + +// GetMenuLabelText() is a wrapper around gtk_notebook_get_menu_label_text(). +func (v *Notebook) GetMenuLabelText(child IWidget) (string, error) { + c := C.gtk_notebook_get_menu_label_text(v.native(), child.toWidget()) + if c == nil { + return "", errors.New("No menu label for widget") + } + return goString(c), nil +} + +// GetScrollable() is a wrapper around gtk_notebook_get_scrollable(). +func (v *Notebook) GetScrollable() bool { + c := C.gtk_notebook_get_scrollable(v.native()) + return gobool(c) +} + +// GetShowBorder() is a wrapper around gtk_notebook_get_show_border(). +func (v *Notebook) GetShowBorder() bool { + c := C.gtk_notebook_get_show_border(v.native()) + return gobool(c) +} + +// GetShowTabs() is a wrapper around gtk_notebook_get_show_tabs(). +func (v *Notebook) GetShowTabs() bool { + c := C.gtk_notebook_get_show_tabs(v.native()) + return gobool(c) +} + +// GetTabLabelText() is a wrapper around gtk_notebook_get_tab_label_text(). +func (v *Notebook) GetTabLabelText(child IWidget) (string, error) { + c := C.gtk_notebook_get_tab_label_text(v.native(), child.toWidget()) + if c == nil { + return "", errors.New("No tab label for widget") + } + return goString(c), nil +} + +// GetTabPos() is a wrapper around gtk_notebook_get_tab_pos(). +func (v *Notebook) GetTabPos() PositionType { + c := C.gtk_notebook_get_tab_pos(v.native()) + return PositionType(c) +} + +// GetTabReorderable() is a wrapper around gtk_notebook_get_tab_reorderable(). +func (v *Notebook) GetTabReorderable(child IWidget) bool { + c := C.gtk_notebook_get_tab_reorderable(v.native(), child.toWidget()) + return gobool(c) +} + +// GetTabDetachable() is a wrapper around gtk_notebook_get_tab_detachable(). +func (v *Notebook) GetTabDetachable(child IWidget) bool { + c := C.gtk_notebook_get_tab_detachable(v.native(), child.toWidget()) + return gobool(c) +} + +// SetCurrentPage() is a wrapper around gtk_notebook_set_current_page(). +func (v *Notebook) SetCurrentPage(pageNum int) { + C.gtk_notebook_set_current_page(v.native(), C.gint(pageNum)) +} + +// SetGroupName() is a wrapper around gtk_notebook_set_group_name(). +func (v *Notebook) SetGroupName(groupName string) { + cstr := C.CString(groupName) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_notebook_set_group_name(v.native(), (*C.gchar)(cstr)) +} + +// GetGroupName() is a wrapper around gtk_notebook_get_group_name(). +func (v *Notebook) GetGroupName() (string, error) { + c := C.gtk_notebook_get_group_name(v.native()) + if c == nil { + return "", errors.New("No group name") + } + return goString(c), nil +} + +// SetActionWidget() is a wrapper around gtk_notebook_set_action_widget(). +func (v *Notebook) SetActionWidget(widget IWidget, packType PackType) { + C.gtk_notebook_set_action_widget(v.native(), widget.toWidget(), + C.GtkPackType(packType)) +} + +// GetActionWidget() is a wrapper around gtk_notebook_get_action_widget(). +func (v *Notebook) GetActionWidget(packType PackType) (IWidget, error) { + c := C.gtk_notebook_get_action_widget(v.native(), C.GtkPackType(packType)) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +/* + * GtkOffscreenWindow + */ + +// OffscreenWindow is a representation of GTK's GtkOffscreenWindow. +type OffscreenWindow struct { + Window +} + +// native returns a pointer to the underlying GtkOffscreenWindow. +func (v *OffscreenWindow) native() *C.GtkOffscreenWindow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkOffscreenWindow(p) +} + +func marshalOffscreenWindow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapOffscreenWindow(obj), nil +} + +func wrapOffscreenWindow(obj *glib.Object) *OffscreenWindow { + if obj == nil { + return nil + } + + return &OffscreenWindow{Window{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}} +} + +// OffscreenWindowNew is a wrapper around gtk_offscreen_window_new(). +func OffscreenWindowNew() (*OffscreenWindow, error) { + c := C.gtk_offscreen_window_new() + if c == nil { + return nil, nilPtrErr + } + return wrapOffscreenWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// GetSurface is a wrapper around gtk_offscreen_window_get_surface(). +// The returned surface is safe to use over window resizes. +func (v *OffscreenWindow) GetSurface() (*cairo.Surface, error) { + c := C.gtk_offscreen_window_get_surface(v.native()) + if c == nil { + return nil, nilPtrErr + } + cairoPtr := (uintptr)(unsafe.Pointer(c)) + s := cairo.NewSurface(cairoPtr, true) + return s, nil +} + +// GetPixbuf is a wrapper around gtk_offscreen_window_get_pixbuf(). +func (v *OffscreenWindow) GetPixbuf() (*gdk.Pixbuf, error) { + c := C.gtk_offscreen_window_get_pixbuf(v.native()) + if c == nil { + return nil, nilPtrErr + } + + // Pixbuf is returned with ref count of 1, so don't increment. + // Is it a floating reference? + pb := &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))} + return pb, nil +} + +/* + * GtkOrientable + */ + +// Orientable is a representation of GTK's GtkOrientable GInterface. +type Orientable struct { + *glib.Object +} + +// IOrientable is an interface type implemented by all structs +// embedding an Orientable. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkOrientable. +type IOrientable interface { + toOrientable() *C.GtkOrientable +} + +// native returns a pointer to the underlying GObject as a GtkOrientable. +func (v *Orientable) native() *C.GtkOrientable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkOrientable(p) +} + +func marshalOrientable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapOrientable(obj), nil +} + +func wrapOrientable(obj *glib.Object) *Orientable { + if obj == nil { + return nil + } + + return &Orientable{obj} +} + +// GetOrientation is a wrapper around gtk_orientable_get_orientation(). +func (v *Orientable) GetOrientation() Orientation { + c := C.gtk_orientable_get_orientation(v.native()) + return Orientation(c) +} + +// SetOrientation is a wrapper around gtk_orientable_set_orientation(). +func (v *Orientable) SetOrientation(orientation Orientation) { + C.gtk_orientable_set_orientation(v.native(), + C.GtkOrientation(orientation)) +} + +/* + * GtkOverlay + */ + +// Overlay is a representation of GTK's GtkOverlay. +type Overlay struct { + Bin +} + +// native returns a pointer to the underlying GtkOverlay. +func (v *Overlay) native() *C.GtkOverlay { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkOverlay(p) +} + +func marshalOverlay(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapOverlay(obj), nil +} + +func wrapOverlay(obj *glib.Object) *Overlay { + if obj == nil { + return nil + } + + return &Overlay{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// OverlayNew() is a wrapper around gtk_overlay_new(). +func OverlayNew() (*Overlay, error) { + c := C.gtk_overlay_new() + if c == nil { + return nil, nilPtrErr + } + return wrapOverlay(glib.Take(unsafe.Pointer(c))), nil +} + +// AddOverlay() is a wrapper around gtk_overlay_add_overlay(). +func (v *Overlay) AddOverlay(widget IWidget) { + C.gtk_overlay_add_overlay(v.native(), widget.toWidget()) +} + +/* + * GtkPaned + */ + +// Paned is a representation of GTK's GtkPaned. +type Paned struct { + Bin +} + +// native returns a pointer to the underlying GtkPaned. +func (v *Paned) native() *C.GtkPaned { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkPaned(p) +} + +func marshalPaned(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPaned(obj), nil +} + +func wrapPaned(obj *glib.Object) *Paned { + if obj == nil { + return nil + } + + return &Paned{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// PanedNew() is a wrapper around gtk_paned_new(). +func PanedNew(orientation Orientation) (*Paned, error) { + c := C.gtk_paned_new(C.GtkOrientation(orientation)) + if c == nil { + return nil, nilPtrErr + } + return wrapPaned(glib.Take(unsafe.Pointer(c))), nil +} + +// Add1() is a wrapper around gtk_paned_add1(). +func (v *Paned) Add1(child IWidget) { + C.gtk_paned_add1(v.native(), child.toWidget()) +} + +// Add2() is a wrapper around gtk_paned_add2(). +func (v *Paned) Add2(child IWidget) { + C.gtk_paned_add2(v.native(), child.toWidget()) +} + +// Pack1() is a wrapper around gtk_paned_pack1(). +func (v *Paned) Pack1(child IWidget, resize, shrink bool) { + C.gtk_paned_pack1(v.native(), child.toWidget(), gbool(resize), gbool(shrink)) +} + +// Pack2() is a wrapper around gtk_paned_pack2(). +func (v *Paned) Pack2(child IWidget, resize, shrink bool) { + C.gtk_paned_pack2(v.native(), child.toWidget(), gbool(resize), gbool(shrink)) +} + +// SetPosition() is a wrapper around gtk_paned_set_position(). +func (v *Paned) SetPosition(position int) { + C.gtk_paned_set_position(v.native(), C.gint(position)) +} + +// GetChild1() is a wrapper around gtk_paned_get_child1(). +func (v *Paned) GetChild1() (IWidget, error) { + c := C.gtk_paned_get_child1(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetChild2() is a wrapper around gtk_paned_get_child2(). +func (v *Paned) GetChild2() (IWidget, error) { + c := C.gtk_paned_get_child2(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetHandleWindow() is a wrapper around gtk_paned_get_handle_window(). +func (v *Paned) GetHandleWindow() (*Window, error) { + c := C.gtk_paned_get_handle_window(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// GetPosition() is a wrapper around gtk_paned_get_position(). +func (v *Paned) GetPosition() int { + return int(C.gtk_paned_get_position(v.native())) +} + +/* + * GtkInvisible + */ + +// TODO: +// gtk_invisible_new(). +// gtk_invisible_new_for_screen(). +// gtk_invisible_set_screen(). +// gtk_invisible_get_screen(). + +/* + * GtkProgressBar + */ + +// ProgressBar is a representation of GTK's GtkProgressBar. +type ProgressBar struct { + Widget + // Interfaces + Orientable +} + +// native returns a pointer to the underlying GtkProgressBar. +func (v *ProgressBar) native() *C.GtkProgressBar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkProgressBar(p) +} + +func marshalProgressBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapProgressBar(obj), nil +} + +func wrapProgressBar(obj *glib.Object) *ProgressBar { + if obj == nil { + return nil + } + + o := wrapOrientable(obj) + return &ProgressBar{Widget{glib.InitiallyUnowned{obj}}, *o} +} + +// ProgressBarNew is a wrapper around gtk_progress_bar_new(). +func ProgressBarNew() (*ProgressBar, error) { + c := C.gtk_progress_bar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapProgressBar(glib.Take(unsafe.Pointer(c))), nil +} + +// SetFraction is a wrapper around gtk_progress_bar_set_fraction(). +func (v *ProgressBar) SetFraction(fraction float64) { + C.gtk_progress_bar_set_fraction(v.native(), C.gdouble(fraction)) +} + +// GetFraction is a wrapper around gtk_progress_bar_get_fraction(). +func (v *ProgressBar) GetFraction() float64 { + c := C.gtk_progress_bar_get_fraction(v.native()) + return float64(c) +} + +// SetShowText is a wrapper around gtk_progress_bar_set_show_text(). +func (v *ProgressBar) SetShowText(showText bool) { + C.gtk_progress_bar_set_show_text(v.native(), gbool(showText)) +} + +// GetShowText is a wrapper around gtk_progress_bar_get_show_text(). +func (v *ProgressBar) GetShowText() bool { + c := C.gtk_progress_bar_get_show_text(v.native()) + return gobool(c) +} + +// SetText is a wrapper around gtk_progress_bar_set_text(). +func (v *ProgressBar) SetText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_progress_bar_set_text(v.native(), (*C.gchar)(cstr)) +} + +// TODO: +// gtk_progress_bar_get_text(). +// gtk_progress_bar_set_ellipsize(). +// gtk_progress_bar_get_ellipsize(). + +// SetPulseStep is a wrapper around gtk_progress_bar_set_pulse_step(). +func (v *ProgressBar) SetPulseStep(fraction float64) { + C.gtk_progress_bar_set_pulse_step(v.native(), C.gdouble(fraction)) +} + +// GetPulseStep is a wrapper around gtk_progress_bar_get_pulse_step(). +func (v *ProgressBar) GetPulseStep() float64 { + c := C.gtk_progress_bar_get_pulse_step(v.native()) + return float64(c) +} + +// Pulse is a wrapper arountd gtk_progress_bar_pulse(). +func (v *ProgressBar) Pulse() { + C.gtk_progress_bar_pulse(v.native()) +} + +// SetInverted is a wrapper around gtk_progress_bar_set_inverted(). +func (v *ProgressBar) SetInverted(inverted bool) { + C.gtk_progress_bar_set_inverted(v.native(), gbool(inverted)) +} + +// GetInverted is a wrapper around gtk_progress_bar_get_inverted(). +func (v *ProgressBar) GetInverted() bool { + c := C.gtk_progress_bar_get_inverted(v.native()) + return gobool(c) +} + +/* + * GtkRadioButton + */ + +// RadioButton is a representation of GTK's GtkRadioButton. +type RadioButton struct { + CheckButton +} + +// native returns a pointer to the underlying GtkRadioButton. +func (v *RadioButton) native() *C.GtkRadioButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRadioButton(p) +} + +func marshalRadioButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapRadioButton(obj), nil +} + +func wrapRadioButton(obj *glib.Object) *RadioButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &RadioButton{CheckButton{ToggleButton{Button{Bin{Container{ + Widget{glib.InitiallyUnowned{obj}}}}, actionable}}}} +} + +// RadioButtonNew is a wrapper around gtk_radio_button_new(). +func RadioButtonNew(group *glib.SList) (*RadioButton, error) { + c := C.gtk_radio_button_new(cGSList(group)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioButton(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioButtonNewFromWidget is a wrapper around gtk_radio_button_new_from_widget(). +func RadioButtonNewFromWidget(radioGroupMember *RadioButton) (*RadioButton, error) { + c := C.gtk_radio_button_new_from_widget(radioGroupMember.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioButton(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioButtonNewWithLabel is a wrapper around gtk_radio_button_new_with_label(). +func RadioButtonNewWithLabel(group *glib.SList, label string) (*RadioButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_radio_button_new_with_label(cGSList(group), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioButton(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioButtonNewWithLabelFromWidget is a wrapper around gtk_radio_button_new_with_label_from_widget(). +func RadioButtonNewWithLabelFromWidget(radioGroupMember *RadioButton, label string) (*RadioButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + var cradio *C.GtkRadioButton + if radioGroupMember != nil { + cradio = radioGroupMember.native() + } + c := C.gtk_radio_button_new_with_label_from_widget(cradio, (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioButton(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioButtonNewWithMnemonic is a wrapper around gtk_radio_button_new_with_mnemonic(). +func RadioButtonNewWithMnemonic(group *glib.SList, label string) (*RadioButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_radio_button_new_with_mnemonic(cGSList(group), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioButton(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioButtonNewWithMnemonicFromWidget is a wrapper around gtk_radio_button_new_with_mnemonic_from_widget(). +func RadioButtonNewWithMnemonicFromWidget(radioGroupMember *RadioButton, label string) (*RadioButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + var cradio *C.GtkRadioButton + if radioGroupMember != nil { + cradio = radioGroupMember.native() + } + c := C.gtk_radio_button_new_with_mnemonic_from_widget(cradio, + (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SetGroup is a wrapper around gtk_radio_button_set_group(). +func (v *RadioButton) SetGroup(group *glib.SList) { + C.gtk_radio_button_set_group(v.native(), cGSList(group)) +} + +// GetGroup is a wrapper around gtk_radio_button_get_group(). +func (v *RadioButton) GetGroup() (*glib.SList, error) { + c := C.gtk_radio_button_get_group(v.native()) + if c == nil { + return nil, nilPtrErr + } + + // TODO: call DataWrapper on SList and wrap them to gtk.RadioButton + + return glib.WrapSList(uintptr(unsafe.Pointer(c))), nil +} + +// JoinGroup is a wrapper around gtk_radio_button_join_group(). +func (v *RadioButton) JoinGroup(groupSource *RadioButton) { + var cgroup *C.GtkRadioButton + if groupSource != nil { + cgroup = groupSource.native() + } + C.gtk_radio_button_join_group(v.native(), cgroup) +} + +/* + * GtkRadioMenuItem + */ + +// RadioMenuItem is a representation of GTK's GtkRadioMenuItem. +type RadioMenuItem struct { + CheckMenuItem +} + +// native returns a pointer to the underlying GtkRadioMenuItem. +func (v *RadioMenuItem) native() *C.GtkRadioMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRadioMenuItem(p) +} + +func marshalRadioMenuItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapRadioMenuItem(obj), nil +} + +func wrapRadioMenuItem(obj *glib.Object) *RadioMenuItem { + if obj == nil { + return nil + } + + return &RadioMenuItem{CheckMenuItem{MenuItem{Bin{Container{ + Widget{glib.InitiallyUnowned{obj}}}}}}} +} + +// RadioMenuItemNew is a wrapper around gtk_radio_menu_item_new(). +func RadioMenuItemNew(group *glib.SList) (*RadioMenuItem, error) { + c := C.gtk_radio_menu_item_new(cGSList(group)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioMenuItemNewWithLabel is a wrapper around gtk_radio_menu_item_new_with_label(). +func RadioMenuItemNewWithLabel(group *glib.SList, label string) (*RadioMenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_radio_menu_item_new_with_label(cGSList(group), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioMenuItemNewWithMnemonic is a wrapper around gtk_radio_menu_item_new_with_mnemonic(). +func RadioMenuItemNewWithMnemonic(group *glib.SList, label string) (*RadioMenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_radio_menu_item_new_with_mnemonic(cGSList(group), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioMenuItemNewFromWidget is a wrapper around gtk_radio_menu_item_new_from_widget(). +func RadioMenuItemNewFromWidget(group *RadioMenuItem) (*RadioMenuItem, error) { + c := C.gtk_radio_menu_item_new_from_widget(group.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioMenuItemNewWithLabelFromWidget is a wrapper around gtk_radio_menu_item_new_with_label_from_widget(). +func RadioMenuItemNewWithLabelFromWidget(group *RadioMenuItem, label string) (*RadioMenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_radio_menu_item_new_with_label_from_widget(group.native(), + (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// RadioMenuItemNewWithMnemonicFromWidget is a wrapper around gtk_radio_menu_item_new_with_mnemonic_from_widget(). +func RadioMenuItemNewWithMnemonicFromWidget(group *RadioMenuItem, label string) (*RadioMenuItem, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_radio_menu_item_new_with_mnemonic_from_widget(group.native(), + (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapRadioMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +// SetGroup is a wrapper around gtk_radio_menu_item_set_group(). +func (v *RadioMenuItem) SetGroup(group *glib.SList) { + C.gtk_radio_menu_item_set_group(v.native(), cGSList(group)) +} + +// GetGroup is a wrapper around gtk_radio_menu_item_get_group(). +func (v *RadioMenuItem) GetGroup() (*glib.SList, error) { + c := C.gtk_radio_menu_item_get_group(v.native()) + if c == nil { + return nil, nilPtrErr + } + + // TODO: call DataWrapper on SList and wrap them to gtk.RadioMenuItem + + return glib.WrapSList(uintptr(unsafe.Pointer(c))), nil +} + +/* + * GtkRange + */ + +// Range is a representation of GTK's GtkRange. +type Range struct { + Widget +} + +// native returns a pointer to the underlying GtkRange. +func (v *Range) native() *C.GtkRange { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRange(p) +} + +func marshalRange(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapRange(obj), nil +} + +func wrapRange(obj *glib.Object) *Range { + if obj == nil { + return nil + } + + return &Range{Widget{glib.InitiallyUnowned{obj}}} +} + +// GetFillLevel is a wrapper around gtk_range_get_fill_level(). +func (v *Range) GetFillLevel() float64 { + return float64(C.gtk_range_get_fill_level(v.native())) +} + +// GetRestrictToFillLevel is a wrapper around gtk_range_get_restrict_to_fill_level(). +func (v *Range) GetRestrictToFillLevel() bool { + return gobool(C.gtk_range_get_restrict_to_fill_level(v.native())) +} + +// GetShowFillLevel is a wrapper around gtk_range_get_show_fill_level(). +func (v *Range) GetShowFillLevel() bool { + return gobool(C.gtk_range_get_show_fill_level(v.native())) +} + +// SetFillLevel is a wrapper around gtk_range_set_fill_level(). +func (v *Range) SetFillLevel(fill_level float64) { + C.gtk_range_set_fill_level(v.native(), C.gdouble(fill_level)) +} + +// RestrictToFillLevel is a wrapper around gtk_range_set_restrict_to_fill_level(). +func (v *Range) RestrictToFillLevel(restrict_to_fill_level bool) { + C.gtk_range_set_restrict_to_fill_level(v.native(), gbool(restrict_to_fill_level)) +} + +// SetShowFillLevel is a wrapper around gtk_range_set_show_fill_level(). +func (v *Range) SetShowFillLevel(show_fill_level bool) { + C.gtk_range_set_show_fill_level(v.native(), gbool(show_fill_level)) +} + +// GetAdjustment is a wrapper around gtk_range_get_adjustment(). +func (v *Range) GetAdjustment() *Adjustment { + + c := C.gtk_range_get_adjustment(v.native()) + if c == nil { + return nil + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAdjustment(obj) +} + +// SetAdjustment is a wrapper around gtk_range_set_adjustment(). +func (v *Range) SetAdjustment(adjustment *Adjustment) { + C.gtk_range_set_adjustment(v.native(), adjustment.native()) +} + +// GetValue is a wrapper around gtk_range_get_value(). +func (v *Range) GetValue() float64 { + c := C.gtk_range_get_value(v.native()) + return float64(c) +} + +// SetValue is a wrapper around gtk_range_set_value(). +func (v *Range) SetValue(value float64) { + C.gtk_range_set_value(v.native(), C.gdouble(value)) +} + +// SetIncrements is a wrapper around gtk_range_set_increments(). +func (v *Range) SetIncrements(step, page float64) { + C.gtk_range_set_increments(v.native(), C.gdouble(step), C.gdouble(page)) +} + +// SetRange is a wrapper around gtk_range_set_range(). +func (v *Range) SetRange(min, max float64) { + C.gtk_range_set_range(v.native(), C.gdouble(min), C.gdouble(max)) +} + +// GetInverted is a wrapper around gtk_range_get_inverted(). +func (v *Range) GetInverted() bool { + c := C.gtk_range_get_inverted(v.native()) + return gobool(c) +} + +// SetInverted is a wrapper around gtk_range_set_inverted(). +func (v *Range) SetInverted(inverted bool) { + C.gtk_range_set_inverted(v.native(), gbool(inverted)) +} + +// GetRoundDigits is a wrapper around gtk_range_get_round_digits(). +func (v *Range) GetRoundDigits() int { + return int(C.gtk_range_get_round_digits(v.native())) +} + +// SetRoundDigits is a wrapper around gtk_range_set_round_digits(). +func (v *Range) SetRoundDigits(round_digits int) { + C.gtk_range_set_round_digits(v.native(), C.gint(round_digits)) +} + +// SetLowerStepperSensitivity is a wrapper around gtk_range_set_lower_stepper_sensitivity(). +func (v *Range) SetLowerStepperSensitivity(sensitivity SensitivityType) { + C.gtk_range_set_lower_stepper_sensitivity( + v.native(), + C.GtkSensitivityType(sensitivity)) +} + +// GetLowerStepperSensitivity is a wrapper around gtk_range_get_lower_stepper_sensitivity(). +func (v *Range) GetLowerStepperSensitivity() SensitivityType { + return SensitivityType(C.gtk_range_get_lower_stepper_sensitivity( + v.native())) +} + +// SetUpperStepperSensitivity is a wrapper around gtk_range_set_upper_stepper_sensitivity(). +func (v *Range) SetUpperStepperSensitivity(sensitivity SensitivityType) { + C.gtk_range_set_upper_stepper_sensitivity( + v.native(), + C.GtkSensitivityType(sensitivity)) +} + +// GetUpperStepperSensitivity is a wrapper around gtk_range_get_upper_stepper_sensitivity(). +func (v *Range) GetUpperStepperSensitivity() SensitivityType { + return SensitivityType(C.gtk_range_get_upper_stepper_sensitivity( + v.native())) +} + +// GetFlippable is a wrapper around gtk_range_get_flippable(). +func (v *Range) GetFlippable() bool { + return gobool(C.gtk_range_get_flippable(v.native())) +} + +// SetFlippable is a wrapper around gtk_range_set_flippable(). +func (v *Range) SetFlippable(flippable bool) { + C.gtk_range_set_flippable(v.native(), gbool(flippable)) +} + +// GetRangeRect is a wrapper around gtk_range_get_range_rect(). +func (v *Range) GetRangeRect() *gdk.Rectangle { + var cRect *C.GdkRectangle + C.gtk_range_get_range_rect(v.native(), cRect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) +} + +// GetSliderRange is a wrapper around gtk_range_get_slider_range(). +func (v *Range) GetSliderRange() (int, int) { + var cStart, cEnd C.gint + C.gtk_range_get_slider_range(v.native(), &cStart, &cEnd) + return int(cStart), int(cEnd) +} + +// GetSliderFixedSize is a wrapper gtk_range_get_slider_size_fixed(). +func (v *Range) GetSliderFixedSize() bool { + return gobool(C.gtk_range_get_slider_size_fixed(v.native())) +} + +// SetSliderFixedSize is a wrapper around gtk_range_set_slider_size_fixed(). +func (v *Range) SetSliderFixedSize(size_fixed bool) { + C.gtk_range_set_slider_size_fixed(v.native(), gbool(size_fixed)) +} + +// IRecentChooser is an interface type implemented by all structs +// embedding a RecentChooser. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkWidget. +type IRecentChooser interface { + toRecentChooser() *C.GtkRecentChooser +} + +/* + * GtkRecentChooser + */ + +// RecentChooser is a representation of GTK's GtkRecentChooser. +type RecentChooser struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkRecentChooser. +func (v *RecentChooser) native() *C.GtkRecentChooser { + if v == nil || v.Object == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRecentChooser(p) +} + +func wrapRecentChooser(obj *glib.Object) *RecentChooser { + if obj == nil { + return nil + } + + return &RecentChooser{obj} +} + +func (v *RecentChooser) toRecentChooser() *C.GtkRecentChooser { + return v.native() +} + +func (v *RecentChooser) GetCurrentUri() string { + curi := C.gtk_recent_chooser_get_current_uri(v.native()) + return goString(curi) +} + +func (v *RecentChooser) AddFilter(filter *RecentFilter) { + C.gtk_recent_chooser_add_filter(v.native(), filter.native()) +} + +func (v *RecentChooser) RemoveFilter(filter *RecentFilter) { + C.gtk_recent_chooser_remove_filter(v.native(), filter.native()) +} + +/* + * GtkRecentChooserWidget + */ + +// TODO: +// gtk_recent_chooser_widget_new(). +// gtk_recent_chooser_widget_new_for_manager(). + +/* + * GtkRecentChooserMenu + */ + +// RecentChooserMenu is a representation of GTK's GtkRecentChooserMenu. +type RecentChooserMenu struct { + Menu + RecentChooser +} + +// native returns a pointer to the underlying GtkRecentManager. +func (v *RecentChooserMenu) native() *C.GtkRecentChooserMenu { + if v == nil || v.Object == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRecentChooserMenu(p) +} + +func wrapRecentChooserMenu(obj *glib.Object) *RecentChooserMenu { + if obj == nil { + return nil + } + + return &RecentChooserMenu{ + Menu{MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}}}, + RecentChooser{obj}, + } +} + +/* + * GtkRecentFilter + */ + +// RecentFilter is a representation of GTK's GtkRecentFilter. +type RecentFilter struct { + glib.InitiallyUnowned +} + +// native returns a pointer to the underlying GtkRecentFilter. +func (v *RecentFilter) native() *C.GtkRecentFilter { + if v == nil || v.Object == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRecentFilter(p) +} + +func wrapRecentFilter(obj *glib.Object) *RecentFilter { + if obj == nil { + return nil + } + + return &RecentFilter{glib.InitiallyUnowned{obj}} +} + +// RecentFilterNew is a wrapper around gtk_recent_filter_new(). +func RecentFilterNew() (*RecentFilter, error) { + c := C.gtk_recent_filter_new() + if c == nil { + return nil, nilPtrErr + } + return wrapRecentFilter(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkRecentManager + */ + +// RecentManager is a representation of GTK's GtkRecentManager. +type RecentManager struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkRecentManager. +func (v *RecentManager) native() *C.GtkRecentManager { + if v == nil || v.Object == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRecentManager(p) +} + +func marshalRecentManager(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapRecentManager(obj), nil +} + +func wrapRecentManager(obj *glib.Object) *RecentManager { + if obj == nil { + return nil + } + + return &RecentManager{obj} +} + +// RecentManagerGetDefault is a wrapper around gtk_recent_manager_get_default(). +func RecentManagerGetDefault() (*RecentManager, error) { + c := C.gtk_recent_manager_get_default() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + v := wrapRecentManager(obj) + return v, nil +} + +// AddItem is a wrapper around gtk_recent_manager_add_item(). +func (v *RecentManager) AddItem(fileURI string) bool { + cstr := C.CString(fileURI) + defer C.free(unsafe.Pointer(cstr)) + cok := C.gtk_recent_manager_add_item(v.native(), (*C.gchar)(cstr)) + return gobool(cok) +} + +/* + * GtkScale + */ + +// Scale is a representation of GTK's GtkScale. +type Scale struct { + Range +} + +// native returns a pointer to the underlying GtkScale. +func (v *Scale) native() *C.GtkScale { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScale(p) +} + +func marshalScale(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapScale(obj), nil +} + +func wrapScale(obj *glib.Object) *Scale { + if obj == nil { + return nil + } + + return &Scale{Range{Widget{glib.InitiallyUnowned{obj}}}} +} + +// ScaleNew is a wrapper around gtk_scale_new(). +func ScaleNew(orientation Orientation, adjustment *Adjustment) (*Scale, error) { + c := C.gtk_scale_new(C.GtkOrientation(orientation), adjustment.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapScale(glib.Take(unsafe.Pointer(c))), nil +} + +// ScaleNewWithRange is a wrapper around gtk_scale_new_with_range(). +func ScaleNewWithRange(orientation Orientation, min, max, step float64) (*Scale, error) { + c := C.gtk_scale_new_with_range(C.GtkOrientation(orientation), + C.gdouble(min), C.gdouble(max), C.gdouble(step)) + + if c == nil { + return nil, nilPtrErr + } + return wrapScale(glib.Take(unsafe.Pointer(c))), nil +} + +// TODO: +// gtk_scale_set_digits(). + +// SetDrawValue is a wrapper around gtk_scale_set_draw_value(). +func (v *Scale) SetDrawValue(drawValue bool) { + C.gtk_scale_set_draw_value(v.native(), gbool(drawValue)) +} + +// TODO: +// gtk_scale_set_has_origin(). +// gtk_scale_set_value_pos(). +// gtk_scale_get_digits(). +// gtk_scale_get_draw_value(). +// gtk_scale_get_has_origin(). +// gtk_scale_get_value_pos(). +// gtk_scale_get_layout(). +// gtk_scale_get_layout_offsets(). + +// AddMark is a wrpaper around gtk_scale_add_mark. +func (v *Scale) AddMark(value float64, pos PositionType, markup string) { + var markupchar *C.gchar + if markup != "" { + markupchar = (*C.gchar)(C.CString(markup)) + defer C.free(unsafe.Pointer(markupchar)) + } + + C.gtk_scale_add_mark(v.native(), C.gdouble(value), C.GtkPositionType(pos), markupchar) +} + +// ClearMarks is a wrapper around gtk_scale_clear_marks. +func (v *Scale) ClearMarks() { + C.gtk_scale_clear_marks(v.native()) +} + +/* + * GtkScaleButton + */ + +// ScaleButton is a representation of GTK's GtkScaleButton. +type ScaleButton struct { + Button +} + +// native returns a pointer to the underlying GtkScaleButton. +func (v *ScaleButton) native() *C.GtkScaleButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScaleButton(p) +} + +func marshalScaleButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapScaleButton(obj), nil +} + +func wrapScaleButton(obj *glib.Object) *ScaleButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &ScaleButton{Button{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, actionable}} +} + +// ScaleButtonNew is a wrapper around gtk_scale_button_new(). +func ScaleButtonNew(size IconSize, min, max, step float64, icons []string) (*ScaleButton, error) { + cicons := make([]*C.gchar, len(icons)) + for i, icon := range icons { + cicons[i] = (*C.gchar)(C.CString(icon)) + defer C.free(unsafe.Pointer(cicons[i])) + } + cicons = append(cicons, nil) + + c := C.gtk_scale_button_new(C.GtkIconSize(size), + C.gdouble(min), + C.gdouble(max), + C.gdouble(step), + &cicons[0]) + if c == nil { + return nil, nilPtrErr + } + return wrapScaleButton(glib.Take(unsafe.Pointer(c))), nil +} + +// GetPopup is a wrapper around gtk_scale_button_get_popup(). +func (v *ScaleButton) GetPopup() (IWidget, error) { + c := C.gtk_scale_button_get_popup(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// GetValue is a wrapper around gtk_scale_button_get_value(). +func (v *ScaleButton) GetValue() float64 { + return float64(C.gtk_scale_button_get_value(v.native())) +} + +// SetValue is a wrapper around gtk_scale_button_set_value(). +func (v *ScaleButton) SetValue(value float64) { + C.gtk_scale_button_set_value(v.native(), C.gdouble(value)) +} + +// SetIcons is a wrapper around gtk_scale_button_set_icons(). +func (v *ScaleButton) SetIcons() []string { + var iconNames *C.gchar = nil + C.gtk_scale_button_set_icons(v.native(), &iconNames) + return toGoStringArray(&iconNames) +} + +// GetAdjustment is a wrapper around gtk_scale_button_get_adjustment(). +func (v *ScaleButton) GetAdjustment() *Adjustment { + c := C.gtk_scale_button_get_adjustment(v.native()) + obj := glib.Take(unsafe.Pointer(c)) + return &Adjustment{glib.InitiallyUnowned{obj}} +} + +// SetAdjustment is a wrapper around gtk_scale_button_set_adjustment(). +func (v *ScaleButton) SetAdjustment(adjustment *Adjustment) { + C.gtk_scale_button_set_adjustment(v.native(), adjustment.native()) +} + +// GetPlusButton is a wrapper around gtk_scale_button_get_plus_button(). +func (v *ScaleButton) GetPlusButton() (IWidget, error) { + c := C.gtk_scale_button_get_plus_button(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// GetMinusButton is a wrapper around gtk_scale_button_get_minus_button(). +func (v *ScaleButton) GetMinusButton() (IWidget, error) { + c := C.gtk_scale_button_get_minus_button(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +/* + * GtkScrollable + */ + +// IScrollable is an interface type implemented by all structs +// embedding a Scrollable. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkScrollable. +type IScrollable interface { + toScrollable() *C.GtkScrollable +} + +// Scrollable is a representation of GTK's GtkScrollable GInterface. +type Scrollable struct { + *glib.Object +} + +// native() returns a pointer to the underlying GObject as a GtkScrollable. +func (v *Scrollable) native() *C.GtkScrollable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScrollable(p) +} + +func wrapScrollable(obj *glib.Object) *Scrollable { + if obj == nil { + return nil + } + + return &Scrollable{obj} +} + +func (v *Scrollable) toScrollable() *C.GtkScrollable { + if v == nil { + return nil + } + return v.native() +} + +// SetHAdjustment is a wrapper around gtk_scrollable_set_hadjustment(). +func (v *Scrollable) SetHAdjustment(adjustment *Adjustment) { + C.gtk_scrollable_set_hadjustment(v.native(), adjustment.native()) +} + +// GetHAdjustment is a wrapper around gtk_scrollable_get_hadjustment(). +func (v *Scrollable) GetHAdjustment() (*Adjustment, error) { + c := C.gtk_scrollable_get_hadjustment(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapAdjustment(glib.Take(unsafe.Pointer(c))), nil +} + +// SetVAdjustment is a wrapper around gtk_scrollable_set_vadjustment(). +func (v *Scrollable) SetVAdjustment(adjustment *Adjustment) { + C.gtk_scrollable_set_vadjustment(v.native(), adjustment.native()) +} + +// GetVAdjustment is a wrapper around gtk_scrollable_get_vadjustment(). +func (v *Scrollable) GetVAdjustment() (*Adjustment, error) { + c := C.gtk_scrollable_get_vadjustment(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapAdjustment(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkScrollbar + */ + +// Scrollbar is a representation of GTK's GtkScrollbar. +type Scrollbar struct { + Range +} + +// native returns a pointer to the underlying GtkScrollbar. +func (v *Scrollbar) native() *C.GtkScrollbar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScrollbar(p) +} + +func marshalScrollbar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapScrollbar(obj), nil +} + +func wrapScrollbar(obj *glib.Object) *Scrollbar { + if obj == nil { + return nil + } + + return &Scrollbar{Range{Widget{glib.InitiallyUnowned{obj}}}} +} + +// ScrollbarNew is a wrapper around gtk_scrollbar_new(). +func ScrollbarNew(orientation Orientation, adjustment *Adjustment) (*Scrollbar, error) { + c := C.gtk_scrollbar_new(C.GtkOrientation(orientation), adjustment.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapScrollbar(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkScrolledWindow + */ + +// ScrolledWindow is a representation of GTK's GtkScrolledWindow. +type ScrolledWindow struct { + Bin +} + +// native returns a pointer to the underlying GtkScrolledWindow. +func (v *ScrolledWindow) native() *C.GtkScrolledWindow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkScrolledWindow(p) +} + +func marshalScrolledWindow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapScrolledWindow(obj), nil +} + +func wrapScrolledWindow(obj *glib.Object) *ScrolledWindow { + if obj == nil { + return nil + } + + return &ScrolledWindow{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// ScrolledWindowNew() is a wrapper around gtk_scrolled_window_new(). +func ScrolledWindowNew(hadjustment, vadjustment *Adjustment) (*ScrolledWindow, error) { + c := C.gtk_scrolled_window_new(hadjustment.native(), + vadjustment.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapScrolledWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// GetPolicy() is a wrapper around gtk_scrolled_window_get_policy(). +func (v *ScrolledWindow) GetPolicy() (hScrollbarPolicy, vScrollbarPolicy PolicyType) { + var hScrPol, vScrPol C.GtkPolicyType + C.gtk_scrolled_window_get_policy(v.native(), &hScrPol, &vScrPol) + hScrollbarPolicy, vScrollbarPolicy = PolicyType(hScrPol), PolicyType(vScrPol) + return +} + +// SetPolicy() is a wrapper around gtk_scrolled_window_set_policy(). +func (v *ScrolledWindow) SetPolicy(hScrollbarPolicy, vScrollbarPolicy PolicyType) { + C.gtk_scrolled_window_set_policy(v.native(), + C.GtkPolicyType(hScrollbarPolicy), + C.GtkPolicyType(vScrollbarPolicy)) +} + +// GetHAdjustment() is a wrapper around gtk_scrolled_window_get_hadjustment(). +func (v *ScrolledWindow) GetHAdjustment() *Adjustment { + c := C.gtk_scrolled_window_get_hadjustment(v.native()) + if c == nil { + return nil + } + return wrapAdjustment(glib.Take(unsafe.Pointer(c))) +} + +// SetHAdjustment is a wrapper around gtk_scrolled_window_set_hadjustment(). +func (v *ScrolledWindow) SetHAdjustment(adjustment *Adjustment) { + C.gtk_scrolled_window_set_hadjustment(v.native(), adjustment.native()) +} + +// GetVAdjustment() is a wrapper around gtk_scrolled_window_get_vadjustment(). +func (v *ScrolledWindow) GetVAdjustment() *Adjustment { + c := C.gtk_scrolled_window_get_vadjustment(v.native()) + if c == nil { + return nil + } + return wrapAdjustment(glib.Take(unsafe.Pointer(c))) +} + +// SetVAdjustment is a wrapper around gtk_scrolled_window_set_vadjustment(). +func (v *ScrolledWindow) SetVAdjustment(adjustment *Adjustment) { + C.gtk_scrolled_window_set_vadjustment(v.native(), adjustment.native()) +} + +// GetHScrollbar is a wrapper around gtk_scrolled_window_get_hscrollbar(). +func (v *ScrolledWindow) GetHScrollbar() *Scrollbar { + c := C.gtk_scrolled_window_get_hscrollbar(v.native()) + if c == nil { + return nil + } + return wrapScrollbar(glib.Take(unsafe.Pointer(c))) +} + +// GetVScrollbar is a wrapper around gtk_scrolled_window_get_vscrollbar(). +func (v *ScrolledWindow) GetVScrollbar() *Scrollbar { + c := C.gtk_scrolled_window_get_vscrollbar(v.native()) + if c == nil { + return nil + } + return wrapScrollbar(glib.Take(unsafe.Pointer(c))) +} + +// GetPlacement is a wrapper around gtk_scrolled_window_get_placement(). +func (v *ScrolledWindow) GetPlacement() CornerType { + c := C.gtk_scrolled_window_get_placement(v.native()) + return CornerType(c) +} + +// SetPlacement is a wrapper around gtk_scrolled_window_set_placement(). +func (v *ScrolledWindow) SetPlacement(windowPlacement CornerType) { + C.gtk_scrolled_window_set_placement(v.native(), C.GtkCornerType(windowPlacement)) +} + +// UnsetPlacement is a wrapper around gtk_scrolled_window_unset_placement(). +func (v *ScrolledWindow) UnsetPlacement() { + C.gtk_scrolled_window_unset_placement(v.native()) +} + +// GetShadowType is a wrapper around gtk_scrolled_window_get_shadow_type(). +func (v *ScrolledWindow) GetShadowType() ShadowType { + c := C.gtk_scrolled_window_get_shadow_type(v.native()) + return ShadowType(c) +} + +// SetShadowType is a wrapper around gtk_scrolled_window_set_shadow_type(). +func (v *ScrolledWindow) SetShadowType(t ShadowType) { + C.gtk_scrolled_window_set_shadow_type(v.native(), C.GtkShadowType(t)) +} + +// GetKineticScrolling is a wrapper around gtk_scrolled_window_get_kinetic_scrolling(). +func (v *ScrolledWindow) GetKineticScrolling() bool { + c := C.gtk_scrolled_window_get_kinetic_scrolling(v.native()) + return gobool(c) +} + +// SetKineticScrolling is a wrapper around gtk_scrolled_window_set_kinetic_scrolling(). +func (v *ScrolledWindow) SetKineticScrolling(kineticScrolling bool) { + C.gtk_scrolled_window_set_kinetic_scrolling(v.native(), gbool(kineticScrolling)) +} + +// GetCaptureButtonPress is a wrapper around gtk_scrolled_window_get_capture_button_press(). +func (v *ScrolledWindow) GetCaptureButtonPress() bool { + c := C.gtk_scrolled_window_get_capture_button_press(v.native()) + return gobool(c) +} + +// SetCaptureButtonPress is a wrapper around gtk_scrolled_window_set_capture_button_press(). +func (v *ScrolledWindow) SetCaptureButtonPress(captureButtonPress bool) { + C.gtk_scrolled_window_set_capture_button_press(v.native(), gbool(captureButtonPress)) +} + +// GetMinContentWidth is a wrapper around gtk_scrolled_window_get_min_content_width(). +func (v *ScrolledWindow) GetMinContentWidth() int { + c := C.gtk_scrolled_window_get_min_content_width(v.native()) + return int(c) +} + +// SetMinContentWidth is a wrapper around gtk_scrolled_window_set_min_content_width(). +func (v *ScrolledWindow) SetMinContentWidth(width int) { + C.gtk_scrolled_window_set_min_content_width(v.native(), C.gint(width)) +} + +// GetMinContentHeight is a wrapper around gtk_scrolled_window_get_min_content_height(). +func (v *ScrolledWindow) GetMinContentHeight() int { + c := C.gtk_scrolled_window_get_min_content_height(v.native()) + return int(c) +} + +// SetMinContentHeight is a wrapper around gtk_scrolled_window_set_min_content_height(). +func (v *ScrolledWindow) SetMinContentHeight(width int) { + C.gtk_scrolled_window_set_min_content_height(v.native(), C.gint(width)) +} + +/* + * GtkSearchEntry + */ + +// SearchEntry is a reprensentation of GTK's GtkSearchEntry. +type SearchEntry struct { + Entry +} + +// native returns a pointer to the underlying GtkSearchEntry. +func (v *SearchEntry) native() *C.GtkSearchEntry { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSearchEntry(p) +} + +func marshalSearchEntry(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSearchEntry(obj), nil +} + +func wrapSearchEntry(obj *glib.Object) *SearchEntry { + if obj == nil { + return nil + } + + e := wrapEditable(obj) + ce := wrapCellEditable(obj) + return &SearchEntry{Entry{Widget{glib.InitiallyUnowned{obj}}, *e, *ce}} +} + +// SearchEntryNew is a wrapper around gtk_search_entry_new(). +func SearchEntryNew() (*SearchEntry, error) { + c := C.gtk_search_entry_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSearchEntry(glib.Take(unsafe.Pointer(c))), nil +} + +/* +* GtkSelectionData + */ +type SelectionData struct { + GtkSelectionData *C.GtkSelectionData +} + +func marshalSelectionData(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return (*SelectionData)(unsafe.Pointer(c)), nil +} + +// native returns a pointer to the underlying GtkSelectionData. +func (v *SelectionData) native() *C.GtkSelectionData { + if v == nil { + return nil + } + + // I don't understand why we need this, but we do. + c := (*C.GValue)(unsafe.Pointer(v)) + p := (*C.GtkSelectionData)(unsafe.Pointer(c)) + return p +} + +// GetLength is a wrapper around gtk_selection_data_get_length(). +func (v *SelectionData) GetLength() int { + return int(C.gtk_selection_data_get_length(v.native())) +} + +// GetData is a wrapper around gtk_selection_data_get_data_with_length(). +// It returns a slice of the correct size with the copy of the selection's data. +func (v *SelectionData) GetData() []byte { + var length C.gint + c := C.gtk_selection_data_get_data_with_length(v.native(), &length) + + // Only set if length is valid. + if int(length) < 1 { + return nil + } + + var data []byte + sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&data)) + sliceHeader.Len = int(length) + sliceHeader.Cap = int(length) + sliceHeader.Data = uintptr(unsafe.Pointer(c)) + + // Keep the SelectionData alive for as long as the byte slice is. + runtime.SetFinalizer(&data, func(*[]byte) { + runtime.KeepAlive(v) + }) + + return data +} + +// SetData is a wrapper around gtk_selection_data_set_data_with_length(). +func (v *SelectionData) SetData(atom gdk.Atom, data []byte) { + C.gtk_selection_data_set( + v.native(), + C.GdkAtom(unsafe.Pointer(atom)), + C.gint(8), (*C.guchar)(&data[0]), C.gint(len(data)), + ) +} + +// GetText is a wrapper around gtk_selection_data_get_text(). It returns a copy +// of the string from SelectionData and frees the C reference. +func (v *SelectionData) GetText() string { + charptr := C.gtk_selection_data_get_text(v.native()) + if charptr == nil { + return "" + } + + defer C.g_free(C.gpointer(charptr)) + + return ucharString(charptr) +} + +// SetText is a wrapper around gtk_selection_data_set_text(). +func (v *SelectionData) SetText(text string) bool { + textPtr := *(*[]byte)(unsafe.Pointer(&text)) + + return gobool(C.gtk_selection_data_set_text( + v.native(), + // https://play.golang.org/p/PmGaLDhRuEU + // This is probably safe since we expect Gdk to copy the string anyway. + (*C.gchar)(unsafe.Pointer(&textPtr[0])), C.int(len(text)), + )) +} + +// SetPixbuf is a wrapper around gtk_selection_data_set_pixbuf(). +func (v *SelectionData) SetPixbuf(pixbuf *gdk.Pixbuf) bool { + return gobool(C.gtk_selection_data_set_pixbuf( + v.native(), + (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native())), + )) +} + +// GetPixbuf is a wrapper around gtk_selection_data_get_pixbuf(). It returns nil +// if the data is a recognized image type that could be converted to a new +// Pixbuf. +func (v *SelectionData) GetPixbuf() *gdk.Pixbuf { + c := C.gtk_selection_data_get_pixbuf(v.native()) + if c == nil { + return nil + } + + obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))} + p := &gdk.Pixbuf{obj} + runtime.SetFinalizer(p, func(_ interface{}) { obj.Unref() }) + + return p +} + +// SetURIs is a wrapper around gtk_selection_data_set_uris(). +func (v *SelectionData) SetURIs(uris []string) bool { + var clist = C.make_strings(C.int(len(uris))) + for i := range uris { + cstring := C.CString(uris[i]) + // This defer will only run once the function exits, not once the loop + // exits, so it's perfectly fine. + defer C.free(unsafe.Pointer(cstring)) + + C.set_string(clist, C.int(i), (*C.gchar)(cstring)) + } + + return gobool(C.gtk_selection_data_set_uris(v.native(), clist)) +} + +// GetURIs is a wrapper around gtk_selection_data_get_uris(). +func (v *SelectionData) GetURIs() []string { + uriPtrs := C.gtk_selection_data_get_uris(v.native()) + return toGoStringArray(uriPtrs) +} + +func (v *SelectionData) free() { + C.gtk_selection_data_free(v.native()) +} + +// DragSetIconPixbuf is used for the "drag-begin" event. It is a wrapper around +// gtk_drag_set_icon_pixbuf(). +func DragSetIconPixbuf(context *gdk.DragContext, pixbuf *gdk.Pixbuf, hotX, hotY int) { + ctx := unsafe.Pointer(context.Native()) + pix := unsafe.Pointer(pixbuf.Native()) + C.gtk_drag_set_icon_pixbuf((*C.GdkDragContext)(ctx), (*C.GdkPixbuf)(pix), C.gint(hotX), C.gint(hotY)) +} + +// DragSetIconWidget is a wrapper around gtk_drag_set_icon_widget(). +func DragSetIconWidget(context *gdk.DragContext, w IWidget, hotX, hotY int) { + ctx := unsafe.Pointer(context.Native()) + C.gtk_drag_set_icon_widget((*C.GdkDragContext)(ctx), w.toWidget(), C.gint(hotX), C.gint(hotY)) +} + +// DragSetIconSurface is a wrapper around gtk_drag_set_icon_surface(). +func DragSetIconSurface(context *gdk.DragContext, surface *cairo.Surface) { + ctx := unsafe.Pointer(context.Native()) + sur := unsafe.Pointer(surface.Native()) + C.gtk_drag_set_icon_surface((*C.GdkDragContext)(ctx), (*C.cairo_surface_t)(sur)) +} + +// DragSetIconName is a wrapper around gtk_drag_set_icon_name(). +func DragSetIconName(context *gdk.DragContext, iconName string, hotX, hotY int) { + ctx := unsafe.Pointer(context.Native()) + ico := (*C.gchar)(C.CString(iconName)) + defer C.free(unsafe.Pointer(ico)) + + C.gtk_drag_set_icon_name((*C.GdkDragContext)(ctx), ico, C.gint(hotX), C.gint(hotY)) +} + +// DragSetIconDefault is a wrapper around gtk_drag_set_icon_default(). +func DragSetIconDefault(context *gdk.DragContext) { + ctx := unsafe.Pointer(context.Native()) + C.gtk_drag_set_icon_default((*C.GdkDragContext)(ctx)) +} + +/* + * GtkSeparator + */ + +// Separator is a representation of GTK's GtkSeparator. +type Separator struct { + Widget +} + +// native returns a pointer to the underlying GtkSeperator. +func (v *Separator) native() *C.GtkSeparator { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSeparator(p) +} + +func marshalSeparator(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSeparator(obj), nil +} + +func wrapSeparator(obj *glib.Object) *Separator { + if obj == nil { + return nil + } + + return &Separator{Widget{glib.InitiallyUnowned{obj}}} +} + +// SeparatorNew is a wrapper around gtk_separator_new(). +func SeparatorNew(orientation Orientation) (*Separator, error) { + c := C.gtk_separator_new(C.GtkOrientation(orientation)) + if c == nil { + return nil, nilPtrErr + } + return wrapSeparator(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkSeparatorMenuItem + */ + +// SeparatorMenuItem is a representation of GTK's GtkSeparatorMenuItem. +type SeparatorMenuItem struct { + MenuItem +} + +// native returns a pointer to the underlying GtkSeparatorMenuItem. +func (v *SeparatorMenuItem) native() *C.GtkSeparatorMenuItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSeparatorMenuItem(p) +} + +func marshalSeparatorMenuItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSeparatorMenuItem(obj), nil +} + +func wrapSeparatorMenuItem(obj *glib.Object) *SeparatorMenuItem { + if obj == nil { + return nil + } + + return &SeparatorMenuItem{MenuItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// SeparatorMenuItemNew is a wrapper around gtk_separator_menu_item_new(). +func SeparatorMenuItemNew() (*SeparatorMenuItem, error) { + c := C.gtk_separator_menu_item_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSeparatorMenuItem(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkSeparatorToolItem + */ + +// SeparatorToolItem is a representation of GTK's GtkSeparatorToolItem. +type SeparatorToolItem struct { + ToolItem +} + +// native returns a pointer to the underlying GtkSeparatorToolItem. +func (v *SeparatorToolItem) native() *C.GtkSeparatorToolItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSeparatorToolItem(p) +} + +func marshalSeparatorToolItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSeparatorToolItem(obj), nil +} + +func wrapSeparatorToolItem(obj *glib.Object) *SeparatorToolItem { + if obj == nil { + return nil + } + + return &SeparatorToolItem{ToolItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}} +} + +// SeparatorToolItemNew is a wrapper around gtk_separator_tool_item_new(). +func SeparatorToolItemNew() (*SeparatorToolItem, error) { + c := C.gtk_separator_tool_item_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSeparatorToolItem(glib.Take(unsafe.Pointer(c))), nil +} + +// SetDraw is a wrapper around gtk_separator_tool_item_set_draw(). +func (v *SeparatorToolItem) SetDraw(draw bool) { + C.gtk_separator_tool_item_set_draw(v.native(), gbool(draw)) +} + +// GetDraw is a wrapper around gtk_separator_tool_item_get_draw(). +func (v *SeparatorToolItem) GetDraw() bool { + c := C.gtk_separator_tool_item_get_draw(v.native()) + return gobool(c) +} + +/* + * GtkSizeGroup + */ + +// SizeGroup is a representation of GTK's GtkSizeGroup +type SizeGroup struct { + *glib.Object +} + +// native() returns a pointer to the underlying GtkSizeGroup +func (v *SizeGroup) native() *C.GtkSizeGroup { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSizeGroup(p) +} + +func marshalSizeGroup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return &SizeGroup{obj}, nil +} + +func wrapSizeGroup(obj *glib.Object) *SizeGroup { + if obj == nil { + return nil + } + + return &SizeGroup{obj} +} + +// SizeGroupNew is a wrapper around gtk_size_group_new(). +func SizeGroupNew(mode SizeGroupMode) (*SizeGroup, error) { + c := C.gtk_size_group_new(C.GtkSizeGroupMode(mode)) + if c == nil { + return nil, nilPtrErr + } + return wrapSizeGroup(glib.Take(unsafe.Pointer(c))), nil +} + +func (v *SizeGroup) SetMode(mode SizeGroupMode) { + C.gtk_size_group_set_mode(v.native(), C.GtkSizeGroupMode(mode)) +} + +func (v *SizeGroup) GetMode() SizeGroupMode { + return SizeGroupMode(C.gtk_size_group_get_mode(v.native())) +} + +func (v *SizeGroup) AddWidget(widget IWidget) { + C.gtk_size_group_add_widget(v.native(), widget.toWidget()) +} + +func (v *SizeGroup) RemoveWidget(widget IWidget) { + C.gtk_size_group_remove_widget(v.native(), widget.toWidget()) +} + +func (v *SizeGroup) GetWidgets() *glib.SList { + c := C.gtk_size_group_get_widgets(v.native()) + if c == nil { + return nil + } + + // TODO: call DataWrapper on SList and wrap them to gtk.IWidget + // see (v *Container) GetFocusChain() + + return glib.WrapSList(uintptr(unsafe.Pointer(c))) +} + +/* + * GtkSpinButton + */ + +// SpinButton is a representation of GTK's GtkSpinButton. +type SpinButton struct { + Entry + Orientable +} + +// native returns a pointer to the underlying GtkSpinButton. +func (v *SpinButton) native() *C.GtkSpinButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSpinButton(p) +} + +func marshalSpinButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSpinButton(obj), nil +} + +func wrapSpinButton(obj *glib.Object) *SpinButton { + if obj == nil { + return nil + } + + e := wrapEditable(obj) + ce := wrapCellEditable(obj) + o := wrapOrientable(obj) + return &SpinButton{Entry{Widget{glib.InitiallyUnowned{obj}}, *e, *ce}, *o} +} + +// Configure is a wrapper around gtk_spin_button_configure(). +func (v *SpinButton) Configure(adjustment *Adjustment, climbRate float64, digits uint) { + C.gtk_spin_button_configure(v.native(), adjustment.native(), + C.gdouble(climbRate), C.guint(digits)) +} + +// SpinButtonNew is a wrapper around gtk_spin_button_new(). +func SpinButtonNew(adjustment *Adjustment, climbRate float64, digits uint) (*SpinButton, error) { + c := C.gtk_spin_button_new(adjustment.native(), + C.gdouble(climbRate), C.guint(digits)) + if c == nil { + return nil, nilPtrErr + } + return wrapSpinButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SpinButtonNewWithRange is a wrapper around gtk_spin_button_new_with_range(). +func SpinButtonNewWithRange(min, max, step float64) (*SpinButton, error) { + c := C.gtk_spin_button_new_with_range(C.gdouble(min), C.gdouble(max), + C.gdouble(step)) + if c == nil { + return nil, nilPtrErr + } + return wrapSpinButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SetAdjustment() is a wrapper around gtk_spin_button_set_adjustment(). +func (v *SpinButton) SetAdjustment(adjustment *Adjustment) { + C.gtk_spin_button_set_adjustment(v.native(), adjustment.native()) +} + +// GetAdjustment() is a wrapper around gtk_spin_button_get_adjustment +func (v *SpinButton) GetAdjustment() *Adjustment { + c := C.gtk_spin_button_get_adjustment(v.native()) + if c == nil { + return nil + } + return wrapAdjustment(glib.Take(unsafe.Pointer(c))) +} + +// SetDigits() is a wrapper around gtk_spin_button_set_digits(). +func (v *SpinButton) SetDigits(digits uint) { + C.gtk_spin_button_set_digits(v.native(), C.guint(digits)) +} + +// SetIncrements() is a wrapper around gtk_spin_button_set_increments(). +func (v *SpinButton) SetIncrements(step, page float64) { + C.gtk_spin_button_set_increments(v.native(), C.gdouble(step), C.gdouble(page)) +} + +// SetRange is a wrapper around gtk_spin_button_set_range(). +func (v *SpinButton) SetRange(min, max float64) { + C.gtk_spin_button_set_range(v.native(), C.gdouble(min), C.gdouble(max)) +} + +// SetValue() is a wrapper around gtk_spin_button_set_value(). +func (v *SpinButton) SetValue(value float64) { + C.gtk_spin_button_set_value(v.native(), C.gdouble(value)) +} + +// GetValue() is a wrapper around gtk_spin_button_get_value(). +func (v *SpinButton) GetValue() float64 { + c := C.gtk_spin_button_get_value(v.native()) + return float64(c) +} + +// GetValueAsInt is a wrapper around gtk_spin_button_get_value_as_int(). +func (v *SpinButton) GetValueAsInt() int { + c := C.gtk_spin_button_get_value_as_int(v.native()) + return int(c) +} + +// SetUpdatePolicy() is a wrapper around gtk_spin_button_set_update_policy(). +func (v *SpinButton) SetUpdatePolicy(policy SpinButtonUpdatePolicy) { + C.gtk_spin_button_set_update_policy( + v.native(), + C.GtkSpinButtonUpdatePolicy(policy)) +} + +// SetNumeric() is a wrapper around gtk_spin_button_set_numeric(). +func (v *SpinButton) SetNumeric(numeric bool) { + C.gtk_spin_button_set_numeric(v.native(), gbool(numeric)) +} + +// Spin() is a wrapper around gtk_spin_button_spin(). +func (v *SpinButton) Spin(direction SpinType, increment float64) { + C.gtk_spin_button_spin( + v.native(), + C.GtkSpinType(direction), + C.gdouble(increment)) +} + +// gtk_spin_button_set_wrap(). +// gtk_spin_button_set_snap_to_ticks(). + +// Update() is a wrapper around gtk_spin_button_update(). +func (v *SpinButton) Update() { + C.gtk_spin_button_update(v.native()) +} + +// GetDigits() is a wrapper around gtk_spin_button_get_digits(). +func (v *SpinButton) GetDigits() uint { + return uint(C.gtk_spin_button_get_digits(v.native())) +} + +// gtk_spin_button_get_increments(). +// gtk_spin_button_get_numeric(). +// gtk_spin_button_get_range(). +// gtk_spin_button_get_snap_to_ticks(). + +// GetUpdatePolicy() is a wrapper around gtk_spin_button_get_update_policy(). +func (v *SpinButton) GetUpdatePolicy() SpinButtonUpdatePolicy { + return SpinButtonUpdatePolicy( + C.gtk_spin_button_get_update_policy( + v.native())) +} + +// gtk_spin_button_get_wrap(). + +/* + * GtkSpinner + */ + +// Spinner is a representation of GTK's GtkSpinner. +type Spinner struct { + Widget +} + +// native returns a pointer to the underlying GtkSpinner. +func (v *Spinner) native() *C.GtkSpinner { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSpinner(p) +} + +func marshalSpinner(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSpinner(obj), nil +} + +func wrapSpinner(obj *glib.Object) *Spinner { + if obj == nil { + return nil + } + + return &Spinner{Widget{glib.InitiallyUnowned{obj}}} +} + +// SpinnerNew is a wrapper around gtk_spinner_new(). +func SpinnerNew() (*Spinner, error) { + c := C.gtk_spinner_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSpinner(glib.Take(unsafe.Pointer(c))), nil +} + +// Start is a wrapper around gtk_spinner_start(). +func (v *Spinner) Start() { + C.gtk_spinner_start(v.native()) +} + +// Stop is a wrapper around gtk_spinner_stop(). +func (v *Spinner) Stop() { + C.gtk_spinner_stop(v.native()) +} + +/* + * GtkStatusbar + */ + +// Statusbar is a representation of GTK's GtkStatusbar +type Statusbar struct { + Box +} + +// native returns a pointer to the underlying GtkStatusbar +func (v *Statusbar) native() *C.GtkStatusbar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkStatusbar(p) +} + +func marshalStatusbar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapStatusbar(obj), nil +} + +func wrapStatusbar(obj *glib.Object) *Statusbar { + if obj == nil { + return nil + } + + return &Statusbar{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// StatusbarNew() is a wrapper around gtk_statusbar_new(). +func StatusbarNew() (*Statusbar, error) { + c := C.gtk_statusbar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapStatusbar(glib.Take(unsafe.Pointer(c))), nil +} + +// GetContextId() is a wrapper around gtk_statusbar_get_context_id(). +func (v *Statusbar) GetContextId(contextDescription string) uint { + cstr := C.CString(contextDescription) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_statusbar_get_context_id(v.native(), (*C.gchar)(cstr)) + return uint(c) +} + +// Push() is a wrapper around gtk_statusbar_push(). +func (v *Statusbar) Push(contextID uint, text string) uint { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_statusbar_push(v.native(), C.guint(contextID), + (*C.gchar)(cstr)) + return uint(c) +} + +// Pop() is a wrapper around gtk_statusbar_pop(). +func (v *Statusbar) Pop(contextID uint) { + C.gtk_statusbar_pop(v.native(), C.guint(contextID)) +} + +// GetMessageArea() is a wrapper around gtk_statusbar_get_message_area(). +func (v *Statusbar) GetMessageArea() (*Box, error) { + c := C.gtk_statusbar_get_message_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return &Box{Container{Widget{glib.InitiallyUnowned{obj}}}}, nil +} + +// RemoveAll() is a wrapper around gtk_statusbar_remove_all() +func (v *Statusbar) RemoveAll(contextID uint) { + C.gtk_statusbar_remove_all(v.native(), C.guint(contextID)) +} + +/* + * GtkSwitch + */ + +// Switch is a representation of GTK's GtkSwitch. +type Switch struct { + Widget +} + +// native returns a pointer to the underlying GtkSwitch. +func (v *Switch) native() *C.GtkSwitch { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSwitch(p) +} + +func marshalSwitch(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSwitch(obj), nil +} + +func wrapSwitch(obj *glib.Object) *Switch { + if obj == nil { + return nil + } + + return &Switch{Widget{glib.InitiallyUnowned{obj}}} +} + +// SwitchNew is a wrapper around gtk_switch_new(). +func SwitchNew() (*Switch, error) { + c := C.gtk_switch_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSwitch(glib.Take(unsafe.Pointer(c))), nil +} + +// GetActive is a wrapper around gtk_switch_get_active(). +func (v *Switch) GetActive() bool { + c := C.gtk_switch_get_active(v.native()) + return gobool(c) +} + +// SetActive is a wrapper around gtk_switch_set_active(). +func (v *Switch) SetActive(isActive bool) { + C.gtk_switch_set_active(v.native(), gbool(isActive)) +} + +/* + * GtkTargetEntry + */ + +// TargetEntry is a representation of GTK's GtkTargetEntry +type TargetEntry C.GtkTargetEntry + +func marshalTargetEntry(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return (*TargetEntry)(unsafe.Pointer(c)), nil +} + +func (v *TargetEntry) native() *C.GtkTargetEntry { + return (*C.GtkTargetEntry)(unsafe.Pointer(v)) +} + +// TargetEntryNew is a wrapper around gtk_target_entry_new(). +func TargetEntryNew(target string, flags TargetFlags, info uint) (*TargetEntry, error) { + cstr := C.CString(target) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_target_entry_new((*C.gchar)(cstr), C.guint(flags), C.guint(info)) + if c == nil { + return nil, nilPtrErr + } + t := (*TargetEntry)(unsafe.Pointer(c)) + // causes setFinilizer error + // runtime.SetFinalizer(t, (*TargetEntry).free) + return t, nil +} + +func (v *TargetEntry) free() { + C.gtk_target_entry_free(v.native()) +} + +/* + * GtkTextTag + */ + +type TextTag struct { + *glib.Object +} + +// native returns a pointer to the underlying GObject as a GtkTextTag. +func (v *TextTag) native() *C.GtkTextTag { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextTag(p) +} + +func marshalTextTag(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextTag(obj), nil +} + +func wrapTextTag(obj *glib.Object) *TextTag { + if obj == nil { + return nil + } + + return &TextTag{obj} +} + +// TextTagNew is a wrapper around gtk_text_tag_new(). If name is empty, then the +// tag is anonymous. +func TextTagNew(name string) (*TextTag, error) { + var gchar *C.gchar + if name != "" { + gchar = (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(gchar)) + } + + c := C.gtk_text_tag_new(gchar) + if c == nil { + return nil, nilPtrErr + } + + return wrapTextTag(glib.Take(unsafe.Pointer(c))), nil +} + +// GetPriority() is a wrapper around gtk_text_tag_get_priority(). +func (v *TextTag) GetPriority() int { + return int(C.gtk_text_tag_get_priority(v.native())) +} + +// SetPriority() is a wrapper around gtk_text_tag_set_priority(). +func (v *TextTag) SetPriority(priority int) { + C.gtk_text_tag_set_priority(v.native(), C.gint(priority)) +} + +// Event() is a wrapper around gtk_text_tag_event(). +func (v *TextTag) Event(eventObject *glib.Object, event *gdk.Event, iter *TextIter) bool { + ok := C.gtk_text_tag_event(v.native(), + (*C.GObject)(unsafe.Pointer(eventObject.Native())), + (*C.GdkEvent)(unsafe.Pointer(event.Native())), + (*C.GtkTextIter)(iter), + ) + return gobool(ok) +} + +/* + * GtkTextTagTable + */ + +type TextTagTable struct { + *glib.Object +} + +// native returns a pointer to the underlying GObject as a GtkTextTagTable. +func (v *TextTagTable) native() *C.GtkTextTagTable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextTagTable(p) +} + +func marshalTextTagTable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextTagTable(obj), nil +} + +func wrapTextTagTable(obj *glib.Object) *TextTagTable { + if obj == nil { + return nil + } + + return &TextTagTable{obj} +} + +func TextTagTableNew() (*TextTagTable, error) { + c := C.gtk_text_tag_table_new() + if c == nil { + return nil, nilPtrErr + } + return wrapTextTagTable(glib.Take(unsafe.Pointer(c))), nil +} + +// Add() is a wrapper around gtk_text_tag_table_add(). +func (v *TextTagTable) Add(tag *TextTag) { + C.gtk_text_tag_table_add(v.native(), tag.native()) + //return gobool(c) // TODO version-separate +} + +// Lookup() is a wrapper around gtk_text_tag_table_lookup(). +func (v *TextTagTable) Lookup(name string) (*TextTag, error) { + cname := C.CString(name) + defer C.free(unsafe.Pointer(cname)) + c := C.gtk_text_tag_table_lookup(v.native(), (*C.gchar)(cname)) + if c == nil { + return nil, nilPtrErr + } + return wrapTextTag(glib.Take(unsafe.Pointer(c))), nil +} + +// Remove() is a wrapper around gtk_text_tag_table_remove(). +func (v *TextTagTable) Remove(tag *TextTag) { + C.gtk_text_tag_table_remove(v.native(), tag.native()) +} + +/* + * GtkTextBuffer + */ + +// TextBuffer is a representation of GTK's GtkTextBuffer. +type TextBuffer struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkTextBuffer. +func (v *TextBuffer) native() *C.GtkTextBuffer { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextBuffer(p) +} + +func marshalTextBuffer(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextBuffer(obj), nil +} + +func wrapTextBuffer(obj *glib.Object) *TextBuffer { + if obj == nil { + return nil + } + + return &TextBuffer{obj} +} + +// TextBufferNew() is a wrapper around gtk_text_buffer_new(). +func TextBufferNew(table *TextTagTable) (*TextBuffer, error) { + c := C.gtk_text_buffer_new(table.native()) + if c == nil { + return nil, nilPtrErr + } + + e := wrapTextBuffer(glib.Take(unsafe.Pointer(c))) + return e, nil +} + +// ApplyTag() is a wrapper around gtk_text_buffer_apply_tag(). +func (v *TextBuffer) ApplyTag(tag *TextTag, start, end *TextIter) { + C.gtk_text_buffer_apply_tag(v.native(), tag.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +// ApplyTagByName() is a wrapper around gtk_text_buffer_apply_tag_by_name(). +func (v *TextBuffer) ApplyTagByName(name string, start, end *TextIter) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_apply_tag_by_name(v.native(), (*C.gchar)(cstr), + (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +// SelectRange is a wrapper around gtk_text_buffer_select_range. +func (v *TextBuffer) SelectRange(start, end *TextIter) { + C.gtk_text_buffer_select_range(v.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +// CreateChildAnchor() is a wrapper around gtk_text_buffer_create_child_anchor(). +// Since it copies garbage from the stack into the padding bytes of iter, +// iter can't be reliably reused after this call unless GODEBUG=cgocheck=0. +func (v *TextBuffer) CreateChildAnchor(iter *TextIter) (*TextChildAnchor, error) { + c := C.gtk_text_buffer_create_child_anchor(v.native(), iter.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapTextChildAnchor(glib.Take(unsafe.Pointer(c))), nil +} + +// Delete() is a wrapper around gtk_text_buffer_delete(). +func (v *TextBuffer) Delete(start, end *TextIter) { + C.gtk_text_buffer_delete(v.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +func (v *TextBuffer) GetBounds() (start, end *TextIter) { + start, end = new(TextIter), new(TextIter) + C.gtk_text_buffer_get_bounds(v.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) + return +} + +// GetCharCount() is a wrapper around gtk_text_buffer_get_char_count(). +func (v *TextBuffer) GetCharCount() int { + return int(C.gtk_text_buffer_get_char_count(v.native())) +} + +// GetIterAtOffset() is a wrapper around gtk_text_buffer_get_iter_at_offset(). +func (v *TextBuffer) GetIterAtOffset(charOffset int) *TextIter { + var iter C.GtkTextIter + C.gtk_text_buffer_get_iter_at_offset(v.native(), &iter, C.gint(charOffset)) + return (*TextIter)(&iter) +} + +// GetIterAtLine() is a wrapper around gtk_text_buffer_get_iter_at_line(). +func (v *TextBuffer) GetIterAtLine(line int) *TextIter { + var iter C.GtkTextIter + C.gtk_text_buffer_get_iter_at_line(v.native(), &iter, C.gint(line)) + return (*TextIter)(&iter) +} + +// GetStartIter() is a wrapper around gtk_text_buffer_get_start_iter(). +func (v *TextBuffer) GetStartIter() *TextIter { + var iter C.GtkTextIter + C.gtk_text_buffer_get_start_iter(v.native(), &iter) + return (*TextIter)(&iter) +} + +// GetEndIter() is a wrapper around gtk_text_buffer_get_end_iter(). +func (v *TextBuffer) GetEndIter() *TextIter { + var iter C.GtkTextIter + C.gtk_text_buffer_get_end_iter(v.native(), &iter) + return (*TextIter)(&iter) +} + +// GetLineCount() is a wrapper around gtk_text_buffer_get_line_count(). +func (v *TextBuffer) GetLineCount() int { + return int(C.gtk_text_buffer_get_line_count(v.native())) +} + +// GetModified() is a wrapper around gtk_text_buffer_get_modified(). +func (v *TextBuffer) GetModified() bool { + return gobool(C.gtk_text_buffer_get_modified(v.native())) +} + +// GetTagTable() is a wrapper around gtk_text_buffer_get_tag_table(). +func (v *TextBuffer) GetTagTable() (*TextTagTable, error) { + c := C.gtk_text_buffer_get_tag_table(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextTagTable(obj), nil +} + +func (v *TextBuffer) GetText(start, end *TextIter, includeHiddenChars bool) (string, error) { + c := C.gtk_text_buffer_get_text( + v.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end), gbool(includeHiddenChars), + ) + if c == nil { + return "", nilPtrErr + } + gostr := goString(c) + C.g_free(C.gpointer(c)) + return gostr, nil +} + +// Insert() is a wrapper around gtk_text_buffer_insert(). +func (v *TextBuffer) Insert(iter *TextIter, text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_insert(v.native(), (*C.GtkTextIter)(iter), (*C.gchar)(cstr), C.gint(len(text))) +} + +// InsertPixbuf() is a wrapper around gtk_text_buffer_insert_pixbuf(). +func (v *TextBuffer) InsertPixbuf(iter *TextIter, pixbuf *gdk.Pixbuf) { + C.gtk_text_buffer_insert_pixbuf(v.native(), (*C.GtkTextIter)(iter), + (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native()))) +} + +// InsertAtCursor() is a wrapper around gtk_text_buffer_insert_at_cursor(). +func (v *TextBuffer) InsertAtCursor(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_insert_at_cursor(v.native(), (*C.gchar)(cstr), C.gint(len(text))) +} + +// InsertWithTag() is a wrapper around gtk_text_buffer_insert_with_tags() that supports only one tag +// as cgo does not support functions with variable-argument lists (see https://github.com/golang/go/issues/975) +func (v *TextBuffer) InsertWithTag(iter *TextIter, text string, tag *TextTag) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C._gtk_text_buffer_insert_with_tag(v.native(), (*C.GtkTextIter)(iter), (*C.gchar)(cstr), C.gint(len(text)), tag.native()) +} + +// InsertWithTagByName() is a wrapper around gtk_text_buffer_insert_with_tags_by_name() that supports only one tag +// as cgo does not support functions with variable-argument lists (see https://github.com/golang/go/issues/975) +func (v *TextBuffer) InsertWithTagByName(iter *TextIter, text string, tagName string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + ctag := C.CString(tagName) + defer C.free(unsafe.Pointer(ctag)) + C._gtk_text_buffer_insert_with_tag_by_name(v.native(), (*C.GtkTextIter)(iter), (*C.gchar)(cstr), C.gint(len(text)), (*C.gchar)(ctag)) +} + +// RemoveTag() is a wrapper around gtk_text_buffer_remove_tag(). +func (v *TextBuffer) RemoveTag(tag *TextTag, start, end *TextIter) { + C.gtk_text_buffer_remove_tag(v.native(), tag.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +// RemoveAllTags() is a wrapper around gtk_text_buffer_remove_all_tags(). +func (v *TextBuffer) RemoveAllTags(start, end *TextIter) { + C.gtk_text_buffer_remove_all_tags(v.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +// SetModified() is a wrapper around gtk_text_buffer_set_modified(). +func (v *TextBuffer) SetModified(setting bool) { + C.gtk_text_buffer_set_modified(v.native(), gbool(setting)) +} + +func (v *TextBuffer) SetText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_set_text(v.native(), (*C.gchar)(cstr), + C.gint(len(text))) +} + +// GetIterAtMark() is a wrapper around gtk_text_buffer_get_iter_at_mark(). +func (v *TextBuffer) GetIterAtMark(mark *TextMark) *TextIter { + var iter C.GtkTextIter + C.gtk_text_buffer_get_iter_at_mark(v.native(), &iter, mark.native()) + return (*TextIter)(&iter) +} + +// CreateMark() is a wrapper around gtk_text_buffer_create_mark(). +func (v *TextBuffer) CreateMark(mark_name string, where *TextIter, left_gravity bool) *TextMark { + cstr := C.CString(mark_name) + defer C.free(unsafe.Pointer(cstr)) + ret := C.gtk_text_buffer_create_mark(v.native(), (*C.gchar)(cstr), (*C.GtkTextIter)(where), gbool(left_gravity)) + return wrapTextMark(glib.Take(unsafe.Pointer(ret))) +} + +// GetMark() is a wrapper around gtk_text_buffer_get_mark(). +func (v *TextBuffer) GetMark(mark_name string) *TextMark { + cstr := C.CString(mark_name) + defer C.free(unsafe.Pointer(cstr)) + ret := C.gtk_text_buffer_get_mark(v.native(), (*C.gchar)(cstr)) + return wrapTextMark(glib.Take(unsafe.Pointer(ret))) +} + +// DeleteMark() is a wrapper around gtk_text_buffer_delete_mark() +func (v *TextBuffer) DeleteMark(mark *TextMark) { + C.gtk_text_buffer_delete_mark(v.native(), mark.native()) +} + +// DeleteMarkByName() is a wrapper around gtk_text_buffer_delete_mark_by_name() +func (v *TextBuffer) DeleteMarkByName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_delete_mark_by_name(v.native(), (*C.gchar)(cstr)) +} + +// PlaceCursor() is a wrapper around gtk_text_buffer_place_cursor() +func (v *TextBuffer) PlaceCursor(iter *TextIter) { + C.gtk_text_buffer_place_cursor(v.native(), (*C.GtkTextIter)(iter)) +} + +// GetHasSelection() is a variant solution around gtk_text_buffer_get_has_selection(). +func (v *TextBuffer) GetHasSelection() bool { + value, _ := v.GetProperty("has-selection") + return value.(bool) +} + +// DeleteSelection() is a wrapper around gtk_text_buffer_delete_selection(). +func (v *TextBuffer) DeleteSelection(interactive, defaultEditable bool) bool { + return gobool(C.gtk_text_buffer_delete_selection(v.native(), gbool(interactive), gbool(defaultEditable))) +} + +// GetSelectionBound() is a wrapper around gtk_text_buffer_get_selection_bound(). +func (v *TextBuffer) GetSelectionBound() *TextMark { + ret := C.gtk_text_buffer_get_selection_bound(v.native()) + return wrapTextMark(glib.Take(unsafe.Pointer(ret))) +} + +// GetSelectionBounds() is a wrapper around gtk_text_buffer_get_selection_bounds(). +func (v *TextBuffer) GetSelectionBounds() (start, end *TextIter, ok bool) { + start, end = new(TextIter), new(TextIter) + cbool := C.gtk_text_buffer_get_selection_bounds(v.native(), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) + return start, end, gobool(cbool) +} + +// GetIterAtLineOffset() is a wrapper around gtk_text_buffer_get_iter_at_line_offset(). +func (v *TextBuffer) GetIterAtLineOffset(lineNumber, charOffset int) (iter *TextIter) { + iter = new(TextIter) + C.gtk_text_buffer_get_iter_at_line_offset(v.native(), (*C.GtkTextIter)(iter), (C.gint)(lineNumber), (C.gint)(charOffset)) + return +} + +// CreateTag() is a variant solution around gtk_text_buffer_create_tag(). +func (v *TextBuffer) CreateTag(name string, props map[string]interface{}) (tag *TextTag) { + var err error + var tagTable *TextTagTable + if tag, err = TextTagNew(name); err == nil { + if tagTable, err = v.GetTagTable(); err == nil { + tagTable.Add(tag) + for p, v := range props { + if err = tag.SetProperty(p, v); err != nil { + err = errors.New(fmt.Sprintf("%s, %v: %v\n", err.Error(), p, v)) + break + } + } + } + } + if err != nil { + fmt.Println(err.Error()) + } + return +} + +// RemoveTagByName() is a wrapper around gtk_text_buffer_remove_tag_by_name() +func (v *TextBuffer) RemoveTagByName(name string, start, end *TextIter) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_remove_tag_by_name(v.native(), (*C.gchar)(cstr), (*C.GtkTextIter)(start), (*C.GtkTextIter)(end)) +} + +// InsertMarkup() is a wrapper around gtk_text_buffer_register_serialize_tagset() +func (v *TextBuffer) RegisterSerializeTagset(tagsetName string) gdk.Atom { + cstr := C.CString(tagsetName) + if len(tagsetName) == 0 { + cstr = nil + } + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_text_buffer_register_serialize_tagset(v.native(), (*C.gchar)(cstr)) + return gdk.Atom(uintptr(unsafe.Pointer(c))) +} + +// RegisterDeserializeTagset() is a wrapper around gtk_text_buffer_register_deserialize_tagset() +func (v *TextBuffer) RegisterDeserializeTagset(tagsetName string) gdk.Atom { + cstr := C.CString(tagsetName) + if len(tagsetName) == 0 { + cstr = nil + } + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_text_buffer_register_deserialize_tagset(v.native(), (*C.gchar)(cstr)) + return gdk.Atom(uintptr(unsafe.Pointer(c))) +} + +// Serialize() is a wrapper around gtk_text_buffer_serialize() +func (v *TextBuffer) Serialize(contentBuffer *TextBuffer, format gdk.Atom, start, end *TextIter) string { + var length = new(C.gsize) + ptr := C.gtk_text_buffer_serialize(v.native(), contentBuffer.native(), C.GdkAtom(unsafe.Pointer(format)), + (*C.GtkTextIter)(start), (*C.GtkTextIter)(end), length) + return C.GoStringN((*C.char)(unsafe.Pointer(ptr)), (C.int)(*length)) +} + +// Deserialize() is a wrapper around gtk_text_buffer_deserialize() +func (v *TextBuffer) Deserialize(contentBuffer *TextBuffer, format gdk.Atom, iter *TextIter, data []byte) (ok bool, err error) { + var length = (C.gsize)(len(data)) + var cerr *C.GError = nil + cbool := C.gtk_text_buffer_deserialize(v.native(), contentBuffer.native(), C.GdkAtom(unsafe.Pointer(format)), + (*C.GtkTextIter)(iter), (*C.guint8)(unsafe.Pointer(&data[0])), length, &cerr) + if !gobool(cbool) { + defer C.g_error_free(cerr) + return false, errors.New(goString(cerr.message)) + } + return gobool(cbool), nil +} + +// GetInsert() is a wrapper around gtk_text_buffer_get_insert(). +func (v *TextBuffer) GetInsert() *TextMark { + ret := C.gtk_text_buffer_get_insert(v.native()) + return wrapTextMark(glib.Take(unsafe.Pointer(ret))) +} + +// CopyClipboard() is a wrapper around gtk_text_buffer_copy_clipboard(). +func (v *TextBuffer) CopyClipboard(clipboard *Clipboard) { + C.gtk_text_buffer_copy_clipboard(v.native(), clipboard.native()) +} + +// CutClipboard() is a wrapper around gtk_text_buffer_cut_clipboard(). +func (v *TextBuffer) CutClipboard(clipboard *Clipboard, defaultEditable bool) { + C.gtk_text_buffer_cut_clipboard(v.native(), clipboard.native(), gbool(defaultEditable)) +} + +// PasteClipboard() is a wrapper around gtk_text_buffer_paste_clipboard(). +func (v *TextBuffer) PasteClipboard(clipboard *Clipboard, overrideLocation *TextIter, defaultEditable bool) { + C.gtk_text_buffer_paste_clipboard(v.native(), clipboard.native(), (*C.GtkTextIter)(overrideLocation), gbool(defaultEditable)) +} + +// AddSelectionClipboard() is a wrapper around gtk_text_buffer_add_selection_clipboard(). +func (v *TextBuffer) AddSelectionClipboard(clipboard *Clipboard) { + C.gtk_text_buffer_add_selection_clipboard(v.native(), clipboard.native()) +} + +// RemoveSelectionClipboard() is a wrapper around gtk_text_buffer_remove_selection_clipboard(). +func (v *TextBuffer) RemoveSelectionClipboard(clipboard *Clipboard) { + C.gtk_text_buffer_remove_selection_clipboard(v.native(), clipboard.native()) +} + +// GetIterAtLineIndex() is a wrapper around gtk_text_buffer_get_iter_at_line_index(). +func (v *TextBuffer) GetIterAtLineIndex(lineNumber, charIndex int) (iter *TextIter) { + iter = new(TextIter) + C.gtk_text_buffer_get_iter_at_line_index(v.native(), (*C.GtkTextIter)(iter), (C.gint)(lineNumber), (C.gint)(charIndex)) + return +} + +// InsertInteractiveAtCursor() is a wrapper around gtk_text_buffer_insert_interactive_at_cursor(). +func (v *TextBuffer) InsertInteractiveAtCursor(text string, editable bool) bool { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.gtk_text_buffer_insert_interactive_at_cursor( + v.native(), + (*C.gchar)(cstr), + C.gint(len(text)), + gbool(editable))) +} + +// InsertInteractive() is a wrapper around gtk_text_buffer_insert_interactive(). +func (v *TextBuffer) InsertInteractive(iter *TextIter, text string, editable bool) bool { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.gtk_text_buffer_insert_interactive( + v.native(), + (*C.GtkTextIter)(iter), + (*C.gchar)(cstr), + C.gint(len(text)), + gbool(editable))) +} + +// InsertRangeInteractive() is a wrapper around gtk_text_buffer_insert_range_interactive(). +func (v *TextBuffer) InsertRangeInteractive(iter, start, end *TextIter, editable bool) bool { + + return gobool(C.gtk_text_buffer_insert_range_interactive( + v.native(), + (*C.GtkTextIter)(iter), + (*C.GtkTextIter)(start), + (*C.GtkTextIter)(end), + gbool(editable))) +} + +// InsertRange() is a wrapper around gtk_text_buffer_insert_range(). +func (v *TextBuffer) InsertRange(iter, start, end *TextIter) { + + C.gtk_text_buffer_insert_range( + v.native(), + (*C.GtkTextIter)(iter), + (*C.GtkTextIter)(start), + (*C.GtkTextIter)(end)) +} + +// DeleteInteractive() is a wrapper around gtk_text_buffer_delete_interactive(). +func (v *TextBuffer) DeleteInteractive(start, end *TextIter, editable bool) bool { + + return gobool(C.gtk_text_buffer_delete_interactive( + v.native(), + (*C.GtkTextIter)(start), + (*C.GtkTextIter)(end), + gbool(editable))) +} + +// BeginUserAction() is a wrapper around gtk_text_buffer_begin_user_action(). +func (v *TextBuffer) BeginUserAction() { + + C.gtk_text_buffer_begin_user_action(v.native()) +} + +// EndUserAction() is a wrapper around gtk_text_buffer_end_user_action(). +func (v *TextBuffer) EndUserAction() { + + C.gtk_text_buffer_end_user_action(v.native()) +} + +/* + * GtkToggleButton + */ + +// ToggleButton is a representation of GTK's GtkToggleButton. +type ToggleButton struct { + Button +} + +// native returns a pointer to the underlying GtkToggleButton. +func (v *ToggleButton) native() *C.GtkToggleButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToggleButton(p) +} + +func marshalToggleButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapToggleButton(obj), nil +} + +func wrapToggleButton(obj *glib.Object) *ToggleButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &ToggleButton{Button{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}, actionable}} +} + +// ToggleButtonNew is a wrapper around gtk_toggle_button_new(). +func ToggleButtonNew() (*ToggleButton, error) { + c := C.gtk_toggle_button_new() + if c == nil { + return nil, nilPtrErr + } + return wrapToggleButton(glib.Take(unsafe.Pointer(c))), nil +} + +// ToggleButtonNewWithLabel is a wrapper around +// gtk_toggle_button_new_with_label(). +func ToggleButtonNewWithLabel(label string) (*ToggleButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_toggle_button_new_with_label((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapToggleButton(glib.Take(unsafe.Pointer(c))), nil +} + +// ToggleButtonNewWithMnemonic is a wrapper around +// gtk_toggle_button_new_with_mnemonic(). +func ToggleButtonNewWithMnemonic(label string) (*ToggleButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_toggle_button_new_with_mnemonic((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapToggleButton(glib.Take(unsafe.Pointer(c))), nil +} + +// GetActive is a wrapper around gtk_toggle_button_get_active(). +func (v *ToggleButton) GetActive() bool { + c := C.gtk_toggle_button_get_active(v.native()) + return gobool(c) +} + +// SetActive is a wrapper around gtk_toggle_button_set_active(). +func (v *ToggleButton) SetActive(isActive bool) { + C.gtk_toggle_button_set_active(v.native(), gbool(isActive)) +} + +// GetMode is a wrapper around gtk_toggle_button_get_mode(). +func (v *ToggleButton) GetMode() bool { + c := C.gtk_toggle_button_get_mode(v.native()) + return gobool(c) +} + +// SetMode is a wrapper around gtk_toggle_button_set_mode(). +func (v *ToggleButton) SetMode(drawIndicator bool) { + C.gtk_toggle_button_set_mode(v.native(), gbool(drawIndicator)) +} + +// Toggled is a wrapper around gtk_toggle_button_toggled(). +func (v *ToggleButton) Toggled() { + C.gtk_toggle_button_toggled(v.native()) +} + +// GetInconsistent gtk_toggle_button_get_inconsistent(). +func (v *ToggleButton) GetInconsistent() bool { + c := C.gtk_toggle_button_get_inconsistent(v.native()) + return gobool(c) +} + +// SetInconsistent gtk_toggle_button_set_inconsistent(). +func (v *ToggleButton) SetInconsistent(setting bool) { + C.gtk_toggle_button_set_inconsistent(v.native(), gbool(setting)) +} + +/* + * GtkToolbar + */ + +// Toolbar is a representation of GTK's GtkToolbar. +type Toolbar struct { + Container +} + +// native returns a pointer to the underlying GtkToolbar. +func (v *Toolbar) native() *C.GtkToolbar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToolbar(p) +} + +func marshalToolbar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapToolbar(obj), nil +} + +func wrapToolbar(obj *glib.Object) *Toolbar { + if obj == nil { + return nil + } + + return &Toolbar{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// ToolbarNew is a wrapper around gtk_toolbar_new(). +func ToolbarNew() (*Toolbar, error) { + c := C.gtk_toolbar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapToolbar(glib.Take(unsafe.Pointer(c))), nil +} + +// Insert is a wrapper around gtk_toolbar_insert(). +func (v *Toolbar) Insert(item IToolItem, pos int) { + C.gtk_toolbar_insert(v.native(), item.toToolItem(), C.gint(pos)) +} + +// GetItemIndex is a wrapper around gtk_toolbar_get_item_index(). +func (v *Toolbar) GetItemIndex(item IToolItem) int { + c := C.gtk_toolbar_get_item_index(v.native(), item.toToolItem()) + return int(c) +} + +// GetNItems is a wrapper around gtk_toolbar_get_n_items(). +func (v *Toolbar) GetNItems() int { + c := C.gtk_toolbar_get_n_items(v.native()) + return int(c) +} + +// GetNthItem is a wrapper around gtk_toolbar_get_nth_item(). +func (v *Toolbar) GetNthItem(n int) *ToolItem { + c := C.gtk_toolbar_get_nth_item(v.native(), C.gint(n)) + if c == nil { + return nil + } + return wrapToolItem(glib.Take(unsafe.Pointer(c))) +} + +// GetDropIndex is a wrapper around gtk_toolbar_get_drop_index(). +func (v *Toolbar) GetDropIndex(x, y int) int { + c := C.gtk_toolbar_get_drop_index(v.native(), C.gint(x), C.gint(y)) + return int(c) +} + +// SetDropHighlightItem is a wrapper around gtk_toolbar_set_drop_highlight_item(). +func (v *Toolbar) SetDropHighlightItem(toolItem IToolItem, index int) { + C.gtk_toolbar_set_drop_highlight_item(v.native(), + toolItem.toToolItem(), C.gint(index)) +} + +// SetShowArrow is a wrapper around gtk_toolbar_set_show_arrow(). +func (v *Toolbar) SetShowArrow(showArrow bool) { + C.gtk_toolbar_set_show_arrow(v.native(), gbool(showArrow)) +} + +// UnsetIconSize is a wrapper around gtk_toolbar_unset_icon_size(). +func (v *Toolbar) UnsetIconSize() { + C.gtk_toolbar_unset_icon_size(v.native()) +} + +// GetShowArrow is a wrapper around gtk_toolbar_get_show_arrow(). +func (v *Toolbar) GetShowArrow() bool { + c := C.gtk_toolbar_get_show_arrow(v.native()) + return gobool(c) +} + +// GetStyle is a wrapper around gtk_toolbar_get_style(). +func (v *Toolbar) GetStyle() ToolbarStyle { + c := C.gtk_toolbar_get_style(v.native()) + return ToolbarStyle(c) +} + +// GetIconSize is a wrapper around gtk_toolbar_get_icon_size(). +func (v *Toolbar) GetIconSize() IconSize { + c := C.gtk_toolbar_get_icon_size(v.native()) + return IconSize(c) +} + +// GetReliefStyle is a wrapper around gtk_toolbar_get_relief_style(). +func (v *Toolbar) GetReliefStyle() ReliefStyle { + c := C.gtk_toolbar_get_relief_style(v.native()) + return ReliefStyle(c) +} + +// SetStyle is a wrapper around gtk_toolbar_set_style(). +func (v *Toolbar) SetStyle(style ToolbarStyle) { + C.gtk_toolbar_set_style(v.native(), C.GtkToolbarStyle(style)) +} + +// SetIconSize is a wrapper around gtk_toolbar_set_icon_size(). +func (v *Toolbar) SetIconSize(iconSize IconSize) { + C.gtk_toolbar_set_icon_size(v.native(), C.GtkIconSize(iconSize)) +} + +// UnsetStyle is a wrapper around gtk_toolbar_unset_style(). +func (v *Toolbar) UnsetStyle() { + C.gtk_toolbar_unset_style(v.native()) +} + +/* + * GtkToolButton + */ + +// ToolButton is a representation of GTK's GtkToolButton. +type ToolButton struct { + ToolItem +} + +// native returns a pointer to the underlying GtkToolButton. +func (v *ToolButton) native() *C.GtkToolButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToolButton(p) +} + +func marshalToolButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapToolButton(obj), nil +} + +func wrapToolButton(obj *glib.Object) *ToolButton { + if obj == nil { + return nil + } + + return &ToolButton{ToolItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}} +} + +// ToolButtonNew is a wrapper around gtk_tool_button_new(). +func ToolButtonNew(iconWidget IWidget, label string) (*ToolButton, error) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + w := nullableWidget(iconWidget) + c := C.gtk_tool_button_new(w, (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapToolButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SetLabel is a wrapper around gtk_tool_button_set_label(). +func (v *ToolButton) SetLabel(label string) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tool_button_set_label(v.native(), (*C.gchar)(cstr)) +} + +// GetLabel is a wrapper around gtk_tool_button_get_label(). +func (v *ToolButton) GetLabel() string { + c := C.gtk_tool_button_get_label(v.native()) + return goString(c) +} + +// SetUseUnderline is a wrapper around gtk_tool_button_set_use_underline(). +func (v *ToolButton) SetGetUnderline(useUnderline bool) { + C.gtk_tool_button_set_use_underline(v.native(), gbool(useUnderline)) +} + +// GetUseUnderline is a wrapper around gtk_tool_button_get_use_underline(). +func (v *ToolButton) GetuseUnderline() bool { + c := C.gtk_tool_button_get_use_underline(v.native()) + return gobool(c) +} + +// SetIconName is a wrapper around gtk_tool_button_set_icon_name(). +func (v *ToolButton) SetIconName(iconName string) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tool_button_set_icon_name(v.native(), (*C.gchar)(cstr)) +} + +// GetIconName is a wrapper around gtk_tool_button_get_icon_name(). +func (v *ToolButton) GetIconName() string { + c := C.gtk_tool_button_get_icon_name(v.native()) + return goString(c) +} + +// SetIconWidget is a wrapper around gtk_tool_button_set_icon_widget(). +func (v *ToolButton) SetIconWidget(iconWidget IWidget) { + C.gtk_tool_button_set_icon_widget(v.native(), iconWidget.toWidget()) +} + +// GetIconWidget is a wrapper around gtk_tool_button_get_icon_widget(). +func (v *ToolButton) GetIconWidget() (IWidget, error) { + c := C.gtk_tool_button_get_icon_widget(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetLabelWidget is a wrapper around gtk_tool_button_set_label_widget(). +func (v *ToolButton) SetLabelWidget(labelWidget IWidget) { + C.gtk_tool_button_set_label_widget(v.native(), labelWidget.toWidget()) +} + +// GetLabelWidget is a wrapper around gtk_tool_button_get_label_widget(). +func (v *ToolButton) GetLabelWidget() (IWidget, error) { + c := C.gtk_tool_button_get_label_widget(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +/* + * GtkToggleToolButton + */ + +// ToggleToolButton is a representation of GTK's GtkToggleToolButton. +type ToggleToolButton struct { + ToolButton +} + +// native returns a pointer to the underlying GtkToggleToolButton. +func (v *ToggleToolButton) native() *C.GtkToggleToolButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToggleToolButton(p) +} + +func marshalToggleToolButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapToggleToolButton(obj), nil +} + +func wrapToggleToolButton(obj *glib.Object) *ToggleToolButton { + if obj == nil { + return nil + } + + return &ToggleToolButton{ToolButton{ToolItem{Bin{Container{Widget{ + glib.InitiallyUnowned{obj}}}}}}} +} + +// ToggleToolButtonNew is a wrapper around gtk_toggle_tool_button_new(). +func ToggleToolButtonNew() (*ToggleToolButton, error) { + c := C.gtk_toggle_tool_button_new() + if c == nil { + return nil, nilPtrErr + } + return wrapToggleToolButton(glib.Take(unsafe.Pointer(c))), nil +} + +// GetActive is a wrapper around gtk_toggle_tool_button_get_active(). +func (v *ToggleToolButton) GetActive() bool { + c := C.gtk_toggle_tool_button_get_active(v.native()) + return gobool(c) +} + +// SetActive is a wrapper around gtk_toggle_tool_button_set_active(). +func (v *ToggleToolButton) SetActive(isActive bool) { + C.gtk_toggle_tool_button_set_active(v.native(), gbool(isActive)) +} + +/* + * GtkToolItem + */ + +// ToolItem is a representation of GTK's GtkToolItem. +type ToolItem struct { + Bin +} + +// IToolItem is an interface type implemented by all structs embedding +// a ToolItem. It is meant to be used as an argument type for wrapper +// functions that wrap around a C GTK function taking a GtkToolItem. +type IToolItem interface { + toToolItem() *C.GtkToolItem +} + +// native returns a pointer to the underlying GtkToolItem. +func (v *ToolItem) native() *C.GtkToolItem { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkToolItem(p) +} + +func (v *ToolItem) toToolItem() *C.GtkToolItem { + return v.native() +} + +func marshalToolItem(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapToolItem(obj), nil +} + +func wrapToolItem(obj *glib.Object) *ToolItem { + if obj == nil { + return nil + } + + return &ToolItem{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// ToolItemNew is a wrapper around gtk_tool_item_new(). +func ToolItemNew() (*ToolItem, error) { + c := C.gtk_tool_item_new() + if c == nil { + return nil, nilPtrErr + } + return wrapToolItem(glib.Take(unsafe.Pointer(c))), nil +} + +// SetHomogeneous is a wrapper around gtk_tool_item_set_homogeneous(). +func (v *ToolItem) SetHomogeneous(homogeneous bool) { + C.gtk_tool_item_set_homogeneous(v.native(), gbool(homogeneous)) +} + +// GetHomogeneous is a wrapper around gtk_tool_item_get_homogeneous(). +func (v *ToolItem) GetHomogeneous() bool { + c := C.gtk_tool_item_get_homogeneous(v.native()) + return gobool(c) +} + +// SetExpand is a wrapper around gtk_tool_item_set_expand(). +func (v *ToolItem) SetExpand(expand bool) { + C.gtk_tool_item_set_expand(v.native(), gbool(expand)) +} + +// GetExpand is a wrapper around gtk_tool_item_get_expand(). +func (v *ToolItem) GetExpand() bool { + c := C.gtk_tool_item_get_expand(v.native()) + return gobool(c) +} + +// SetTooltipText is a wrapper around gtk_tool_item_set_tooltip_text(). +func (v *ToolItem) SetTooltipText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tool_item_set_tooltip_text(v.native(), (*C.gchar)(cstr)) +} + +// SetTooltipMarkup is a wrapper around gtk_tool_item_set_tooltip_markup(). +func (v *ToolItem) SetTooltipMarkup(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tool_item_set_tooltip_markup(v.native(), (*C.gchar)(cstr)) +} + +// SetUseDragWindow is a wrapper around gtk_tool_item_set_use_drag_window(). +func (v *ToolItem) SetUseDragWindow(useDragWindow bool) { + C.gtk_tool_item_set_use_drag_window(v.native(), gbool(useDragWindow)) +} + +// GetUseDragWindow is a wrapper around gtk_tool_item_get_use_drag_window(). +func (v *ToolItem) GetUseDragWindow() bool { + c := C.gtk_tool_item_get_use_drag_window(v.native()) + return gobool(c) +} + +// SetVisibleHorizontal is a wrapper around gtk_tool_item_set_visible_horizontal(). +func (v *ToolItem) SetVisibleHorizontal(visibleHorizontal bool) { + C.gtk_tool_item_set_visible_horizontal(v.native(), + gbool(visibleHorizontal)) +} + +// GetVisibleHorizontal is a wrapper around gtk_tool_item_get_visible_horizontal(). +func (v *ToolItem) GetVisibleHorizontal() bool { + c := C.gtk_tool_item_get_visible_horizontal(v.native()) + return gobool(c) +} + +// SetVisibleVertical is a wrapper around gtk_tool_item_set_visible_vertical(). +func (v *ToolItem) SetVisibleVertical(visibleVertical bool) { + C.gtk_tool_item_set_visible_vertical(v.native(), gbool(visibleVertical)) +} + +// GetVisibleVertical is a wrapper around gtk_tool_item_get_visible_vertical(). +func (v *ToolItem) GetVisibleVertical() bool { + c := C.gtk_tool_item_get_visible_vertical(v.native()) + return gobool(c) +} + +// SetIsImportant is a wrapper around gtk_tool_item_set_is_important(). +func (v *ToolItem) SetIsImportant(isImportant bool) { + C.gtk_tool_item_set_is_important(v.native(), gbool(isImportant)) +} + +// GetIsImportant is a wrapper around gtk_tool_item_get_is_important(). +func (v *ToolItem) GetIsImportant() bool { + c := C.gtk_tool_item_get_is_important(v.native()) + return gobool(c) +} + +// TODO: gtk_tool_item_get_ellipsize_mode + +// GetIconSize is a wrapper around gtk_tool_item_get_icon_size(). +func (v *ToolItem) GetIconSize() IconSize { + c := C.gtk_tool_item_get_icon_size(v.native()) + return IconSize(c) +} + +// GetOrientation is a wrapper around gtk_tool_item_get_orientation(). +func (v *ToolItem) GetOrientation() Orientation { + c := C.gtk_tool_item_get_orientation(v.native()) + return Orientation(c) +} + +// GetToolbarStyle is a wrapper around gtk_tool_item_get_toolbar_style(). +func (v *ToolItem) GetToolbarStyle() ToolbarStyle { + c := C.gtk_tool_item_get_toolbar_style(v.native()) + return ToolbarStyle(c) +} + +// GetReliefStyle is a wrapper around gtk_tool_item_get_relief_style(). +func (v *ToolItem) GetReliefStyle() ReliefStyle { + c := C.gtk_tool_item_get_relief_style(v.native()) + return ReliefStyle(c) +} + +// GetTextAlignment is a wrapper around gtk_tool_item_get_text_alignment(). +func (v *ToolItem) GetTextAlignment() float32 { + c := C.gtk_tool_item_get_text_alignment(v.native()) + return float32(c) +} + +// GetTextOrientation is a wrapper around gtk_tool_item_get_text_orientation(). +func (v *ToolItem) GetTextOrientation() Orientation { + c := C.gtk_tool_item_get_text_orientation(v.native()) + return Orientation(c) +} + +// RetrieveProxyMenuItem is a wrapper around gtk_tool_item_retrieve_proxy_menu_item() +func (v *ToolItem) RetrieveProxyMenuItem() *MenuItem { + c := C.gtk_tool_item_retrieve_proxy_menu_item(v.native()) + if c == nil { + return nil + } + return wrapMenuItem(glib.Take(unsafe.Pointer(c))) +} + +// TODO: +// gtk_tool_item_get_proxy_menu_item(). + +// SetProxyMenuItem is a wrapper around gtk_tool_item_set_proxy_menu_item(). +func (v *ToolItem) SetProxyMenuItem(menuItemId string, menuItem IMenuItem) { + cstr := C.CString(menuItemId) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tool_item_set_proxy_menu_item(v.native(), (*C.gchar)(cstr), + C.toGtkWidget(unsafe.Pointer(menuItem.toMenuItem()))) +} + +// RebuildMenu is a wrapper around gtk_tool_item_rebuild_menu(). +func (v *ToolItem) RebuildMenu() { + C.gtk_tool_item_rebuild_menu(v.native()) +} + +// ToolbarReconfigured is a wrapper around gtk_tool_item_toolbar_reconfigured(). +func (v *ToolItem) ToolbarReconfigured() { + C.gtk_tool_item_toolbar_reconfigured(v.native()) +} + +// TODO: gtk_tool_item_get_text_size_group + +/* + * GtkToolItemGroup + */ + +// TODO: +// gtk_tool_item_group_get_collapsed(). +// gtk_tool_item_group_get_drop_item(). +// gtk_tool_item_group_get_ellipsize(). +// gtk_tool_item_group_get_item_position(). +// gtk_tool_item_group_get_n_items(). +// gtk_tool_item_group_get_label(). +// gtk_tool_item_group_get_label_widget(). +// gtk_tool_item_group_get_nth_item(). +// gtk_tool_item_group_get_header_relief(). +// gtk_tool_item_group_insert(). +// gtk_tool_item_group_new(). +// gtk_tool_item_group_set_collapsed(). +// gtk_tool_item_group_set_ellipsize(). +// gtk_tool_item_group_set_item_position(). +// gtk_tool_item_group_set_label(). +// gtk_tool_item_group_set_label_widget(). +// gtk_tool_item_group_set_header_relief(). + +/* + * GtkToolPalette + */ + +// TODO: +// gtk_tool_palette_new(). +// gtk_tool_palette_get_exclusive(). +// gtk_tool_palette_set_exclusive(). +// gtk_tool_palette_get_expand(). +// gtk_tool_palette_set_expand(). +// gtk_tool_palette_get_group_position(). +// gtk_tool_palette_set_group_position(). +// gtk_tool_palette_get_icon_size(). +// gtk_tool_palette_set_icon_size(). +// gtk_tool_palette_unset_icon_size(). +// gtk_tool_palette_get_style(). +// gtk_tool_palette_set_style(). +// gtk_tool_palette_unset_style(). +// gtk_tool_palette_add_drag_dest(). +// gtk_tool_palette_get_drag_item(). +// gtk_tool_palette_get_drag_target_group(). +// gtk_tool_palette_get_drag_target_item(). +// gtk_tool_palette_get_drop_group(). +// gtk_tool_palette_get_drop_item(). +// gtk_tool_palette_set_drag_source(). +// GtkToolPaletteDragTargets + +/* + * GtkTreeIter + */ + +// TreeIter is a representation of GTK's GtkTreeIter. +type TreeIter struct { + GtkTreeIter C.GtkTreeIter +} + +// native returns a pointer to the underlying GtkTreeIter. +func (v *TreeIter) native() *C.GtkTreeIter { + if v == nil { + return nil + } + return &v.GtkTreeIter +} + +func marshalTreeIter(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return (*TreeIter)(unsafe.Pointer(c)), nil +} + +func (v *TreeIter) free() { + C.gtk_tree_iter_free(v.native()) +} + +// Copy() is a wrapper around gtk_tree_iter_copy(). +// +// Caution: when this method is used together with selection.GetSelectedRows(), +// it might cause random crash issue. See issue #590 and #610. +func (v *TreeIter) Copy() (*TreeIter, error) { + c := C.gtk_tree_iter_copy(v.native()) + if c == nil { + return nil, nilPtrErr + } + t := &TreeIter{*c} + runtime.SetFinalizer(t, (*TreeIter).free) + return t, nil +} + +/* + * GtkTreeModel + */ + +// TreeModel is a representation of GTK's GtkTreeModel GInterface. +type TreeModel struct { + *glib.Object +} + +// ITreeModel is an interface type implemented by all structs +// embedding a TreeModel. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkTreeModel. +type ITreeModel interface { + toTreeModel() *C.GtkTreeModel + ToTreeModel() *TreeModel +} + +// native returns a pointer to the underlying GObject as a GtkTreeModel. +func (v *TreeModel) native() *C.GtkTreeModel { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeModel(p) +} + +func (v *TreeModel) toTreeModel() *C.GtkTreeModel { + if v == nil { + return nil + } + return v.native() +} + +func marshalTreeModel(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeModel(obj), nil +} + +func wrapTreeModel(obj *glib.Object) *TreeModel { + if obj == nil { + return nil + } + + return &TreeModel{obj} +} + +// ToTreeModel is a helper getter, e.g.: it returns *gtk.TreeStore/ListStore as a *gtk.TreeModel. +// In other cases, where you have a gtk.ITreeModel, use the type assertion. +func (v *TreeModel) ToTreeModel() *TreeModel { + return v +} + +// GetFlags() is a wrapper around gtk_tree_model_get_flags(). +func (v *TreeModel) GetFlags() TreeModelFlags { + c := C.gtk_tree_model_get_flags(v.native()) + return TreeModelFlags(c) +} + +// GetNColumns() is a wrapper around gtk_tree_model_get_n_columns(). +func (v *TreeModel) GetNColumns() int { + c := C.gtk_tree_model_get_n_columns(v.native()) + return int(c) +} + +// GetColumnType() is a wrapper around gtk_tree_model_get_column_type(). +func (v *TreeModel) GetColumnType(index int) glib.Type { + c := C.gtk_tree_model_get_column_type(v.native(), C.gint(index)) + return glib.Type(c) +} + +// GetIter() is a wrapper around gtk_tree_model_get_iter(). +func (v *TreeModel) GetIter(path *TreePath) (*TreeIter, error) { + var iter C.GtkTreeIter + c := C.gtk_tree_model_get_iter(v.native(), &iter, path.native()) + if !gobool(c) { + return nil, errors.New("Unable to set iterator") + } + t := &TreeIter{iter} + return t, nil +} + +// GetIterFromString() is a wrapper around +// gtk_tree_model_get_iter_from_string(). +func (v *TreeModel) GetIterFromString(path string) (*TreeIter, error) { + var iter C.GtkTreeIter + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_tree_model_get_iter_from_string(v.native(), &iter, + (*C.gchar)(cstr)) + if !gobool(c) { + return nil, errors.New("Unable to set iterator") + } + t := &TreeIter{iter} + return t, nil +} + +// GetIterFirst() is a wrapper around gtk_tree_model_get_iter_first(). +func (v *TreeModel) GetIterFirst() (*TreeIter, bool) { + var iter C.GtkTreeIter + c := C.gtk_tree_model_get_iter_first(v.native(), &iter) + if !gobool(c) { + return nil, false + } + t := &TreeIter{iter} + return t, true +} + +// GetPath() is a wrapper around gtk_tree_model_get_path(). +func (v *TreeModel) GetPath(iter *TreeIter) (*TreePath, error) { + c := C.gtk_tree_model_get_path(v.native(), iter.native()) + if c == nil { + return nil, nilPtrErr + } + p := &TreePath{c} + runtime.SetFinalizer(p, (*TreePath).free) + return p, nil +} + +// GetStringFromIter() is a wrapper around gtk_tree_model_get_string_from_iter(). +func (v *TreeModel) GetStringFromIter(iter *TreeIter) string { + c := C.gtk_tree_model_get_string_from_iter(v.native(), iter.native()) + s := goString(c) + defer C.g_free((C.gpointer)(c)) + return s +} + +// GetValue() is a wrapper around gtk_tree_model_get_value(). +func (v *TreeModel) GetValue(iter *TreeIter, column int) (*glib.Value, error) { + val, err := glib.ValueAlloc() + if err != nil { + return nil, err + } + C.gtk_tree_model_get_value( + v.native(), + iter.native(), + C.gint(column), + (*C.GValue)(unsafe.Pointer(val.Native()))) + return val, nil +} + +// IterHasChild() is a wrapper around gtk_tree_model_iter_has_child(). +func (v *TreeModel) IterHasChild(iter *TreeIter) bool { + c := C.gtk_tree_model_iter_has_child(v.native(), iter.native()) + return gobool(c) +} + +// IterNext() is a wrapper around gtk_tree_model_iter_next(). +func (v *TreeModel) IterNext(iter *TreeIter) bool { + c := C.gtk_tree_model_iter_next(v.native(), iter.native()) + return gobool(c) +} + +// IterPrevious is a wrapper around gtk_tree_model_iter_previous(). +func (v *TreeModel) IterPrevious(iter *TreeIter) bool { + c := C.gtk_tree_model_iter_previous(v.native(), iter.native()) + return gobool(c) +} + +// IterParent is a wrapper around gtk_tree_model_iter_parent(). +func (v *TreeModel) IterParent(iter, child *TreeIter) bool { + c := C.gtk_tree_model_iter_parent(v.native(), iter.native(), child.native()) + return gobool(c) +} + +// IterNthChild is a wrapper around gtk_tree_model_iter_nth_child(). +func (v *TreeModel) IterNthChild(iter *TreeIter, parent *TreeIter, n int) bool { + c := C.gtk_tree_model_iter_nth_child(v.native(), iter.native(), parent.native(), C.gint(n)) + return gobool(c) +} + +// IterChildren is a wrapper around gtk_tree_model_iter_children(). +func (v *TreeModel) IterChildren(iter, child *TreeIter) bool { + var cIter, cChild *C.GtkTreeIter + if iter != nil { + cIter = iter.native() + } + cChild = child.native() + c := C.gtk_tree_model_iter_children(v.native(), cChild, cIter) + return gobool(c) +} + +// IterNChildren is a wrapper around gtk_tree_model_iter_n_children(). +func (v *TreeModel) IterNChildren(iter *TreeIter) int { + var cIter *C.GtkTreeIter + if iter != nil { + cIter = iter.native() + } + c := C.gtk_tree_model_iter_n_children(v.native(), cIter) + return int(c) +} + +// FilterNew is a wrapper around gtk_tree_model_filter_new(). +func (v *TreeModel) FilterNew(root *TreePath) (*TreeModelFilter, error) { + c := C.gtk_tree_model_filter_new(v.native(), root.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeModelFilter(obj), nil +} + +// TreeModelForeachFunc defines the function prototype for the foreach function (f arg) for +// (* TreeModel).ForEach +type TreeModelForeachFunc func(model *TreeModel, path *TreePath, iter *TreeIter) bool + +// ForEach() is a wrapper around gtk_tree_model_foreach () +func (v *TreeModel) ForEach(f TreeModelForeachFunc) { + id := callback.Assign(f) + defer callback.Delete(id) + + C._gtk_tree_model_foreach(v.toTreeModel(), C.gpointer(id)) +} + +/* + * GtkTreeModelFilter + */ + +// TreeModelFilter is a representation of GTK's GtkTreeModelFilter. +type TreeModelFilter struct { + *glib.Object + + // Interfaces + TreeModel +} + +func (v *TreeModelFilter) native() *C.GtkTreeModelFilter { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeModelFilter(p) +} + +func (v *TreeModelFilter) toTreeModelFilter() *C.GtkTreeModelFilter { + if v == nil { + return nil + } + return v.native() +} + +func marshalTreeModelFilter(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeModelFilter(obj), nil +} + +func wrapTreeModelFilter(obj *glib.Object) *TreeModelFilter { + if obj == nil { + return nil + } + + tm := wrapTreeModel(obj) + return &TreeModelFilter{obj, *tm} +} + +// SetVisibleColumn is a wrapper around gtk_tree_model_filter_set_visible_column(). +func (v *TreeModelFilter) SetVisibleColumn(column int) { + C.gtk_tree_model_filter_set_visible_column(v.native(), C.gint(column)) +} + +// ConvertChildPathToPath is a wrapper around gtk_tree_model_filter_convert_child_path_to_path(). +func (v *TreeModelFilter) ConvertChildPathToPath(childPath *TreePath) *TreePath { + path := C.gtk_tree_model_filter_convert_child_path_to_path(v.native(), childPath.native()) + if path == nil { + return nil + } + p := &TreePath{path} + runtime.SetFinalizer(p, (*TreePath).free) + return p +} + +// ConvertChildIterToIter is a wrapper around gtk_tree_model_filter_convert_child_iter_to_iter(). +func (v *TreeModelFilter) ConvertChildIterToIter(childIter *TreeIter) (*TreeIter, bool) { + var iter C.GtkTreeIter + ok := gobool(C.gtk_tree_model_filter_convert_child_iter_to_iter(v.native(), &iter, childIter.native())) + t := &TreeIter{iter} + return t, ok +} + +// ConvertIterToChildIter is a wrapper around gtk_tree_model_filter_convert_child_iter_to_iter(). +func (v *TreeModelFilter) ConvertIterToChildIter(filterIter *TreeIter) *TreeIter { + var iter C.GtkTreeIter + C.gtk_tree_model_filter_convert_iter_to_child_iter(v.native(), &iter, filterIter.native()) + t := &TreeIter{iter} + return t +} + +// ConvertPathToChildPath is a wrapper around gtk_tree_model_filter_convert_path_to_child_path(). +func (v *TreeModelFilter) ConvertPathToChildPath(filterPath *TreePath) *TreePath { + path := C.gtk_tree_model_filter_convert_path_to_child_path(v.native(), filterPath.native()) + if path == nil { + return nil + } + p := &TreePath{path} + runtime.SetFinalizer(p, (*TreePath).free) + return p +} + +// Refilter is a wrapper around gtk_tree_model_filter_refilter(). +func (v *TreeModelFilter) Refilter() { + C.gtk_tree_model_filter_refilter(v.native()) +} + +// TreeModelFilterVisibleFunc defines the function prototype for the filter visibility function (f arg) +// to TreeModelFilter.SetVisibleFunc. +type TreeModelFilterVisibleFunc func(model *TreeModel, iter *TreeIter) bool + +// SetVisibleFunc is a wrapper around gtk_tree_model_filter_set_visible_func(). +func (v *TreeModelFilter) SetVisibleFunc(f TreeModelFilterVisibleFunc) { + C._gtk_tree_model_filter_set_visible_func(v.native(), C.gpointer(callback.Assign(f))) +} + +// Down() is a wrapper around gtk_tree_path_down() +func (v *TreePath) Down() { + C.gtk_tree_path_down(v.native()) +} + +// IsAncestor() is a wrapper around gtk_tree_path_is_ancestor() +func (v *TreePath) IsAncestor(descendant *TreePath) bool { + return gobool(C.gtk_tree_path_is_ancestor(v.native(), descendant.native())) +} + +// IsDescendant() is a wrapper around gtk_tree_path_is_descendant() +func (v *TreePath) IsDescendant(ancestor *TreePath) bool { + return gobool(C.gtk_tree_path_is_descendant(v.native(), ancestor.native())) +} + +/* + * GtkTreePath + */ + +// TreePath is a representation of GTK's GtkTreePath. +type TreePath struct { + GtkTreePath *C.GtkTreePath +} + +// Return a TreePath from the GList +func TreePathFromList(list *glib.List) *TreePath { + if list == nil { + return nil + } + return &TreePath{(*C.GtkTreePath)(list.Data().(unsafe.Pointer))} +} + +// native returns a pointer to the underlying GtkTreePath. +func (v *TreePath) native() *C.GtkTreePath { + if v == nil { + return nil + } + return v.GtkTreePath +} + +func marshalTreePath(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return &TreePath{(*C.GtkTreePath)(unsafe.Pointer(c))}, nil +} + +func (v *TreePath) free() { + C.gtk_tree_path_free(v.native()) +} + +// GetIndices is a wrapper around gtk_tree_path_get_indices_with_depth +func (v *TreePath) GetIndices() []int { + var depth C.gint + var goindices []int + var ginthelp C.gint + indices := uintptr(unsafe.Pointer(C.gtk_tree_path_get_indices_with_depth(v.native(), &depth))) + size := unsafe.Sizeof(ginthelp) + for i := 0; i < int(depth); i++ { + goind := int(*((*C.gint)(unsafe.Pointer(indices)))) + goindices = append(goindices, goind) + indices += size + } + return goindices +} + +// String is a wrapper around gtk_tree_path_to_string(). +func (v *TreePath) String() string { + c := C.gtk_tree_path_to_string(v.native()) + return goString(c) +} + +// TreePathNewFromString is a wrapper around gtk_tree_path_new_from_string(). +func TreePathNewFromString(path string) (*TreePath, error) { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_tree_path_new_from_string((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + t := &TreePath{c} + runtime.SetFinalizer(t, (*TreePath).free) + return t, nil +} + +// Next() is a wrapper around gtk_tree_path_next() +func (v *TreePath) Next() { + C.gtk_tree_path_next(v.native()) +} + +// Prev() is a wrapper around gtk_tree_path_prev() +func (v *TreePath) Prev() bool { + return gobool(C.gtk_tree_path_prev(v.native())) +} + +// Up() is a wrapper around gtk_tree_path_up() +func (v *TreePath) Up() bool { + return gobool(C.gtk_tree_path_up(v.native())) +} + +// TreePathNewFirst() is a wrapper around gtk_tree_path_new_first(). +func TreePathNewFirst() (*TreePath, error) { + c := C.gtk_tree_path_new_first() + if c == nil { + return nil, nilPtrErr + } + t := &TreePath{c} + runtime.SetFinalizer(t, (*TreePath).free) + return t, nil +} + +// AppendIndex() is a wrapper around gtk_tree_path_append_index(). +func (v *TreePath) AppendIndex(index int) { + C.gtk_tree_path_append_index(v.native(), C.gint(index)) +} + +// PrependIndex() is a wrapper around gtk_tree_path_prepend_index(). +func (v *TreePath) PrependIndex(index int) { + C.gtk_tree_path_prepend_index(v.native(), C.gint(index)) +} + +// GetDepth() is a wrapper around gtk_tree_path_get_depth(). +func (v *TreePath) GetDepth() int { + return int(C.gtk_tree_path_get_depth(v.native())) +} + +// Copy() is a wrapper around gtk_tree_path_copy(). +func (v *TreePath) Copy() (*TreePath, error) { + c := C.gtk_tree_path_copy(v.native()) + if c == nil { + return nil, nilPtrErr + } + t := &TreePath{c} + runtime.SetFinalizer(t, (*TreePath).free) + return t, nil +} + +// Compare() is a wrapper around gtk_tree_path_compare(). +func (v *TreePath) Compare(b *TreePath) int { + return int(C.gtk_tree_path_compare(v.native(), b.native())) +} + +/* + * GtkTreeSelection + */ + +// TreeSelection is a representation of GTK's GtkTreeSelection. +type TreeSelection struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkTreeSelection. +func (v *TreeSelection) native() *C.GtkTreeSelection { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeSelection(p) +} + +func marshalTreeSelection(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeSelection(obj), nil +} + +func wrapTreeSelection(obj *glib.Object) *TreeSelection { + if obj == nil { + return nil + } + + return &TreeSelection{obj} +} + +// GetSelected() is a wrapper around gtk_tree_selection_get_selected(). +func (v *TreeSelection) GetSelected() (model ITreeModel, iter *TreeIter, ok bool) { + var cmodel *C.GtkTreeModel + var citer C.GtkTreeIter + c := C.gtk_tree_selection_get_selected(v.native(), + &cmodel, &citer) + model = wrapTreeModel(glib.Take(unsafe.Pointer(cmodel))) + iter = &TreeIter{citer} + ok = gobool(c) + return +} + +// SelectPath is a wrapper around gtk_tree_selection_select_path(). +func (v *TreeSelection) SelectPath(path *TreePath) { + C.gtk_tree_selection_select_path(v.native(), path.native()) +} + +// UnselectPath is a wrapper around gtk_tree_selection_unselect_path(). +func (v *TreeSelection) UnselectPath(path *TreePath) { + C.gtk_tree_selection_unselect_path(v.native(), path.native()) +} + +// GetSelectedRows is a wrapper around gtk_tree_selection_get_selected_rows(). +// All the elements of returned list are wrapped into (*gtk.TreePath) values. +// +// Please note that a runtime finalizer is only set on the head of the linked +// list, and must be kept live while accessing any item in the list, or the +// Go garbage collector will free the whole list. +func (v *TreeSelection) GetSelectedRows(model ITreeModel) *glib.List { + var pcmodel **C.GtkTreeModel + if model != nil { + cmodel := model.toTreeModel() + pcmodel = &cmodel + } + + clist := C.gtk_tree_selection_get_selected_rows(v.native(), pcmodel) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return &TreePath{(*C.GtkTreePath)(ptr)} + }) + runtime.SetFinalizer(glist, func(glist *glib.List) { + glist.FreeFull(func(item interface{}) { + path := item.(*TreePath) + C.gtk_tree_path_free(path.GtkTreePath) + }) + }) + + return glist +} + +// CountSelectedRows() is a wrapper around gtk_tree_selection_count_selected_rows(). +func (v *TreeSelection) CountSelectedRows() int { + return int(C.gtk_tree_selection_count_selected_rows(v.native())) +} + +// SelectIter is a wrapper around gtk_tree_selection_select_iter(). +func (v *TreeSelection) SelectIter(iter *TreeIter) { + C.gtk_tree_selection_select_iter(v.native(), iter.native()) +} + +// SetMode() is a wrapper around gtk_tree_selection_set_mode(). +func (v *TreeSelection) SetMode(m SelectionMode) { + C.gtk_tree_selection_set_mode(v.native(), C.GtkSelectionMode(m)) +} + +// GetMode() is a wrapper around gtk_tree_selection_get_mode(). +func (v *TreeSelection) GetMode() SelectionMode { + return SelectionMode(C.gtk_tree_selection_get_mode(v.native())) +} + +// SelectAll() is a wrapper around gtk_tree_selection_select_all() +func (v *TreeSelection) SelectAll() { + C.gtk_tree_selection_select_all(v.native()) +} + +// UnelectAll() is a wrapper around gtk_tree_selection_unselect_all() +func (v *TreeSelection) UnselectAll() { + C.gtk_tree_selection_unselect_all(v.native()) +} + +// UnselectIter() is a wrapper around gtk_tree_selection_unselect_iter(). +func (v *TreeSelection) UnselectIter(iter *TreeIter) { + C.gtk_tree_selection_unselect_iter(v.native(), iter.native()) +} + +// IterIsSelected() is a wrapper around gtk_tree_selection_iter_is_selected(). +func (v *TreeSelection) IterIsSelected(iter *TreeIter) bool { + return gobool(C.gtk_tree_selection_iter_is_selected(v.native(), iter.native())) +} + +// SelectRange() is a wrapper around gtk_tree_selection_select_range(). +func (v *TreeSelection) SelectRange(start, end *TreePath) { + C.gtk_tree_selection_select_range(v.native(), start.native(), end.native()) +} + +// UnselectRange() is a wrapper around gtk_tree_selection_unselect_range(). +func (v *TreeSelection) UnselectRange(start, end *TreePath) { + C.gtk_tree_selection_unselect_range(v.native(), start.native(), end.native()) +} + +// PathIsSelected() is a wrapper around gtk_tree_selection_path_is_selected(). +func (v *TreeSelection) PathIsSelected(path *TreePath) bool { + return gobool(C.gtk_tree_selection_path_is_selected(v.native(), path.native())) +} + +// TreeSelectionForeachFunc defines the function prototype for the selected_foreach function (f arg) for +// (* TreeSelection).SelectedForEach +type TreeSelectionForeachFunc func(model *TreeModel, path *TreePath, iter *TreeIter) + +// SelectedForEach() is a wrapper around gtk_tree_selection_selected_foreach() +func (v *TreeSelection) SelectedForEach(f TreeSelectionForeachFunc) { + id := callback.Assign(f) + defer callback.Delete(id) + + C._gtk_tree_selection_selected_foreach(v.native(), C.gpointer(id)) +} + +// TreeSelectionFunc defines the function prototype for the gtk_tree_selection_set_select_function +// function (f arg) for (* TreeSelection).SetSelectFunction +type TreeSelectionFunc func(selection *TreeSelection, model *TreeModel, path *TreePath, selected bool) bool + +// SetSelectFunction() is a wrapper around gtk_tree_selection_set_select_function() +func (v *TreeSelection) SetSelectFunction(f TreeSelectionFunc) { + C._gtk_tree_selection_set_select_function(v.native(), C.gpointer(callback.Assign(f))) +} + +/* + * GtkTreeRowReference + */ + +// TreeRowReference is a representation of GTK's GtkTreeRowReference. +type TreeRowReference struct { + GtkTreeRowReference *C.GtkTreeRowReference +} + +func (v *TreeRowReference) native() *C.GtkTreeRowReference { + if v == nil { + return nil + } + return v.GtkTreeRowReference +} + +func (v *TreeRowReference) free() { + C.gtk_tree_row_reference_free(v.native()) +} + +// TreeRowReferenceNew is a wrapper around gtk_tree_row_reference_new(). +func TreeRowReferenceNew(model *TreeModel, path *TreePath) (*TreeRowReference, error) { + c := C.gtk_tree_row_reference_new(model.native(), path.native()) + if c == nil { + return nil, nilPtrErr + } + r := &TreeRowReference{c} + runtime.SetFinalizer(r, (*TreeRowReference).free) + return r, nil +} + +// GetPath is a wrapper around gtk_tree_row_reference_get_path. +func (v *TreeRowReference) GetPath() *TreePath { + c := C.gtk_tree_row_reference_get_path(v.native()) + if c == nil { + return nil + } + t := &TreePath{c} + runtime.SetFinalizer(t, (*TreePath).free) + return t +} + +// GetModel is a wrapper around gtk_tree_row_reference_get_path. +func (v *TreeRowReference) GetModel() (ITreeModel, error) { + c := C.gtk_tree_row_reference_get_model(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castTreeModel(c) +} + +// Valid is a wrapper around gtk_tree_row_reference_valid. +func (v *TreeRowReference) Valid() bool { + c := C.gtk_tree_row_reference_valid(v.native()) + return gobool(c) +} + +/* + * GtkTreeSortable + */ + +// TreeSortable is a representation of GTK's GtkTreeSortable +type TreeSortable struct { + *glib.Object +} + +// ITreeSortable is an interface type implemented by all structs +// embedding a TreeSortable. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkTreeSortable. +type ITreeSortable interface { + toTreeSortable() *C.GtkTreeSortable +} + +// native returns a pointer to the underlying GtkTreeSortable +func (v *TreeSortable) native() *C.GtkTreeSortable { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeSortable(p) +} + +func (v *TreeSortable) toTreeSortable() *C.GtkTreeSortable { + if v == nil { + return nil + } + return v.native() +} + +func marshalTreeSortable(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeSortable(obj), nil +} + +func wrapTreeSortable(obj *glib.Object) *TreeSortable { + if obj == nil { + return nil + } + + return &TreeSortable{obj} +} + +// TreeIterCompareFunc is a representation of GtkTreeIterCompareFunc. +// It defines the function prototype for the sort function (f arg) for (* TreeSortable).SetSortFunc +type TreeIterCompareFunc func(model *TreeModel, a, b *TreeIter) int + +// GetSortColumnId() is a wrapper around gtk_tree_sortable_get_sort_column_id(). +func (v *TreeSortable) GetSortColumnId() (int, SortType, bool) { + var column C.gint + var order C.GtkSortType + ok := gobool(C.gtk_tree_sortable_get_sort_column_id(v.native(), &column, &order)) + return int(column), SortType(order), ok +} + +// SetSortColumnId() is a wrapper around gtk_tree_sortable_set_sort_column_id(). +func (v *TreeSortable) SetSortColumnId(column int, order SortType) { + C.gtk_tree_sortable_set_sort_column_id(v.native(), C.gint(column), C.GtkSortType(order)) +} + +// SetSortFunc() is a wrapper around gtk_tree_sortable_set_sort_func(). +func (v *TreeSortable) SetSortFunc(sortColumn int, f TreeIterCompareFunc) { + C._gtk_tree_sortable_set_sort_func(v.native(), C.gint(sortColumn), C.gpointer(callback.Assign(f))) +} + +// SetDefaultSortFunc() is a wrapper around gtk_tree_sortable_set_default_sort_func(). +func (v *TreeSortable) SetDefaultSortFunc(f TreeIterCompareFunc) { + C._gtk_tree_sortable_set_default_sort_func(v.native(), C.gpointer(callback.Assign(f))) +} + +func (v *TreeSortable) HasDefaultSortFunc() bool { + return gobool(C.gtk_tree_sortable_has_default_sort_func(v.native())) +} + +/* + * GtkTreeModelSort + */ + +// TreeModelSort is a representation of GTK's GtkTreeModelSort +type TreeModelSort struct { + *glib.Object + + // Interfaces + TreeModel + TreeSortable +} + +// native returns a pointer to the underlying GtkTreeModelSort +func (v *TreeModelSort) native() *C.GtkTreeModelSort { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeModelSort(p) +} + +func marshalTreeModelSort(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeModelSort(obj), nil +} + +func wrapTreeModelSort(obj *glib.Object) *TreeModelSort { + if obj == nil { + return nil + } + + tm := wrapTreeModel(obj) + ts := wrapTreeSortable(obj) + return &TreeModelSort{obj, *tm, *ts} +} + +func (v *TreeModelSort) toTreeModel() *C.GtkTreeModel { + if v == nil { + return nil + } + return C.toGtkTreeModel(unsafe.Pointer(v.GObject)) +} + +func (v *TreeModelSort) toTreeSortable() *C.GtkTreeSortable { + if v == nil { + return nil + } + return C.toGtkTreeSortable(unsafe.Pointer(v.GObject)) +} + +// TreeModelSortNew is a wrapper around gtk_tree_model_sort_new_with_model(): +func TreeModelSortNew(model ITreeModel) (*TreeModelSort, error) { + var mptr *C.GtkTreeModel + if model != nil { + mptr = model.toTreeModel() + } + c := C.gtk_tree_model_sort_new_with_model(mptr) + if c == nil { + return nil, nilPtrErr + } + + tms := wrapTreeModelSort(glib.Take(unsafe.Pointer(c))) + return tms, nil +} + +// GetModel is a wrapper around gtk_tree_model_sort_get_model() +func (v *TreeModelSort) GetModel() (ITreeModel, error) { + c := C.gtk_tree_model_sort_get_model(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castTreeModel(c) +} + +// ConvertChildPathToPath is a wrapper around gtk_tree_model_sort_convert_child_path_to_path(). +func (v *TreeModelSort) ConvertChildPathToPath(childPath *TreePath) *TreePath { + path := C.gtk_tree_model_sort_convert_child_path_to_path(v.native(), childPath.native()) + if path == nil { + return nil + } + p := &TreePath{path} + runtime.SetFinalizer(p, (*TreePath).free) + return p +} + +// ConvertChildIterToIter is a wrapper around gtk_tree_model_sort_convert_child_iter_to_iter(). +func (v *TreeModelSort) ConvertChildIterToIter(childIter *TreeIter) (*TreeIter, bool) { + var iter C.GtkTreeIter + ok := gobool(C.gtk_tree_model_sort_convert_child_iter_to_iter(v.native(), &iter, childIter.native())) + t := &TreeIter{iter} + return t, ok +} + +// ConvertPathToChildPath is a wrapper around gtk_tree_model_sort_convert_path_to_child_path(). +func (v *TreeModelSort) ConvertPathToChildPath(sortPath *TreePath) *TreePath { + path := C.gtk_tree_model_sort_convert_path_to_child_path(v.native(), sortPath.native()) + if path == nil { + return nil + } + p := &TreePath{path} + runtime.SetFinalizer(p, (*TreePath).free) + return p +} + +// ConvertIterToChildIter is a wrapper around gtk_tree_model_sort_convert_iter_to_child_iter(). +func (v *TreeModelSort) ConvertIterToChildIter(sortIter *TreeIter) *TreeIter { + var iter C.GtkTreeIter + C.gtk_tree_model_sort_convert_iter_to_child_iter(v.native(), &iter, sortIter.native()) + t := &TreeIter{iter} + return t +} + +// ResetDefaultSortFunc is a wrapper around gtk_tree_model_sort_reset_default_sort_func(). +func (v *TreeModelSort) ResetDefaultSortFunc() { + C.gtk_tree_model_sort_reset_default_sort_func(v.native()) +} + +// ClearCache is a wrapper around gtk_tree_model_sort_clear_cache(). +func (v *TreeModelSort) ClearCache() { + C.gtk_tree_model_sort_clear_cache(v.native()) +} + +// IterIsValid is a wrapper around gtk_tree_model_sort_iter_is_valid(). +func (v *TreeModelSort) IterIsValid(iter *TreeIter) bool { + return gobool(C.gtk_tree_model_sort_iter_is_valid(v.native(), iter.native())) +} + +/* + * GtkTreeStore + */ + +// TreeStore is a representation of GTK's GtkTreeStore. +type TreeStore struct { + *glib.Object + + // Interfaces + TreeModel + TreeSortable +} + +// native returns a pointer to the underlying GtkTreeStore. +func (v *TreeStore) native() *C.GtkTreeStore { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeStore(p) +} + +func marshalTreeStore(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeStore(obj), nil +} + +func wrapTreeStore(obj *glib.Object) *TreeStore { + if obj == nil { + return nil + } + + tm := wrapTreeModel(obj) + ts := wrapTreeSortable(obj) + return &TreeStore{obj, *tm, *ts} +} + +func (v *TreeStore) toTreeModel() *C.GtkTreeModel { + if v == nil { + return nil + } + return C.toGtkTreeModel(unsafe.Pointer(v.GObject)) +} + +func (v *TreeStore) toTreeSortable() *C.GtkTreeSortable { + if v == nil { + return nil + } + return C.toGtkTreeSortable(unsafe.Pointer(v.GObject)) +} + +// TreeStoreNew is a wrapper around gtk_tree_store_newv(). +func TreeStoreNew(types ...glib.Type) (*TreeStore, error) { + gtypes := C.alloc_types(C.int(len(types))) + for n, val := range types { + C.set_type(gtypes, C.int(n), C.GType(val)) + } + defer C.g_free(C.gpointer(gtypes)) + c := C.gtk_tree_store_newv(C.gint(len(types)), gtypes) + if c == nil { + return nil, nilPtrErr + } + + ts := wrapTreeStore(glib.Take(unsafe.Pointer(c))) + return ts, nil +} + +// Append is a wrapper around gtk_tree_store_append(). +func (v *TreeStore) Append(parent *TreeIter) *TreeIter { + var ti C.GtkTreeIter + var cParent *C.GtkTreeIter + if parent != nil { + cParent = parent.native() + } + C.gtk_tree_store_append(v.native(), &ti, cParent) + iter := &TreeIter{ti} + return iter +} + +// Prepend is a wrapper around gtk_tree_store_prepend(). +func (v *TreeStore) Prepend(parent *TreeIter) *TreeIter { + var ti C.GtkTreeIter + var cParent *C.GtkTreeIter + if parent != nil { + cParent = parent.native() + } + C.gtk_tree_store_prepend(v.native(), &ti, cParent) + iter := &TreeIter{ti} + return iter +} + +// Insert is a wrapper around gtk_tree_store_insert +func (v *TreeStore) Insert(parent *TreeIter, position int) *TreeIter { + var ti C.GtkTreeIter + var cParent *C.GtkTreeIter + if parent != nil { + cParent = parent.native() + } + C.gtk_tree_store_insert(v.native(), &ti, cParent, C.gint(position)) + iter := &TreeIter{ti} + return iter +} + +// SetValue is a wrapper around gtk_tree_store_set_value() +func (v *TreeStore) SetValue(iter *TreeIter, column int, value interface{}) error { + switch value.(type) { + case *gdk.Pixbuf: + pix := value.(*gdk.Pixbuf) + C._gtk_tree_store_set(v.native(), iter.native(), C.gint(column), unsafe.Pointer(pix.Native())) + + default: + gv, err := glib.GValue(value) + if err != nil { + return err + } + C.gtk_tree_store_set_value(v.native(), iter.native(), + C.gint(column), + (*C.GValue)(C.gpointer(gv.Native()))) + } + return nil +} + +// Remove is a wrapper around gtk_tree_store_remove(). +func (v *TreeStore) Remove(iter *TreeIter) bool { + var ti *C.GtkTreeIter + if iter != nil { + ti = iter.native() + } + return 0 != C.gtk_tree_store_remove(v.native(), ti) +} + +// Clear is a wrapper around gtk_tree_store_clear(). +func (v *TreeStore) Clear() { + C.gtk_tree_store_clear(v.native()) +} + +// InsertBefore() is a wrapper around gtk_tree_store_insert_before(). +func (v *TreeStore) InsertBefore(parent, sibling *TreeIter) *TreeIter { + var ti C.GtkTreeIter + C.gtk_tree_store_insert_before(v.native(), &ti, parent.native(), sibling.native()) + iter := &TreeIter{ti} + return iter +} + +// InsertAfter() is a wrapper around gtk_tree_store_insert_after(). +func (v *TreeStore) InsertAfter(parent, sibling *TreeIter) *TreeIter { + var ti C.GtkTreeIter + C.gtk_tree_store_insert_after(v.native(), &ti, parent.native(), sibling.native()) + iter := &TreeIter{ti} + return iter +} + +// InsertWithValues() is a wrapper around gtk_tree_store_insert_with_valuesv(). +func (v *TreeStore) InsertWithValues(iter, parent *TreeIter, position int, inColumns []int, inValues []interface{}) error { + length := len(inColumns) + if len(inValues) < length { + length = len(inValues) + } + + cColumns := make([]C.gint, 0, length) + cValues := make([]C.GValue, 0, length) + + for i := 0; i < length; i++ { + + value := inValues[i] + var gvalue *C.GValue + + switch value.(type) { + case *gdk.Pixbuf: + pix := value.(*gdk.Pixbuf) + + if pix == nil { + continue + } + + gvalue = (*C.GValue)(unsafe.Pointer(pix.Native())) + + default: + gv, err := glib.GValue(value) + if err != nil { + return err + } + gvalue = (*C.GValue)(C.gpointer(gv.Native())) + } + + cColumns = append(cColumns, C.gint(inColumns[i])) + cValues = append(cValues, *gvalue) + } + + var cColumnsPointer *C.gint + if len(cColumns) > 0 { + cColumnsPointer = &cColumns[0] + } + var cValuesPointer *C.GValue + if len(cValues) > 0 { + cValuesPointer = &cValues[0] + } + + C.gtk_tree_store_insert_with_valuesv(v.native(), iter.native(), parent.native(), C.gint(position), cColumnsPointer, cValuesPointer, C.gint(len(cColumns))) + + return nil +} + +// MoveBefore is a wrapper around gtk_tree_store_move_before(). +func (v *TreeStore) MoveBefore(iter, position *TreeIter) { + C.gtk_tree_store_move_before(v.native(), iter.native(), + position.native()) +} + +// MoveAfter is a wrapper around gtk_tree_store_move_after(). +func (v *TreeStore) MoveAfter(iter, position *TreeIter) { + C.gtk_tree_store_move_after(v.native(), iter.native(), + position.native()) +} + +// Swap is a wrapper around gtk_tree_store_swap(). +func (v *TreeStore) Swap(a, b *TreeIter) { + C.gtk_tree_store_swap(v.native(), a.native(), b.native()) +} + +// SetColumnTypes is a wrapper around gtk_tree_store_set_column_types(). +// The size of glib.Type must match the number of columns +func (v *TreeStore) SetColumnTypes(types ...glib.Type) { + gtypes := C.alloc_types(C.int(len(types))) + for n, val := range types { + C.set_type(gtypes, C.int(n), C.GType(val)) + } + defer C.g_free(C.gpointer(gtypes)) + C.gtk_tree_store_set_column_types(v.native(), C.gint(len(types)), gtypes) +} + +/* + * GtkViewport + */ + +// Viewport is a representation of GTK's GtkViewport GInterface. +type Viewport struct { + Bin + + // Interfaces + Scrollable +} + +// IViewport is an interface type implemented by all structs +// embedding a Viewport. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkViewport. +type IViewport interface { + toViewport() *C.GtkViewport +} + +// native() returns a pointer to the underlying GObject as a GtkViewport. +func (v *Viewport) native() *C.GtkViewport { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkViewport(p) +} + +func wrapViewport(obj *glib.Object) *Viewport { + if obj == nil { + return nil + } + + b := wrapBin(obj) + s := wrapScrollable(obj) + return &Viewport{ + Bin: *b, + Scrollable: *s, + } +} + +func (v *Viewport) toViewport() *C.GtkViewport { + if v == nil { + return nil + } + return v.native() +} + +// ViewportNew() is a wrapper around gtk_viewport_new(). +func ViewportNew(hadjustment, vadjustment *Adjustment) (*Viewport, error) { + c := C.gtk_viewport_new(hadjustment.native(), vadjustment.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapViewport(glib.Take(unsafe.Pointer(c))), nil +} + +// SetShadowType is a wrapper around gtk_viewport_set_shadow_type(). +func (v *Viewport) SetShadowType(shadowType ShadowType) { + C.gtk_viewport_set_shadow_type(v.native(), C.GtkShadowType(shadowType)) +} + +// GetShadowType is a wrapper around gtk_viewport_get_shadow_type(). +func (v *Viewport) GetShadowType() ShadowType { + c := C.gtk_viewport_get_shadow_type(v.native()) + return ShadowType(c) +} + +// GetBinWindow is a wrapper around gtk_viewport_get_bin_window(). +func (v *Viewport) GetBinWindow() *gdk.Window { + c := C.gtk_viewport_get_bin_window(v.native()) + if c == nil { + return nil + } + return &gdk.Window{glib.Take(unsafe.Pointer(c))} +} + +// GetViewWindow is a wrapper around gtk_viewport_get_view_window(). +func (v *Viewport) GetViewWindow() *gdk.Window { + c := C.gtk_viewport_get_view_window(v.native()) + if c == nil { + return nil + } + return &gdk.Window{glib.Take(unsafe.Pointer(c))} +} + +/* + * GtkVolumeButton + */ + +// VolumeButton is a representation of GTK's GtkVolumeButton. +type VolumeButton struct { + ScaleButton +} + +// native() returns a pointer to the underlying GtkVolumeButton. +func (v *VolumeButton) native() *C.GtkVolumeButton { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkVolumeButton(p) +} + +func marshalVolumeButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapVolumeButton(obj), nil +} + +func wrapVolumeButton(obj *glib.Object) *VolumeButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &VolumeButton{ScaleButton{Button{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, actionable}}} +} + +// VolumeButtonNew is a wrapper around gtk_volume_button_new(). +func VolumeButtonNew() (*VolumeButton, error) { + c := C.gtk_volume_button_new() + if c == nil { + return nil, nilPtrErr + } + return wrapVolumeButton(glib.Take(unsafe.Pointer(c))), nil +} + +type WrapFn interface{} + +var WrapMap = map[string]WrapFn{ + "GtkAccelGroup": wrapAccelGroup, + "GtkAccelMao": wrapAccelMap, + "GtkAdjustment": wrapAdjustment, + "GtkApplicationWindow": wrapApplicationWindow, + "GtkAssistant": wrapAssistant, + "GtkBin": wrapBin, + "GtkBox": wrapBox, + "GtkButton": wrapButton, + "GtkCalendar": wrapCalendar, + "GtkCellLayout": wrapCellLayout, + "GtkCellEditable": wrapCellEditable, + "GtkCellRenderer": wrapCellRenderer, + "GtkCellRendererSpinner": wrapCellRendererSpinner, + "GtkCellRendererPixbuf": wrapCellRendererPixbuf, + "GtkCellRendererText": wrapCellRendererText, + "GtkCellRendererProgress": wrapCellRendererProgress, + "GtkCellRendererToggle": wrapCellRendererToggle, + "GtkCellRendererCombo": wrapCellRendererCombo, + "GtkCellRendererAccel": wrapCellRendererAccel, + "GtkCellRendererSpin": wrapCellRendererSpin, + "GtkCheckButton": wrapCheckButton, + "GtkCheckMenuItem": wrapCheckMenuItem, + "GtkClipboard": wrapClipboard, + "GtkColorButton": wrapColorButton, + "GtkContainer": wrapContainer, + "GtkDialog": wrapDialog, + "GtkDrawingArea": wrapDrawingArea, + "GtkEditable": wrapEditable, + "GtkEntry": wrapEntry, + "GtkEntryBuffer": wrapEntryBuffer, + "GtkEntryCompletion": wrapEntryCompletion, + "GtkEventBox": wrapEventBox, + "GtkExpander": wrapExpander, + "GtkFrame": wrapFrame, + "GtkFileChooser": wrapFileChooser, + "GtkFileChooserButton": wrapFileChooserButton, + "GtkFileChooserDialog": wrapFileChooserDialog, + "GtkFileChooserWidget": wrapFileChooserWidget, + "GtkGrid": wrapGrid, + "GtkIconView": wrapIconView, + "GtkImage": wrapImage, + "GtkLabel": wrapLabel, + "GtkLayout": wrapLayout, + "GtkLinkButton": wrapLinkButton, + "GtkListStore": wrapListStore, + "GtkMenu": wrapMenu, + "GtkMenuBar": wrapMenuBar, + "GtkMenuButton": wrapMenuButton, + "GtkMenuItem": wrapMenuItem, + "GtkMenuShell": wrapMenuShell, + "GtkMessageDialog": wrapMessageDialog, + "GtkNotebook": wrapNotebook, + "GtkOffscreenWindow": wrapOffscreenWindow, + "GtkOrientable": wrapOrientable, + "GtkOverlay": wrapOverlay, + "GtkPaned": wrapPaned, + "GtkProgressBar": wrapProgressBar, + "GtkRadioButton": wrapRadioButton, + "GtkRadioMenuItem": wrapRadioMenuItem, + "GtkRange": wrapRange, + "GtkRecentChooser": wrapRecentChooser, + "GtkRecentChooserMenu": wrapRecentChooserMenu, + "GtkRecentFilter": wrapRecentFilter, + "GtkRecentManager": wrapRecentManager, + "GtkScaleButton": wrapScaleButton, + "GtkScale": wrapScale, + "GtkScrollable": wrapScrollable, + "GtkScrollbar": wrapScrollbar, + "GtkScrolledWindow": wrapScrolledWindow, + "GtkSearchEntry": wrapSearchEntry, + "GtkSeparator": wrapSeparator, + "GtkSeparatorMenuItem": wrapSeparatorMenuItem, + "GtkSeparatorToolItem": wrapSeparatorToolItem, + "GtkSpinButton": wrapSpinButton, + "GtkSpinner": wrapSpinner, + "GtkStatusbar": wrapStatusbar, + "GtkSwitch": wrapSwitch, + "GtkTextBuffer": wrapTextBuffer, + "GtkTextChildAnchor": wrapTextChildAnchor, + "GtkTextTag": wrapTextTag, + "GtkTextTagTable": wrapTextTagTable, + "GtkTextView": wrapTextView, + "GtkToggleButton": wrapToggleButton, + "GtkToolbar": wrapToolbar, + "GtkToolButton": wrapToolButton, + "GtkToggleToolButton": wrapToggleToolButton, + "GtkToolItem": wrapToolItem, + "GtkTreeModel": wrapTreeModel, + "GtkTreeModelFilter": wrapTreeModelFilter, + "GtkTreeModelSort": wrapTreeModelSort, + "GtkTreeSelection": wrapTreeSelection, + "GtkTreeStore": wrapTreeStore, + "GtkTreeView": wrapTreeView, + "GtkTreeViewColumn": wrapTreeViewColumn, + "GtkViewport": wrapViewport, + "GtkVolumeButton": wrapVolumeButton, + "GtkWidget": wrapWidget, + "GtkWindow": wrapWindow, +} + +// castInternal casts the given object to the appropriate Go struct, but returns it as interface for later type assertions. +// The className is the results of C.object_get_class_name(c) called on the native object. +// The obj is the result of glib.Take(unsafe.Pointer(c)), used as a parameter for the wrapper functions. +func castInternal(className string, obj *glib.Object) (interface{}, error) { + fn, ok := WrapMap[className] + if !ok { + return nil, errors.New("unrecognized class name '" + className + "'") + } + + // Check that the wrapper function is actually a function + rf := reflect.ValueOf(fn) + if rf.Type().Kind() != reflect.Func { + return nil, errors.New("wraper is not a function") + } + + // Call the wraper function with the *glib.Object as first parameter + // e.g. "wrapWindow(obj)" + v := reflect.ValueOf(obj) + rv := rf.Call([]reflect.Value{v}) + + // At most/max 1 return value + if len(rv) != 1 { + return nil, errors.New("wrapper did not return") + } + + // Needs to be a pointer of some sort + if k := rv[0].Kind(); k != reflect.Ptr { + return nil, fmt.Errorf("wrong return type %s", k) + } + + // Only get an interface value, type check will be done in more specific functions + return rv[0].Interface(), nil +} + +// cast takes a native GObject and casts it to the appropriate Go struct. +//TODO change all wrapFns to return an IObject +//^- not sure about this TODO. This may make some usages of the wrapper functions quite verbose, no? +func cast(c *C.GObject) (glib.IObject, error) { + ptr := unsafe.Pointer(c) + var ( + className = goString(C.object_get_class_name(C.toGObject(ptr))) + obj = glib.Take(ptr) + ) + + intf, err := castInternal(className, obj) + if err != nil { + return nil, err + } + + ret, ok := intf.(glib.IObject) + if !ok { + return nil, errors.New("did not return an IObject") + } + + return ret, nil +} + +// castWidget takes a native GtkWidget and casts it to the appropriate Go struct. +func castWidget(c *C.GtkWidget) (IWidget, error) { + ptr := unsafe.Pointer(c) + var ( + className = goString(C.object_get_class_name(C.toGObject(ptr))) + obj = glib.Take(ptr) + ) + + intf, err := castInternal(className, obj) + if err != nil { + return nil, err + } + + ret, ok := intf.(IWidget) + if !ok { + return nil, fmt.Errorf("expected value of type IWidget, got %T", intf) + } + + return ret, nil +} + +// castCellRenderer takes a native GtkCellRenderer and casts it to the appropriate Go struct. +func castCellRenderer(c *C.GtkCellRenderer) (ICellRenderer, error) { + ptr := unsafe.Pointer(c) + var ( + className = goString(C.object_get_class_name(C.toGObject(ptr))) + obj = glib.Take(ptr) + ) + + intf, err := castInternal(className, obj) + if err != nil { + return nil, err + } + + ret, ok := intf.(ICellRenderer) + if !ok { + return nil, fmt.Errorf("expected value of type ICellRenderer, got %T", intf) + } + + return ret, nil +} + +// castTreeModel takes a native GtkCellTreeModel and casts it to the appropriate Go struct. +func castTreeModel(c *C.GtkTreeModel) (ITreeModel, error) { + ptr := unsafe.Pointer(c) + var ( + className = goString(C.object_get_class_name(C.toGObject(ptr))) + obj = glib.Take(ptr) + ) + + intf, err := castInternal(className, obj) + if err != nil { + return nil, err + } + + ret, ok := intf.(ITreeModel) + if !ok { + return nil, fmt.Errorf("expected value of type ITreeModel, got %T", intf) + } + + return ret, nil +} + +// castCellEditable takes a native GtkCellEditable and casts it to the appropriate Go struct. +func castCellEditable(c *C.GtkCellEditable) (ICellEditable, error) { + ptr := unsafe.Pointer(c) + var ( + className = goString(C.object_get_class_name(C.toGObject(ptr))) + obj = glib.Take(ptr) + ) + + intf, err := castInternal(className, obj) + if err != nil { + return nil, err + } + + ret, ok := intf.(ICellEditable) + if !ok { + return nil, fmt.Errorf("expected value of type ICellEditable, got %T", intf) + } + + return ret, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk.go.h new file mode 100644 index 0000000..9e11052 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk.go.h @@ -0,0 +1,651 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#include +#include +#include + +// gotk3_callbackDelete satisfies the GDestroyNotify type. +extern void gotk3_callbackDelete(gpointer callback_id); + +static GtkAboutDialog *toGtkAboutDialog(void *p) { + return (GTK_ABOUT_DIALOG(p)); +} + +static GtkAppChooser *toGtkAppChooser(void *p) { return (GTK_APP_CHOOSER(p)); } + +static GtkAppChooserButton *toGtkAppChooserButton(void *p) { + return (GTK_APP_CHOOSER_BUTTON(p)); +} + +static GtkAppChooserDialog *toGtkAppChooserDialog(void *p) { + return (GTK_APP_CHOOSER_DIALOG(p)); +} + +static GtkAppChooserWidget *toGtkAppChooserWidget(void *p) { + return (GTK_APP_CHOOSER_WIDGET(p)); +} + +static GtkApplication *toGtkApplication(void *p) { + return (GTK_APPLICATION(p)); +} + +static GtkApplicationWindow *toGtkApplicationWindow(void *p) { + return (GTK_APPLICATION_WINDOW(p)); +} + +static GtkAssistant *toGtkAssistant(void *p) { return (GTK_ASSISTANT(p)); } + +static GtkCalendar *toGtkCalendar(void *p) { return (GTK_CALENDAR(p)); } + +static GtkColorChooserDialog *toGtkColorChooserDialog(void *p) { + return (GTK_COLOR_CHOOSER_DIALOG(p)); +} + +static GtkDrawingArea *toGtkDrawingArea(void *p) { + return (GTK_DRAWING_AREA(p)); +} + +static GtkCellRendererSpinner *toGtkCellRendererSpinner(void *p) { + return (GTK_CELL_RENDERER_SPINNER(p)); +} + +static GtkEventBox *toGtkEventBox(void *p) { return (GTK_EVENT_BOX(p)); } + +static GtkGrid *toGtkGrid(void *p) { return (GTK_GRID(p)); } + +static GtkWidget *toGtkWidget(void *p) { return (GTK_WIDGET(p)); } + +static GtkContainer *toGtkContainer(void *p) { return (GTK_CONTAINER(p)); } + +static GtkOverlay *toGtkOverlay(void *p) { return (GTK_OVERLAY(p)); } + +static GtkPageSetup *toGtkPageSetup(void *p) { return (GTK_PAGE_SETUP(p)); } + +static GtkPaned *toGtkPaned(void *p) { return (GTK_PANED(p)); } + +static GtkPrintContext *toGtkPrintContext(void *p) { + return (GTK_PRINT_CONTEXT(p)); +} + +static GtkPrintOperation *toGtkPrintOperation(void *p) { + return (GTK_PRINT_OPERATION(p)); +} + +static GtkPrintOperationPreview *toGtkPrintOperationPreview(void *p) { + return (GTK_PRINT_OPERATION_PREVIEW(p)); +} + +static GtkPrintSettings *toGtkPrintSettings(void *p) { + return (GTK_PRINT_SETTINGS(p)); +} + +static GtkProgressBar *toGtkProgressBar(void *p) { + return (GTK_PROGRESS_BAR(p)); +} + +static GtkLevelBar *toGtkLevelBar(void *p) { return (GTK_LEVEL_BAR(p)); } + +static GtkBin *toGtkBin(void *p) { return (GTK_BIN(p)); } + +static GtkWindow *toGtkWindow(void *p) { return (GTK_WINDOW(p)); } + +static GtkWindowGroup *toGtkWindowGroup(void *p) { + return (GTK_WINDOW_GROUP(p)); +} + +static GtkBox *toGtkBox(void *p) { return (GTK_BOX(p)); } + +static GtkStatusbar *toGtkStatusbar(void *p) { return (GTK_STATUSBAR(p)); } + +static GtkLabel *toGtkLabel(void *p) { return (GTK_LABEL(p)); } + +static GtkNotebook *toGtkNotebook(void *p) { return (GTK_NOTEBOOK(p)); } + +static GtkEntry *toGtkEntry(void *p) { return (GTK_ENTRY(p)); } + +static GtkEntryBuffer *toGtkEntryBuffer(void *p) { + return (GTK_ENTRY_BUFFER(p)); +} + +static GtkEntryCompletion *toGtkEntryCompletion(void *p) { + return (GTK_ENTRY_COMPLETION(p)); +} + +static GtkAdjustment *toGtkAdjustment(void *p) { return (GTK_ADJUSTMENT(p)); } + +static GtkAccelGroup *toGtkAccelGroup(void *p) { return (GTK_ACCEL_GROUP(p)); } + +static GtkAccelMap *toGtkAccelMap(void *p) { return (GTK_ACCEL_MAP(p)); } + +static GtkTextTag *toGtkTextTag(void *p) { return (GTK_TEXT_TAG(p)); } + +static GtkIconView *toGtkIconView(void *p) { return (GTK_ICON_VIEW(p)); } + +static GtkImage *toGtkImage(void *p) { return (GTK_IMAGE(p)); } + +static GtkButtonBox *toGtkButtonBox(void *p) { return (GTK_BUTTON_BOX(p)); } + +static GtkButton *toGtkButton(void *p) { return (GTK_BUTTON(p)); } + +static GtkScaleButton *toGtkScaleButton(void *p) { + return (GTK_SCALE_BUTTON(p)); +} + +static GtkColorButton *toGtkColorButton(void *p) { + return (GTK_COLOR_BUTTON(p)); +} + +static GtkViewport *toGtkViewport(void *p) { return (GTK_VIEWPORT(p)); } + +static GtkVolumeButton *toGtkVolumeButton(void *p) { + return (GTK_VOLUME_BUTTON(p)); +} + +static GtkScrollable *toGtkScrollable(void *p) { return (GTK_SCROLLABLE(p)); } + +static GtkScrolledWindow *toGtkScrolledWindow(void *p) { + return (GTK_SCROLLED_WINDOW(p)); +} + +static GtkMenuItem *toGtkMenuItem(void *p) { return (GTK_MENU_ITEM(p)); } + +static GtkMenu *toGtkMenu(void *p) { return (GTK_MENU(p)); } + +static GtkMenuShell *toGtkMenuShell(void *p) { return (GTK_MENU_SHELL(p)); } + +static GtkMenuBar *toGtkMenuBar(void *p) { return (GTK_MENU_BAR(p)); } + +static GtkSizeGroup *toGtkSizeGroup(void *p) { return (GTK_SIZE_GROUP(p)); } + +static GtkSpinButton *toGtkSpinButton(void *p) { return (GTK_SPIN_BUTTON(p)); } + +static GtkSpinner *toGtkSpinner(void *p) { return (GTK_SPINNER(p)); } + +static GtkComboBox *toGtkComboBox(void *p) { return (GTK_COMBO_BOX(p)); } + +static GtkComboBoxText *toGtkComboBoxText(void *p) { + return (GTK_COMBO_BOX_TEXT(p)); +} + +static GtkLinkButton *toGtkLinkButton(void *p) { return (GTK_LINK_BUTTON(p)); } + +static GtkLockButton *toGtkLockButton(void *p) { return (GTK_LOCK_BUTTON(p)); } + +static GtkLayout *toGtkLayout(void *p) { return (GTK_LAYOUT(p)); } + +static GtkTreeModelSort *toGtkTreeModelSortable(void *p) { + return (GTK_TREE_MODEL_SORT(p)); +} + +static GtkListStore *toGtkListStore(void *p) { return (GTK_LIST_STORE(p)); } + +static GtkSwitch *toGtkSwitch(void *p) { return (GTK_SWITCH(p)); } + +static GtkTextView *toGtkTextView(void *p) { return (GTK_TEXT_VIEW(p)); } + +static GtkTextMark *toGtkTextMark(void *p) { return (GTK_TEXT_MARK(p)); } + +static GtkTextTagTable *toGtkTextTagTable(void *p) { + return (GTK_TEXT_TAG_TABLE(p)); +} + +static GtkTextBuffer *toGtkTextBuffer(void *p) { return (GTK_TEXT_BUFFER(p)); } + +static GtkTreeModel *toGtkTreeModel(void *p) { return (GTK_TREE_MODEL(p)); } + +static GtkTreeModelFilter *toGtkTreeModelFilter(void *p) { + return (GTK_TREE_MODEL_FILTER(p)); +} + +static GtkCellRenderer *toGtkCellRenderer(void *p) { + return (GTK_CELL_RENDERER(p)); +} + +static GtkCellEditable *toGtkCellEditable(void *p) { + return (GTK_CELL_EDITABLE(p)); +} + +static GtkCellRendererPixbuf *toGtkCellRendererPixbuf(void *p) { + return (GTK_CELL_RENDERER_PIXBUF(p)); +} + +static GtkCellRendererProgress *toGtkCellRendererProgress(void *p) { + return (GTK_CELL_RENDERER_PROGRESS(p)); +} + +static GtkCellRendererText *toGtkCellRendererText(void *p) { + return (GTK_CELL_RENDERER_TEXT(p)); +} + +static GtkCellRendererToggle *toGtkCellRendererToggle(void *p) { + return (GTK_CELL_RENDERER_TOGGLE(p)); +} + +static GtkCellRendererCombo *toGtkCellRendererCombo(void *p) { + return (GTK_CELL_RENDERER_COMBO(p)); +} + +static GtkCellRendererAccel *toGtkCellRendererAccel(void *p) { + return (GTK_CELL_RENDERER_ACCEL(p)); +} + +static GtkCellRendererSpin *toGtkCellRendererSpin(void *p) { + return (GTK_CELL_RENDERER_SPIN(p)); +} + +static GtkCellLayout *toGtkCellLayout(void *p) { return (GTK_CELL_LAYOUT(p)); } + +static GtkCellArea *toGtkCellArea(void *p) { return (GTK_CELL_AREA(p)); } + +static GtkCellAreaContext *toGtkCellAreaContext(void *p) { + return (GTK_CELL_AREA_CONTEXT(p)); +} + +static GtkCellAreaBox *toGtkCellAreaBox(void *p) { + return (GTK_CELL_AREA_BOX(p)); +} + +static GtkOrientable *toGtkOrientable(void *p) { return (GTK_ORIENTABLE(p)); } + +static GtkTreeStore *toGtkTreeStore(void *p) { return (GTK_TREE_STORE(p)); } + +static GtkTreeView *toGtkTreeView(void *p) { return (GTK_TREE_VIEW(p)); } + +static GtkTreeViewColumn *toGtkTreeViewColumn(void *p) { + return (GTK_TREE_VIEW_COLUMN(p)); +} + +static GtkTreeSelection *toGtkTreeSelection(void *p) { + return (GTK_TREE_SELECTION(p)); +} + +static GtkTreeModelSort *toGtkTreeModelSort(void *p) { + return (GTK_TREE_MODEL_SORT(p)); +} + +static GtkTreeSortable *toGtkTreeSortable(void *p) { + return (GTK_TREE_SORTABLE(p)); +} + +static GtkClipboard *toGtkClipboard(void *p) { return (GTK_CLIPBOARD(p)); } + +static GtkDialog *toGtkDialog(void *p) { return (GTK_DIALOG(p)); } + +static GtkMessageDialog *toGtkMessageDialog(void *p) { + return (GTK_MESSAGE_DIALOG(p)); +} + +static GtkBuilder *toGtkBuilder(void *p) { return (GTK_BUILDER(p)); } + +static GtkSeparatorMenuItem *toGtkSeparatorMenuItem(void *p) { + return (GTK_SEPARATOR_MENU_ITEM(p)); +} + +static GtkCheckButton *toGtkCheckButton(void *p) { + return (GTK_CHECK_BUTTON(p)); +} + +static GtkToggleButton *toGtkToggleButton(void *p) { + return (GTK_TOGGLE_BUTTON(p)); +} + +static GtkFontButton *toGtkFontButton(void *p) { return (GTK_FONT_BUTTON(p)); } + +static GtkFrame *toGtkFrame(void *p) { return (GTK_FRAME(p)); } + +static GtkAspectFrame *toGtkAspectFrame(void *p) { + return (GTK_ASPECT_FRAME(p)); +} + +static GtkSeparator *toGtkSeparator(void *p) { return (GTK_SEPARATOR(p)); } + +static GtkScale *toGtkScale(void *p) { return (GTK_SCALE(p)); } + +static GtkScrollbar *toGtkScrollbar(void *p) { return (GTK_SCROLLBAR(p)); } + +static GtkRange *toGtkRange(void *p) { return (GTK_RANGE(p)); } + +static GtkSearchEntry *toGtkSearchEntry(void *p) { + return (GTK_SEARCH_ENTRY(p)); +} + +static GtkOffscreenWindow *toGtkOffscreenWindow(void *p) { + return (GTK_OFFSCREEN_WINDOW(p)); +} + +static GtkExpander *toGtkExpander(void *p) { return (GTK_EXPANDER(p)); } + +static GtkFileChooser *toGtkFileChooser(void *p) { + return (GTK_FILE_CHOOSER(p)); +} + +static GtkFileChooserButton *toGtkFileChooserButton(void *p) { + return (GTK_FILE_CHOOSER_BUTTON(p)); +} + +static GtkFileChooserDialog *toGtkFileChooserDialog(void *p) { + return (GTK_FILE_CHOOSER_DIALOG(p)); +} + +static GtkFileChooserWidget *toGtkFileChooserWidget(void *p) { + return (GTK_FILE_CHOOSER_WIDGET(p)); +} + +static GtkFileFilter *toGtkFileFilter(void *p) { return (GTK_FILE_FILTER(p)); } + +static GtkMenuButton *toGtkMenuButton(void *p) { return (GTK_MENU_BUTTON(p)); } + +static GtkRadioButton *toGtkRadioButton(void *p) { + return (GTK_RADIO_BUTTON(p)); +} + +static GtkRecentChooser *toGtkRecentChooser(void *p) { + return (GTK_RECENT_CHOOSER(p)); +} + +static GtkRecentChooserMenu *toGtkRecentChooserMenu(void *p) { + return (GTK_RECENT_CHOOSER_MENU(p)); +} + +static GtkColorChooser *toGtkColorChooser(void *p) { + return (GTK_COLOR_CHOOSER(p)); +} + +static GtkFontChooser *toGtkFontChooser(void *p) { + return (GTK_FONT_CHOOSER(p)); +} + +static GtkRecentFilter *toGtkRecentFilter(void *p) { + return (GTK_RECENT_FILTER(p)); +} + +static GtkRecentManager *toGtkRecentManager(void *p) { + return (GTK_RECENT_MANAGER(p)); +} + +static GtkCheckMenuItem *toGtkCheckMenuItem(void *p) { + return (GTK_CHECK_MENU_ITEM(p)); +} + +static GtkRadioMenuItem *toGtkRadioMenuItem(void *p) { + return (GTK_RADIO_MENU_ITEM(p)); +} + +static GtkToolItem *toGtkToolItem(void *p) { return (GTK_TOOL_ITEM(p)); } + +static GtkToolbar *toGtkToolbar(void *p) { return (GTK_TOOLBAR(p)); } + +static GtkTooltip *toGtkTooltip(void *p) { return (GTK_TOOLTIP(p)); } + +static GtkEditable *toGtkEditable(void *p) { return (GTK_EDITABLE(p)); } + +static GtkToolButton *toGtkToolButton(void *p) { return (GTK_TOOL_BUTTON(p)); } + +static GtkToggleToolButton *toGtkToggleToolButton(void *p) { + return (GTK_TOGGLE_TOOL_BUTTON(p)); +} + +static GtkSeparatorToolItem *toGtkSeparatorToolItem(void *p) { + return (GTK_SEPARATOR_TOOL_ITEM(p)); +} + +static GtkCssProvider *toGtkCssProvider(void *p) { + return (GTK_CSS_PROVIDER(p)); +} + +static GtkStyleContext *toGtkStyleContext(void *p) { + return (GTK_STYLE_CONTEXT(p)); +} + +static GtkStyleProvider *toGtkStyleProvider(void *p) { + return (GTK_STYLE_PROVIDER(p)); +} + +static GtkInfoBar *toGtkInfoBar(void *p) { return (GTK_INFO_BAR(p)); } + +static GMenuModel *toGMenuModel(void *p) { return (G_MENU_MODEL(p)); } + +static GActionGroup *toGActionGroup(void *p) { return (G_ACTION_GROUP(p)); } + +static GdkPixbuf *toGdkPixbuf(void *p) { return (GDK_PIXBUF(p)); } + +static GdkScreen *toGdkScreen(void *p) { return (GDK_SCREEN(p)); } + +static GdkDevice *toGdkDevice(void *p) { return (GDK_DEVICE(p)); } + +static GObject *toGObject(void *p) { return (G_OBJECT(p)); } + +static GType *alloc_types(int n) { return ((GType *)g_new0(GType, n)); } + +static void set_type(GType *types, int n, GType t) { types[n] = t; } + +// _gtk_test_init is a wrapper to use gtk_test_init directly from go. +// The variadic part on gtk_test_init is not used at the moment, according to +// the documentation. +static void _gtk_test_init(int *argcp, char ***argvp) { + gtk_test_init(argcp, argvp); +} + +static GtkTreeViewColumn *_gtk_tree_view_column_new_with_attributes_one( + const gchar *title, GtkCellRenderer *renderer, const gchar *attribute, + gint column) { + GtkTreeViewColumn *tvc; + + tvc = gtk_tree_view_column_new_with_attributes(title, renderer, attribute, + column, NULL); + return (tvc); +} + +static void _gtk_list_store_set(GtkListStore *list_store, GtkTreeIter *iter, + gint column, void *value) { + gtk_list_store_set(list_store, iter, column, value, -1); +} + +static void _gtk_tree_store_set(GtkTreeStore *store, GtkTreeIter *iter, + gint column, void *value) { + gtk_tree_store_set(store, iter, column, value, -1); +} + +extern gboolean substring_match_equal_func(GtkTreeModel *model, gint column, + gchar *key, GtkTreeIter *iter, + gpointer data); + +static GtkWidget *_gtk_message_dialog_new(GtkWindow *parent, + GtkDialogFlags flags, + GtkMessageType type, + GtkButtonsType buttons, char *msg) { + GtkWidget *w; + + w = gtk_message_dialog_new(parent, flags, type, buttons, "%s", msg); + return (w); +} + +static GtkWidget *_gtk_message_dialog_new_with_markup(GtkWindow *parent, + GtkDialogFlags flags, + GtkMessageType type, + GtkButtonsType buttons, + char *msg) { + GtkWidget *w; + + w = gtk_message_dialog_new_with_markup(parent, flags, type, buttons, "%s", + msg); + return (w); +} + +static void +_gtk_message_dialog_format_secondary_text(GtkMessageDialog *message_dialog, + const gchar *msg) { + gtk_message_dialog_format_secondary_text(message_dialog, "%s", msg); +} + +static void +_gtk_message_dialog_format_secondary_markup(GtkMessageDialog *message_dialog, + const gchar *msg) { + gtk_message_dialog_format_secondary_markup(message_dialog, "%s", msg); +} + +static const gchar *object_get_class_name(GObject *object) { + return G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(object)); +} + +static GtkWidget *gtk_file_chooser_dialog_new_1(const gchar *title, + GtkWindow *parent, + GtkFileChooserAction action, + const gchar *first_button_text, + int first_button_id) { + return gtk_file_chooser_dialog_new(title, parent, action, first_button_text, + first_button_id, NULL); +} + +static GtkWidget *gtk_file_chooser_dialog_new_2( + const gchar *title, GtkWindow *parent, GtkFileChooserAction action, + const gchar *first_button_text, int first_button_id, + const gchar *second_button_text, int second_button_id) { + return gtk_file_chooser_dialog_new(title, parent, action, first_button_text, + first_button_id, second_button_text, + second_button_id, NULL); +} + +static void _gtk_widget_hide_on_delete(GtkWidget *w) { + g_signal_connect(GTK_WIDGET(w), "delete-event", + G_CALLBACK(gtk_widget_hide_on_delete), NULL); +} + +static inline gchar **make_strings(int count) { + return (gchar **)malloc(sizeof(gchar *) * count); +} + +static inline void destroy_strings(gchar **strings) { free(strings); } + +static inline gchar *get_string(gchar **strings, int n) { return strings[n]; } + +static inline void set_string(gchar **strings, int n, gchar *str) { + strings[n] = str; +} + +extern void goBuilderConnect(GtkBuilder *builder, GObject *object, + gchar *signal_name, gchar *handler_name, + GObject *connect_object, GConnectFlags flags, + gpointer user_data); + +static inline void _gtk_builder_connect_signals_full(GtkBuilder *builder) { + gtk_builder_connect_signals_full( + builder, (GtkBuilderConnectFunc)(goBuilderConnect), NULL); +} + +extern gboolean goTreeViewSearchEqualFunc(GtkTreeModel *model, gint column, + gchar *key, GtkTreeIter *iter, + gpointer data); + +static inline void _gtk_tree_view_set_search_equal_func(GtkTreeView *tree_view, + gpointer user_data) { + gtk_tree_view_set_search_equal_func( + tree_view, (GtkTreeViewSearchEqualFunc)(goTreeViewSearchEqualFunc), + user_data, (GDestroyNotify)(gotk3_callbackDelete)); +} + +extern gboolean goTreeModelFilterVisibleFunc(GtkTreeModel *model, + GtkTreeIter *iter, gpointer data); + +static inline void +_gtk_tree_model_filter_set_visible_func(GtkTreeModelFilter *filter, + gpointer user_data) { + gtk_tree_model_filter_set_visible_func( + filter, (GtkTreeModelFilterVisibleFunc)(goTreeModelFilterVisibleFunc), + user_data, (GDestroyNotify)(gotk3_callbackDelete)); +} + +static inline void _gtk_text_buffer_insert_with_tag_by_name( + GtkTextBuffer *buffer, GtkTextIter *iter, const gchar *text, gint len, + const gchar *first_tag_name) { + gtk_text_buffer_insert_with_tags_by_name(buffer, iter, text, len, + first_tag_name, NULL); +} + +static inline void _gtk_text_buffer_insert_with_tag(GtkTextBuffer *buffer, + GtkTextIter *iter, + const gchar *text, gint len, + GtkTextTag *tag) { + gtk_text_buffer_insert_with_tags(buffer, iter, text, len, tag, NULL); +} + +extern gint goTreeSortableSortFunc(GtkTreeModel *model, GtkTreeIter *a, + GtkTreeIter *b, gpointer data); + +static inline void _gtk_tree_sortable_set_sort_func(GtkTreeSortable *sortable, + gint sort_column_id, + gpointer user_data) { + gtk_tree_sortable_set_sort_func( + sortable, sort_column_id, + (GtkTreeIterCompareFunc)(goTreeSortableSortFunc), user_data, NULL); +} + +static inline void +_gtk_tree_sortable_set_default_sort_func(GtkTreeSortable *sortable, + gpointer user_data) { + gtk_tree_sortable_set_default_sort_func( + sortable, (GtkTreeIterCompareFunc)(goTreeSortableSortFunc), user_data, + (GDestroyNotify)(gotk3_callbackDelete)); +} + +static GtkWidget *_gtk_dialog_new_with_buttons(const gchar *title, + GtkWindow *parent, + GtkDialogFlags flags, + const gchar *first_button_text) { + GtkWidget *w; + + w = gtk_dialog_new_with_buttons(title, parent, flags, first_button_text, + NULL); + return (w); +} + +extern gint goTreeModelForeachFunc(GtkTreeModel *model, GtkTreePath *path, + GtkTreeIter *iter, gpointer data); + +static inline void _gtk_tree_model_foreach(GtkTreeModel *model, + gpointer user_data) { + gtk_tree_model_foreach( + model, (GtkTreeModelForeachFunc)(goTreeModelForeachFunc), user_data); +} + +extern void goTreeSelectionForeachFunc(GtkTreeModel *model, GtkTreePath *path, + GtkTreeIter *iter, gpointer data); + +static inline void +_gtk_tree_selection_selected_foreach(GtkTreeSelection *selection, + gpointer user_data) { + gtk_tree_selection_selected_foreach( + selection, (GtkTreeSelectionForeachFunc)(goTreeSelectionForeachFunc), + user_data); +} + +extern gboolean goTreeSelectionFunc(GtkTreeSelection *selection, + GtkTreeModel *model, GtkTreePath *path, + gboolean selected, gpointer data); + +static inline void +_gtk_tree_selection_set_select_function(GtkTreeSelection *selection, + gpointer user_data) { + gtk_tree_selection_set_select_function( + + selection, (GtkTreeSelectionFunc)(goTreeSelectionFunc), user_data, + (GDestroyNotify)(gotk3_callbackDelete)); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go new file mode 100644 index 0000000..c9b47e7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_10.go @@ -0,0 +1,336 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols deprecated beginning with GTK 3.10, +// and should only be included in a build targeted intended to target GTK +// 3.8 or earlier. To target an earlier build build, use the build tag +// gtk_MAJOR_MINOR. For example, to target GTK 3.8, run +// 'go build -tags gtk_3_8'. +// +build gtk_3_6 gtk_3_8 gtk_deprecated + +package gtk + +// #include +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// ButtonNewFromStock is a wrapper around gtk_button_new_from_stock(). +func ButtonNewFromStock(stock Stock) (*Button, error) { + cstr := C.CString(string(stock)) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_button_new_from_stock((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapButton(glib.Take(unsafe.Pointer(c))), nil +} + +// SetUseStock is a wrapper around gtk_button_set_use_stock(). +func (v *Button) SetUseStock(useStock bool) { + C.gtk_button_set_use_stock(v.native(), gbool(useStock)) +} + +// GetUseStock is a wrapper around gtk_button_get_use_stock(). +func (v *Button) GetUseStock() bool { + c := C.gtk_button_get_use_stock(v.native()) + return gobool(c) +} + +// GetIconStock is a wrapper around gtk_entry_get_icon_stock(). +func (v *Entry) GetIconStock(iconPos EntryIconPosition) (string, error) { + c := C.gtk_entry_get_icon_stock(v.native(), + C.GtkEntryIconPosition(iconPos)) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// SetIconFromStock is a wrapper around gtk_entry_set_icon_from_stock(). +func (v *Entry) SetIconFromStock(iconPos EntryIconPosition, stockID string) { + cstr := C.CString(stockID) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_entry_set_icon_from_stock(v.native(), + C.GtkEntryIconPosition(iconPos), (*C.gchar)(cstr)) +} + +/* + * GtkImage + */ + +// TODO: + +/* +// gtk_image_get_icon_set(). +func (v *Image) GetIconSet() { +} +*/ + +// gtk_image_get_stock(). + +/* +// gtk_image_new_from_icon_set(). +func ImageNewFromIconSet() { +} +*/ + +// ImageNewFromStock is a wrapper around gtk_image_new_from_stock(). +func ImageNewFromStock(stock Stock, size IconSize) (*Image, error) { + cstr := C.CString(string(stock)) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_image_new_from_stock((*C.gchar)(cstr), C.GtkIconSize(size)) + if c == nil { + return nil, nilPtrErr + } + return wrapImage(glib.Take(unsafe.Pointer(c))), nil +} + +// SetFromStock is a wrapper around gtk_image_set_from_stock(). +func (v *Image) SetFromStock(stock Stock, size IconSize) { + cstr := C.CString(string(stock)) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_image_set_from_stock(v.native(), (*C.gchar)(cstr), + C.GtkIconSize(size)) +} + +// TODO: +/* +// gtk_image_set_from_icon_set(). +func (v *Image) SetFromIconSet() { +} +*/ + +// StatusIconNewFromStock is a wrapper around gtk_status_icon_new_from_stock(). +// Deprecated since 3.10, use StatusIconNewFromIconName (gtk_status_icon_new_from_icon_name) instead. +func StatusIconNewFromStock(stockId string) (*StatusIcon, error) { + cstr := C.CString(stockId) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_status_icon_new_from_file((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapStatusIcon(obj), nil +} + +// SetFromStock is a wrapper around gtk_status_icon_set_from_stock() +// Deprecated since 3.10, use SetFromIconName (gtk_status_icon_set_from_icon_name) instead. +func (v *StatusIcon) SetFromStock(stockID string) { + cstr := C.CString(stockID) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_from_stock(v.native(), (*C.gchar)(cstr)) +} + +// GetStock is a wrapper around gtk_status_icon_get_stock() +// Deprecated since 3.10, use GetIconName (gtk_status_icon_get_icon_name) instead +func (v *StatusIcon) GetStock() string { + c := C.gtk_status_icon_get_stock(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} + +// Stock is a special type that does not have an equivalent type in +// GTK. It is the type used as a parameter anytime an identifier for +// stock icons are needed. A Stock must be type converted to string when +// function parameters may take a Stock, but when other string values are +// valid as well. +type Stock string + +const ( + STOCK_ABOUT Stock = C.GTK_STOCK_ABOUT + STOCK_ADD Stock = C.GTK_STOCK_ADD + STOCK_APPLY Stock = C.GTK_STOCK_APPLY + STOCK_BOLD Stock = C.GTK_STOCK_BOLD + STOCK_CANCEL Stock = C.GTK_STOCK_CANCEL + STOCK_CAPS_LOCK_WARNING Stock = C.GTK_STOCK_CAPS_LOCK_WARNING + STOCK_CDROM Stock = C.GTK_STOCK_CDROM + STOCK_CLEAR Stock = C.GTK_STOCK_CLEAR + STOCK_CLOSE Stock = C.GTK_STOCK_CLOSE + STOCK_COLOR_PICKER Stock = C.GTK_STOCK_COLOR_PICKER + STOCK_CONNECT Stock = C.GTK_STOCK_CONNECT + STOCK_CONVERT Stock = C.GTK_STOCK_CONVERT + STOCK_COPY Stock = C.GTK_STOCK_COPY + STOCK_CUT Stock = C.GTK_STOCK_CUT + STOCK_DELETE Stock = C.GTK_STOCK_DELETE + STOCK_DIALOG_AUTHENTICATION Stock = C.GTK_STOCK_DIALOG_AUTHENTICATION + STOCK_DIALOG_INFO Stock = C.GTK_STOCK_DIALOG_INFO + STOCK_DIALOG_WARNING Stock = C.GTK_STOCK_DIALOG_WARNING + STOCK_DIALOG_ERROR Stock = C.GTK_STOCK_DIALOG_ERROR + STOCK_DIALOG_QUESTION Stock = C.GTK_STOCK_DIALOG_QUESTION + STOCK_DIRECTORY Stock = C.GTK_STOCK_DIRECTORY + STOCK_DISCARD Stock = C.GTK_STOCK_DISCARD + STOCK_DISCONNECT Stock = C.GTK_STOCK_DISCONNECT + STOCK_DND Stock = C.GTK_STOCK_DND + STOCK_DND_MULTIPLE Stock = C.GTK_STOCK_DND_MULTIPLE + STOCK_EDIT Stock = C.GTK_STOCK_EDIT + STOCK_EXECUTE Stock = C.GTK_STOCK_EXECUTE + STOCK_FILE Stock = C.GTK_STOCK_FILE + STOCK_FIND Stock = C.GTK_STOCK_FIND + STOCK_FIND_AND_REPLACE Stock = C.GTK_STOCK_FIND_AND_REPLACE + STOCK_FLOPPY Stock = C.GTK_STOCK_FLOPPY + STOCK_FULLSCREEN Stock = C.GTK_STOCK_FULLSCREEN + STOCK_GOTO_BOTTOM Stock = C.GTK_STOCK_GOTO_BOTTOM + STOCK_GOTO_FIRST Stock = C.GTK_STOCK_GOTO_FIRST + STOCK_GOTO_LAST Stock = C.GTK_STOCK_GOTO_LAST + STOCK_GOTO_TOP Stock = C.GTK_STOCK_GOTO_TOP + STOCK_GO_BACK Stock = C.GTK_STOCK_GO_BACK + STOCK_GO_DOWN Stock = C.GTK_STOCK_GO_DOWN + STOCK_GO_FORWARD Stock = C.GTK_STOCK_GO_FORWARD + STOCK_GO_UP Stock = C.GTK_STOCK_GO_UP + STOCK_HARDDISK Stock = C.GTK_STOCK_HARDDISK + STOCK_HELP Stock = C.GTK_STOCK_HELP + STOCK_HOME Stock = C.GTK_STOCK_HOME + STOCK_INDEX Stock = C.GTK_STOCK_INDEX + STOCK_INDENT Stock = C.GTK_STOCK_INDENT + STOCK_INFO Stock = C.GTK_STOCK_INFO + STOCK_ITALIC Stock = C.GTK_STOCK_ITALIC + STOCK_JUMP_TO Stock = C.GTK_STOCK_JUMP_TO + STOCK_JUSTIFY_CENTER Stock = C.GTK_STOCK_JUSTIFY_CENTER + STOCK_JUSTIFY_FILL Stock = C.GTK_STOCK_JUSTIFY_FILL + STOCK_JUSTIFY_LEFT Stock = C.GTK_STOCK_JUSTIFY_LEFT + STOCK_JUSTIFY_RIGHT Stock = C.GTK_STOCK_JUSTIFY_RIGHT + STOCK_LEAVE_FULLSCREEN Stock = C.GTK_STOCK_LEAVE_FULLSCREEN + STOCK_MISSING_IMAGE Stock = C.GTK_STOCK_MISSING_IMAGE + STOCK_MEDIA_FORWARD Stock = C.GTK_STOCK_MEDIA_FORWARD + STOCK_MEDIA_NEXT Stock = C.GTK_STOCK_MEDIA_NEXT + STOCK_MEDIA_PAUSE Stock = C.GTK_STOCK_MEDIA_PAUSE + STOCK_MEDIA_PLAY Stock = C.GTK_STOCK_MEDIA_PLAY + STOCK_MEDIA_PREVIOUS Stock = C.GTK_STOCK_MEDIA_PREVIOUS + STOCK_MEDIA_RECORD Stock = C.GTK_STOCK_MEDIA_RECORD + STOCK_MEDIA_REWIND Stock = C.GTK_STOCK_MEDIA_REWIND + STOCK_MEDIA_STOP Stock = C.GTK_STOCK_MEDIA_STOP + STOCK_NETWORK Stock = C.GTK_STOCK_NETWORK + STOCK_NEW Stock = C.GTK_STOCK_NEW + STOCK_NO Stock = C.GTK_STOCK_NO + STOCK_OK Stock = C.GTK_STOCK_OK + STOCK_OPEN Stock = C.GTK_STOCK_OPEN + STOCK_ORIENTATION_PORTRAIT Stock = C.GTK_STOCK_ORIENTATION_PORTRAIT + STOCK_ORIENTATION_LANDSCAPE Stock = C.GTK_STOCK_ORIENTATION_LANDSCAPE + STOCK_ORIENTATION_REVERSE_LANDSCAPE Stock = C.GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE + STOCK_ORIENTATION_REVERSE_PORTRAIT Stock = C.GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT + STOCK_PAGE_SETUP Stock = C.GTK_STOCK_PAGE_SETUP + STOCK_PASTE Stock = C.GTK_STOCK_PASTE + STOCK_PREFERENCES Stock = C.GTK_STOCK_PREFERENCES + STOCK_PRINT Stock = C.GTK_STOCK_PRINT + STOCK_PRINT_ERROR Stock = C.GTK_STOCK_PRINT_ERROR + STOCK_PRINT_PAUSED Stock = C.GTK_STOCK_PRINT_PAUSED + STOCK_PRINT_PREVIEW Stock = C.GTK_STOCK_PRINT_PREVIEW + STOCK_PRINT_REPORT Stock = C.GTK_STOCK_PRINT_REPORT + STOCK_PRINT_WARNING Stock = C.GTK_STOCK_PRINT_WARNING + STOCK_PROPERTIES Stock = C.GTK_STOCK_PROPERTIES + STOCK_QUIT Stock = C.GTK_STOCK_QUIT + STOCK_REDO Stock = C.GTK_STOCK_REDO + STOCK_REFRESH Stock = C.GTK_STOCK_REFRESH + STOCK_REMOVE Stock = C.GTK_STOCK_REMOVE + STOCK_REVERT_TO_SAVED Stock = C.GTK_STOCK_REVERT_TO_SAVED + STOCK_SAVE Stock = C.GTK_STOCK_SAVE + STOCK_SAVE_AS Stock = C.GTK_STOCK_SAVE_AS + STOCK_SELECT_ALL Stock = C.GTK_STOCK_SELECT_ALL + STOCK_SELECT_COLOR Stock = C.GTK_STOCK_SELECT_COLOR + STOCK_SELECT_FONT Stock = C.GTK_STOCK_SELECT_FONT + STOCK_SORT_ASCENDING Stock = C.GTK_STOCK_SORT_ASCENDING + STOCK_SORT_DESCENDING Stock = C.GTK_STOCK_SORT_DESCENDING + STOCK_SPELL_CHECK Stock = C.GTK_STOCK_SPELL_CHECK + STOCK_STOP Stock = C.GTK_STOCK_STOP + STOCK_STRIKETHROUGH Stock = C.GTK_STOCK_STRIKETHROUGH + STOCK_UNDELETE Stock = C.GTK_STOCK_UNDELETE + STOCK_UNDERLINE Stock = C.GTK_STOCK_UNDERLINE + STOCK_UNDO Stock = C.GTK_STOCK_UNDO + STOCK_UNINDENT Stock = C.GTK_STOCK_UNINDENT + STOCK_YES Stock = C.GTK_STOCK_YES + STOCK_ZOOM_100 Stock = C.GTK_STOCK_ZOOM_100 + STOCK_ZOOM_FIT Stock = C.GTK_STOCK_ZOOM_FIT + STOCK_ZOOM_IN Stock = C.GTK_STOCK_ZOOM_IN + STOCK_ZOOM_OUT Stock = C.GTK_STOCK_ZOOM_OUT +) + +// ReshowWithInitialSize is a wrapper around +// gtk_window_reshow_with_initial_size(). +func (v *Window) ReshowWithInitialSize() { + C.gtk_window_reshow_with_initial_size(v.native()) +} + +/* + * GtkWidget + */ + +// TODO: +// gtk_widget_render_icon_pixbuf(). +// gtk_widget_pop_composite_child(). +// gtk_widget_push_composite_child(). +// gtk_widget_set_composite_name(). + +/* + * GtkContainer + */ + +// TODO: +// gtk_container_resize_children(). + +/* + * GtkImageMenuItem + */ + +// TODO: +// gtk_image_menu_item_set_image(). +// gtk_image_menu_item_get_image(). +// gtk_image_menu_item_new(). +// gtk_image_menu_item_new_from_stock(). +// gtk_image_menu_item_new_with_label(). +// gtk_image_menu_item_new_with_mnemonic(). +// gtk_image_menu_item_get_use_stock(). +// gtk_image_menu_item_set_use_stock(). +// gtk_image_menu_item_get_always_show_image(). +// gtk_image_menu_item_set_always_show_image(). +// gtk_image_menu_item_set_accel_group(). + +/* + * GtkToolButton + */ + +// TODO: +// gtk_tool_button_new_from_stock(). +// gtk_tool_button_set_stock_id(). +// gtk_tool_button_get_stock_id(). + +/* + * GtkDialog + */ + +// TODO: + +/* +// gtk_dialog_set_alternative_button_order(). +func SetAlternativeButtonOrder(ids ...ResponseType) { +} +*/ + +/* +// gtk_alternative_dialog_button_order(). +func (v *gdk.Screen) AlternativeDialogButtonOrder() bool { + c := C.gtk_alternative_dialog_button_order(v.native()) + return gobool(c) +} +*/ + +// gtk_dialog_set_alternative_button_order_from_array diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go new file mode 100644 index 0000000..293febc --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_12.go @@ -0,0 +1,95 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols deprecated beginning with GTK 3.12, +// and should only be included in a build targeted intended to target GTK +// 3.10 or earlier. To target an earlier build build, use the build tag +// gtk_MAJOR_MINOR. For example, to target GTK 3.8, run +// 'go build -tags gtk_3_8'. +// +build gtk_3_6 gtk_3_8 gtk_3_10 gtk_deprecated + +package gtk + +// #include +import "C" + +/* + * GtkDialog + */ + +// GetActionArea() is a wrapper around gtk_dialog_get_action_area(). +func (v *Dialog) GetActionArea() (IWidget, error) { + c := C.gtk_dialog_get_action_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +/* + * GtkMessageDialog + */ + +// GetImage is a wrapper around gtk_message_dialog_get_image(). +func (v *MessageDialog) GetImage() (IWidget, error) { + c := C.gtk_message_dialog_get_image(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// SetImage is a wrapper around gtk_message_dialog_set_image(). +func (v *MessageDialog) SetImage(image IWidget) { + C.gtk_message_dialog_set_image(v.native(), image.toWidget()) +} + +/* + * GtkWidget + */ + +// GetMarginLeft is a wrapper around gtk_widget_get_margin_left(). +func (v *Widget) GetMarginLeft() int { + c := C.gtk_widget_get_margin_left(v.native()) + return int(c) +} + +// SetMarginLeft is a wrapper around gtk_widget_set_margin_left(). +func (v *Widget) SetMarginLeft(margin int) { + C.gtk_widget_set_margin_left(v.native(), C.gint(margin)) +} + +// GetMarginRight is a wrapper around gtk_widget_get_margin_right(). +func (v *Widget) GetMarginRight() int { + c := C.gtk_widget_get_margin_right(v.native()) + return int(c) +} + +// SetMarginRight is a wrapper around gtk_widget_set_margin_right(). +func (v *Widget) SetMarginRight(margin int) { + C.gtk_widget_set_margin_right(v.native(), C.gint(margin)) +} + +// TODO: +// gtk_widget_get_root_window(). + +/* + * GtkContainer + */ + +// TODO: +// gtk_container_get_resize_mode(). +// gtk_container_set_resize_mode(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go new file mode 100644 index 0000000..9984f7e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go @@ -0,0 +1,508 @@ +// +build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_deprecated + +package gtk + +// #include +// #include +// #include "gtk_deprecated_since_3_14.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_alignment_get_type()), marshalAlignment}, + {glib.Type(C.gtk_arrow_get_type()), marshalArrow}, + {glib.Type(C.gtk_misc_get_type()), marshalMisc}, + {glib.Type(C.gtk_status_icon_get_type()), marshalStatusIcon}, + } + glib.RegisterGValueMarshalers(tm) + + //Contribute to casting + for k, v := range map[string]WrapFn{ + "GtkAlignment": wrapAlignment, + "GtkArrow": wrapArrow, + "GtkMisc": wrapMisc, + "GtkStatusIcon": wrapStatusIcon, + } { + WrapMap[k] = v + } +} + +/* + * deprecated since version 3.14 and should not be used in newly-written code + */ + +/* + * GtkTreeView + */ + +// TODO: +// gtk_tree_view_set_rules_hint(). +// gtk_tree_view_get_rules_hint(). + +/* + * GtkWindow + */ + +// SetHasResizeGrip is a wrapper around gtk_window_set_has_resize_grip(). +func (v *Window) SetHasResizeGrip(setting bool) { + C.gtk_window_set_has_resize_grip(v.native(), gbool(setting)) +} + +// GetHasResizeGrip is a wrapper around gtk_window_get_has_resize_grip(). +func (v *Window) GetHasResizeGrip() bool { + c := C.gtk_window_get_has_resize_grip(v.native()) + return gobool(c) +} + +// ResizeGripIsVisible is a wrapper around gtk_window_resize_grip_is_visible(). +func (v *Window) ResizeGripIsVisible() bool { + c := C.gtk_window_resize_grip_is_visible(v.native()) + return gobool(c) +} + +// GetResizeGripArea is a wrapper around gtk_window_get_resize_grip_area(). +func (v *Window) GetResizeGripArea() (*gdk.Rectangle, bool) { + var cRect *C.GdkRectangle + wasRetrieved := C.gtk_window_get_resize_grip_area(v.native(), cRect) + rect := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return rect, gobool(wasRetrieved) +} + +/* + * GtkWidget + */ + +// Reparent() is a wrapper around gtk_widget_reparent(). +func (v *Widget) Reparent(newParent IWidget) { + C.gtk_widget_reparent(v.native(), newParent.toWidget()) +} + +// SetDoubleBuffered is a wrapper around gtk_widget_set_double_buffered(). +func (v *Widget) SetDoubleBuffered(doubleBuffered bool) { + C.gtk_widget_set_double_buffered(v.native(), gbool(doubleBuffered)) +} + +// GetDoubleBuffered is a wrapper around gtk_widget_get_double_buffered(). +func (v *Widget) GetDoubleBuffered() bool { + c := C.gtk_widget_get_double_buffered(v.native()) + return gobool(c) +} + +// TODO: +// gtk_widget_region_intersect(). + +// GetPadding is a wrapper around gtk_alignment_get_padding(). +func (v *Alignment) GetPadding() (top, bottom, left, right uint) { + var ctop, cbottom, cleft, cright C.guint + C.gtk_alignment_get_padding(v.native(), &ctop, &cbottom, &cleft, + &cright) + return uint(ctop), uint(cbottom), uint(cleft), uint(cright) +} + +// SetPadding is a wrapper around gtk_alignment_set_padding(). +func (v *Alignment) SetPadding(top, bottom, left, right uint) { + C.gtk_alignment_set_padding(v.native(), C.guint(top), C.guint(bottom), + C.guint(left), C.guint(right)) +} + +// AlignmentNew is a wrapper around gtk_alignment_new(). +func AlignmentNew(xalign, yalign, xscale, yscale float32) (*Alignment, error) { + c := C.gtk_alignment_new(C.gfloat(xalign), C.gfloat(yalign), C.gfloat(xscale), + C.gfloat(yscale)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapAlignment(obj), nil +} + +// Set is a wrapper around gtk_alignment_set(). +func (v *Alignment) Set(xalign, yalign, xscale, yscale float32) { + C.gtk_alignment_set(v.native(), C.gfloat(xalign), C.gfloat(yalign), + C.gfloat(xscale), C.gfloat(yscale)) +} + +/* + * GtkArrow + */ + +// Arrow is a representation of GTK's GtkArrow. +type Arrow struct { + Misc +} + +// ArrowNew is a wrapper around gtk_arrow_new(). +func ArrowNew(arrowType ArrowType, shadowType ShadowType) (*Arrow, error) { + c := C.gtk_arrow_new(C.GtkArrowType(arrowType), + C.GtkShadowType(shadowType)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapArrow(obj), nil +} + +// Set is a wrapper around gtk_arrow_set(). +func (v *Arrow) Set(arrowType ArrowType, shadowType ShadowType) { + C.gtk_arrow_set(v.native(), C.GtkArrowType(arrowType), C.GtkShadowType(shadowType)) +} + +// SetAlignment() is a wrapper around gtk_button_set_alignment(). +func (v *Button) SetAlignment(xalign, yalign float32) { + C.gtk_button_set_alignment(v.native(), (C.gfloat)(xalign), + (C.gfloat)(yalign)) +} + +// GetAlignment() is a wrapper around gtk_button_get_alignment(). +func (v *Button) GetAlignment() (xalign, yalign float32) { + var x, y C.gfloat + C.gtk_button_get_alignment(v.native(), &x, &y) + return float32(x), float32(y) +} + +// SetReallocateRedraws is a wrapper around gtk_container_set_reallocate_redraws(). +func (v *Container) SetReallocateRedraws(needsRedraws bool) { + C.gtk_container_set_reallocate_redraws(v.native(), gbool(needsRedraws)) +} + +// GetAlignment is a wrapper around gtk_misc_get_alignment(). +func (v *Misc) GetAlignment() (xAlign, yAlign float32) { + var x, y C.gfloat + C.gtk_misc_get_alignment(v.native(), &x, &y) + return float32(x), float32(y) +} + +// SetAlignment is a wrapper around gtk_misc_set_alignment(). +func (v *Misc) SetAlignment(xAlign, yAlign float32) { + C.gtk_misc_set_alignment(v.native(), C.gfloat(xAlign), C.gfloat(yAlign)) +} + +// GetPadding is a wrapper around gtk_misc_get_padding(). +func (v *Misc) GetPadding() (xpad, ypad int) { + var x, y C.gint + C.gtk_misc_get_padding(v.native(), &x, &y) + return int(x), int(y) +} + +// SetPadding is a wrapper around gtk_misc_set_padding(). +func (v *Misc) SetPadding(xPad, yPad int) { + C.gtk_misc_set_padding(v.native(), C.gint(xPad), C.gint(yPad)) +} + +/* + * GtkArrow + * deprecated since version 3.14 + */ +// native returns a pointer to the underlying GtkButton. +func (v *Arrow) native() *C.GtkArrow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkArrow(p) +} + +func marshalArrow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapArrow(obj), nil +} + +func wrapArrow(obj *glib.Object) *Arrow { + if obj == nil { + return nil + } + + return &Arrow{Misc{Widget{glib.InitiallyUnowned{obj}}}} +} + +/* + * GtkAlignment + * deprecated since version 3.14 + */ + +type Alignment struct { + Bin +} + +// native returns a pointer to the underlying GtkAlignment. +func (v *Alignment) native() *C.GtkAlignment { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkAlignment(p) +} + +func marshalAlignment(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapAlignment(obj), nil +} + +func wrapAlignment(obj *glib.Object) *Alignment { + if obj == nil { + return nil + } + + return &Alignment{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +/* + * GtkStatusIcon + * deprecated since version 3.14 + */ + +// StatusIcon is a representation of GTK's GtkStatusIcon. +// Deprecated since 3.14 in favor of notifications +// (no replacement, see https://stackoverflow.com/questions/41917903/gtk-3-statusicon-replacement) +type StatusIcon struct { + *glib.Object +} + +func marshalStatusIcon(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapStatusIcon(obj), nil +} + +func wrapStatusIcon(obj *glib.Object) *StatusIcon { + if obj == nil { + return nil + } + + return &StatusIcon{obj} +} + +func (v *StatusIcon) native() *C.GtkStatusIcon { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkStatusIcon(p) +} + +// TODO: GtkStatusIcon * gtk_status_icon_new_from_gicon (GIcon *icon); +// TODO: void gtk_status_icon_set_from_gicon (GtkStatusIcon *status_icon, GIcon *icon); + +// TODO: GIcon * gtk_status_icon_get_gicon (GtkStatusIcon *status_icon); + +// TODO: void gtk_status_icon_set_screen (GtkStatusIcon *status_icon, GdkScreen *screen); +// TODO: GdkScreen * gtk_status_icon_get_screen (GtkStatusIcon *status_icon); + +// TODO: GdkPixbuf * gtk_status_icon_get_pixbuf (GtkStatusIcon *status_icon); + +// TODO: void gtk_status_icon_position_menu (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data); +// TODO: gboolean gtk_status_icon_get_geometry (GtkStatusIcon *status_icon, GdkScreen **screen, GdkRectangle *area, GtkOrientation *orientation); + +// StatusIconNew is a wrapper around gtk_status_icon_new() +func StatusIconNew() (*StatusIcon, error) { + c := C.gtk_status_icon_new() + if c == nil { + return nil, nilPtrErr + } + return wrapStatusIcon(glib.Take(unsafe.Pointer(c))), nil +} + +// StatusIconNewFromFile is a wrapper around gtk_status_icon_new_from_file() +func StatusIconNewFromFile(filename string) (*StatusIcon, error) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_status_icon_new_from_file((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapStatusIcon(glib.Take(unsafe.Pointer(c))), nil +} + +// StatusIconNewFromIconName is a wrapper around gtk_status_icon_new_from_icon_name() +func StatusIconNewFromIconName(iconName string) (*StatusIcon, error) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_status_icon_new_from_icon_name((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return wrapStatusIcon(glib.Take(unsafe.Pointer(c))), nil +} + +// StatusIconNewFromPixbuf is a wrapper around gtk_status_icon_new_from_pixbuf(). +func StatusIconNewFromPixbuf(pixbuf *gdk.Pixbuf) (*StatusIcon, error) { + c := C.gtk_status_icon_new_from_pixbuf(C.toGdkPixbuf(unsafe.Pointer(pixbuf.Native()))) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapStatusIcon(obj), nil +} + +// SetFromFile is a wrapper around gtk_status_icon_set_from_file() +func (v *StatusIcon) SetFromFile(filename string) { + cstr := C.CString(filename) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_from_file(v.native(), (*C.gchar)(cstr)) +} + +// SetFromIconName is a wrapper around gtk_status_icon_set_from_icon_name() +func (v *StatusIcon) SetFromIconName(iconName string) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_from_icon_name(v.native(), (*C.gchar)(cstr)) +} + +// SetFromPixbuf is a wrapper around gtk_status_icon_set_from_pixbuf() +func (v *StatusIcon) SetFromPixbuf(pixbuf *gdk.Pixbuf) { + C.gtk_status_icon_set_from_pixbuf(v.native(), C.toGdkPixbuf(unsafe.Pointer(pixbuf.Native()))) +} + +// GetStorageType is a wrapper around gtk_status_icon_get_storage_type() +func (v *StatusIcon) GetStorageType() ImageType { + return (ImageType)(C.gtk_status_icon_get_storage_type(v.native())) +} + +// SetTooltipText is a wrapper around gtk_status_icon_set_tooltip_text() +func (v *StatusIcon) SetTooltipText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_tooltip_text(v.native(), (*C.gchar)(cstr)) +} + +// GetTooltipText is a wrapper around gtk_status_icon_get_tooltip_text() +func (v *StatusIcon) GetTooltipText() string { + c := C.gtk_status_icon_get_tooltip_text(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} + +// SetTooltipMarkup is a wrapper around gtk_status_icon_set_tooltip_markup() +func (v *StatusIcon) SetTooltipMarkup(markup string) { + cstr := C.CString(markup) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_tooltip_markup(v.native(), (*C.gchar)(cstr)) +} + +// GetTooltipMarkup is a wrapper around gtk_status_icon_get_tooltip_markup() +func (v *StatusIcon) GetTooltipMarkup() string { + c := C.gtk_status_icon_get_tooltip_markup(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} + +// SetHasTooltip is a wrapper around gtk_status_icon_set_has_tooltip() +func (v *StatusIcon) SetHasTooltip(hasTooltip bool) { + C.gtk_status_icon_set_has_tooltip(v.native(), gbool(hasTooltip)) +} + +// GetTitle is a wrapper around gtk_status_icon_get_title() +func (v *StatusIcon) GetTitle() string { + c := C.gtk_status_icon_get_title(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} + +// SetName is a wrapper around gtk_status_icon_set_name() +func (v *StatusIcon) SetName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_name(v.native(), (*C.gchar)(cstr)) +} + +// SetVisible is a wrapper around gtk_status_icon_set_visible() +func (v *StatusIcon) SetVisible(visible bool) { + C.gtk_status_icon_set_visible(v.native(), gbool(visible)) +} + +// GetVisible is a wrapper around gtk_status_icon_get_visible() +func (v *StatusIcon) GetVisible() bool { + return gobool(C.gtk_status_icon_get_visible(v.native())) +} + +// IsEmbedded is a wrapper around gtk_status_icon_is_embedded() +func (v *StatusIcon) IsEmbedded() bool { + return gobool(C.gtk_status_icon_is_embedded(v.native())) +} + +// GetX11WindowID is a wrapper around gtk_status_icon_get_x11_window_id() +func (v *StatusIcon) GetX11WindowID() uint32 { + return uint32(C.gtk_status_icon_get_x11_window_id(v.native())) +} + +// GetHasTooltip is a wrapper around gtk_status_icon_get_has_tooltip() +func (v *StatusIcon) GetHasTooltip() bool { + return gobool(C.gtk_status_icon_get_has_tooltip(v.native())) +} + +// SetTitle is a wrapper around gtk_status_icon_set_title() +func (v *StatusIcon) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_status_icon_set_title(v.native(), (*C.gchar)(cstr)) +} + +// GetIconName is a wrapper around gtk_status_icon_get_icon_name() +func (v *StatusIcon) GetIconName() string { + c := C.gtk_status_icon_get_icon_name(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} + +// GetSize is a wrapper around gtk_status_icon_get_size() +func (v *StatusIcon) GetSize() int { + return int(C.gtk_status_icon_get_size(v.native())) +} + +// PopupAtStatusIcon() is a wrapper around gtk_menu_popup() specific to usage with GtkStatusIcon. +// gomenu_popup() is defined in menu.go.h, this is a workaround to pass gtk_status_icon_position_menu as the GtkMenuPositionFunc. +func (v *Menu) PopupAtStatusIcon(statusIcon *StatusIcon, button gdk.Button, activateTime uint32) { + C.gotk_menu_popup_at_status_icon(v.native(), statusIcon.native(), C.guint(button), C.guint32(activateTime)) +} + +/* + * GtkMisc + */ + +// Misc is a representation of GTK's GtkMisc. +type Misc struct { + Widget +} + +// native returns a pointer to the underlying GtkMisc. +func (v *Misc) native() *C.GtkMisc { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMisc(p) +} + +func marshalMisc(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMisc(obj), nil +} + +func wrapMisc(obj *glib.Object) *Misc { + if obj == nil { + return nil + } + + return &Misc{Widget{glib.InitiallyUnowned{obj}}} +} + +/* + * End deprecated since version 3.14 + */ diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h new file mode 100644 index 0000000..f5ad487 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_14.go.h @@ -0,0 +1,28 @@ + +/* + * deprecated since version 3.14 + */ + +// Wrapper for gtk_menu_popup to allow calling gtk_status_icon_position_menu as +// callback from go code Used in func (v *Menu) PopupAtStatusIcon +static void gotk_menu_popup_at_status_icon(GtkMenu *menu, + GtkStatusIcon *status_icon, + guint button, + guint32 activate_time) { + gtk_menu_popup(menu, NULL, NULL, gtk_status_icon_position_menu, status_icon, + button, activate_time); +} + +static GtkAlignment *toGtkAlignment(void *p) { return (GTK_ALIGNMENT(p)); } + +static GtkArrow *toGtkArrow(void *p) { return (GTK_ARROW(p)); } + +static GtkMisc *toGtkMisc(void *p) { return (GTK_MISC(p)); } + +static GtkStatusIcon *toGtkStatusIcon(void *p) { return (GTK_STATUS_ICON(p)); } + +static GdkPixbuf *toGdkPixbuf(void *p) { return (GDK_PIXBUF(p)); } + +/* + * End deprecated since version 3.14 + */ diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go new file mode 100644 index 0000000..ef51cf1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_16.go @@ -0,0 +1,55 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_deprecated + +package gtk + +// #include +// #include +// #include +import "C" + +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" +) + +// OverrideColor is a wrapper around gtk_widget_override_color(). +func (v *Widget) OverrideColor(state StateFlags, color *gdk.RGBA) { + var cColor *C.GdkRGBA + if color != nil { + cColor = (*C.GdkRGBA)(unsafe.Pointer(color.Native())) + } + C.gtk_widget_override_color(v.native(), C.GtkStateFlags(state), cColor) +} + +// OverrideBackgroundColor is a wrapper around gtk_widget_override_background_color(). +func (v *Widget) OverrideBackgroundColor(state StateFlags, color *gdk.RGBA) { + var cColor *C.GdkRGBA + if color != nil { + cColor = (*C.GdkRGBA)(unsafe.Pointer(color.Native())) + } + C.gtk_widget_override_background_color(v.native(), C.GtkStateFlags(state), cColor) +} + +// SetColor is a convenience func to override the background color of the given button. +func (v *Button) SetColor(color string) { + rgba := C.GdkRGBA{} + C.gdk_rgba_parse(&rgba, (*C.gchar)(C.CString(color))) + C.gtk_widget_override_background_color(v.toWidget(), C.GTK_STATE_FLAG_NORMAL, &rgba) +} + +// OverrideFont is a wrapper around gtk_widget_override_font(). +func (v *Widget) OverrideFont(description string) { + cstr := C.CString(description) + defer C.free(unsafe.Pointer(cstr)) + c := C.pango_font_description_from_string(cstr) + C.gtk_widget_override_font(v.native(), c) +} + +// TODO: +// gtk_widget_override_symbolic_color(). +// gtk_widget_override_cursor(). + +func (v *Label) SetFont(font string) { + v.OverrideFont(font) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_18.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_18.go new file mode 100644 index 0000000..06f9ec5 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_18.go @@ -0,0 +1,11 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_deprecated + +package gtk + +/* + * GtkPlacesSidebar + */ + +// TODO: +// gtk_places_sidebar_get_show_connect_to_server(). +// gtk_places_sidebar_set_show_connect_to_server(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_20.go new file mode 100644 index 0000000..3edf2f0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_20.go @@ -0,0 +1,86 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_deprecated + +package gtk + +// #include +// #include +import "C" +import ( + "unsafe" +) + +/* + * GtkRange + */ + +// TODO: +// gtk_range_get_min_slider_size(). +// gtk_range_set_min_slider_size(). + +/* + * GtkToolbar + */ + +// TODO: +// GtkToolbarSpaceStyle + +/* + * GtkFileChooserButton + */ + +// GetFocusOnClick is a wrapper around gtk_file_chooser_button_get_focus_on_click(). +func (v *FileChooserButton) GetFocusOnClick() bool { + return gobool(C.gtk_file_chooser_button_get_focus_on_click(v.native())) +} + +// SetFocusOnClick is a wrapper around gtk_file_chooser_button_set_focus_on_click(). +func (v *FileChooserButton) SetFocusOnClick(grabFocus bool) { + C.gtk_file_chooser_button_set_focus_on_click(v.native(), gbool(grabFocus)) +} + +/* + * GtkButton + */ + +// GetFocusOnClick is a wrapper around gtk_button_get_focus_on_click(). +func (v *Button) GetFocusOnClick() bool { + c := C.gtk_button_get_focus_on_click(v.native()) + return gobool(c) +} + +// SetFocusOnClick is a wrapper around gtk_button_set_focus_on_click(). +func (v *Button) SetFocusOnClick(focusOnClick bool) { + C.gtk_button_set_focus_on_click(v.native(), gbool(focusOnClick)) +} + +/* + * GtkTextIter + */ + +// BeginsTag is a wrapper around gtk_text_iter_begins_tag(). +func (v *TextIter) BeginsTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_begins_tag(v.native(), v1.native())) +} + +/* + * GtkWindow + */ + +// ParseGeometry is a wrapper around gtk_window_parse_geometry(). +func (v *Window) ParseGeometry(geometry string) bool { + cstr := C.CString(geometry) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_window_parse_geometry(v.native(), (*C.gchar)(cstr)) + return gobool(c) +} + +// ResizeToGeometry is a wrapper around gtk_window_resize_to_geometry(). +func (v *Window) ResizeToGeometry(width, height int) { + C.gtk_window_resize_to_geometry(v.native(), C.gint(width), C.gint(height)) +} + +// SetDefaultGeometry is a wrapper around gtk_window_set_default_geometry(). +func (v *Window) SetDefaultGeometry(width, height int) { + C.gtk_window_set_default_geometry(v.native(), C.gint(width), + C.gint(height)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_22.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_22.go new file mode 100644 index 0000000..7f658b7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_22.go @@ -0,0 +1,67 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_3_20 gtk_deprecated + +package gtk + +// #include +// #include +import "C" + +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" +) + +/* + * GtkWidget + */ + +// TODO: +// gtk_widget_send_expose(). +// gtk_widget_is_composited(). + +// PopupAtMouse() is a wrapper for gtk_menu_popup(), without the option for a custom positioning function. +func (v *Menu) PopupAtMouseCursor(parentMenuShell IMenu, parentMenuItem IMenuItem, button gdk.Button, activateTime uint32) { + wshell := nullableWidget(parentMenuShell) + witem := nullableWidget(parentMenuItem) + + C.gtk_menu_popup(v.native(), + wshell, + witem, + nil, + nil, + C.guint(button), + C.guint32(activateTime)) +} + +func (v *SizeGroup) GetIgnoreHidden() bool { + c := C.gtk_size_group_get_ignore_hidden(v.native()) + return gobool(c) +} + +// SetWMClass is a wrapper around gtk_window_set_wmclass(). +func (v *Window) SetWMClass(name, class string) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + cClass := C.CString(class) + defer C.free(unsafe.Pointer(cClass)) + C.gtk_window_set_wmclass(v.native(), (*C.gchar)(cName), (*C.gchar)(cClass)) +} + +func (v *SizeGroup) SetIgnoreHidden(ignoreHidden bool) { + C.gtk_size_group_set_ignore_hidden(v.native(), gbool(ignoreHidden)) +} + +// GetFontName is a wrapper around gtk_font_button_get_font_name(). +func (v *FontButton) GetFontName() string { + c := C.gtk_font_button_get_font_name(v.native()) + return goString(c) +} + +// SetFontName is a wrapper around gtk_font_button_set_font_name(). +func (v *FontButton) SetFontName(fontname string) bool { + cstr := C.CString(fontname) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_font_button_set_font_name(v.native(), (*C.gchar)(cstr)) + return gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_24.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_24.go new file mode 100644 index 0000000..14541ed --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_24.go @@ -0,0 +1,66 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_3_20 gtk_3_22 gtk_deprecated + +package gtk + +// #include +// #include +import "C" +import ( + "fmt" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +// GetFocusChain is a wrapper around gtk_container_get_focus_chain(). +func (v *Container) GetFocusChain() ([]IWidget, bool, error) { + var cwlist *C.GList + c := C.gtk_container_get_focus_chain(v.native(), &cwlist) + + if cwlist == nil { + return nil, gobool(c), nil + } + + var widgets []IWidget + wlist := glib.WrapList(uintptr(unsafe.Pointer(cwlist))) + for ; wlist.Data() != nil; wlist = wlist.Next() { + w, ok := wlist.Data().(*Widget) + if !ok { + return nil, gobool(c), fmt.Errorf("element is not of type *Widget, got %T", w) + } + widget, err := castWidget(w.toWidget()) + if err != nil { + return nil, gobool(c), err + } + widgets = append(widgets, widget) + } + return widgets, gobool(c), nil +} + +/* + * GtkContainer + */ + +// SetFocusChain is a wrapper around gtk_container_set_focus_chain(). +func (v *Container) SetFocusChain(focusableWidgets []IWidget) { + var list *glib.List + for _, w := range focusableWidgets { + data := uintptr(unsafe.Pointer(w.toWidget())) + list = list.Append(data) + } + glist := (*C.GList)(unsafe.Pointer(list)) + C.gtk_container_set_focus_chain(v.native(), glist) +} + +// TODO: +// gtk_container_unset_focus_chain + +// CssProviderGetDefault is a wrapper around gtk_css_provider_get_default(). +func CssProviderGetDefault() (*CssProvider, error) { + c := C.gtk_css_provider_get_default() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapCssProvider(obj), nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_8.go new file mode 100644 index 0000000..815521d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_deprecated_since_3_8.go @@ -0,0 +1,41 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols deprecated beginning with GTK 3.8, +// and should only be included in a build targeted intended to target GTK +// 3.6 or earlier. To target an earlier build build, use the build tag +// gtk_MAJOR_MINOR. For example, to target GTK 3.6, run +// 'go build -tags gtk_3_6'. +// +build gtk_3_6 gtk_deprecated + +package gtk + +// #include +// #include +import "C" + +// SetOpacity is a wrapper around gtk_window_set_opacity() +// Deprecated since 3.8, replaced by SetOpacity on Widget (gtk_widget_set_opacity) +func (v *Window) SetOpacity(opacity float64) { + C.gtk_window_set_opacity(v.native(), C.gdouble(opacity)) +} + +// GetOpacity is a wrapper around gtk_window_get_opacity() +// Deprecated since 3.8, replaced by GetOpacity on Widget (gtk_widget_get_opacity) +func (v *Window) GetOpacity() float64 { + c := C.gtk_window_get_opacity(v.native()) + return float64(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_export.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_export.go new file mode 100644 index 0000000..6c0153a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_export.go @@ -0,0 +1,109 @@ +package gtk + +/* + #include +*/ +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +//export goBuilderConnect +func goBuilderConnect( + builder *C.GtkBuilder, + object *C.GObject, + signal_name *C.gchar, + handler_name *C.gchar, + connect_object *C.GObject, + flags C.GConnectFlags, + user_data C.gpointer) { + + builderSignals.Lock() + signals, ok := builderSignals.m[builder] + builderSignals.Unlock() + + if !ok { + panic("no signal mapping defined for this GtkBuilder") + } + + h := C.GoString((*C.char)(handler_name)) + s := C.GoString((*C.char)(signal_name)) + + handler, ok := signals[h] + if !ok { + return + } + + if object == nil { + panic("unexpected nil object from builder") + } + + //TODO: figure out a better way to get a glib.Object from a *C.GObject + gobj := glib.Object{glib.ToGObject(unsafe.Pointer(object))} + gobj.Connect(s, handler) +} + +//export goTreeViewSearchEqualFunc +func goTreeViewSearchEqualFunc(model *C.GtkTreeModel, column C.gint, key *C.gchar, iter *C.GtkTreeIter, data C.gpointer) C.gboolean { + fn := callback.Get(uintptr(data)).(TreeViewSearchEqualFunc) + return gbool(fn( + wrapTreeModel(glib.Take(unsafe.Pointer(model))), + int(column), + C.GoString(key), + &TreeIter{(C.GtkTreeIter)(*iter)}, + )) +} + +//export goTreeModelFilterVisibleFunc +func goTreeModelFilterVisibleFunc(model *C.GtkTreeModel, iter *C.GtkTreeIter, data C.gpointer) C.gboolean { + goIter := &TreeIter{(C.GtkTreeIter)(*iter)} + fn := callback.Get(uintptr(data)).(TreeModelFilterVisibleFunc) + return gbool(fn( + wrapTreeModel(glib.Take(unsafe.Pointer(model))), + goIter, + )) +} + +//export goTreeSortableSortFunc +func goTreeSortableSortFunc(model *C.GtkTreeModel, a, b *C.GtkTreeIter, data C.gpointer) C.gint { + fn := callback.Get(uintptr(data)).(TreeIterCompareFunc) + return C.gint(fn( + wrapTreeModel(glib.Take(unsafe.Pointer(model))), + &TreeIter{(C.GtkTreeIter)(*a)}, + &TreeIter{(C.GtkTreeIter)(*b)}, + )) +} + +//export goTreeModelForeachFunc +func goTreeModelForeachFunc(model *C.GtkTreeModel, path *C.GtkTreePath, iter *C.GtkTreeIter, data C.gpointer) C.gboolean { + fn := callback.Get(uintptr(data)).(TreeModelForeachFunc) + return gbool(fn( + wrapTreeModel(glib.Take(unsafe.Pointer(model))), + &TreePath{(*C.GtkTreePath)(path)}, + &TreeIter{(C.GtkTreeIter)(*iter)}, + )) +} + +//export goTreeSelectionForeachFunc +func goTreeSelectionForeachFunc(model *C.GtkTreeModel, path *C.GtkTreePath, iter *C.GtkTreeIter, data C.gpointer) { + fn := callback.Get(uintptr(data)).(TreeSelectionForeachFunc) + fn( + wrapTreeModel(glib.Take(unsafe.Pointer(model))), + &TreePath{(*C.GtkTreePath)(path)}, + &TreeIter{(C.GtkTreeIter)(*iter)}, + ) +} + +//export goTreeSelectionFunc +func goTreeSelectionFunc(selection *C.GtkTreeSelection, model *C.GtkTreeModel, path *C.GtkTreePath, selected C.gboolean, data C.gpointer) C.gboolean { + fn := callback.Get(uintptr(data)).(TreeSelectionFunc) + return gbool(fn( + wrapTreeSelection(glib.Take(unsafe.Pointer(selection))), + wrapTreeModel(glib.Take(unsafe.Pointer(model))), + &TreePath{(*C.GtkTreePath)(path)}, + gobool(selected), + )) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_10.go new file mode 100644 index 0000000..59b72e4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_10.go @@ -0,0 +1,36 @@ +// +build !gtk_3_6,!gtk_3_8 + +package gtk + +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +//export goListBoxFilterFuncs +func goListBoxFilterFuncs(row *C.GtkListBoxRow, userData C.gpointer) C.gboolean { + fn := callback.Get(uintptr(userData)).(ListBoxFilterFunc) + return gbool(fn(wrapListBoxRow(glib.Take(unsafe.Pointer(row))))) +} + +//export goListBoxHeaderFuncs +func goListBoxHeaderFuncs(row *C.GtkListBoxRow, before *C.GtkListBoxRow, userData C.gpointer) { + fn := callback.Get(uintptr(userData)).(ListBoxHeaderFunc) + fn( + wrapListBoxRow(glib.Take(unsafe.Pointer(row))), + wrapListBoxRow(glib.Take(unsafe.Pointer(before))), + ) +} + +//export goListBoxSortFuncs +func goListBoxSortFuncs(row1 *C.GtkListBoxRow, row2 *C.GtkListBoxRow, userData C.gpointer) C.gint { + fn := callback.Get(uintptr(userData)).(ListBoxSortFunc) + return C.gint(fn( + wrapListBoxRow(glib.Take(unsafe.Pointer(row1))), + wrapListBoxRow(glib.Take(unsafe.Pointer(row2))), + )) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_14.go new file mode 100644 index 0000000..60a9788 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_14.go @@ -0,0 +1,19 @@ +// Same copyright and license as the rest of the files in this project +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +package gtk + +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +//export goListBoxForEachFuncs +func goListBoxForEachFuncs(box *C.GtkListBox, row *C.GtkListBoxRow, userData C.gpointer) { + fn := callback.Get(uintptr(userData)).(ListBoxForeachFunc) + fn(wrapListBox(glib.Take(unsafe.Pointer(box))), wrapListBoxRow(glib.Take(unsafe.Pointer(row)))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_16.go new file mode 100644 index 0000000..e1c0480 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_export_since_3_16.go @@ -0,0 +1,14 @@ +// Same copyright and license as the rest of the files in this project +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 + +package gtk + +// #include +import "C" +import "github.com/gotk3/gotk3/internal/callback" + +//export goListBoxCreateWidgetFuncs +func goListBoxCreateWidgetFuncs(item, userData C.gpointer) { + fn := callback.Get(uintptr(userData)).(ListBoxCreateWidgetFunc) + fn(uintptr(item)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go new file mode 100644 index 0000000..dae8a75 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go @@ -0,0 +1,918 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +// +build !gtk_3_6,!gtk_3_8 +// not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10 + +package gtk + +// #include +// #include +// #include "gtk_since_3_10.go.h" +import "C" +import ( + "errors" + "unsafe" + + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" + "github.com/gotk3/gotk3/pango" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gtk_revealer_transition_type_get_type()), marshalRevealerTransitionType}, + {glib.Type(C.gtk_stack_transition_type_get_type()), marshalStackTransitionType}, + + // Objects/Interfaces + {glib.Type(C.gtk_header_bar_get_type()), marshalHeaderBar}, + {glib.Type(C.gtk_list_box_get_type()), marshalListBox}, + {glib.Type(C.gtk_list_box_row_get_type()), marshalListBoxRow}, + {glib.Type(C.gtk_revealer_get_type()), marshalRevealer}, + {glib.Type(C.gtk_search_bar_get_type()), marshalSearchBar}, + {glib.Type(C.gtk_stack_get_type()), marshalStack}, + {glib.Type(C.gtk_stack_switcher_get_type()), marshalStackSwitcher}, + } + glib.RegisterGValueMarshalers(tm) + + //Contribute to casting + for k, v := range map[string]WrapFn{ + "GtkHeaderBar": wrapHeaderBar, + "GtkListBox": wrapListBox, + "GtkListBoxRow": wrapListBoxRow, + "GtkRevealer": wrapRevealer, + "GtkSearchBar": wrapSearchBar, + "GtkStack": wrapStack, + } { + WrapMap[k] = v + } +} + +/* + * Constants + */ + +const ( + ALIGN_BASELINE Align = C.GTK_ALIGN_BASELINE +) + +// ImageType +const ( + IMAGE_SURFACE ImageType = C.GTK_IMAGE_SURFACE +) + +// RevealerTransitionType is a representation of GTK's GtkRevealerTransitionType. +type RevealerTransitionType int + +const ( + REVEALER_TRANSITION_TYPE_NONE RevealerTransitionType = C.GTK_REVEALER_TRANSITION_TYPE_NONE + REVEALER_TRANSITION_TYPE_CROSSFADE RevealerTransitionType = C.GTK_REVEALER_TRANSITION_TYPE_CROSSFADE + REVEALER_TRANSITION_TYPE_SLIDE_RIGHT RevealerTransitionType = C.GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT + REVEALER_TRANSITION_TYPE_SLIDE_LEFT RevealerTransitionType = C.GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT + REVEALER_TRANSITION_TYPE_SLIDE_UP RevealerTransitionType = C.GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP + REVEALER_TRANSITION_TYPE_SLIDE_DOWN RevealerTransitionType = C.GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN +) + +func marshalRevealerTransitionType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return RevealerTransitionType(c), nil +} + +// StackTransitionType is a representation of GTK's GtkStackTransitionType. +type StackTransitionType int + +const ( + STACK_TRANSITION_TYPE_NONE StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_NONE + STACK_TRANSITION_TYPE_CROSSFADE StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_CROSSFADE + STACK_TRANSITION_TYPE_SLIDE_RIGHT StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT + STACK_TRANSITION_TYPE_SLIDE_LEFT StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT + STACK_TRANSITION_TYPE_SLIDE_UP StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_SLIDE_UP + STACK_TRANSITION_TYPE_SLIDE_DOWN StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN + STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT + STACK_TRANSITION_TYPE_SLIDE_UP_DOWN StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN +) + +func marshalStackTransitionType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return StackTransitionType(c), nil +} + +/* + * GtkWidget + */ + +// TODO: +// gtk_widget_get_composite_name(). + +/* + * GtkImage + */ + +// ImageNewFromSurface is a wrapper around gtk_image_new_from_surface(). +func ImageNewFromSurface(surface *cairo.Surface) (*Image, error) { + c := C.gtk_image_new_from_surface((*C.cairo_surface_t)(surface.GetCSurface())) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapImage(obj), nil +} + +// SetFromSurface is a wrapper around gtk_image_set_from_surface(). +func (v *Image) SetFromSurface(surface *cairo.Surface) { + csurface := (*C.cairo_surface_t)(surface.GetCSurface()) + C.gtk_image_set_from_surface(v.native(), csurface) +} + +/* + * GtkIconTheme + */ + +// HasIcon is a wrapper around gtk_icon_theme_load_icon_for_scale(). +func (v *IconTheme) LoadIconForScale(iconName string, size, scale int, flags IconLookupFlags) (*gdk.Pixbuf, error) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + + var err *C.GError = nil + c := C.gtk_icon_theme_load_icon_for_scale(v.Theme, (*C.gchar)(cstr), C.gint(size), C.gint(scale), C.GtkIconLookupFlags(flags), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(goString(err.message)) + } + return &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))}, nil +} + +/* + * GtkEntry + */ + +// GetTabs is a wrapper around gtk_entry_get_tabs(). +func (v *Entry) GetTabs() (*pango.TabArray, error) { + c := C.gtk_entry_get_tabs(v.native()) + if c == nil { + return nil, nilPtrErr + } + return pango.WrapTabArray(uintptr(unsafe.Pointer(c))), nil +} + +// SetTabs is a wrapper around gtk_entry_set_tabs(). +func (v *Entry) SetTabs(tabs *pango.TabArray) { + C.gtk_entry_set_tabs(v.native(), (*C.PangoTabArray)(unsafe.Pointer(tabs.Native()))) +} + +/* + * GtkButton + */ + +// ButtonNewFromIconName is a wrapper around gtk_button_new_from_icon_name(). +func ButtonNewFromIconName(iconName string, size IconSize) (*Button, error) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_button_new_from_icon_name((*C.gchar)(cstr), + C.GtkIconSize(size)) + if c == nil { + return nil, nilPtrErr + } + return wrapButton(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkBox + */ + +// TODO: +// gtk_box_get_baseline_position(). +// gtk_box_set_baseline_position(). + +/* + * GtkGrid + */ + +// RemoveRow is a wrapper around gtk_grid_remove_row(). +func (v *Grid) RemoveRow(position int) { + C.gtk_grid_remove_row(v.native(), C.gint(position)) +} + +// RemoveColumn is a wrapper around gtk_grid_remove_column(). +func (v *Grid) RemoveColumn(position int) { + C.gtk_grid_remove_column(v.native(), C.gint(position)) +} + +// TODO: +// gtk_grid_get_baseline_row(). +// gtk_grid_set_baseline_row(). +// gtk_grid_get_row_baseline_position(). +// gtk_grid_set_row_baseline_position(). + +/* + * GtkHeaderBar + */ + +// HeaderBar is a representation of GtkHeaderBar +type HeaderBar struct { + Container +} + +// native returns a pointer to the underlying GtkHeaderBar. +func (v *HeaderBar) native() *C.GtkHeaderBar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkHeaderBar(p) +} + +func marshalHeaderBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapHeaderBar(obj), nil +} + +func wrapHeaderBar(obj *glib.Object) *HeaderBar { + if obj == nil { + return nil + } + + return &HeaderBar{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// HeaderBarNew is a wrapper around gtk_header_bar_new(). +func HeaderBarNew() (*HeaderBar, error) { + c := C.gtk_header_bar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapHeaderBar(glib.Take(unsafe.Pointer(c))), nil +} + +// SetTitle is a wrapper around gtk_header_bar_set_title(). +func (v *HeaderBar) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_header_bar_set_title(v.native(), (*C.gchar)(cstr)) +} + +// GetTitle is a wrapper around gtk_header_bar_get_title(). +func (v *HeaderBar) GetTitle() string { + cstr := C.gtk_header_bar_get_title(v.native()) + return C.GoString((*C.char)(cstr)) +} + +// SetSubtitle is a wrapper around gtk_header_bar_set_subtitle(). +func (v *HeaderBar) SetSubtitle(subtitle string) { + cstr := C.CString(subtitle) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_header_bar_set_subtitle(v.native(), (*C.gchar)(cstr)) +} + +// GetSubtitle is a wrapper around gtk_header_bar_get_subtitle(). +func (v *HeaderBar) GetSubtitle() string { + cstr := C.gtk_header_bar_get_subtitle(v.native()) + return C.GoString((*C.char)(cstr)) +} + +// SetCustomTitle is a wrapper around gtk_header_bar_set_custom_title(). +func (v *HeaderBar) SetCustomTitle(titleWidget IWidget) { + C.gtk_header_bar_set_custom_title(v.native(), titleWidget.toWidget()) +} + +// GetCustomTitle is a wrapper around gtk_header_bar_get_custom_title(). +func (v *HeaderBar) GetCustomTitle() (IWidget, error) { + c := C.gtk_header_bar_get_custom_title(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// PackStart is a wrapper around gtk_header_bar_pack_start(). +func (v *HeaderBar) PackStart(child IWidget) { + C.gtk_header_bar_pack_start(v.native(), child.toWidget()) +} + +// PackEnd is a wrapper around gtk_header_bar_pack_end(). +func (v *HeaderBar) PackEnd(child IWidget) { + C.gtk_header_bar_pack_end(v.native(), child.toWidget()) +} + +// SetShowCloseButton is a wrapper around gtk_header_bar_set_show_close_button(). +func (v *HeaderBar) SetShowCloseButton(setting bool) { + C.gtk_header_bar_set_show_close_button(v.native(), gbool(setting)) +} + +// GetShowCloseButton is a wrapper around gtk_header_bar_get_show_close_button(). +func (v *HeaderBar) GetShowCloseButton() bool { + c := C.gtk_header_bar_get_show_close_button(v.native()) + return gobool(c) +} + +/* + * GtkLabel + */ + +// GetLines is a wrapper around gtk_label_get_lines(). +func (v *Label) GetLines() int { + c := C.gtk_label_get_lines(v.native()) + return int(c) +} + +// SetLines is a wrapper around gtk_label_set_lines(). +func (v *Label) SetLines(lines int) { + C.gtk_label_set_lines(v.native(), C.gint(lines)) +} + +/* + * GtkListBox + */ + +// ListBox is a representation of GTK's GtkListBox. +type ListBox struct { + Container +} + +// native returns a pointer to the underlying GtkListBox. +func (v *ListBox) native() *C.GtkListBox { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkListBox(p) +} + +func marshalListBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapListBox(obj), nil +} + +func wrapListBox(obj *glib.Object) *ListBox { + if obj == nil { + return nil + } + + return &ListBox{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// ListBoxNew is a wrapper around gtk_list_box_new(). +func ListBoxNew() (*ListBox, error) { + c := C.gtk_list_box_new() + if c == nil { + return nil, nilPtrErr + } + return wrapListBox(glib.Take(unsafe.Pointer(c))), nil +} + +// Prepend is a wrapper around gtk_list_box_prepend(). +func (v *ListBox) Prepend(child IWidget) { + C.gtk_list_box_prepend(v.native(), child.toWidget()) +} + +// Insert is a wrapper around gtk_list_box_insert(). +func (v *ListBox) Insert(child IWidget, position int) { + C.gtk_list_box_insert(v.native(), child.toWidget(), C.gint(position)) +} + +// SelectRow is a wrapper around gtk_list_box_select_row(). +func (v *ListBox) SelectRow(row *ListBoxRow) { + C.gtk_list_box_select_row(v.native(), row.native()) +} + +// GetSelectedRow is a wrapper around gtk_list_box_get_selected_row(). +func (v *ListBox) GetSelectedRow() *ListBoxRow { + c := C.gtk_list_box_get_selected_row(v.native()) + if c == nil { + return nil + } + return wrapListBoxRow(glib.Take(unsafe.Pointer(c))) +} + +// SetSelectionMode is a wrapper around gtk_list_box_set_selection_mode(). +func (v *ListBox) SetSelectionMode(mode SelectionMode) { + C.gtk_list_box_set_selection_mode(v.native(), C.GtkSelectionMode(mode)) +} + +// GetSelectionMode is a wrapper around gtk_list_box_get_selection_mode() +func (v *ListBox) GetSelectionMode() SelectionMode { + c := C.gtk_list_box_get_selection_mode(v.native()) + return SelectionMode(c) +} + +// SetActivateOnSingleClick is a wrapper around gtk_list_box_set_activate_on_single_click(). +func (v *ListBox) SetActivateOnSingleClick(single bool) { + C.gtk_list_box_set_activate_on_single_click(v.native(), gbool(single)) +} + +// GetActivateOnSingleClick is a wrapper around gtk_list_box_get_activate_on_single_click(). +func (v *ListBox) GetActivateOnSingleClick() bool { + c := C.gtk_list_box_get_activate_on_single_click(v.native()) + return gobool(c) +} + +// GetAdjustment is a wrapper around gtk_list_box_get_adjustment(). +func (v *ListBox) GetAdjustment() *Adjustment { + c := C.gtk_list_box_get_adjustment(v.native()) + obj := glib.Take(unsafe.Pointer(c)) + return &Adjustment{glib.InitiallyUnowned{obj}} +} + +// SetAdjustment is a wrapper around gtk_list_box_set_adjustment(). +func (v *ListBox) SetAdjustment(adjustment *Adjustment) { + C.gtk_list_box_set_adjustment(v.native(), adjustment.native()) +} + +// SetPlaceholder is a wrapper around gtk_list_box_set_placeholder(). +func (v *ListBox) SetPlaceholder(placeholder IWidget) { + C.gtk_list_box_set_placeholder(v.native(), placeholder.toWidget()) +} + +// GetRowAtIndex is a wrapper around gtk_list_box_get_row_at_index(). +func (v *ListBox) GetRowAtIndex(index int) *ListBoxRow { + c := C.gtk_list_box_get_row_at_index(v.native(), C.gint(index)) + if c == nil { + return nil + } + return wrapListBoxRow(glib.Take(unsafe.Pointer(c))) +} + +// GetRowAtY is a wrapper around gtk_list_box_get_row_at_y(). +func (v *ListBox) GetRowAtY(y int) *ListBoxRow { + c := C.gtk_list_box_get_row_at_y(v.native(), C.gint(y)) + if c == nil { + return nil + } + return wrapListBoxRow(glib.Take(unsafe.Pointer(c))) +} + +// InvalidateFilter is a wrapper around gtk_list_box_invalidate_filter(). +func (v *ListBox) InvalidateFilter() { + C.gtk_list_box_invalidate_filter(v.native()) +} + +// InvalidateHeaders is a wrapper around gtk_list_box_invalidate_headers(). +func (v *ListBox) InvalidateHeaders() { + C.gtk_list_box_invalidate_headers(v.native()) +} + +// InvalidateSort is a wrapper around gtk_list_box_invalidate_sort(). +func (v *ListBox) InvalidateSort() { + C.gtk_list_box_invalidate_sort(v.native()) +} + +// ListBoxFilterFunc is a representation of GtkListBoxFilterFunc +type ListBoxFilterFunc func(row *ListBoxRow) bool + +// SetFilterFunc is a wrapper around gtk_list_box_set_filter_func +func (v *ListBox) SetFilterFunc(fn ListBoxFilterFunc) { + C._gtk_list_box_set_filter_func(v.native(), C.gpointer(callback.Assign(fn))) +} + +// ListBoxHeaderFunc is a representation of GtkListBoxUpdateHeaderFunc +type ListBoxHeaderFunc func(row *ListBoxRow, before *ListBoxRow) + +// SetHeaderFunc is a wrapper around gtk_list_box_set_header_func +func (v *ListBox) SetHeaderFunc(fn ListBoxHeaderFunc) { + C._gtk_list_box_set_header_func(v.native(), C.gpointer(callback.Assign(fn))) +} + +// ListBoxSortFunc is a representation of GtkListBoxSortFunc +type ListBoxSortFunc func(row1 *ListBoxRow, row2 *ListBoxRow) int + +// SetSortFunc is a wrapper around gtk_list_box_set_sort_func +func (v *ListBox) SetSortFunc(fn ListBoxSortFunc) { + C._gtk_list_box_set_sort_func(v.native(), C.gpointer(callback.Assign(fn))) +} + +// DragHighlightRow is a wrapper around gtk_list_box_drag_highlight_row() +func (v *ListBox) DragHighlightRow(row *ListBoxRow) { + C.gtk_list_box_drag_highlight_row(v.native(), row.native()) +} + +// DragUnhighlightRow is a wrapper around gtk_list_box_drag_unhighlight_row(). +func (v *ListBox) DragUnhighlightRow() { + C.gtk_list_box_drag_unhighlight_row(v.native()) +} + +/* + * GtkListBoxRow + */ + +// ListBoxRow is a representation of GTK's GtkListBoxRow. +type ListBoxRow struct { + Bin +} + +// native returns a pointer to the underlying GtkListBoxRow. +func (v *ListBoxRow) native() *C.GtkListBoxRow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkListBoxRow(p) +} + +func marshalListBoxRow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapListBoxRow(obj), nil +} + +func wrapListBoxRow(obj *glib.Object) *ListBoxRow { + if obj == nil { + return nil + } + + return &ListBoxRow{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// ListBoxRowNew is a wrapper around gtk_list_box_row_new(). +func ListBoxRowNew() (*ListBoxRow, error) { + c := C.gtk_list_box_row_new() + if c == nil { + return nil, nilPtrErr + } + return wrapListBoxRow(glib.Take(unsafe.Pointer(c))), nil +} + +// Changed is a wrapper around gtk_list_box_row_changed(). +func (v *ListBoxRow) Changed() { + C.gtk_list_box_row_changed(v.native()) +} + +// GetHeader is a wrapper around gtk_list_box_row_get_header(). +func (v *ListBoxRow) GetHeader() (IWidget, error) { + c := C.gtk_list_box_row_get_header(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetHeader is a wrapper around gtk_list_box_row_set_header(). +func (v *ListBoxRow) SetHeader(header IWidget) { + if header == nil { + C.gtk_list_box_row_set_header(v.native(), nil) + return + } + C.gtk_list_box_row_set_header(v.native(), header.toWidget()) +} + +// GetIndex is a wrapper around gtk_list_box_row_get_index() +func (v *ListBoxRow) GetIndex() int { + c := C.gtk_list_box_row_get_index(v.native()) + return int(c) +} + +/* + * GtkPlacesSidebar + */ + +// TODO: +// gtk_places_sidebar_new(). +// gtk_places_sidebar_set_open_flags(). +// gtk_places_sidebar_get_open_flags(). +// gtk_places_sidebar_set_location(). +// gtk_places_sidebar_get_location(). +// gtk_places_sidebar_set_show_desktop(). +// gtk_places_sidebar_get_show_desktop(). +// gtk_places_sidebar_add_shortcut(). +// gtk_places_sidebar_remove_shortcut(). +// gtk_places_sidebar_list_shortcuts(). +// gtk_places_sidebar_get_nth_bookmark(). +// enum GtkPlacesOpenFlags + +/* + * GtkRevealer + */ + +// Revealer is a representation of GTK's GtkRevealer +type Revealer struct { + Bin +} + +// native returns a pointer to the underlying GtkRevealer. +func (v *Revealer) native() *C.GtkRevealer { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkRevealer(p) +} + +func marshalRevealer(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapRevealer(obj), nil +} + +func wrapRevealer(obj *glib.Object) *Revealer { + if obj == nil { + return nil + } + + return &Revealer{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// RevealerNew is a wrapper around gtk_revealer_new() +func RevealerNew() (*Revealer, error) { + c := C.gtk_revealer_new() + if c == nil { + return nil, nilPtrErr + } + return wrapRevealer(glib.Take(unsafe.Pointer(c))), nil +} + +// GetRevealChild is a wrapper around gtk_revealer_get_reveal_child(). +func (v *Revealer) GetRevealChild() bool { + c := C.gtk_revealer_get_reveal_child(v.native()) + return gobool(c) +} + +// SetRevealChild is a wrapper around gtk_revealer_set_reveal_child(). +func (v *Revealer) SetRevealChild(revealChild bool) { + C.gtk_revealer_set_reveal_child(v.native(), gbool(revealChild)) +} + +// GetChildRevealed is a wrapper around gtk_revealer_get_child_revealed(). +func (v *Revealer) GetChildRevealed() bool { + c := C.gtk_revealer_get_child_revealed(v.native()) + return gobool(c) +} + +// GetTransitionDuration is a wrapper around gtk_revealer_get_transition_duration() +func (v *Revealer) GetTransitionDuration() uint { + c := C.gtk_revealer_get_transition_duration(v.native()) + return uint(c) +} + +// SetTransitionDuration is a wrapper around gtk_revealer_set_transition_duration(). +func (v *Revealer) SetTransitionDuration(duration uint) { + C.gtk_revealer_set_transition_duration(v.native(), C.guint(duration)) +} + +// GetTransitionType is a wrapper around gtk_revealer_get_transition_type() +func (v *Revealer) GetTransitionType() RevealerTransitionType { + c := C.gtk_revealer_get_transition_type(v.native()) + return RevealerTransitionType(c) +} + +// SetTransitionType is a wrapper around gtk_revealer_set_transition_type() +func (v *Revealer) SetTransitionType(transition RevealerTransitionType) { + t := C.GtkRevealerTransitionType(transition) + C.gtk_revealer_set_transition_type(v.native(), t) +} + +/* + * GtkSearchBar + */ + +// SearchBar is a representation of GTK's GtkSearchBar. +type SearchBar struct { + Bin +} + +// native returns a pointer to the underlying GtkSearchBar. +func (v *SearchBar) native() *C.GtkSearchBar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSearchBar(p) +} + +func marshalSearchBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSearchBar(obj), nil +} + +func wrapSearchBar(obj *glib.Object) *SearchBar { + if obj == nil { + return nil + } + + return &SearchBar{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// SearchBarNew is a wrapper around gtk_search_bar_new() +func SearchBarNew() (*SearchBar, error) { + c := C.gtk_search_bar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSearchBar(glib.Take(unsafe.Pointer(c))), nil +} + +// ConnectEntry is a wrapper around gtk_search_bar_connect_entry(). +func (v *SearchBar) ConnectEntry(entry IEntry) { + C.gtk_search_bar_connect_entry(v.native(), entry.toEntry()) +} + +// GetSearchMode is a wrapper around gtk_search_bar_get_search_mode(). +func (v *SearchBar) GetSearchMode() bool { + c := C.gtk_search_bar_get_search_mode(v.native()) + return gobool(c) +} + +// SetSearchMode is a wrapper around gtk_search_bar_set_search_mode(). +func (v *SearchBar) SetSearchMode(searchMode bool) { + C.gtk_search_bar_set_search_mode(v.native(), gbool(searchMode)) +} + +// GetShowCloseButton is a wrapper arounb gtk_search_bar_get_show_close_button(). +func (v *SearchBar) GetShowCloseButton() bool { + c := C.gtk_search_bar_get_show_close_button(v.native()) + return gobool(c) +} + +// SetShowCloseButton is a wrapper around gtk_search_bar_set_show_close_button() +func (v *SearchBar) SetShowCloseButton(visible bool) { + C.gtk_search_bar_set_show_close_button(v.native(), gbool(visible)) +} + +// HandleEvent is a wrapper around gtk_search_bar_handle_event() +func (v *SearchBar) HandleEvent(event *gdk.Event) { + e := (*C.GdkEvent)(unsafe.Pointer(event.Native())) + C.gtk_search_bar_handle_event(v.native(), e) +} + +/* + * GtkStack + */ + +// Stack is a representation of GTK's GtkStack. +type Stack struct { + Container +} + +// native returns a pointer to the underlying GtkStack. +func (v *Stack) native() *C.GtkStack { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkStack(p) +} + +func marshalStack(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapStack(obj), nil +} + +func wrapStack(obj *glib.Object) *Stack { + if obj == nil { + return nil + } + + return &Stack{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// StackNew is a wrapper around gtk_stack_new(). +func StackNew() (*Stack, error) { + c := C.gtk_stack_new() + if c == nil { + return nil, nilPtrErr + } + return wrapStack(glib.Take(unsafe.Pointer(c))), nil +} + +// AddNamed is a wrapper around gtk_stack_add_named(). +func (v *Stack) AddNamed(child IWidget, name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_stack_add_named(v.native(), child.toWidget(), (*C.gchar)(cstr)) +} + +// AddTitled is a wrapper around gtk_stack_add_titled(). +func (v *Stack) AddTitled(child IWidget, name, title string) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + cTitle := C.CString(title) + defer C.free(unsafe.Pointer(cTitle)) + C.gtk_stack_add_titled(v.native(), child.toWidget(), (*C.gchar)(cName), + (*C.gchar)(cTitle)) +} + +// SetVisibleChild is a wrapper around gtk_stack_set_visible_child(). +func (v *Stack) SetVisibleChild(child IWidget) { + C.gtk_stack_set_visible_child(v.native(), child.toWidget()) +} + +// GetVisibleChild is a wrapper around gtk_stack_get_visible_child(). +func (v *Stack) GetVisibleChild() (IWidget, error) { + c := C.gtk_stack_get_visible_child(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetVisibleChildName is a wrapper around gtk_stack_set_visible_child_name(). +func (v *Stack) SetVisibleChildName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_stack_set_visible_child_name(v.native(), (*C.gchar)(cstr)) +} + +// GetVisibleChildName is a wrapper around gtk_stack_get_visible_child_name(). +func (v *Stack) GetVisibleChildName() string { + c := C.gtk_stack_get_visible_child_name(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetVisibleChildFull is a wrapper around gtk_stack_set_visible_child_full(). +func (v *Stack) SetVisibleChildFull(name string, transaction StackTransitionType) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_stack_set_visible_child_full(v.native(), (*C.gchar)(cstr), + C.GtkStackTransitionType(transaction)) +} + +// SetHomogeneous is a wrapper around gtk_stack_set_homogeneous(). +func (v *Stack) SetHomogeneous(homogeneous bool) { + C.gtk_stack_set_homogeneous(v.native(), gbool(homogeneous)) +} + +// GetHomogeneous is a wrapper around gtk_stack_get_homogeneous(). +func (v *Stack) GetHomogeneous() bool { + c := C.gtk_stack_get_homogeneous(v.native()) + return gobool(c) +} + +// SetTransitionDuration is a wrapper around gtk_stack_set_transition_duration(). +func (v *Stack) SetTransitionDuration(duration uint) { + C.gtk_stack_set_transition_duration(v.native(), C.guint(duration)) +} + +// GetTransitionDuration is a wrapper around gtk_stack_get_transition_duration(). +func (v *Stack) GetTransitionDuration() uint { + c := C.gtk_stack_get_transition_duration(v.native()) + return uint(c) +} + +// SetTransitionType is a wrapper around gtk_stack_set_transition_type(). +func (v *Stack) SetTransitionType(transition StackTransitionType) { + C.gtk_stack_set_transition_type(v.native(), C.GtkStackTransitionType(transition)) +} + +// GetTransitionType is a wrapper around gtk_stack_get_transition_type(). +func (v *Stack) GetTransitionType() StackTransitionType { + c := C.gtk_stack_get_transition_type(v.native()) + return StackTransitionType(c) +} + +/* + * GtkBuilder + */ + +// BuilderNewFromFile is a wrapper around gtk_builder_new_from_file(). +func BuilderNewFromFile(filePath string) (*Builder, error) { + cstr := C.CString(filePath) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_builder_new_from_file((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + + obj := glib.Take(unsafe.Pointer(c)) + return &Builder{obj}, nil +} + +// BuilderNewFromResource is a wrapper around gtk_builder_new_from_resource(). +func BuilderNewFromResource(resourcePath string) (*Builder, error) { + cstr := C.CString(resourcePath) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_builder_new_from_resource((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + + obj := glib.Take(unsafe.Pointer(c)) + return &Builder{obj}, nil +} + +// BuilderNewFromString is a wrapper around gtk_builder_new_from_string(). +func BuilderNewFromString(resource string) (*Builder, error) { + cstr := C.CString(resource) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_builder_new_from_string((*C.gchar)(cstr), C.gssize(len(resource))) + if c == nil { + return nil, nilPtrErr + } + + obj := glib.Take(unsafe.Pointer(c)) + return &Builder{obj}, nil +} + +// TODO: +// gtk_builder_add_callback_symbol +// gtk_builder_add_callback_symbols +// gtk_builder_lookup_callback_symbol +// gtk_builder_set_application +// gtk_builder_get_application diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h new file mode 100644 index 0000000..4d30466 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_10.go.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "gtk.go.h" // for gotk3_callbackDelete +#include + +static GtkHeaderBar *toGtkHeaderBar(void *p) { return (GTK_HEADER_BAR(p)); } + +static GtkListBox *toGtkListBox(void *p) { return (GTK_LIST_BOX(p)); } + +static GtkListBoxRow *toGtkListBoxRow(void *p) { return (GTK_LIST_BOX_ROW(p)); } + +static GtkRevealer *toGtkRevealer(void *p) { return (GTK_REVEALER(p)); } + +static GtkSearchBar *toGtkSearchBar(void *p) { return (GTK_SEARCH_BAR(p)); } + +static GtkStack *toGtkStack(void *p) { return (GTK_STACK(p)); } + +static GtkStackSwitcher *toGtkStackSwitcher(void *p) { + return (GTK_STACK_SWITCHER(p)); +} + +extern gboolean goListBoxFilterFuncs(GtkListBoxRow *row, gpointer user_data); + +static inline void _gtk_list_box_set_filter_func(GtkListBox *box, + gpointer user_data) { + gtk_list_box_set_filter_func(box, + (GtkListBoxFilterFunc)(goListBoxFilterFuncs), + user_data, (GDestroyNotify)(gotk3_callbackDelete)); +} + +extern void goListBoxHeaderFuncs(GtkListBoxRow *row, GtkListBoxRow *before, + gpointer user_data); + +static inline void _gtk_list_box_set_header_func(GtkListBox *box, + gpointer user_data) { + gtk_list_box_set_header_func( + box, (GtkListBoxUpdateHeaderFunc)(goListBoxHeaderFuncs), user_data, + (GDestroyNotify)(gotk3_callbackDelete)); +} + +extern gint goListBoxSortFuncs(GtkListBoxRow *row1, GtkListBoxRow *row2, + gpointer user_data); + +static inline void _gtk_list_box_set_sort_func(GtkListBox *box, + gpointer user_data) { + gtk_list_box_set_sort_func(box, (GtkListBoxSortFunc)(goListBoxSortFuncs), + user_data, (GDestroyNotify)(gotk3_callbackDelete)); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_12.go new file mode 100644 index 0000000..ad13a24 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_12.go @@ -0,0 +1,574 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// Wrapper for GtkPopover originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 +// not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10 + +package gtk + +// #include +// #include +// #include "gtk_since_3_12.go.h" +import "C" + +import ( + "errors" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * Constants + */ + +const ( + DIALOG_USE_HEADER_BAR DialogFlags = C.GTK_DIALOG_USE_HEADER_BAR +) + +const ( + STATE_FLAG_LINK StateFlags = C.GTK_STATE_FLAG_LINK + STATE_FLAG_VISITED StateFlags = C.GTK_STATE_FLAG_VISITED +) + +const ( + BUTTONBOX_EXPAND ButtonBoxStyle = C.GTK_BUTTONBOX_EXPAND +) + +func init() { + tm := []glib.TypeMarshaler{ + // Objects/Interfaces + {glib.Type(C.gtk_flow_box_get_type()), marshalFlowBox}, + {glib.Type(C.gtk_flow_box_child_get_type()), marshalFlowBoxChild}, + {glib.Type(C.gtk_popover_get_type()), marshalPopover}, + } + glib.RegisterGValueMarshalers(tm) + + //Contribute to casting + for k, v := range map[string]WrapFn{ + "GtkFlowBox": wrapFlowBox, + "GtkFlowBoxChild": wrapFlowBoxChild, + "GtkPopover": wrapPopover, + } { + WrapMap[k] = v + } +} + +// GetLocaleDirection is a wrapper around gtk_get_locale_direction(). +func GetLocaleDirection() TextDirection { + c := C.gtk_get_locale_direction() + return TextDirection(c) +} + +/* + * GtkStack + */ + +const ( + STACK_TRANSITION_TYPE_OVER_UP StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_OVER_UP + STACK_TRANSITION_TYPE_OVER_DOWN = C.GTK_STACK_TRANSITION_TYPE_OVER_DOWN + STACK_TRANSITION_TYPE_OVER_LEFT = C.GTK_STACK_TRANSITION_TYPE_OVER_LEFT + STACK_TRANSITION_TYPE_OVER_RIGHT = C.GTK_STACK_TRANSITION_TYPE_OVER_RIGHT + STACK_TRANSITION_TYPE_UNDER_UP = C.GTK_STACK_TRANSITION_TYPE_UNDER_UP + STACK_TRANSITION_TYPE_UNDER_DOWN = C.GTK_STACK_TRANSITION_TYPE_UNDER_DOWN + STACK_TRANSITION_TYPE_UNDER_LEFT = C.GTK_STACK_TRANSITION_TYPE_UNDER_LEFT + STACK_TRANSITION_TYPE_UNDER_RIGHT = C.GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT + STACK_TRANSITION_TYPE_OVER_UP_DOWN = C.GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN +) + +/* + * Dialog + */ + +// GetHeaderBar is a wrapper around gtk_dialog_get_header_bar(). +func (v *Dialog) GetHeaderBar() (IWidget, error) { + c := C.gtk_dialog_get_header_bar(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +/* + * Entry + */ + +// SetMaxWidthChars is a wrapper around gtk_entry_set_max_width_chars(). +func (v *Entry) SetMaxWidthChars(nChars int) { + C.gtk_entry_set_max_width_chars(v.native(), C.gint(nChars)) +} + +// GetMaxWidthChars is a wrapper around gtk_entry_get_max_width_chars(). +func (v *Entry) GetMaxWidthChars() int { + c := C.gtk_entry_get_max_width_chars(v.native()) + return int(c) +} + +/* + * HeaderBar + */ + +// GetDecorationLayout is a wrapper around gtk_header_bar_get_decoration_layout(). +func (v *HeaderBar) GetDecorationLayout() string { + c := C.gtk_header_bar_get_decoration_layout(v.native()) + return C.GoString((*C.char)(c)) +} + +// SetDecorationLayout is a wrapper around gtk_header_bar_set_decoration_layout(). +func (v *HeaderBar) SetDecorationLayout(layout string) { + cstr := C.CString(layout) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_header_bar_set_decoration_layout(v.native(), (*C.gchar)(cstr)) +} + +// GetHasSubtitle is a wrapper around gtk_header_bar_get_has_subtitle(). +func (v *HeaderBar) GetHasSubtitle() bool { + c := C.gtk_header_bar_get_has_subtitle(v.native()) + return gobool(c) +} + +// SetHasSubtitle is a wrapper around gtk_header_bar_set_has_subtitle(). +func (v *HeaderBar) SetHasSubtitle(setting bool) { + C.gtk_header_bar_set_has_subtitle(v.native(), gbool(setting)) +} + +/* + * MenuButton + */ + +// SetPopover is a wrapper around gtk_menu_button_set_popover(). +func (v *MenuButton) SetPopover(popover *Popover) { + C.gtk_menu_button_set_popover(v.native(), popover.toWidget()) +} + +// GetPopover is a wrapper around gtk_menu_button_get_popover(). +func (v *MenuButton) GetPopover() *Popover { + c := C.gtk_menu_button_get_popover(v.native()) + if c == nil { + return nil + } + return wrapPopover(glib.Take(unsafe.Pointer(c))) +} + +// GetUsePopover is a wrapper around gtk_menu_button_get_use_popover(). +func (v *MenuButton) GetUsePopover() bool { + c := C.gtk_menu_button_get_use_popover(v.native()) + return gobool(c) +} + +// SetUsePopover is a wrapper around gtk_menu_button_set_use_popover(). +func (v *MenuButton) SetUsePopover(setting bool) { + C.gtk_menu_button_set_use_popover(v.native(), gbool(setting)) +} + +/* + * FlowBox + */ + +// FlowBox is a representation of GtkFlowBox +type FlowBox struct { + Container +} + +func (fb *FlowBox) native() *C.GtkFlowBox { + if fb == nil || fb.GObject == nil { + return nil + } + p := unsafe.Pointer(fb.GObject) + return C.toGtkFlowBox(p) +} + +func marshalFlowBox(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFlowBox(obj), nil +} + +func wrapFlowBox(obj *glib.Object) *FlowBox { + if obj == nil { + return nil + } + + return &FlowBox{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// FlowBoxNew is a wrapper around gtk_flow_box_new() +func FlowBoxNew() (*FlowBox, error) { + c := C.gtk_flow_box_new() + if c == nil { + return nil, nilPtrErr + } + return wrapFlowBox(glib.Take(unsafe.Pointer(c))), nil +} + +// Insert is a wrapper around gtk_flow_box_insert() +func (fb *FlowBox) Insert(widget IWidget, position int) { + C.gtk_flow_box_insert(fb.native(), widget.toWidget(), C.gint(position)) +} + +// GetChildAtIndex is a wrapper around gtk_flow_box_get_child_at_index() +func (fb *FlowBox) GetChildAtIndex(idx int) *FlowBoxChild { + c := C.gtk_flow_box_get_child_at_index(fb.native(), C.gint(idx)) + if c == nil { + return nil + } + return wrapFlowBoxChild(glib.Take(unsafe.Pointer(c))) +} + +// TODO 3.22.6 gtk_flow_box_get_child_at_pos() + +// SetHAdjustment is a wrapper around gtk_flow_box_set_hadjustment() +func (fb *FlowBox) SetHAdjustment(adjustment *Adjustment) { + C.gtk_flow_box_set_hadjustment(fb.native(), adjustment.native()) +} + +// SetVAdjustment is a wrapper around gtk_flow_box_set_vadjustment() +func (fb *FlowBox) SetVAdjustment(adjustment *Adjustment) { + C.gtk_flow_box_set_vadjustment(fb.native(), adjustment.native()) +} + +// SetHomogeneous is a wrapper around gtk_flow_box_set_homogeneous() +func (fb *FlowBox) SetHomogeneous(homogeneous bool) { + C.gtk_flow_box_set_homogeneous(fb.native(), gbool(homogeneous)) +} + +// GetHomogeneous is a wrapper around gtk_flow_box_get_homogeneous() +func (fb *FlowBox) GetHomogeneous() bool { + c := C.gtk_flow_box_get_homogeneous(fb.native()) + return gobool(c) +} + +// SetRowSpacing is a wrapper around gtk_flow_box_set_row_spacing() +func (fb *FlowBox) SetRowSpacing(spacing uint) { + C.gtk_flow_box_set_row_spacing(fb.native(), C.guint(spacing)) +} + +// GetRowSpacing is a wrapper around gtk_flow_box_get_row_spacing() +func (fb *FlowBox) GetRowSpacing() uint { + c := C.gtk_flow_box_get_row_spacing(fb.native()) + return uint(c) +} + +// SetColumnSpacing is a wrapper around gtk_flow_box_set_column_spacing() +func (fb *FlowBox) SetColumnSpacing(spacing uint) { + C.gtk_flow_box_set_column_spacing(fb.native(), C.guint(spacing)) +} + +// GetColumnSpacing is a wrapper around gtk_flow_box_get_column_spacing() +func (fb *FlowBox) GetColumnSpacing() uint { + c := C.gtk_flow_box_get_column_spacing(fb.native()) + return uint(c) +} + +// SetMinChildrenPerLine is a wrapper around gtk_flow_box_set_min_children_per_line() +func (fb *FlowBox) SetMinChildrenPerLine(n_children uint) { + C.gtk_flow_box_set_min_children_per_line(fb.native(), C.guint(n_children)) +} + +// GetMinChildrenPerLine is a wrapper around gtk_flow_box_get_min_children_per_line() +func (fb *FlowBox) GetMinChildrenPerLine() uint { + c := C.gtk_flow_box_get_min_children_per_line(fb.native()) + return uint(c) +} + +// SetMaxChildrenPerLine is a wrapper around gtk_flow_box_set_max_children_per_line() +func (fb *FlowBox) SetMaxChildrenPerLine(n_children uint) { + C.gtk_flow_box_set_max_children_per_line(fb.native(), C.guint(n_children)) +} + +// GetMaxChildrenPerLine is a wrapper around gtk_flow_box_get_max_children_per_line() +func (fb *FlowBox) GetMaxChildrenPerLine() uint { + c := C.gtk_flow_box_get_max_children_per_line(fb.native()) + return uint(c) +} + +// SetActivateOnSingleClick is a wrapper around gtk_flow_box_set_activate_on_single_click() +func (fb *FlowBox) SetActivateOnSingleClick(single bool) { + C.gtk_flow_box_set_activate_on_single_click(fb.native(), gbool(single)) +} + +// GetActivateOnSingleClick gtk_flow_box_get_activate_on_single_click() +func (fb *FlowBox) GetActivateOnSingleClick() bool { + c := C.gtk_flow_box_get_activate_on_single_click(fb.native()) + return gobool(c) +} + +// TODO: gtk_flow_box_selected_foreach() + +// GetSelectedChildren is a wrapper around gtk_flow_box_get_selected_children() +func (fb *FlowBox) GetSelectedChildren() (rv []*FlowBoxChild) { + c := C.gtk_flow_box_get_selected_children(fb.native()) + if c == nil { + return + } + list := glib.WrapList(uintptr(unsafe.Pointer(c))) + for l := list; l != nil; l = l.Next() { + o := wrapFlowBoxChild(glib.Take(l.Data().(unsafe.Pointer))) + rv = append(rv, o) + } + // We got a transfer container, so we must free the list. + list.Free() + + return +} + +// SelectChild is a wrapper around gtk_flow_box_select_child() +func (fb *FlowBox) SelectChild(child *FlowBoxChild) { + C.gtk_flow_box_select_child(fb.native(), child.native()) +} + +// UnselectChild is a wrapper around gtk_flow_box_unselect_child() +func (fb *FlowBox) UnselectChild(child *FlowBoxChild) { + C.gtk_flow_box_unselect_child(fb.native(), child.native()) +} + +// SelectAll is a wrapper around gtk_flow_box_select_all() +func (fb *FlowBox) SelectAll() { + C.gtk_flow_box_select_all(fb.native()) +} + +// UnselectAll is a wrapper around gtk_flow_box_unselect_all() +func (fb *FlowBox) UnselectAll() { + C.gtk_flow_box_unselect_all(fb.native()) +} + +// SetSelectionMode is a wrapper around gtk_flow_box_set_selection_mode() +func (fb *FlowBox) SetSelectionMode(mode SelectionMode) { + C.gtk_flow_box_set_selection_mode(fb.native(), C.GtkSelectionMode(mode)) +} + +// GetSelectionMode is a wrapper around gtk_flow_box_get_selection_mode() +func (fb *FlowBox) GetSelectionMode() SelectionMode { + c := C.gtk_flow_box_get_selection_mode(fb.native()) + return SelectionMode(c) +} + +// TODO gtk_flow_box_set_filter_func() +// TODO gtk_flow_box_invalidate_filter() +// TODO gtk_flow_box_set_sort_func() +// TODO gtk_flow_box_invalidate_sort() +// TODO 3.18 gtk_flow_box_bind_model() + +/* + * FlowBoxChild + */ + +// FlowBoxChild is a representation of GtkFlowBoxChild +type FlowBoxChild struct { + Bin +} + +func (fbc *FlowBoxChild) native() *C.GtkFlowBoxChild { + if fbc == nil || fbc.GObject == nil { + return nil + } + p := unsafe.Pointer(fbc.GObject) + return C.toGtkFlowBoxChild(p) +} + +func marshalFlowBoxChild(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapFlowBoxChild(obj), nil +} + +func wrapFlowBoxChild(obj *glib.Object) *FlowBoxChild { + if obj == nil { + return nil + } + + return &FlowBoxChild{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// FlowBoxChildNew is a wrapper around gtk_flow_box_child_new() +func FlowBoxChildNew() (*FlowBoxChild, error) { + c := C.gtk_flow_box_child_new() + if c == nil { + return nil, nilPtrErr + } + return wrapFlowBoxChild(glib.Take(unsafe.Pointer(c))), nil +} + +// GetIndex is a wrapper around gtk_flow_box_child_get_index() +func (fbc *FlowBoxChild) GetIndex() int { + c := C.gtk_flow_box_child_get_index(fbc.native()) + return int(c) +} + +// IsSelected is a wrapper around gtk_flow_box_child_is_selected() +func (fbc *FlowBoxChild) IsSelected() bool { + c := C.gtk_flow_box_child_is_selected(fbc.native()) + return gobool(c) +} + +// Changed is a wrapper around gtk_flow_box_child_changed() +func (fbc *FlowBoxChild) Changed() { + C.gtk_flow_box_child_changed(fbc.native()) +} + +/* + * GtkPlacesSidebar + */ + +// TODO: +// gtk_places_sidebar_get_local_only(). +// gtk_places_sidebar_set_local_only(). + +/* + * GtkPopover + */ + +// Popover is a representation of GTK's GtkPopover. +type Popover struct { + Bin +} + +func (v *Popover) native() *C.GtkPopover { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkPopover(p) +} + +func marshalPopover(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapPopover(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapPopover(obj *glib.Object) *Popover { + if obj == nil { + return nil + } + + return &Popover{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// PopoverNew is a wrapper around gtk_popover_new(). +func PopoverNew(relative IWidget) (*Popover, error) { + //Takes relative to widget + var c *C.struct__GtkWidget + if relative == nil { + c = C.gtk_popover_new(nil) + } else { + c = C.gtk_popover_new(relative.toWidget()) + } + if c == nil { + return nil, nilPtrErr + } + return wrapPopover(glib.Take(unsafe.Pointer(c))), nil +} + +// PopoverNewFromModel is a wrapper around gtk_popover_new_from_model(). +func PopoverNewFromModel(relative IWidget, model *glib.MenuModel) (*Popover, error) { + //Takes relative to widget + var c *C.struct__GtkWidget + + mptr := C.toGMenuModel(unsafe.Pointer(model.Native())) + + if relative == nil { + c = C.gtk_popover_new_from_model(nil, mptr) + } else { + c = C.gtk_popover_new_from_model(relative.toWidget(), mptr) + } + if c == nil { + return nil, nilPtrErr + } + return wrapPopover(glib.Take(unsafe.Pointer(c))), nil +} + +// BindModel is a wrapper around gtk_popover_bind_model(). +func (v *Popover) BindModel(menuModel *glib.MenuModel, actionNamespace string) { + cstr := C.CString(actionNamespace) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_popover_bind_model(v.native(), C.toGMenuModel(unsafe.Pointer(menuModel.Native())), (*C.gchar)(cstr)) +} + +// SetRelativeTo is a wrapper around gtk_popover_set_relative_to(). +func (v *Popover) SetRelativeTo(relative IWidget) { + C.gtk_popover_set_relative_to(v.native(), relative.toWidget()) +} + +// GetRelativeTo is a wrapper around gtk_popover_get_relative_to(). +func (v *Popover) GetRelativeTo() (IWidget, error) { + c := C.gtk_popover_get_relative_to(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetPointingTo is a wrapper around gtk_popover_set_pointing_to(). +func (v *Popover) SetPointingTo(rect gdk.Rectangle) { + C.gtk_popover_set_pointing_to(v.native(), nativeGdkRectangle(rect)) +} + +// GetPointingTo is a wrapper around gtk_popover_get_pointing_to(). +func (v *Popover) GetPointingTo() (*gdk.Rectangle, bool) { + var cRect *C.GdkRectangle + isSet := C.gtk_popover_get_pointing_to(v.native(), cRect) + rect := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return rect, gobool(isSet) +} + +// SetPosition is a wrapper around gtk_popover_set_position(). +func (v *Popover) SetPosition(position PositionType) { + C.gtk_popover_set_position(v.native(), C.GtkPositionType(position)) +} + +// GetPosition is a wrapper around gtk_popover_get_position(). +func (v *Popover) GetPosition() PositionType { + c := C.gtk_popover_get_position(v.native()) + return PositionType(c) +} + +// SetModal is a wrapper around gtk_popover_set_modal(). +func (v *Popover) SetModal(modal bool) { + C.gtk_popover_set_modal(v.native(), gbool(modal)) +} + +// GetModal is a wrapper around gtk_popover_get_modal(). +func (v *Popover) GetModal() bool { + return gobool(C.gtk_popover_get_modal(v.native())) +} + +/* + * TreePath + */ + +// TreePathNewFromIndicesv is a wrapper around gtk_tree_path_new_from_indicesv(). +func TreePathNewFromIndicesv(indices []int) (*TreePath, error) { + if len(indices) == 0 { + return nil, errors.New("no indice") + } + + var cIndices []C.gint + for i := 0; i < len(indices); i++ { + cIndices = append(cIndices, C.gint(indices[i])) + } + + var cIndicesPointer *C.gint = &cIndices[0] + c := C.gtk_tree_path_new_from_indicesv(cIndicesPointer, C.gsize(len(indices))) + if c == nil { + return nil, nilPtrErr + } + t := &TreePath{c} + runtime.SetFinalizer(t, (*TreePath).free) + return t, nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_12.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_12.go.h new file mode 100644 index 0000000..24c2f18 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_12.go.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +static GtkFlowBox *toGtkFlowBox(void *p) { return (GTK_FLOW_BOX(p)); } + +static GtkFlowBoxChild *toGtkFlowBoxChild(void *p) { + return (GTK_FLOW_BOX_CHILD(p)); +} + +static GMenuModel *toGMenuModel(void *p) { return (G_MENU_MODEL(p)); } + +static GtkPopover *toGtkPopover(void *p) { return (GTK_POPOVER(p)); } diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_14.go new file mode 100644 index 0000000..865a1ef --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_14.go @@ -0,0 +1,134 @@ +// Same copyright and license as the rest of the files in this project +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +package gtk + +// #include +// #include +// #include "gtk_since_3_14.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/internal/callback" + "github.com/gotk3/gotk3/glib" +) + +/* + * Constants + */ + +const ( + STATE_FLAG_CHECKED StateFlags = C.GTK_STATE_FLAG_CHECKED +) + +// IconLookupFlags is a representation of GTK's GtkIconLookupFlags. +const ( + ICON_LOOKUP_FORCE_REGULAR IconLookupFlags = C.GTK_ICON_LOOKUP_FORCE_REGULAR + ICON_LOOKUP_FORCE_SYMBOLIC = C.GTK_ICON_LOOKUP_FORCE_SYMBOLIC + ICON_LOOKUP_DIR_LTR = C.GTK_ICON_LOOKUP_DIR_LTR + ICON_LOOKUP_DIR_RTL = C.GTK_ICON_LOOKUP_DIR_RTL +) + +/* + * GtkStack + */ + +const ( + STACK_TRANSITION_TYPE_OVER_DOWN_UP StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP + STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT = C.GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT + STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT = C.GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT +) + +/* + * GtkListBox + */ + +// UnselectRow is a wrapper around gtk_list_box_unselect_row(). +func (v *ListBox) UnselectRow(row *ListBoxRow) { + C.gtk_list_box_unselect_row(v.native(), row.native()) +} + +// SelectAll is a wrapper around gtk_list_box_select_all(). +func (v *ListBox) SelectAll() { + C.gtk_list_box_select_all(v.native()) +} + +// UnselectAll is a wrapper around gtk_list_box_unselect_all(). +func (v *ListBox) UnselectAll() { + C.gtk_list_box_unselect_all(v.native()) +} + +// ListBoxForeachFunc is a representation of GtkListBoxForeachFunc +type ListBoxForeachFunc func(box *ListBox, row *ListBoxRow) int + +// SelectedForeach is a wrapper around gtk_list_box_selected_foreach(). +func (v *ListBox) SelectedForeach(fn ListBoxForeachFunc) { + id := callback.Assign(fn) + defer callback.Delete(id) + + C._gtk_list_box_selected_foreach(v.native(), C.gpointer(id)) +} + +// GetSelectedRows is a wrapper around gtk_list_box_get_selected_rows(). +func (v *ListBox) GetSelectedRows() *glib.List { + clist := C.gtk_list_box_get_selected_rows(v.native()) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapListBoxRow(glib.Take(ptr)) + }) + + return glist +} + +/* + * GtkListBoxRow + */ + +// IsSelected is a wrapper around gtk_list_box_row_is_selected(). +func (v *ListBoxRow) IsSelected() bool { + c := C.gtk_list_box_row_is_selected(v.native()) + return gobool(c) +} + +// SetActivatable is a wrapper around gtk_list_box_row_set_activatable(). +func (v *ListBoxRow) SetActivatable(activatable bool) { + C.gtk_list_box_row_set_activatable(v.native(), gbool(activatable)) +} + +// GetActivatable is a wrapper around gtk_list_box_row_get_activatable(). +func (v *ListBoxRow) GetActivatable() bool { + c := C.gtk_list_box_row_get_activatable(v.native()) + return gobool(c) +} + +// SetSelectable is a wrapper around gtk_list_box_row_set_selectable(). +func (v *ListBoxRow) SetSelectable(selectable bool) { + C.gtk_list_box_row_set_selectable(v.native(), gbool(selectable)) +} + +// GetSelectable is a wrapper around gtk_list_box_row_get_selectable(). +func (v *ListBoxRow) GetSelectable() bool { + c := C.gtk_list_box_row_get_selectable(v.native()) + return gobool(c) +} + +/* + * GtkPlacesSidebar + */ + +// TODO: +// gtk_places_sidebar_get_show_enter_location(). +// gtk_places_sidebar_set_show_enter_location(). + +/* + * GtkSwitch + */ + +// TODO: +// gtk_switch_set_state(). +// gtk_switch_get_state(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_14.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_14.go.h new file mode 100644 index 0000000..9cf2054 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_14.go.h @@ -0,0 +1,10 @@ +// Same copyright and license as the rest of the files in this project + +extern void goListBoxForEachFuncs(GtkListBox *box, GtkListBoxRow *row, + gpointer user_data); + +static inline void _gtk_list_box_selected_foreach(GtkListBox *box, + gpointer user_data) { + gtk_list_box_selected_foreach( + box, (GtkListBoxForeachFunc)(goListBoxForEachFuncs), user_data); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16.go new file mode 100644 index 0000000..98f807c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16.go @@ -0,0 +1,371 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 + +// See: https://developer.gnome.org/gtk3/3.16/api-index-3-16.html + +package gtk + +// #include +// #include "gtk_since_3_16.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +const ( + POLICY_EXTERNAL PolicyType = C.GTK_POLICY_EXTERNAL +) + +func init() { + tm := []glib.TypeMarshaler{ + + // Objects/Interfaces + {glib.Type(C.gtk_button_role_get_type()), marshalButtonRole}, + {glib.Type(C.gtk_popover_menu_get_type()), marshalPopoverMenu}, + {glib.Type(C.gtk_model_button_get_type()), marshalModelButton}, + {glib.Type(C.gtk_stack_sidebar_get_type()), marshalStackSidebar}, + {glib.Type(C.gtk_text_extend_selection_get_type()), marshalTextExtendSelection}, + } + glib.RegisterGValueMarshalers(tm) + + //Contribute to casting + for k, v := range map[string]WrapFn{ + "GtkPopoverMenu": wrapPopoverMenu, + "GtkModelButton": wrapModelButton, + "GtkStackSidebar": wrapStackSidebar, + } { + WrapMap[k] = v + } +} + +/* + * Constants + */ + +// ButtonRole is a representation of GTK's GtkButtonRole. +type ButtonRole int + +const ( + BUTTON_ROLE_NORMAL ButtonRole = C.GTK_BUTTON_ROLE_NORMAL + BUTTON_ROLE_CHECK ButtonRole = C.GTK_BUTTON_ROLE_CHECK + BUTTON_ROLE_RADIO ButtonRole = C.GTK_BUTTON_ROLE_RADIO +) + +func marshalButtonRole(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return ButtonRole(c), nil +} + +/* + * TextView + */ + +// TextExtendSelection is a representation of GTK's GtkTextExtendSelection. +type TextExtendSelection int + +const ( + TEXT_EXTEND_SELECTION_WORD TextExtendSelection = C.GTK_TEXT_EXTEND_SELECTION_WORD + TEXT_EXTEND_SELECTION_LINE TextExtendSelection = C.GTK_TEXT_EXTEND_SELECTION_LINE +) + +func marshalTextExtendSelection(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TextExtendSelection(c), nil +} + +/* + * GtkStack + */ + +// SetHHomogeneous is a wrapper around gtk_stack_set_hhomogeneous(). +func (v *Stack) SetHHomogeneous(hhomogeneous bool) { + C.gtk_stack_set_hhomogeneous(v.native(), gbool(hhomogeneous)) +} + +// GetHHomogeneous is a wrapper around gtk_stack_get_hhomogeneous(). +func (v *Stack) GetHHomogeneous() bool { + return gobool(C.gtk_stack_get_hhomogeneous(v.native())) +} + +// SetVHomogeneous is a wrapper around gtk_stack_set_vhomogeneous(). +func (v *Stack) SetVHomogeneous(vhomogeneous bool) { + C.gtk_stack_set_vhomogeneous(v.native(), gbool(vhomogeneous)) +} + +// GetVHomogeneous is a wrapper around gtk_stack_get_vhomogeneous(). +func (v *Stack) GetVHomogeneous() bool { + return gobool(C.gtk_stack_get_vhomogeneous(v.native())) +} + +/* + * GtkNotebook + */ + +// DetachTab is a wrapper around gtk_notebook_detach_tab(). +func (v *Notebook) DetachTab(child IWidget) { + C.gtk_notebook_detach_tab(v.native(), child.toWidget()) +} + +/* + * GtkListBox + */ + +// ListBoxCreateWidgetFunc is a representation of GtkListBoxCreateWidgetFunc. +type ListBoxCreateWidgetFunc func(item interface{}) int + +/* + * GtkScrolledWindow + */ + +// SetOverlayScrolling is a wrapper around gtk_scrolled_window_set_overlay_scrolling(). +func (v *ScrolledWindow) SetOverlayScrolling(scrolling bool) { + C.gtk_scrolled_window_set_overlay_scrolling(v.native(), gbool(scrolling)) +} + +// GetOverlayScrolling is a wrapper around gtk_scrolled_window_get_overlay_scrolling(). +func (v *ScrolledWindow) GetOverlayScrolling() bool { + return gobool(C.gtk_scrolled_window_get_overlay_scrolling(v.native())) +} + +/* + * GtkPaned + */ + +// SetWideHandle is a wrapper around gtk_paned_set_wide_handle(). +func (v *Paned) SetWideHandle(wide bool) { + C.gtk_paned_set_wide_handle(v.native(), gbool(wide)) +} + +// GetWideHandle is a wrapper around gtk_paned_get_wide_handle(). +func (v *Paned) GetWideHandle() bool { + return gobool(C.gtk_paned_get_wide_handle(v.native())) +} + +/* + * GtkLabel + */ + +// GetXAlign is a wrapper around gtk_label_get_xalign(). +func (v *Label) GetXAlign() float64 { + c := C.gtk_label_get_xalign(v.native()) + return float64(c) +} + +// GetYAlign is a wrapper around gtk_label_get_yalign(). +func (v *Label) GetYAlign() float64 { + c := C.gtk_label_get_yalign(v.native()) + return float64(c) +} + +// SetXAlign is a wrapper around gtk_label_set_xalign(). +func (v *Label) SetXAlign(n float64) { + C.gtk_label_set_xalign(v.native(), C.gfloat(n)) +} + +// SetYAlign is a wrapper around gtk_label_set_yalign(). +func (v *Label) SetYAlign(n float64) { + C.gtk_label_set_yalign(v.native(), C.gfloat(n)) +} + +/* +* GtkModelButton + */ + +// ModelButton is a representation of GTK's GtkModelButton. +type ModelButton struct { + Button +} + +func (v *ModelButton) native() *C.GtkModelButton { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkModelButton(p) +} + +func marshalModelButton(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapModelButton(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapModelButton(obj *glib.Object) *ModelButton { + if obj == nil { + return nil + } + + actionable := wrapActionable(obj) + return &ModelButton{Button{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}, actionable}} +} + +// ModelButtonNew is a wrapper around gtk_model_button_new +func ModelButtonNew() (*ModelButton, error) { + c := C.gtk_model_button_new() + if c == nil { + return nil, nilPtrErr + } + return wrapModelButton(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkPopoverMenu + */ + +// PopoverMenu is a representation of GTK's GtkPopoverMenu. +type PopoverMenu struct { + Popover +} + +func (v *PopoverMenu) native() *C.GtkPopoverMenu { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkPopoverMenu(p) +} + +func marshalPopoverMenu(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapPopoverMenu(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapPopoverMenu(obj *glib.Object) *PopoverMenu { + if obj == nil { + return nil + } + + return &PopoverMenu{Popover{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// PopoverMenuNew is a wrapper around gtk_popover_menu_new +func PopoverMenuNew() (*PopoverMenu, error) { + c := C.gtk_popover_menu_new() + if c == nil { + return nil, nilPtrErr + } + return wrapPopoverMenu(glib.Take(unsafe.Pointer(c))), nil +} + +// OpenSubmenu is a wrapper around gtk_popover_menu_open_submenu +func (v *PopoverMenu) OpenSubmenu(name string) { + cstr1 := (*C.gchar)(C.CString(name)) + defer C.free(unsafe.Pointer(cstr1)) + + C.gtk_popover_menu_open_submenu(v.native(), cstr1) +} + +/* + * GtkStackSidebar + */ + +// StackSidebar is a representation of GTK's GtkStackSidebar. +type StackSidebar struct { + Bin +} + +// native returns a pointer to the underlying GtkStack. +func (v *StackSidebar) native() *C.GtkStackSidebar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkStackSidebar(p) +} + +func marshalStackSidebar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapStackSidebar(obj), nil +} + +func wrapStackSidebar(obj *glib.Object) *StackSidebar { + if obj == nil { + return nil + } + + return &StackSidebar{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// StackSidebarNew is a wrapper around gtk_stack_sidebar_new(). +func StackSidebarNew() (*StackSidebar, error) { + c := C.gtk_stack_sidebar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapStackSidebar(glib.Take(unsafe.Pointer(c))), nil +} + +// SetStack is a wrapper around gtk_stack_sidebar_set_stack(). +func (v *StackSidebar) SetStack(stack *Stack) { + C.gtk_stack_sidebar_set_stack(v.native(), stack.native()) +} + +// GetStack is a wrapper around gtk_stack_sidebar_get_stack(). +func (v *StackSidebar) GetStack() *Stack { + c := C.gtk_stack_sidebar_get_stack(v.native()) + if c == nil { + return nil + } + return wrapStack(glib.Take(unsafe.Pointer(c))) +} + +/* + * GtkEntry + */ + +// GrabFocusWithoutSelecting is a wrapper for gtk_entry_grab_focus_without_selecting() +func (v *Entry) GrabFocusWithoutSelecting() { + C.gtk_entry_grab_focus_without_selecting(v.native()) +} + +/* + * GtkSearchEntry + */ + +// HandleEvent is a wrapper around gtk_search_entry_handle_event(). +func (v *SearchEntry) HandleEvent(event *gdk.Event) { + e := (*C.GdkEvent)(unsafe.Pointer(event.Native())) + C.gtk_search_entry_handle_event(v.native(), e) +} + +/* + * GtkTextBuffer + */ + +// InsertMarkup is a wrapper around gtk_text_buffer_insert_markup() +func (v *TextBuffer) InsertMarkup(start *TextIter, text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_text_buffer_insert_markup(v.native(), (*C.GtkTextIter)(start), (*C.gchar)(cstr), C.gint(len(text))) +} + +/* + * CssProvider + */ + +// LoadFromResource is a wrapper around gtk_css_provider_load_from_resource(). +// +// See: https://developer.gnome.org/gtk3/stable/GtkCssProvider.html#gtk-css-provider-load-from-resource +func (v *CssProvider) LoadFromResource(path string) { + cpath := C.CString(path) + defer C.free(unsafe.Pointer(cpath)) + C.gtk_css_provider_load_from_resource(v.native(), (*C.gchar)(cpath)) +} + +/* + * GtkTextView + */ + +// SetMonospace is a wrapper around gtk_text_view_set_monospace() +func (v *TextView) SetMonospace(monospace bool) { + C.gtk_text_view_set_monospace(v.native(), gbool(monospace)) +} + +// GetMonospace is a wrapper around gtk_text_view_get_monospace() +func (v *TextView) GetMonospace() bool { + return gobool(C.gtk_text_view_get_monospace(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16.go.h new file mode 100644 index 0000000..379ade5 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16.go.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#include "gtk.go.h" +#include // for gotk3_callbackDelete + +static GListModel *toGListModel(void *p) { return (G_LIST_MODEL(p)); } + +static GtkModelButton *toGtkModelButton(void *mb) { + return (GTK_MODEL_BUTTON(mb)); +} + +static GtkPopoverMenu *toGtkPopoverMenu(void *p) { + return (GTK_POPOVER_MENU(p)); +} + +static GtkStackSidebar *toGtkStackSidebar(void *p) { + return (GTK_STACK_SIDEBAR(p)); +} + +static GtkGLArea *toGtkGLArea(void *p) { return (GTK_GL_AREA(p)); } + +extern void goListBoxCreateWidgetFuncs(gpointer item, gpointer user_data); + +static inline void _gtk_list_box_bind_model(GtkListBox *box, GListModel *model, + gpointer user_data) { + gtk_list_box_bind_model( + box, model, (GtkListBoxCreateWidgetFunc)(goListBoxCreateWidgetFuncs), + user_data, (GDestroyNotify)(gotk3_callbackDelete)); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16_deprecated_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16_deprecated_since_3_20.go new file mode 100644 index 0000000..0f8350e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16_deprecated_since_3_20.go @@ -0,0 +1,22 @@ +// Same copyright and license as the rest of the files in this project. +// This file is normally only compiled for GTK 3.16 and 3.18. +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,gtk_deprecated gtk_3_16 gtk_3_18 + +package gtk + +// #include +import "C" + +/* + * GtkPopover + */ + +// SetTransitionsEnabled is a wrapper gtk_popover_set_transitions_enabled(). +func (v *Popover) SetTransitionsEnabled(transitionsEnabled bool) { + C.gtk_popover_set_transitions_enabled(v.native(), gbool(transitionsEnabled)) +} + +// GetTransitionsEnabled is a wrapper gtk_popover_get_transitions_enabled(). +func (v *Popover) GetTransitionsEnabled() bool { + return gobool(C.gtk_popover_get_transitions_enabled(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16_glib_2_44.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16_glib_2_44.go new file mode 100644 index 0000000..3b5c237 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_16_glib_2_44.go @@ -0,0 +1,25 @@ +// Same copyright and license as the rest of the files in this project +// The code in this file is only for GTK+ version 3.16+, as well as Glib version 2.44+ + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!glib_2_40,!glib_2_42 + +package gtk + +// #include +// #include "gtk_since_3_16.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/internal/callback" + "github.com/gotk3/gotk3/glib" +) + +// BindModel is a wrapper around gtk_list_box_bind_model(). +func (v *ListBox) BindModel(listModel *glib.ListModel, createWidgetFunc ListBoxCreateWidgetFunc) { + C._gtk_list_box_bind_model( + v.native(), + C.toGListModel(unsafe.Pointer(listModel.Native())), + C.gpointer(callback.Assign(createWidgetFunc)), + ) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_18.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_18.go new file mode 100644 index 0000000..108ecdb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_18.go @@ -0,0 +1,103 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16 + +// See: https://developer.gnome.org/gtk3/3.18/api-index-3-18.html + +// For gtk_overlay_reorder_overlay(): +// See: https://git.gnome.org/browse/gtk+/tree/gtk/gtkoverlay.h?h=gtk-3-18 + +package gtk + +// #include +import "C" + +/* + * GtkStack + */ + +// TODO: +// gtk_stack_get_interpolate_size(). +// gtk_stack_set_interpolate_size(). + +/* + * GtkRadioMenuItem + */ + +// JoinGroup is a wrapper around gtk_radio_menu_item_join_group(). +func (v *RadioMenuItem) JoinGroup(group_source *RadioMenuItem) { + C.gtk_radio_menu_item_join_group(v.native(), group_source.native()) +} + +/* + * GtkOverlay + */ + +// ReorderOverlay() is a wrapper around gtk_overlay_reorder_overlay(). +func (v *Overlay) ReorderOverlay(child IWidget, position int) { + C.gtk_overlay_reorder_overlay(v.native(), child.toWidget(), C.int(position)) +} + +// GetOverlayPassThrough() is a wrapper around gtk_overlay_get_overlay_pass_through(). +func (v *Overlay) GetOverlayPassThrough(widget IWidget) bool { + c := C.gtk_overlay_get_overlay_pass_through(v.native(), widget.toWidget()) + return gobool(c) +} + +// SetOverlayPassThrough() is a wrapper around gtk_overlay_set_overlay_pass_through(). +func (v *Overlay) SetOverlayPassThrough(widget IWidget, passThrough bool) { + C.gtk_overlay_set_overlay_pass_through(v.native(), widget.toWidget(), gbool(passThrough)) +} + +/* + * GtkPlacesSidebar + */ + +// TODO: +// gtk_places_sidebar_set_show_recent(). +// gtk_places_sidebar_get_show_recent(). +// gtk_places_sidebar_get_show_trash(). +// gtk_places_sidebar_set_show_trash(). +// gtk_places_sidebar_get_show_other_locations(). +// gtk_places_sidebar_set_show_other_locations(). +// gtk_places_sidebar_set_drop_targets_visible(). + +/* + * GtkPopover + */ + +// SetDefaultWidget is a wrapper around gtk_popover_set_default_widget(). +func (p *Popover) SetDefaultWidget(widget IWidget) { + C.gtk_popover_set_default_widget(p.native(), widget.toWidget()) +} + +// GetDefaultWidget is a wrapper around gtk_popover_get_default_widget(). +func (p *Popover) GetDefaultWidget() (IWidget, error) { + w := C.gtk_popover_get_default_widget(p.native()) + if w == nil { + return nil, nil + } + return castWidget(w) +} + +/* + * GtkTextView + */ + +// SetTopMargin is a wrapper around gtk_text_view_set_top_margin(). +func (v *TextView) SetTopMargin(topMargin int) { + C.gtk_text_view_set_top_margin(v.native(), C.gint(topMargin)) +} + +// GetTopMargin is a wrapper around gtk_text_view_get_top_margin(). +func (v *TextView) GetTopMargin() int { + return int(C.gtk_text_view_get_top_margin(v.native())) +} + +// SetBottomMargin is a wrapper around gtk_text_view_set_bottom_margin(). +func (v *TextView) SetBottomMargin(bottomMargin int) { + C.gtk_text_view_set_bottom_margin(v.native(), C.gint(bottomMargin)) +} + +// GetBottomMargin is a wrapper around gtk_text_view_get_bottom_margin(). +func (v *TextView) GetBottomMargin() int { + return int(C.gtk_text_view_get_bottom_margin(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_20.go new file mode 100644 index 0000000..0a5a33a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_20.go @@ -0,0 +1,283 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18 + +// See: https://developer.gnome.org/gtk3/3.20/api-index-3-20.html + +package gtk + +// #include +// #include "gtk_since_3_20.go.h" +import "C" + +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gtk_popover_constraint_get_type()), marshalPopoverConstraint}, + } + glib.RegisterGValueMarshalers(tm) +} + +/* + * Constants + */ + +// PopoverConstraint is a representation of GTK's GtkPopoverConstraint. +type PopoverConstraint int + +const ( + POPOVER_CONSTRAINT_NONE PopoverConstraint = C.GTK_POPOVER_CONSTRAINT_NONE + POPOVER_CONSTRAINT_WINDOW PopoverConstraint = C.GTK_POPOVER_CONSTRAINT_WINDOW +) + +func marshalPopoverConstraint(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PopoverConstraint(c), nil +} + +const ( + STATE_FLAG_DROP_ACTIVE StateFlags = C.GTK_STATE_FLAG_DROP_ACTIVE +) + +/* + * GtkNativeDialog + */ + +// NativeDialog is a representation of GTK's GtkNativeDialog. +type NativeDialog struct { + glib.InitiallyUnowned +} + +// native returns a pointer to the underlying GObject as a GtkNativeDialog. +func (v *NativeDialog) native() *C.GtkNativeDialog { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkNativeDialog(p) +} + +func wrapNativeDialog(obj *glib.Object) *NativeDialog { + if obj == nil { + return nil + } + + return &NativeDialog{glib.InitiallyUnowned{obj}} +} + +// Run() is a wrapper around gtk_native_dialog_run(). +func (v *NativeDialog) Run() int { + c := C.gtk_native_dialog_run(v.native()) + return int(c) +} + +// Destroy() is a wrapper around gtk_native_dialog_destroy(). +func (v *NativeDialog) Destroy() { + C.gtk_native_dialog_destroy(v.native()) +} + +// SetModal is a wrapper around gtk_native_dialog_set_modal(). +func (v *NativeDialog) SetModal(modal bool) { + C.gtk_native_dialog_set_modal(v.native(), gbool(modal)) +} + +// GetModal is a wrapper around gtk_native_dialog_get_modal(). +func (v *NativeDialog) GetModal() bool { + c := C.gtk_native_dialog_get_modal(v.native()) + return gobool(c) +} + +// SetTitle is a wrapper around gtk_native_dialog_set_title(). +func (v *NativeDialog) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_native_dialog_set_title(v.native(), (*C.char)(cstr)) +} + +// GetTitle is a wrapper around gtk_native_dialog_get_title(). +func (v *NativeDialog) GetTitle() (string, error) { + return stringReturn((*C.gchar)(C.gtk_native_dialog_get_title(v.native()))) +} + +// SetTransientFor is a wrapper around gtk_native_dialog_set_transient_for(). +func (v *NativeDialog) SetTransientFor(parent IWindow) { + var pw *C.GtkWindow = nil + if parent != nil { + pw = parent.toWindow() + } + C.gtk_native_dialog_set_transient_for(v.native(), pw) +} + +// GetTransientFor is a wrapper around gtk_native_dialog_get_transient_for(). +func (v *NativeDialog) GetTransientFor() (*Window, error) { + c := C.gtk_native_dialog_get_transient_for(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// GetVisible() is a wrapper around gtk_native_dialog_get_visible(). +func (v *NativeDialog) GetVisible() bool { + c := C.gtk_native_dialog_get_visible(v.native()) + return gobool(c) +} + +// Show() is a wrapper around gtk_native_dialog_show(). +func (v *NativeDialog) Show() { + C.gtk_native_dialog_show(v.native()) +} + +// Hide() is a wrapper around gtk_native_dialog_hide(). +func (v *NativeDialog) Hide() { + C.gtk_native_dialog_hide(v.native()) +} + +/* + * GtkFileChooserNative + */ + +// FileChooserNativeDialog is a representation of GTK's GtkFileChooserNative. +type FileChooserNativeDialog struct { + NativeDialog + + // Interfaces + FileChooser +} + +// native returns a pointer to the underlying GObject as a GtkNativeDialog. +func (v *FileChooserNativeDialog) native() *C.GtkFileChooserNative { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkFileChooserNative(p) +} + +func wrapFileChooserNativeDialog(obj *glib.Object) *FileChooserNativeDialog { + if obj == nil { + return nil + } + + fc := wrapFileChooser(obj) + return &FileChooserNativeDialog{NativeDialog{glib.InitiallyUnowned{obj}}, *fc} +} + +// FileChooserNativeDialogNew is a wrapper around gtk_file_chooser_native_new(). +func FileChooserNativeDialogNew(title string, parent IWindow, action FileChooserAction, + accept_label string, cancel_label string) (*FileChooserNativeDialog, error) { + + c_title := C.CString(title) + defer C.free(unsafe.Pointer(c_title)) + + c_accept_label := C.CString(accept_label) + defer C.free(unsafe.Pointer(c_accept_label)) + + c_cancel_label := C.CString(cancel_label) + defer C.free(unsafe.Pointer(c_cancel_label)) + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + c := C.gtk_file_chooser_native_new( + (*C.gchar)(c_title), w, C.GtkFileChooserAction(action), + (*C.gchar)(c_accept_label), (*C.gchar)(c_cancel_label)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapFileChooserNativeDialog(obj), nil +} + +/* + * FileChooserNative + */ +func OpenFileChooserNative(title string, parent IWindow) *string { + c_title := C.CString(title) + + var native *C.GtkFileChooserNative + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + native = C.gtk_file_chooser_native_new((*C.gchar)(c_title), + w, + C.GtkFileChooserAction(FILE_CHOOSER_ACTION_OPEN), + (*C.gchar)(C.CString("_Open")), + (*C.gchar)(C.CString("_Cancel"))) + + p := unsafe.Pointer(unsafe.Pointer(native)) + dlg := C.toGtkNativeDialog(p) + res := C.gtk_native_dialog_run(dlg) + + if res == C.GTK_RESPONSE_ACCEPT { + c := C.gtk_file_chooser_get_filename(C.toGtkFileChooser(p)) + s := goString(c) + defer C.g_free((C.gpointer)(c)) + + return &s + } + + return nil +} + +// SetAcceptLabel is a wrapper around gtk_file_chooser_native_set_accept_label(). +func (v *FileChooserNativeDialog) SetAcceptLabel(accept_label string) { + cstr := C.CString(accept_label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_chooser_native_set_accept_label(v.native(), (*C.char)(cstr)) +} + +// GetAcceptLabel is a wrapper around gtk_file_chooser_native_get_accept_label(). +func (v *FileChooserNativeDialog) GetAcceptLabel() (string, error) { + return stringReturn((*C.gchar)(C.gtk_file_chooser_native_get_accept_label(v.native()))) +} + +// SetCancelLabel is a wrapper around gtk_file_chooser_native_set_cancel_label(). +func (v *FileChooserNativeDialog) SetCancelLabel(cancel_label string) { + cstr := C.CString(cancel_label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_file_chooser_native_set_cancel_label(v.native(), (*C.char)(cstr)) +} + +// GetCancelLabel is a wrapper around gtk_file_chooser_native_get_cancel_label(). +func (v *FileChooserNativeDialog) GetCancelLabel() (string, error) { + return stringReturn((*C.gchar)(C.gtk_file_chooser_native_get_cancel_label(v.native()))) +} + +/* + * GtkTextView + */ + +// TODO: +// gtk_text_view_reset_cursor_blink(). + +/* + * GtkExpander + */ + +// TODO: +// gtk_expander_set_spacing(). +// gtk_expander_get_spacing(). + +/* + * GtkPopover + */ + +// SetConstrainTo is a wrapper gtk_popover_set_constrain_to(). +func (v *Popover) SetConstrainTo(constrain PopoverConstraint) { + C.gtk_popover_set_constrain_to(v.native(), C.GtkPopoverConstraint(constrain)) +} + +// GetConstrainTo is a wrapper gtk_popover_get_constrain_to(). +func (v *Popover) GetConstrainTo() PopoverConstraint { + return PopoverConstraint(C.gtk_popover_get_constrain_to(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_20.go.h b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_20.go.h new file mode 100644 index 0000000..940c4a8 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_20.go.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma once + +#include + +static GtkFileChooser *toGtkFileChooser(void *p) { + return (GTK_FILE_CHOOSER(p)); +} + +static GtkFileChooserNative *toGtkFileChooserNative(void *p) { + return (GTK_FILE_CHOOSER_NATIVE(p)); +} + +static GtkNativeDialog *toGtkNativeDialog(void *p) { + return (GTK_NATIVE_DIALOG(p)); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_22.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_22.go new file mode 100644 index 0000000..ff1e3bf --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_22.go @@ -0,0 +1,66 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18,!gtk_3_20 + +// See: https://developer.gnome.org/gtk3/3.22/api-index-3-22.html + +package gtk + +// #include +import "C" + +// Popup is a wrapper around gtk_popover_popup(). +func (v *Popover) Popup() { + C.gtk_popover_popup(v.native()) +} + +// Popdown is a wrapper around gtk_popover_popdown(). +func (v *Popover) Popdown() { + C.gtk_popover_popdown(v.native()) +} + +/* + * GtkScrolledWindow + */ + +// GetMaxContentWidth is a wrapper around gtk_scrolled_window_get_max_content_width(). +func (v *ScrolledWindow) GetMaxContentWidth() int { + c := C.gtk_scrolled_window_get_max_content_width(v.native()) + return int(c) +} + +// SetMaxContentWidth is a wrapper around gtk_scrolled_window_set_max_content_width(). +func (v *ScrolledWindow) SetMaxContentWidth(width int) { + C.gtk_scrolled_window_set_max_content_width(v.native(), C.gint(width)) +} + +// GetMaxContentHeight is a wrapper around gtk_scrolled_window_get_max_content_height(). +func (v *ScrolledWindow) GetMaxContentHeight() int { + c := C.gtk_scrolled_window_get_max_content_height(v.native()) + return int(c) +} + +// SetMaxContentHeight is a wrapper around gtk_scrolled_window_set_max_content_height(). +func (v *ScrolledWindow) SetMaxContentHeight(width int) { + C.gtk_scrolled_window_set_max_content_height(v.native(), C.gint(width)) +} + +// GetPropagateNaturalWidth is a wrapper around gtk_scrolled_window_get_propagate_natural_width(). +func (v *ScrolledWindow) GetPropagateNaturalWidth() bool { + c := C.gtk_scrolled_window_get_propagate_natural_width(v.native()) + return gobool(c) +} + +// SetPropagateNaturalWidth is a wrapper around gtk_scrolled_window_set_propagate_natural_width(). +func (v *ScrolledWindow) SetPropagateNaturalWidth(propagate bool) { + C.gtk_scrolled_window_set_propagate_natural_width(v.native(), gbool(propagate)) +} + +// GetPropagateNaturalHeight is a wrapper around gtk_scrolled_window_get_propagate_natural_height(). +func (v *ScrolledWindow) GetPropagateNaturalHeight() bool { + c := C.gtk_scrolled_window_get_propagate_natural_height(v.native()) + return gobool(c) +} + +// SetPropagateNaturalHeight is a wrapper around gtk_scrolled_window_set_propagate_natural_height(). +func (v *ScrolledWindow) SetPropagateNaturalHeight(propagate bool) { + C.gtk_scrolled_window_set_propagate_natural_height(v.native(), gbool(propagate)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_24.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_24.go new file mode 100644 index 0000000..97968fb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_24.go @@ -0,0 +1,14 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18,!gtk_3_20,!gtk_3_22 + +package gtk + +// #include +import "C" + +/* + * GtkInputPurpose + */ + +const ( + INPUT_PURPOSE_TERMINAL InputPurpose = C.GTK_INPUT_PURPOSE_TERMINAL +) diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go new file mode 100644 index 0000000..21ffa40 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_since_3_8.go @@ -0,0 +1,36 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols included since GTK 3.8, and +// and should not be included in a build intended to target any older GTK +// versions. To target an older build, such as 3.8, use +// 'go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.18 +// is assumed and this file is built. +// +build !gtk_3_6 + +package gtk + +// #include +import "C" + +/* + * Constants + */ + +const ( + STATE_FLAG_DIR_LTR StateFlags = C.GTK_STATE_FLAG_DIR_LTR + STATE_FLAG_DIR_RTL StateFlags = C.GTK_STATE_FLAG_DIR_RTL +) diff --git a/vendor/github.com/gotk3/gotk3/gtk/gtk_test.go b/vendor/github.com/gotk3/gotk3/gtk/gtk_test.go new file mode 100644 index 0000000..147107e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/gtk_test.go @@ -0,0 +1,875 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package gtk + +import ( + "fmt" + "log" + "testing" + "time" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + Init(nil) +} + +// TestBoolConvs tests the conversion between Go bools and gboolean +// types. +func TestBoolConvs(t *testing.T) { + if err := testBoolConvs(); err != nil { + t.Error(err) + } +} + +// TestBox tests creating and adding widgets to a Box +func TestBox(t *testing.T) { + vbox, err := BoxNew(ORIENTATION_VERTICAL, 0) + if err != nil { + t.Error("Unable to create box") + } + + vbox.Set("homogeneous", true) + if vbox.GetHomogeneous() != true { + t.Error("Could not set or get Box homogeneous property") + } + + vbox.SetHomogeneous(false) + if vbox.GetHomogeneous() != false { + t.Error("Could not set or get Box homogeneous property") + } + + vbox.Set("spacing", 1) + if vbox.GetSpacing() != 1 { + t.Error("Could not set or get Box spacing") + } + + vbox.SetSpacing(2) + if vbox.GetSpacing() != 2 { + t.Error("Could not set or get Box spacing") + } + + // add a child to start and end + start, err := LabelNew("Start") + if err != nil { + t.Error("Unable to create label") + } + + end, err := LabelNew("End") + if err != nil { + t.Error("Unable to create label") + } + + vbox.PackStart(start, true, true, 3) + vbox.PackEnd(end, true, true, 3) +} +func TestTextBuffer_WhenSetText_ExpectGetTextReturnsSame(t *testing.T) { + buffer, err := TextBufferNew(nil) + if err != nil { + t.Error("Unable to create text buffer") + } + expected := "Hello, World!" + buffer.SetText(expected) + + start, end := buffer.GetBounds() + + actual, err := buffer.GetText(start, end, true) + if err != nil { + t.Error("Unable to get text from buffer") + } + + if actual != expected { + t.Errorf("Expected '%s'; Got '%s'", expected, actual) + } +} + +func testTextViewEditable(set bool) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + exp := set + tv.SetEditable(exp) + act := tv.GetEditable() + if exp != act { + return fmt.Errorf("Expected GetEditable(): %v; Got: %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetEditableFalse_ExpectGetEditableReturnsFalse(t *testing.T) { + if err := testTextViewEditable(false); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetEditableTrue_ExpectGetEditableReturnsTrue(t *testing.T) { + if err := testTextViewEditable(true); err != nil { + t.Error(err) + } +} + +func testTextViewWrapMode(set WrapMode) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + exp := set + tv.SetWrapMode(set) + act := tv.GetWrapMode() + if act != exp { + return fmt.Errorf("Expected GetWrapMode(): %v; Got: %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetWrapModeNone_ExpectGetWrapModeReturnsNone(t *testing.T) { + if err := testTextViewWrapMode(WRAP_NONE); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetWrapModeWord_ExpectGetWrapModeReturnsWord(t *testing.T) { + if err := testTextViewWrapMode(WRAP_WORD); err != nil { + t.Error(err) + } +} + +func testTextViewCursorVisible(set bool) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + exp := set + tv.SetCursorVisible(set) + act := tv.GetCursorVisible() + if act != exp { + return fmt.Errorf("Expected GetCursorVisible(): %v; Got: %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetCursorVisibleFalse_ExpectGetCursorVisibleReturnsFalse(t *testing.T) { + if err := testTextViewCursorVisible(false); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetCursorVisibleTrue_ExpectGetCursorVisibleReturnsTrue(t *testing.T) { + if err := testTextViewCursorVisible(true); err != nil { + t.Error(err) + } +} + +func testTextViewOverwrite(set bool) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + exp := set + tv.SetOverwrite(set) + act := tv.GetOverwrite() + if act != exp { + return fmt.Errorf("Expected GetOverwrite(): %v; Got: %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetOverwriteFalse_ExpectGetOverwriteReturnsFalse(t *testing.T) { + if err := testTextViewOverwrite(false); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetOverwriteTrue_ExpectGetOverwriteReturnsTrue(t *testing.T) { + if err := testTextViewOverwrite(true); err != nil { + t.Error(err) + } +} + +func testTextViewJustification(justify Justification) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + exp := justify + tv.SetJustification(justify) + act := tv.GetJustification() + if act != exp { + return fmt.Errorf("Expected GetJustification(): %v; Got: %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetJustificationLeft_ExpectGetJustificationReturnsLeft(t *testing.T) { + if err := testTextViewJustification(JUSTIFY_LEFT); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetJustificationRight_ExpectGetJustificationReturnsRight(t *testing.T) { + if err := testTextViewJustification(JUSTIFY_RIGHT); err != nil { + t.Error(err) + } +} + +func testTextViewAcceptsTab(set bool) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + exp := set + tv.SetAcceptsTab(set) + if act := tv.GetAcceptsTab(); act != exp { + return fmt.Errorf("Expected GetAcceptsTab(): %v; Got: %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetAcceptsTabFalse_ExpectGetAcceptsTabReturnsFalse(t *testing.T) { + if err := testTextViewAcceptsTab(false); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetAcceptsTabTrue_ExpectGetAcceptsTabReturnsTrue(t *testing.T) { + if err := testTextViewAcceptsTab(true); err != nil { + t.Error(err) + } +} + +func testIntProperty(val int, set func(int), get func() int) error { + set(val) + if exp, act := val, get(); act != exp { + return fmt.Errorf("Expected: %d; got: %d", exp, act) + } + return nil +} + +func testTextViewPixelsAboveLines(px int) error { + tv, err := TextViewNew() + if err != nil { + return err + } + return testIntProperty(px, (*tv).SetPixelsAboveLines, (*tv).GetPixelsAboveLines) +} + +func TestTextView_WhenSetPixelsAboveLines10_ExpectGetPixelsAboveLinesReturns10(t *testing.T) { + if err := testTextViewPixelsAboveLines(10); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetPixelsAboveLines11_ExpectGetPixelsAboveLinesReturns11(t *testing.T) { + if err := testTextViewPixelsAboveLines(11); err != nil { + t.Error(err) + } +} + +func testTextViewPixelsBelowLines(px int) error { + tv, err := TextViewNew() + if err != nil { + return err + } + return testIntProperty(px, (*tv).SetPixelsBelowLines, (*tv).GetPixelsBelowLines) +} + +func TestTextView_WhenSetPixelsBelowLines10_ExpectGetPixelsAboveLinesReturns10(t *testing.T) { + if err := testTextViewPixelsBelowLines(10); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetPixelsBelowLines11_ExpectGetPixelsBelowLinesReturns11(t *testing.T) { + if err := testTextViewPixelsBelowLines(11); err != nil { + t.Error(err) + } +} + +func testTextViewPixelsInsideWrap(px int) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + return testIntProperty(px, (*tv).SetPixelsInsideWrap, (*tv).GetPixelsInsideWrap) +} + +func TestTextView_WhenSetPixelsInsideWrap10_ExpectGetPixelsInsideWrapReturns11(t *testing.T) { + if err := testTextViewPixelsInsideWrap(10); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetPixelsInsideWrap11_ExpectGetPixelsInsideWrapReturns11(t *testing.T) { + if err := testTextViewPixelsInsideWrap(11); err != nil { + t.Error(err) + } +} + +func testTextViewLeftMargin(margin int) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + return testIntProperty(margin, (*tv).SetLeftMargin, (*tv).GetLeftMargin) +} + +func TestTextView_WhenSetLeftMargin11_ExpectGetLeftMarginReturns11(t *testing.T) { + if err := testTextViewLeftMargin(11); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetLeftMargin10_ExpectGetLeftMarginReturns10(t *testing.T) { + if err := testTextViewLeftMargin(10); err != nil { + t.Error(err) + } +} + +func testTextViewRightMargin(margin int) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + return testIntProperty(margin, (*tv).SetRightMargin, (*tv).GetRightMargin) +} + +func TestTextView_WhenSetRightMargin10_ExpectGetRightMarginReturns10(t *testing.T) { + if err := testTextViewRightMargin(10); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetRightMargin11_ExpectGetRightMarginReturns11(t *testing.T) { + if err := testTextViewRightMargin(11); err != nil { + t.Error(err) + } +} + +func testTextViewIndent(indent int) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + return testIntProperty(indent, (*tv).SetIndent, (*tv).GetIndent) +} + +func TestTextView_WhenSetIndent10_ExpectGetIndentReturns10(t *testing.T) { + if err := testTextViewIndent(10); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetIndent11_ExpectGetIndentReturns11(t *testing.T) { + if err := testTextViewIndent(11); err != nil { + t.Error(err) + } +} + +func testTextViewInputHints(hint InputHints) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + tv.SetInputHints(hint) + if exp, act := hint, tv.GetInputHints(); act != exp { + return fmt.Errorf("Expected %v; Got %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetInputHintsNone_ExpectGetInputHintsReturnsNone(t *testing.T) { + if err := testTextViewInputHints(INPUT_HINT_NONE); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetInputHintsSpellCheck_ExpectGetInputHintsReturnsSpellCheck(t *testing.T) { + if err := testTextViewInputHints(INPUT_HINT_SPELLCHECK); err != nil { + t.Error(err) + } +} + +func testTextViewInputPurpose(purpose InputPurpose) error { + tv, err := TextViewNew() + if err != nil { + return err + } + + tv.SetInputPurpose(purpose) + if exp, act := purpose, tv.GetInputPurpose(); act != exp { + return fmt.Errorf("Expected %v; Got %v", exp, act) + } + return nil +} + +func TestTextView_WhenSetInputPurposeURL_ExpectGetInputPurposeReturnsURL(t *testing.T) { + if err := testTextViewInputPurpose(INPUT_PURPOSE_URL); err != nil { + t.Error(err) + } +} + +func TestTextView_WhenSetInputPurposeALPHA_ExpectGetInputPurposeReturnsALPHA(t *testing.T) { + if err := testTextViewInputPurpose(INPUT_PURPOSE_ALPHA); err != nil { + t.Error(err) + } +} + +func testCellRendererToggleSetRadio(set bool) error { + renderer, err := CellRendererToggleNew() + if err != nil { + return err + } + + renderer.SetRadio(set) + if exp, act := set, renderer.GetRadio(); act != exp { + return fmt.Errorf("Expected GetRadio(): %v; Got: %v", exp, act) + } + return nil +} + +func TestCellRendererToggle_WhenSetRadioFalse_ExpectGetRadioReturnsFalse(t *testing.T) { + if err := testCellRendererToggleSetRadio(false); err != nil { + t.Error(err) + } +} + +func TestCellRendererToggle_WhenSetRadioTrue_ExpectGetRadioReturnsTrue(t *testing.T) { + if err := testCellRendererToggleSetRadio(true); err != nil { + t.Error(err) + } +} + +func testCellRendererToggleSetActive(set bool) error { + renderer, err := CellRendererToggleNew() + if err != nil { + return err + } + + renderer.SetActive(set) + if exp, act := set, renderer.GetActive(); act != exp { + return fmt.Errorf("Expected GetActive(): %v; Got: %v", exp, act) + } + return nil +} + +func TestCellRendererToggle_WhenSetActiveFalse_ExpectGetActiveReturnsFalse(t *testing.T) { + if err := testCellRendererToggleSetActive(false); err != nil { + t.Error(err) + } +} + +func TestCellRendererToggle_WhenSetActiveTrue_ExpectGetActiveReturnsTrue(t *testing.T) { + if err := testCellRendererToggleSetActive(true); err != nil { + t.Error(err) + } +} + +func testCellRendererToggleSetActivatable(set bool) error { + renderer, err := CellRendererToggleNew() + if err != nil { + return err + } + + renderer.SetActivatable(set) + if exp, act := set, renderer.GetActivatable(); act != exp { + return fmt.Errorf("Expected GetActivatable(): %v; Got: %v", exp, act) + } + return nil +} + +func TestCellRendererToggle_WhenSetActivatableFalse_ExpectGetActivatableReturnsFalse(t *testing.T) { + if err := testCellRendererToggleSetActivatable(false); err != nil { + t.Error(err) + } +} + +func TestCellRendererToggle_WhenSetActivatableTrue_ExpectGetActivatableReturnsTrue(t *testing.T) { + if err := testCellRendererToggleSetActivatable(true); err != nil { + t.Error(err) + } +} + +func TestCellRendererAccel_AccelModeMarshaling(t *testing.T) { + // CellRendererAccel has no getters/setters, everything is handled via properties, so marshaling has to work + renderer, err := CellRendererAccelNew() + if err != nil { + t.Error(err) + } + + err = renderer.SetProperty("accel-mode", CELL_RENDERER_ACCEL_MODE_OTHER) + if err != nil { + t.Error(err) + } + + value, err := renderer.GetProperty("accel-mode") + if err != nil { + t.Error(err) + } + + if CELL_RENDERER_ACCEL_MODE_OTHER != value { + t.Errorf("Expected %v, got %v", CELL_RENDERER_ACCEL_MODE_OTHER, value) + } +} + +func TestCellRendererAccel_ModifierTypeMarshaling(t *testing.T) { + // CellRendererAccel has no getters/setters, everything is handled via properties, so marshaling has to work + renderer, err := CellRendererAccelNew() + if err != nil { + t.Error(err) + } + + err = renderer.SetProperty("accel-mods", gdk.META_MASK) + if err != nil { + t.Error(err) + } + + value, err := renderer.GetProperty("accel-mods") + if err != nil { + t.Error(err) + } + + if gdk.META_MASK != value.(gdk.ModifierType) { + t.Errorf("Expected %v, got %v", gdk.META_MASK, value.(gdk.ModifierType)) + } +} + +func setupListStore() *ListStore { + ls, err := ListStoreNew(glib.TYPE_STRING) + if err != nil { + log.Fatal("Unexpected err:", err) + } + return ls +} + +func getLastIter(ls *ListStore) (*TreeIter, bool) { + iter, listIsntEmpty := ls.GetIterFirst() + if !listIsntEmpty { + return iter, listIsntEmpty + } + + for { + temp := *iter + last := &temp + if !ls.IterNext(iter) { + return last, true + } + } + + panic("Shouldn't get here") +} + +// TestListStoreRemoveLastInvalidIterator tests that when a ListStore stores +// one item and it is removed, the iterator becomes invalid. +func TestListStoreRemoveLastInvalidIterator(t *testing.T) { + ls := setupListStore() + + iter := ls.Append() + + if iterValid := ls.Remove(iter); iterValid { + t.Fatal("Remove() returned true (iter valid); expected false (iter invalid)") + } +} + +func TestListStoreInsertBefore(t *testing.T) { + ls := setupListStore() + + // Given 1 iter is already in the liststore + initialIter := ls.Append() + + // When another iter is inserted before it + newIter := ls.InsertBefore(initialIter) + + // Expect the newly-inserted iter is first iter in list + firstIter, listIsntEmpty := ls.GetIterFirst() + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + if *firstIter != *newIter { + t.Fatal("Expected the new iter added to front of list") + } +} + +// When 'sibling' parameter is nil, the new iter should be appended to the liststore +func TestListStoreInsertBefore_WhenNilSibling(t *testing.T) { + ls := setupListStore() + + // Given 2 iters in liststore + ls.Append() + ls.Append() + + // When 'sibling' parameter of InsertBefore() is nil... + newIter := ls.InsertBefore(nil) + + // Then expect newly-inserted iter is the first iter in list + lastIter, listIsntEmpty := getLastIter(ls) + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + if *lastIter != *newIter { + t.Fatal("Expected the new iter added to end of list") + } +} + +func TestListStoreInsertAfter(t *testing.T) { + ls := setupListStore() + + // Given 1 iter in liststore + sibling := ls.Append() + + // When InsertAfter(sibling) + newIter := ls.InsertAfter(sibling) + + // Then expect newly-inserted iter is the last iter in list + lastIter, listIsntEmpty := getLastIter(ls) + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + if *lastIter != *newIter { + t.Fatal("Expected the new iter added to end of list") + } +} + +// When 'sibling' parameter is nil, the new iter should be prepended to the liststore +func TestListStoreInsertAfter_WhenNilSibling(t *testing.T) { + ls := setupListStore() + + // Given 2 iters in liststore + ls.Append() + ls.Append() + + // When InsertAfter(nil) + newIter := ls.InsertAfter(nil) + + // Then expect newly-inserted iter is the first iter in the list + first, listIsntEmpty := ls.GetIterFirst() + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + if *first != *newIter { + t.Fatal("Expected the new iter was prepended to liststore") + } +} + +// Test storing and fetching a non-empty string value in a ListStore +func TestListStoreGetValue_NonEmptyString(t *testing.T) { + ls := setupListStore() + + // Add a string + err := ls.InsertWithValues(nil, -1, []int{0}, []interface{}{"foo"}) + if err != nil { + t.Fatal("Failed to insert row", err) + } + + // Fetch the first iter + first, listIsntEmpty := ls.GetIterFirst() + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + // Obtain a value + v, err := ls.GetValue(first, 0) + if err != nil { + t.Fatal("Failed GetValue()", err) + } + + s, err := v.GetString() + if err != nil { + t.Fatal("Failed GetString()", err) + } + + if s != "foo" { + t.Errorf("Expected 'foo'; Got %v", s) + } +} + +// Test storing and fetching an empty string value in a ListStore +func TestListStoreGetValue_EmptyString(t *testing.T) { + ls := setupListStore() + + // Add a string + err := ls.InsertWithValues(nil, -1, []int{0}, []interface{}{""}) + if err != nil { + t.Fatal("Failed to insert row", err) + } + + // Fetch the first iter + first, listIsntEmpty := ls.GetIterFirst() + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + // Obtain a value + v, err := ls.GetValue(first, 0) + if err != nil { + t.Fatal("Failed GetValue()", err) + } + + s, err := v.GetString() + if err != nil { + t.Fatal("Failed GetString()", err) + } + + if s != "" { + t.Errorf("Expected an empty string; Got %v", s) + } +} + +// Test storing and fetching a missing string value in a ListStore +func TestListStoreGetValue_MissingString(t *testing.T) { + ls := setupListStore() + + // Add a string + err := ls.InsertWithValues(nil, -1, nil, nil) + if err != nil { + t.Fatal("Failed to insert row", err) + } + + // Fetch the first iter + first, listIsntEmpty := ls.GetIterFirst() + if !listIsntEmpty { + t.Fatal("Unexpected: liststore is empty") + } + + // Obtain a value + v, err := ls.GetValue(first, 0) + if err != nil { + t.Fatal("Failed GetValue()", err) + } + + _, err = v.GetString() + if err == nil { + t.Fatal("Unexpected success: error expected from GetString()", err) + } +} + +func TestBuilder(t *testing.T) { + builder, err := BuilderNew() + if err != nil { + t.Error("Unable to create builder") + } + + str := ` + + + + + 10 + + + 20 + + + gtk-ok + TRUE + + + + + + + + + +` + + err = builder.AddFromString(str) + if err != nil { + t.Error("Unable to add from string") + } + + widget, err := builder.GetObject("ok_button") + if err != nil { + t.Error("Unable to get widget from string") + } + + button, ok := widget.(*Button) + if !ok { + t.Error("Unable to cast to gtk.Button") + } + + l, err := button.GetLabel() + if err != nil { + t.Error("Unable to get button label") + } + + if l != "gtk-ok" { + t.Errorf("Label has the wrong value: %q", l) + } + + done := make(chan bool) + + builder.ConnectSignals(map[string]interface{}{ + "ok_button_clicked": func() { + done <- true + }, + }) + + go button.Emit("clicked") + + select { + case <-done: + case <-time.After(1 * time.Second): + t.Error("Failed to call callback") + } +} + +func TestTextTagEvent(t *testing.T) { + textTag, err := TextTagNew("mytexttag") + if err != nil { + t.Error("could not create text tag") + } + + evk := gdk.EventKeyNew() + + var iter TextIter + ok := textTag.Event(textTag.Object, evk.Event, &iter) + + if ok { + t.Error("event should not have been handled") + } + + textTag.Connect("event", func() bool { + return true + }) + + ok = textTag.Event(textTag.Object, evk.Event, &iter) + + if !ok { + t.Error("event should have been handled") + } + +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/icon_view.go b/vendor/github.com/gotk3/gotk3/gtk/icon_view.go new file mode 100644 index 0000000..3508c1f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/icon_view.go @@ -0,0 +1,481 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkIconView + */ + +// IconView is a representation of GTK's GtkIconView. +type IconView struct { + Container +} + +// native returns a pointer to the underlying GtkIconView. +func (v *IconView) native() *C.GtkIconView { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkIconView(p) +} + +func marshalIconView(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapIconView(obj), nil +} + +func wrapIconView(obj *glib.Object) *IconView { + if obj == nil { + return nil + } + + return &IconView{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// IconViewNew is a wrapper around gtk_icon_view_new(). +func IconViewNew() (*IconView, error) { + c := C.gtk_icon_view_new() + if c == nil { + return nil, nilPtrErr + } + + return wrapIconView(glib.Take(unsafe.Pointer(c))), nil +} + +// TODO: +// gtk_icon_view_new_with_area(). + +// IconViewNewWithModel is a wrapper around gtk_icon_view_new_with_model(). +func IconViewNewWithModel(model ITreeModel) (*IconView, error) { + c := C.gtk_icon_view_new_with_model(model.toTreeModel()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapIconView(obj), nil +} + +// SetModel is a wrapper around gtk_icon_view_set_model(). +func (v *IconView) SetModel(model ITreeModel) { + var mptr *C.GtkTreeModel + if model != nil { + mptr = model.toTreeModel() + } + C.gtk_icon_view_set_model(v.native(), mptr) +} + +// GetModel is a wrapper around gtk_icon_view_get_model(). +func (v *IconView) GetModel() (ITreeModel, error) { + c := C.gtk_icon_view_get_model(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castTreeModel(c) +} + +// SetTextColumn is a wrapper around gtk_icon_view_set_text_column(). +func (v *IconView) SetTextColumn(column int) { + C.gtk_icon_view_set_text_column(v.native(), C.gint(column)) +} + +// GetTextColumn is a wrapper around gtk_icon_view_get_text_column(). +func (v *IconView) GetTextColumn() int { + return int(C.gtk_icon_view_get_text_column(v.native())) +} + +// SetMarkupColumn is a wrapper around gtk_icon_view_set_markup_column(). +func (v *IconView) SetMarkupColumn(column int) { + C.gtk_icon_view_set_markup_column(v.native(), C.gint(column)) +} + +// GetMarkupColumn is a wrapper around gtk_icon_view_get_markup_column(). +func (v *IconView) GetMarkupColumn() int { + return int(C.gtk_icon_view_get_markup_column(v.native())) +} + +// SetPixbufColumn is a wrapper around gtk_icon_view_set_pixbuf_column(). +func (v *IconView) SetPixbufColumn(column int) { + C.gtk_icon_view_set_pixbuf_column(v.native(), C.gint(column)) +} + +// GetPixbufColumn is a wrapper around gtk_icon_view_get_pixbuf_column(). +func (v *IconView) GetPixbufColumn() int { + return int(C.gtk_icon_view_get_pixbuf_column(v.native())) +} + +// GetPathAtPos is a wrapper around gtk_icon_view_get_path_at_pos(). +func (v *IconView) GetPathAtPos(x, y int) *TreePath { + var ( + cpath *C.GtkTreePath + path *TreePath + ) + + cpath = C.gtk_icon_view_get_path_at_pos(v.native(), C.gint(x), C.gint(y)) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + + return path +} + +// GetItemAtPos is a wrapper around gtk_icon_view_get_item_at_pos(). +func (v *IconView) GetItemAtPos(x, y int) (*TreePath, *CellRenderer) { + var ( + cpath *C.GtkTreePath + ccell *C.GtkCellRenderer + path *TreePath + cell *CellRenderer + ) + + C.gtk_icon_view_get_item_at_pos(v.native(), C.gint(x), C.gint(y), &cpath, &ccell) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + + if ccell != nil { + cell = wrapCellRenderer(glib.Take(unsafe.Pointer(ccell))) + } + + return path, cell +} + +// ConvertWidgetToBinWindowCoords is a wrapper around gtk_icon_view_convert_widget_to_bin_window_coords(). +func (v *IconView) ConvertWidgetToBinWindowCoords(x, y int) (int, int) { + var bx, by C.gint + + C.gtk_icon_view_convert_widget_to_bin_window_coords(v.native(), C.gint(x), C.gint(y), &bx, &by) + + return int(bx), int(by) +} + +// SetCursor is a wrapper around gtk_icon_view_set_cursor(). +func (v *IconView) SetCursor(path *TreePath, cell *CellRenderer, startEditing bool) { + C.gtk_icon_view_set_cursor(v.native(), path.native(), cell.native(), gbool(startEditing)) +} + +// GetCursor is a wrapper around gtk_icon_view_get_cursor(). +func (v *IconView) GetCursor() (*TreePath, *CellRenderer) { + var ( + cpath *C.GtkTreePath + ccell *C.GtkCellRenderer + path *TreePath + cell *CellRenderer + ) + + C.gtk_icon_view_get_cursor(v.native(), &cpath, &ccell) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + + if ccell != nil { + cell = wrapCellRenderer(glib.Take(unsafe.Pointer(ccell))) + } + + return path, cell +} + +// TODO: +// gtk_icon_view_selected_foreach(). +// func (v *IconView) SelectedForeach() {} + +// SetSelectionMode is a wrapper around gtk_icon_view_set_selection_mode(). +func (v *IconView) SetSelectionMode(mode SelectionMode) { + C.gtk_icon_view_set_selection_mode(v.native(), C.GtkSelectionMode(mode)) +} + +// GetSelectionMode is a wrapper around gtk_icon_view_get_selection_mode(). +func (v *IconView) GetSelectionMode() SelectionMode { + return SelectionMode(C.gtk_icon_view_get_selection_mode(v.native())) +} + +// SetItemOrientation is a wrapper around gtk_icon_view_set_item_orientation(). +func (v *IconView) SetItemOrientation(orientation Orientation) { + C.gtk_icon_view_set_item_orientation(v.native(), C.GtkOrientation(orientation)) +} + +// GetItemOrientation is a wrapper around gtk_icon_view_get_item_orientation(). +func (v *IconView) GetItemOrientation() Orientation { + return Orientation(C.gtk_icon_view_get_item_orientation(v.native())) +} + +// SetColumns is a wrapper around gtk_icon_view_set_columns(). +func (v *IconView) SetColumns(columns int) { + C.gtk_icon_view_set_columns(v.native(), C.gint(columns)) +} + +// GetColumns is a wrapper around gtk_icon_view_get_columns(). +func (v *IconView) GetColumns() int { + return int(C.gtk_icon_view_get_columns(v.native())) +} + +// SetItemWidth is a wrapper around gtk_icon_view_set_item_width(). +func (v *IconView) SetItemWidth(width int) { + C.gtk_icon_view_set_item_width(v.native(), C.gint(width)) +} + +// GetItemWidth is a wrapper around gtk_icon_view_get_item_width(). +func (v *IconView) GetItemWidth() int { + return int(C.gtk_icon_view_get_item_width(v.native())) +} + +// SetSpacing is a wrapper around gtk_icon_view_set_spacing(). +func (v *IconView) SetSpacing(spacing int) { + C.gtk_icon_view_set_spacing(v.native(), C.gint(spacing)) +} + +// GetSpacing is a wrapper around gtk_icon_view_get_spacing(). +func (v *IconView) GetSpacing() int { + return int(C.gtk_icon_view_get_spacing(v.native())) +} + +// SetRowSpacing is a wrapper around gtk_icon_view_set_row_spacing(). +func (v *IconView) SetRowSpacing(rowSpacing int) { + C.gtk_icon_view_set_row_spacing(v.native(), C.gint(rowSpacing)) +} + +// GetRowSpacing is a wrapper around gtk_icon_view_get_row_spacing(). +func (v *IconView) GetRowSpacing() int { + return int(C.gtk_icon_view_get_row_spacing(v.native())) +} + +// SetColumnSpacing is a wrapper around gtk_icon_view_set_column_spacing(). +func (v *IconView) SetColumnSpacing(columnSpacing int) { + C.gtk_icon_view_set_column_spacing(v.native(), C.gint(columnSpacing)) +} + +// GetColumnSpacing is a wrapper around gtk_icon_view_get_column_spacing(). +func (v *IconView) GetColumnSpacing() int { + return int(C.gtk_icon_view_get_column_spacing(v.native())) +} + +// SetMargin is a wrapper around gtk_icon_view_set_margin(). +func (v *IconView) SetMargin(margin int) { + C.gtk_icon_view_set_margin(v.native(), C.gint(margin)) +} + +// GetMargin is a wrapper around gtk_icon_view_get_margin(). +func (v *IconView) GetMargin() int { + return int(C.gtk_icon_view_get_margin(v.native())) +} + +// SetItemPadding is a wrapper around gtk_icon_view_set_item_padding(). +func (v *IconView) SetItemPadding(itemPadding int) { + C.gtk_icon_view_set_item_padding(v.native(), C.gint(itemPadding)) +} + +// GetItemPadding is a wrapper around gtk_icon_view_get_item_padding(). +func (v *IconView) GetItemPadding() int { + return int(C.gtk_icon_view_get_item_padding(v.native())) +} + +// SetActivateOnSingleClick is a wrapper around gtk_icon_view_set_activate_on_single_click(). +func (v *IconView) SetActivateOnSingleClick(single bool) { + C.gtk_icon_view_set_activate_on_single_click(v.native(), gbool(single)) +} + +// GetActivateOnSingleClick is a wrapper around gtk_icon_view_get_activate_on_single_click(). +func (v *IconView) GetActivateOnSingleClick() bool { + return gobool(C.gtk_icon_view_get_activate_on_single_click(v.native())) +} + +// GetCellRect is a wrapper around gtk_icon_view_get_cell_rect(). +func (v *IconView) GetCellRect(path *TreePath, cell *CellRenderer) *gdk.Rectangle { + var crect C.GdkRectangle + + C.gtk_icon_view_get_cell_rect(v.native(), path.native(), cell.native(), &crect) + + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&crect))) +} + +// SelectPath is a wrapper around gtk_icon_view_select_path(). +func (v *IconView) SelectPath(path *TreePath) { + C.gtk_icon_view_select_path(v.native(), path.native()) +} + +// UnselectPath is a wrapper around gtk_icon_view_unselect_path(). +func (v *IconView) UnselectPath(path *TreePath) { + C.gtk_icon_view_unselect_path(v.native(), path.native()) +} + +// PathIsSelected is a wrapper around gtk_icon_view_path_is_selected(). +func (v *IconView) PathIsSelected(path *TreePath) bool { + return gobool(C.gtk_icon_view_path_is_selected(v.native(), path.native())) +} + +// GetSelectedItems is a wrapper around gtk_icon_view_get_selected_items(). +func (v *IconView) GetSelectedItems() *glib.List { + clist := C.gtk_icon_view_get_selected_items(v.native()) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return &TreePath{(*C.GtkTreePath)(ptr)} + }) + runtime.SetFinalizer(glist, func(glist *glib.List) { + glist.FreeFull(func(item interface{}) { + path := item.(*TreePath) + C.gtk_tree_path_free(path.GtkTreePath) + }) + }) + + return glist +} + +// SelectAll is a wrapper around gtk_icon_view_select_all(). +func (v *IconView) SelectAll() { + C.gtk_icon_view_select_all(v.native()) +} + +// UnselectAll is a wrapper around gtk_icon_view_unselect_all(). +func (v *IconView) UnselectAll() { + C.gtk_icon_view_unselect_all(v.native()) +} + +// ItemActivated is a wrapper around gtk_icon_view_item_activated(). +func (v *IconView) ItemActivated(path *TreePath) { + C.gtk_icon_view_item_activated(v.native(), path.native()) +} + +// ScrollToPath is a wrapper around gtk_icon_view_scroll_to_path(). +func (v *IconView) ScrollToPath(path *TreePath, useAlign bool, rowAlign, colAlign float64) { + C.gtk_icon_view_scroll_to_path(v.native(), path.native(), gbool(useAlign), + C.gfloat(rowAlign), C.gfloat(colAlign)) +} + +// GetVisibleRange is a wrapper around gtk_icon_view_get_visible_range(). +func (v *IconView) GetVisibleRange() (*TreePath, *TreePath) { + var ( + cpathStart, cpathEnd *C.GtkTreePath + pathStart, pathEnd *TreePath + ) + + C.gtk_icon_view_get_visible_range(v.native(), &cpathStart, &cpathEnd) + + if cpathStart != nil { + pathStart = &TreePath{cpathStart} + runtime.SetFinalizer(pathStart, (*TreePath).free) + } + + if cpathEnd != nil { + pathEnd = &TreePath{cpathEnd} + runtime.SetFinalizer(pathEnd, (*TreePath).free) + } + + return pathStart, pathEnd +} + +// SetTooltipItem is a wrapper around gtk_icon_view_set_tooltip_item(). +func (v *IconView) SetTooltipItem(tooltip *Tooltip, path *TreePath) { + C.gtk_icon_view_set_tooltip_item(v.native(), tooltip.native(), path.native()) +} + +// SetTooltipCell is a wrapper around gtk_icon_view_set_tooltip_cell(). +func (v *IconView) SetTooltipCell(tooltip *Tooltip, path *TreePath, cell *CellRenderer) { + C.gtk_icon_view_set_tooltip_cell(v.native(), tooltip.native(), path.native(), cell.native()) +} + +// GetTooltipContext is a wrapper around gtk_icon_view_get_tooltip_context(). +func (v *IconView) GetTooltipContext(x, y int, keyboardTip bool) (*TreeModel, *TreePath, *TreeIter) { + var ( + cmodel *C.GtkTreeModel + cpath *C.GtkTreePath + citer *C.GtkTreeIter + model *TreeModel + path *TreePath + iter *TreeIter + ) + + px := C.gint(x) + py := C.gint(y) + if !gobool(C.gtk_icon_view_get_tooltip_context(v.native(), + &px, + &py, + gbool(keyboardTip), + &cmodel, + &cpath, + citer, + )) { + return nil, nil, nil + } + + if cmodel != nil { + model = wrapTreeModel(glib.Take(unsafe.Pointer(cmodel))) + } + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + + if citer != nil { + iter = &TreeIter{*citer} + runtime.SetFinalizer(iter, (*TreeIter).free) + } + + return model, path, iter +} + +// SetTooltipColumn is a wrapper around gtk_icon_view_set_tooltip_column(). +func (v *IconView) SetTooltipColumn(column int) { + C.gtk_icon_view_set_tooltip_column(v.native(), C.gint(column)) +} + +// GetTooltipColumn is a wrapper around gtk_icon_view_get_tooltip_column(). +func (v *IconView) GetTooltipColumn() int { + return int(C.gtk_icon_view_get_tooltip_column(v.native())) +} + +// GetItemRow is a wrapper around gtk_icon_view_get_item_row(). +func (v *IconView) GetItemRow(path *TreePath) int { + return int(C.gtk_icon_view_get_item_row(v.native(), path.native())) +} + +// TODO: +// gtk_icon_view_get_item_column(). +// gtk_icon_view_enable_model_drag_source(). +// func (v *IconView) EnableModelDragSource() {} +// gtk_icon_view_enable_model_drag_dest(). +// func (v *IconView) EnableModelDragDest() {} +// gtk_icon_view_unset_model_drag_source(). +// func (v *IconView) UnsetModelDragSource() {} +// gtk_icon_view_unset_model_drag_dest(). +// func (v *IconView) UnsetModelDragDest() {} + +// SetReorderable is a wrapper around gtk_icon_view_set_reorderable(). +func (v *IconView) SetReorderable(reorderable bool) { + C.gtk_icon_view_set_reorderable(v.native(), gbool(reorderable)) +} + +// GetReorderable is a wrapper around gtk_icon_view_get_reorderable(). +func (v *IconView) GetReorderable() bool { + return gobool(C.gtk_icon_view_get_reorderable(v.native())) +} + +// TODO: +// gtk_icon_view_set_drag_dest_item(). +// func (v *IconView) SetDragDestItem() {} +// gtk_icon_view_get_drag_dest_item(). +// func (v *IconView) GetDragDestItem() {} +// gtk_icon_view_get_dest_item_at_pos(). +// func (v *IconView) GetDestItemAtPos() {} +// gtk_icon_view_create_drag_icon(). +// func (v *IconView) CreateDragIcon() {} diff --git a/vendor/github.com/gotk3/gotk3/gtk/info_bar.go b/vendor/github.com/gotk3/gotk3/gtk/info_bar.go new file mode 100644 index 0000000..82a12a3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/info_bar.go @@ -0,0 +1,133 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_info_bar_get_type()), marshalInfoBar}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkInfoBar"] = wrapInfoBar +} + +type InfoBar struct { + Box +} + +func (v *InfoBar) native() *C.GtkInfoBar { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkInfoBar(p) +} + +func marshalInfoBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapInfoBar(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapInfoBar(obj *glib.Object) *InfoBar { + if obj == nil { + return nil + } + + return &InfoBar{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// InfoBarNew is a wrapper around gtk_info_bar_new(). +func InfoBarNew() (*InfoBar, error) { + c := C.gtk_info_bar_new() + if c == nil { + return nil, nilPtrErr + } + + return wrapInfoBar(glib.Take(unsafe.Pointer(c))), nil +} + +// TODO: +// gtk_info_bar_new_with_buttons(). + +// AddActionWidget is a wrapper around gtk_info_bar_add_action_widget(). +func (v *InfoBar) AddActionWidget(w IWidget, responseId ResponseType) { + C.gtk_info_bar_add_action_widget(v.native(), w.toWidget(), C.gint(responseId)) +} + +// AddButton is a wrapper around gtk_info_bar_add_button(). +func (v *InfoBar) AddButton(buttonText string, responseId ResponseType) { + cstr := C.CString(buttonText) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_info_bar_add_button(v.native(), (*C.gchar)(cstr), C.gint(responseId)) +} + +// TODO: +// gtk_info_bar_add_buttons(). + +// SetResponseSensitive is a wrapper around gtk_info_bar_set_response_sensitive(). +func (v *InfoBar) SetResponseSensitive(responseId ResponseType, setting bool) { + C.gtk_info_bar_set_response_sensitive(v.native(), C.gint(responseId), gbool(setting)) +} + +// SetDefaultResponse is a wrapper around gtk_info_bar_set_default_response(). +func (v *InfoBar) SetDefaultResponse(responseId ResponseType) { + C.gtk_info_bar_set_default_response(v.native(), C.gint(responseId)) +} + +// TODO: +// gtk_info_bar_response(). + +// SetMessageType is a wrapper around gtk_info_bar_set_message_type(). +func (v *InfoBar) SetMessageType(messageType MessageType) { + C.gtk_info_bar_set_message_type(v.native(), C.GtkMessageType(messageType)) +} + +// GetMessageType is a wrapper around gtk_info_bar_get_message_type(). +func (v *InfoBar) GetMessageType() MessageType { + messageType := C.gtk_info_bar_get_message_type(v.native()) + return MessageType(messageType) +} + +// GetActionArea is a wrapper around gtk_info_bar_get_action_area(). +func (v *InfoBar) GetActionArea() (IWidget, error) { + c := C.gtk_info_bar_get_action_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// GetContentArea is a wrapper around gtk_info_bar_get_content_area(). +func (v *InfoBar) GetContentArea() (*Box, error) { + c := C.gtk_info_bar_get_content_area(v.native()) + if c == nil { + return nil, nilPtrErr + } + + return wrapBox(glib.Take(unsafe.Pointer(c))), nil +} + +// GetShowCloseButton is a wrapper around gtk_info_bar_get_show_close_button(). +func (v *InfoBar) GetShowCloseButton() bool { + b := C.gtk_info_bar_get_show_close_button(v.native()) + return gobool(b) +} + +// SetShowCloseButton is a wrapper around gtk_info_bar_set_show_close_button(). +func (v *InfoBar) SetShowCloseButton(setting bool) { + C.gtk_info_bar_set_show_close_button(v.native(), gbool(setting)) +} + +// TODO: for GTK+ 3.22.29 +// gtk_info_bar_get_revealed(). +// gtk_info_bar_set_revealed(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/label.go b/vendor/github.com/gotk3/gotk3/gtk/label.go new file mode 100644 index 0000000..c8a0846 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/label.go @@ -0,0 +1,299 @@ +// Same copyright and license as the rest of the files in this project +// This file contains style related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/pango" + + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkLabel + */ + +// Label is a representation of GTK's GtkLabel. +type Label struct { + Widget +} + +// native returns a pointer to the underlying GtkLabel. +func (v *Label) native() *C.GtkLabel { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkLabel(p) +} + +func marshalLabel(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapLabel(obj), nil +} + +func wrapLabel(obj *glib.Object) *Label { + if obj == nil { + return nil + } + + return &Label{Widget{glib.InitiallyUnowned{obj}}} +} + +// WidgetToLabel is a convience func that casts the given *Widget into a *Label. +func WidgetToLabel(widget *Widget) (*Label, error) { + obj := glib.Take(unsafe.Pointer(widget.GObject)) + return wrapLabel(obj), nil +} + +// LabelNew is a wrapper around gtk_label_new(). +func LabelNew(str string) (*Label, error) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_label_new((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapLabel(obj), nil +} + +// SetText is a wrapper around gtk_label_set_text(). +func (v *Label) SetText(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_label_set_text(v.native(), (*C.gchar)(cstr)) +} + +// TODO: +// gtk_label_set_text_with_mnemonic(). +// gtk_label_get_attributes(). +func (v *Label) SetAttributes(attributes *pango.AttrList) { + C.gtk_label_set_attributes(v.native(), (*C.PangoAttrList)(unsafe.Pointer(attributes.Native()))) +} + +// SetMarkup is a wrapper around gtk_label_set_markup(). +func (v *Label) SetMarkup(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_label_set_markup(v.native(), (*C.gchar)(cstr)) +} + +// SetMarkupWithMnemonic is a wrapper around +// gtk_label_set_markup_with_mnemonic(). +func (v *Label) SetMarkupWithMnemonic(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_label_set_markup_with_mnemonic(v.native(), (*C.gchar)(cstr)) +} + +// SetPattern is a wrapper around gtk_label_set_pattern(). +func (v *Label) SetPattern(patern string) { + cstr := C.CString(patern) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_label_set_pattern(v.native(), (*C.gchar)(cstr)) +} + +// SetJustify is a wrapper around gtk_label_set_justify(). +func (v *Label) SetJustify(jtype Justification) { + C.gtk_label_set_justify(v.native(), C.GtkJustification(jtype)) +} + +// SetEllipsize is a wrapper around gtk_label_set_ellipsize(). +func (v *Label) SetEllipsize(mode pango.EllipsizeMode) { + C.gtk_label_set_ellipsize(v.native(), C.PangoEllipsizeMode(mode)) +} + +// GetWidthChars is a wrapper around gtk_label_get_width_chars(). +func (v *Label) GetWidthChars() int { + c := C.gtk_label_get_width_chars(v.native()) + return int(c) +} + +// SetWidthChars is a wrapper around gtk_label_set_width_chars(). +func (v *Label) SetWidthChars(nChars int) { + C.gtk_label_set_width_chars(v.native(), C.gint(nChars)) +} + +// GetMaxWidthChars is a wrapper around gtk_label_get_max_width_chars(). +func (v *Label) GetMaxWidthChars() int { + c := C.gtk_label_get_max_width_chars(v.native()) + return int(c) +} + +// SetMaxWidthChars is a wrapper around gtk_label_set_max_width_chars(). +func (v *Label) SetMaxWidthChars(nChars int) { + C.gtk_label_set_max_width_chars(v.native(), C.gint(nChars)) +} + +// GetLineWrap is a wrapper around gtk_label_get_line_wrap(). +func (v *Label) GetLineWrap() bool { + c := C.gtk_label_get_line_wrap(v.native()) + return gobool(c) +} + +// SetLineWrap is a wrapper around gtk_label_set_line_wrap(). +func (v *Label) SetLineWrap(wrap bool) { + C.gtk_label_set_line_wrap(v.native(), gbool(wrap)) +} + +// SetLineWrapMode is a wrapper around gtk_label_set_line_wrap_mode(). +func (v *Label) SetLineWrapMode(wrapMode pango.WrapMode) { + C.gtk_label_set_line_wrap_mode(v.native(), C.PangoWrapMode(wrapMode)) +} + +// TODO: +// gtk_label_get_line_wrap_mode(). +// gtk_label_get_layout_offsets(). +// gtk_label_get_layout(). +// gtk_label_get_mnemonic_widget(). + +// GetSelectable is a wrapper around gtk_label_get_selectable(). +func (v *Label) GetSelectable() bool { + c := C.gtk_label_get_selectable(v.native()) + return gobool(c) +} + +// GetText is a wrapper around gtk_label_get_text(). +func (v *Label) GetText() (string, error) { + c := C.gtk_label_get_text(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// GetJustify is a wrapper around gtk_label_get_justify(). +func (v *Label) GetJustify() Justification { + c := C.gtk_label_get_justify(v.native()) + return Justification(c) +} + +// GetEllipsize is a wrapper around gtk_label_get_ellipsize(). +func (v *Label) GetEllipsize() pango.EllipsizeMode { + c := C.gtk_label_get_ellipsize(v.native()) + return pango.EllipsizeMode(c) +} + +// GetCurrentUri is a wrapper around gtk_label_get_current_uri(). +func (v *Label) GetCurrentUri() string { + c := C.gtk_label_get_current_uri(v.native()) + return C.GoString((*C.char)(c)) +} + +// GetTrackVisitedLinks is a wrapper around gtk_label_get_track_visited_links(). +func (v *Label) GetTrackVisitedLinks() bool { + c := C.gtk_label_get_track_visited_links(v.native()) + return gobool(c) +} + +// SetTrackVisitedLinks is a wrapper around gtk_label_set_track_visited_links(). +func (v *Label) SetTrackVisitedLinks(trackLinks bool) { + C.gtk_label_set_track_visited_links(v.native(), gbool(trackLinks)) +} + +// GetAngle is a wrapper around gtk_label_get_angle(). +func (v *Label) GetAngle() float64 { + c := C.gtk_label_get_angle(v.native()) + return float64(c) +} + +// SetAngle is a wrapper around gtk_label_set_angle(). +func (v *Label) SetAngle(angle float64) { + C.gtk_label_set_angle(v.native(), C.gdouble(angle)) +} + +// GetSelectionBounds is a wrapper around gtk_label_get_selection_bounds(). +func (v *Label) GetSelectionBounds() (start, end int, nonEmpty bool) { + var cstart, cend C.gint + c := C.gtk_label_get_selection_bounds(v.native(), &cstart, &cend) + return int(cstart), int(cend), gobool(c) +} + +// GetSingleLineMode is a wrapper around gtk_label_get_single_line_mode(). +func (v *Label) GetSingleLineMode() bool { + c := C.gtk_label_get_single_line_mode(v.native()) + return gobool(c) +} + +// SetSingleLineMode is a wrapper around gtk_label_set_single_line_mode(). +func (v *Label) SetSingleLineMode(mode bool) { + C.gtk_label_set_single_line_mode(v.native(), gbool(mode)) +} + +// GetUseMarkup is a wrapper around gtk_label_get_use_markup(). +func (v *Label) GetUseMarkup() bool { + c := C.gtk_label_get_use_markup(v.native()) + return gobool(c) +} + +// SetUseMarkup is a wrapper around gtk_label_set_use_markup(). +func (v *Label) SetUseMarkup(use bool) { + C.gtk_label_set_use_markup(v.native(), gbool(use)) +} + +// GetUseUnderline is a wrapper around gtk_label_get_use_underline(). +func (v *Label) GetUseUnderline() bool { + c := C.gtk_label_get_use_underline(v.native()) + return gobool(c) +} + +// SetUseUnderline is a wrapper around gtk_label_set_use_underline(). +func (v *Label) SetUseUnderline(use bool) { + C.gtk_label_set_use_underline(v.native(), gbool(use)) +} + +// LabelNewWithMnemonic is a wrapper around gtk_label_new_with_mnemonic(). +func LabelNewWithMnemonic(str string) (*Label, error) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_label_new_with_mnemonic((*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapLabel(obj), nil +} + +// SelectRegion is a wrapper around gtk_label_select_region(). +func (v *Label) SelectRegion(startOffset, endOffset int) { + C.gtk_label_select_region(v.native(), C.gint(startOffset), + C.gint(endOffset)) +} + +// SetSelectable is a wrapper around gtk_label_set_selectable(). +func (v *Label) SetSelectable(setting bool) { + C.gtk_label_set_selectable(v.native(), gbool(setting)) +} + +// SetLabel is a wrapper around gtk_label_set_label(). +func (v *Label) SetLabel(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_label_set_label(v.native(), (*C.gchar)(cstr)) +} + +// GetLabel is a wrapper around gtk_label_get_label(). +func (v *Label) GetLabel() string { + c := C.gtk_label_get_label(v.native()) + if c == nil { + return "" + } + return C.GoString((*C.char)(c)) +} + +// GetMnemonicKeyval is a wrapper around gtk_label_get_mnemonic_keyval(). +func (v *Label) GetMnemonicKeyval() uint { + return uint(C.gtk_label_get_mnemonic_keyval(v.native())) +} + +// SetMnemonicWidget is a wrapper around gtk_label_set_mnemonic_widget(). +func (v *Label) SetMnemonicWidget(widget IWidget) { + C.gtk_label_set_mnemonic_widget(v.native(), widget.toWidget()) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/level_bar.go b/vendor/github.com/gotk3/gotk3/gtk/level_bar.go new file mode 100644 index 0000000..1e35bf9 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/level_bar.go @@ -0,0 +1,158 @@ +// Supports building with gtk 3.6+ + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_level_bar_mode_get_type()), marshalLevelBarMode}, + + {glib.Type(C.gtk_level_bar_get_type()), marshalLevelBar}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkLevelBar"] = wrapLevelBar +} + +// LevelBarMode is a representation of GTK's GtkLevelBarMode. +type LevelBarMode int + +const ( + LEVEL_BAR_MODE_CONTINUOUS LevelBarMode = C.GTK_LEVEL_BAR_MODE_CONTINUOUS + LEVEL_BAR_MODE_DISCRETE LevelBarMode = C.GTK_LEVEL_BAR_MODE_DISCRETE +) + +// stock offset macro values of GtkLevelBar +const ( + LEVEL_BAR_OFFSET_LOW string = C.GTK_LEVEL_BAR_OFFSET_LOW + LEVEL_BAR_OFFSET_HIGH string = C.GTK_LEVEL_BAR_OFFSET_HIGH +) + +func marshalLevelBarMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return LevelBarMode(c), nil +} + +/* + * GtkLevelBar + */ + +type LevelBar struct { + Widget +} + +// native returns a pointer to the underlying GtkLevelBar. +func (v *LevelBar) native() *C.GtkLevelBar { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkLevelBar(p) +} + +func marshalLevelBar(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapLevelBar(obj), nil +} + +func wrapLevelBar(obj *glib.Object) *LevelBar { + if obj == nil { + return nil + } + + return &LevelBar{Widget{glib.InitiallyUnowned{obj}}} +} + +// LevelBarNew is a wrapper around gtk_level_bar_new(). +func LevelBarNew() (*LevelBar, error) { + c := C.gtk_level_bar_new() + if c == nil { + return nil, nilPtrErr + } + return wrapLevelBar(glib.Take(unsafe.Pointer(c))), nil +} + +// LevelBarNewForInterval is a wrapper around gtk_level_bar_new_for_interval(). +func LevelBarNewForInterval(min_value, max_value float64) (*LevelBar, error) { + c := C.gtk_level_bar_new_for_interval(C.gdouble(min_value), C.gdouble(max_value)) + if c == nil { + return nil, nilPtrErr + } + return wrapLevelBar(glib.Take(unsafe.Pointer(c))), nil +} + +// SetMode is a wrapper around gtk_level_bar_set_mode(). +func (v *LevelBar) SetMode(m LevelBarMode) { + C.gtk_level_bar_set_mode(v.native(), C.GtkLevelBarMode(m)) +} + +// GetMode is a wrapper around gtk_level_bar_get_mode(). +func (v *LevelBar) GetMode() LevelBarMode { + return LevelBarMode(C.gtk_level_bar_get_mode(v.native())) +} + +// SetValue is a wrapper around gtk_level_bar_set_value(). +func (v *LevelBar) SetValue(value float64) { + C.gtk_level_bar_set_value(v.native(), C.gdouble(value)) +} + +// GetValue is a wrapper around gtk_level_bar_get_value(). +func (v *LevelBar) GetValue() float64 { + c := C.gtk_level_bar_get_value(v.native()) + return float64(c) +} + +// SetMinValue is a wrapper around gtk_level_bar_set_min_value(). +func (v *LevelBar) SetMinValue(value float64) { + C.gtk_level_bar_set_min_value(v.native(), C.gdouble(value)) +} + +// GetMinValue is a wrapper around gtk_level_bar_get_min_value(). +func (v *LevelBar) GetMinValue() float64 { + c := C.gtk_level_bar_get_min_value(v.native()) + return float64(c) +} + +// SetMaxValue is a wrapper around gtk_level_bar_set_max_value(). +func (v *LevelBar) SetMaxValue(value float64) { + C.gtk_level_bar_set_max_value(v.native(), C.gdouble(value)) +} + +// GetMaxValue is a wrapper around gtk_level_bar_get_max_value(). +func (v *LevelBar) GetMaxValue() float64 { + c := C.gtk_level_bar_get_max_value(v.native()) + return float64(c) +} + +// AddOffsetValue is a wrapper around gtk_level_bar_add_offset_value(). +func (v *LevelBar) AddOffsetValue(name string, value float64) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_level_bar_add_offset_value(v.native(), (*C.gchar)(cstr), C.gdouble(value)) +} + +// RemoveOffsetValue is a wrapper around gtk_level_bar_remove_offset_value(). +func (v *LevelBar) RemoveOffsetValue(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_level_bar_remove_offset_value(v.native(), (*C.gchar)(cstr)) +} + +// GetOffsetValue is a wrapper around gtk_level_bar_get_offset_value(). +func (v *LevelBar) GetOffsetValue(name string) (float64, bool) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var value C.gdouble + c := C.gtk_level_bar_get_offset_value(v.native(), (*C.gchar)(cstr), &value) + return float64(value), gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_20.go new file mode 100644 index 0000000..c70ff2d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_20.go @@ -0,0 +1,15 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18 + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +/* + * Constants + */ + +const ( + LEVEL_BAR_OFFSET_FULL string = C.GTK_LEVEL_BAR_OFFSET_FULL +) diff --git a/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go new file mode 100644 index 0000000..8df8f29 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/level_bar_since_3_8.go @@ -0,0 +1,18 @@ +// +build !gtk_3_6 + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +// SetInverted() is a wrapper around gtk_level_bar_set_inverted(). +func (v *LevelBar) SetInverted(inverted bool) { + C.gtk_level_bar_set_inverted(v.native(), gbool(inverted)) +} + +// GetInverted() is a wrapper around gtk_level_bar_get_inverted(). +func (v *LevelBar) GetInverted() bool { + c := C.gtk_level_bar_get_inverted(v.native()) + return gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/menu.go b/vendor/github.com/gotk3/gotk3/gtk/menu.go new file mode 100644 index 0000000..43d5e3e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/menu.go @@ -0,0 +1,172 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkMenu + */ + +// Menu is a representation of GTK's GtkMenu. +type Menu struct { + MenuShell +} + +// IMenu is an interface type implemented by all structs embedding +// a Menu. It is meant to be used as an argument type for wrapper +// functions that wrap around a C GTK function taking a +// GtkMenu. +type IMenu interface { + toMenu() *C.GtkMenu + toWidget() *C.GtkWidget +} + +// native() returns a pointer to the underlying GtkMenu. +func (v *Menu) native() *C.GtkMenu { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMenu(p) +} + +func (v *Menu) toMenu() *C.GtkMenu { + if v == nil { + return nil + } + return v.native() +} + +func marshalMenu(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenu(obj), nil +} + +func wrapMenu(obj *glib.Object) *Menu { + if obj == nil { + return nil + } + + return &Menu{MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// MenuNew() is a wrapper around gtk_menu_new(). +func MenuNew() (*Menu, error) { + c := C.gtk_menu_new() + if c == nil { + return nil, nilPtrErr + } + return wrapMenu(glib.Take(unsafe.Pointer(c))), nil +} + +// GtkMenuNewFromModel is a wrapper around gtk_menu_new_from_model(). +func GtkMenuNewFromModel(model *glib.MenuModel) (*Menu, error) { + c := C.gtk_menu_new_from_model(C.toGMenuModel(unsafe.Pointer(model.Native()))) + if c == nil { + return nil, nilPtrErr + } + return wrapMenu(glib.Take(unsafe.Pointer(c))), nil +} + +// SetScreen is a wrapper around gtk_menu_set_screen(). +func (v *Menu) SetScreen(screen *gdk.Screen) { + C.gtk_menu_set_screen(v.native(), (*C.GdkScreen)(unsafe.Pointer(screen.Native()))) +} + +// Attach is a wrapper around gtk_menu_attach(). +func (v *Menu) Attach(child IWidget, l, r, t, b uint) { + C.gtk_menu_attach( + v.native(), + child.toWidget(), + C.guint(l), + C.guint(r), + C.guint(t), + C.guint(b)) +} + +// SetMonitor() is a wrapper around gtk_menu_set_monitor(). +func (v *Menu) SetMonitor(monitor_num int) { + C.gtk_menu_set_monitor(v.native(), C.gint(monitor_num)) +} + +// GetMonitor() is a wrapper around gtk_menu_get_monitor(). +func (v *Menu) GetMonitor() int { + return int(C.gtk_menu_get_monitor(v.native())) +} + +// ReorderChild() is a wrapper around gtk_menu_reorder_child(). +func (v *Menu) ReorderChild(child IWidget, position int) { + C.gtk_menu_reorder_child(v.native(), child.toWidget(), C.gint(position)) +} + +// SetReserveToggleSize() is a wrapper around gtk_menu_set_reserve_toggle_size(). +func (v *Menu) SetReserveToggleSize(reserve bool) { + C.gtk_menu_set_reserve_toggle_size(v.native(), gbool(reserve)) +} + +// GetReserveToggleSize() is a wrapper around gtk_menu_get_reserve_toggle_size(). +func (v *Menu) GetReserveToggleSize() bool { + return gobool(C.gtk_menu_get_reserve_toggle_size(v.native())) +} + +// Popdown() is a wrapper around gtk_menu_popdown(). +func (v *Menu) Popdown() { + C.gtk_menu_popdown(v.native()) +} + +// TODO +/* +gtk_menu_reposition () require 'GtkMenuPositionFunc' (according to its position function.) +*/ + +// GetActive() is a wrapper around gtk_menu_get_active(). +func (v *Menu) GetActive() (*Menu, error) { + c := C.gtk_menu_get_active(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapMenu(glib.Take(unsafe.Pointer(c))), nil +} + +// SetActive() is a wrapper around gtk_menu_set_active(). +func (v *Menu) SetActive(index uint) { + C.gtk_menu_set_active(v.native(), C.guint(index)) +} + +// TODO +/* +void +gtk_menu_attach_to_widget (GtkMenu *menu, + GtkWidget *attach_widget, + GtkMenuDetachFunc detacher); + +void +gtk_menu_detach (GtkMenu *menu); +*/ + +// GetAttachWidget() is a wrapper around gtk_menu_get_attach_widget(). +func (v *Menu) GetAttachWidget() (IWidget, error) { + c := C.gtk_menu_get_attach_widget(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// TODO +/* +GList * +gtk_menu_get_for_attach_widget (GtkWidget *widget); +*/ diff --git a/vendor/github.com/gotk3/gotk3/gtk/menu_before_3_22.go b/vendor/github.com/gotk3/gotk3/gtk/menu_before_3_22.go new file mode 100644 index 0000000..5f138a0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/menu_before_3_22.go @@ -0,0 +1,19 @@ +// +build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_3_20 + +package gtk + +// #include +// #include +import "C" +import "github.com/gotk3/gotk3/gdk" + +// PopupAtPointer() is a wrapper for gtk_menu_popup_at_pointer(), on older versions it uses PopupAtMouseCursor +func (v *Menu) PopupAtPointer(_ *gdk.Event) { + C.gtk_menu_popup(v.native(), + nil, + nil, + nil, + nil, + C.guint(0), + C.gtk_get_current_event_time()) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/menu_shell.go b/vendor/github.com/gotk3/gotk3/gtk/menu_shell.go new file mode 100644 index 0000000..9595a09 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/menu_shell.go @@ -0,0 +1,157 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_menu_direction_type_get_type()), marshalMenuDirectionType}, + } + + glib.RegisterGValueMarshalers(tm) +} + +// MenuDirectionType is a representation of GTK's GtkMenuDirectionType. +type MenuDirectionType int + +const ( + MENU_DIR_PARENT MenuDirectionType = C.GTK_MENU_DIR_PARENT + MENU_DIR_CHILD MenuDirectionType = C.GTK_MENU_DIR_CHILD + MENU_DIR_NEXT MenuDirectionType = C.GTK_MENU_DIR_NEXT + MENU_DIR_PREV MenuDirectionType = C.GTK_MENU_DIR_PREV +) + +func marshalMenuDirectionType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return MenuDirectionType(c), nil +} + +/* + * GtkMenuShell + */ + +// MenuShell is a representation of GTK's GtkMenuShell. +type MenuShell struct { + Container +} + +// native returns a pointer to the underlying GtkMenuShell. +func (v *MenuShell) native() *C.GtkMenuShell { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkMenuShell(p) +} + +func marshalMenuShell(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenuShell(obj), nil +} + +func wrapMenuShell(obj *glib.Object) *MenuShell { + if obj == nil { + return nil + } + + return &MenuShell{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// Append is a wrapper around gtk_menu_shell_append(). +func (v *MenuShell) Append(child IMenuItem) { + C.gtk_menu_shell_append(v.native(), child.toWidget()) +} + +// Prepend is a wrapper around gtk_menu_shell_prepend(). +func (v *MenuShell) Prepend(child IMenuItem) { + C.gtk_menu_shell_prepend(v.native(), child.toWidget()) +} + +// Insert is a wrapper around gtk_menu_shell_insert(). +func (v *MenuShell) Insert(child IMenuItem, position int) { + C.gtk_menu_shell_insert(v.native(), child.toWidget(), C.gint(position)) +} + +// Deactivate is a wrapper around gtk_menu_shell_deactivate(). +func (v *MenuShell) Deactivate() { + C.gtk_menu_shell_deactivate(v.native()) +} + +// SelectItem is a wrapper around gtk_menu_shell_select_item(). +func (v *MenuShell) SelectItem(child IMenuItem) { + C.gtk_menu_shell_select_item(v.native(), child.toWidget()) +} + +// SelectFirst is a wrapper around gtk_menu_shell_select_first(). +func (v *MenuShell) SelectFirst(searchSensitive bool) { + C.gtk_menu_shell_select_first(v.native(), gbool(searchSensitive)) +} + +// Deselect is a wrapper around gtk_menu_shell_deselect(). +func (v *MenuShell) Deselect() { + C.gtk_menu_shell_deselect(v.native()) +} + +// ActivateItem is a wrapper around gtk_menu_shell_activate_item(). +func (v *MenuShell) ActivateItem(child IMenuItem, forceDeactivate bool) { + C.gtk_menu_shell_activate_item(v.native(), child.toWidget(), gbool(forceDeactivate)) +} + +// Cancel is a wrapper around gtk_menu_shell_cancel(). +func (v *MenuShell) Cancel() { + C.gtk_menu_shell_cancel(v.native()) +} + +// SetTakeFocus is a wrapper around gtk_menu_shell_set_take_focus(). +func (v *MenuShell) SetTakeFocus(takeFocus bool) { + C.gtk_menu_shell_set_take_focus(v.native(), gbool(takeFocus)) +} + +// GetTakeFocus is a wrapper around gtk_menu_shell_get_take_focus(). +func (v *MenuShell) GetTakeFocus() bool { + return gobool(C.gtk_menu_shell_get_take_focus(v.native())) +} + +// GetSelectedItem is a wrapper around gtk_menu_shell_get_selected_item(). +func (v *MenuShell) GetSelectedItem() (IMenuItem, error) { + c := C.gtk_menu_shell_get_selected_item(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenuItem(obj), nil +} + +// GetParentShell is a wrapper around gtk_menu_shell_get_parent_shell(). +func (v *MenuShell) GetParentShell() (*MenuShell, error) { + c := C.gtk_menu_shell_get_parent_shell(v.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapMenuShell(obj), nil +} + +// BindModel is a wrapper around gtk_menu_shell_bind_model(). +func (v *MenuShell) BindModel(model *glib.MenuModel, + action_namespace string, with_separators bool) { + + cstr := C.CString(action_namespace) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_menu_shell_bind_model( + v.native(), + (*C.GMenuModel)(unsafe.Pointer(model.Native())), + cstr, + gbool(with_separators)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/menu_since_3_22.go b/vendor/github.com/gotk3/gotk3/gtk/menu_since_3_22.go new file mode 100644 index 0000000..5ac626c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/menu_since_3_22.go @@ -0,0 +1,45 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18,!gtk_3_20 + +package gtk + +// #include +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" +) + +// PopupAtRect is a wrapper around gtk_menu_popup_at_rect(). +func (v *Menu) PopupAtRect(rect_window *gdk.Window, + rect *gdk.Rectangle, rect_anchor, menu_anchor gdk.Gravity, + trigger_event *gdk.Event) { + + C.gtk_menu_popup_at_rect( + v.native(), + (*C.GdkWindow)(unsafe.Pointer(rect_window.Native())), + (*C.GdkRectangle)(unsafe.Pointer(&rect.GdkRectangle)), + C.GdkGravity(rect_anchor), + C.GdkGravity(menu_anchor), + (*C.GdkEvent)(unsafe.Pointer(trigger_event.Native()))) +} + +// PopupAtWidget() is a wrapper for gtk_menu_popup_at_widget() +func (v *Menu) PopupAtWidget(widget IWidget, widgetAnchor gdk.Gravity, menuAnchor gdk.Gravity, triggerEvent *gdk.Event) { + e := (*C.GdkEvent)(unsafe.Pointer(triggerEvent.Native())) + C.gtk_menu_popup_at_widget(v.native(), widget.toWidget(), C.GdkGravity(widgetAnchor), C.GdkGravity(menuAnchor), e) +} + +// PopupAtPointer() is a wrapper for gtk_menu_popup_at_pointer(), on older versions it uses PopupAtMouseCursor +func (v *Menu) PopupAtPointer(triggerEvent *gdk.Event) { + e := (*C.GdkEvent)(unsafe.Pointer(triggerEvent.Native())) + C.gtk_menu_popup_at_pointer(v.native(), e) +} + +// PlaceOnMonitor() is a wrapper around gtk_menu_place_on_monitor(). +func (v *Menu) PlaceOnMonitor(monitor *gdk.Monitor) { + C.gtk_menu_place_on_monitor( + v.native(), + (*C.GdkMonitor)(unsafe.Pointer(monitor.Native()))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/print.go b/vendor/github.com/gotk3/gotk3/gtk/print.go new file mode 100644 index 0000000..e65d04c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/print.go @@ -0,0 +1,1596 @@ +package gtk + +// #include +// #include "gtk.go.h" +// #include "print.go.h" +import "C" +import ( + "errors" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" + "github.com/gotk3/gotk3/pango" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gtk_page_orientation_get_type()), marshalPageOrientation}, + {glib.Type(C.gtk_print_error_get_type()), marshalPrintError}, + {glib.Type(C.gtk_print_operation_action_get_type()), marshalPrintOperationAction}, + {glib.Type(C.gtk_print_operation_result_get_type()), marshalPrintOperationResult}, + {glib.Type(C.gtk_print_status_get_type()), marshalPrintStatus}, + {glib.Type(C.gtk_unit_get_type()), marshalUnit}, + + // Objects/Interfaces + {glib.Type(C.gtk_number_up_layout_get_type()), marshalNumberUpLayout}, + {glib.Type(C.gtk_page_orientation_get_type()), marshalPageOrientation}, + {glib.Type(C.gtk_page_set_get_type()), marshalPageSet}, + {glib.Type(C.gtk_page_setup_get_type()), marshalPageSetup}, + {glib.Type(C.gtk_print_context_get_type()), marshalPrintContext}, + {glib.Type(C.gtk_print_duplex_get_type()), marshalPrintDuplex}, + {glib.Type(C.gtk_print_operation_get_type()), marshalPrintOperation}, + {glib.Type(C.gtk_print_operation_preview_get_type()), marshalPrintOperationPreview}, + {glib.Type(C.gtk_print_pages_get_type()), marshalPrintPages}, + {glib.Type(C.gtk_print_quality_get_type()), marshalPrintQuality}, + {glib.Type(C.gtk_print_settings_get_type()), marshalPrintSettings}, + + // Boxed + {glib.Type(C.gtk_paper_size_get_type()), marshalPaperSize}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkPageSetup"] = wrapPageSetup + WrapMap["GtkPrintContext"] = wrapPrintContext + WrapMap["GtkPrintOperation"] = wrapPrintOperation + WrapMap["GtkPrintOperationPreview"] = wrapPrintOperationPreview + WrapMap["GtkPrintSettings"] = wrapPrintSettings +} + +/* + * Constants + */ + +// NumberUpLayout is a representation of GTK's GtkNumberUpLayout. +type NumberUpLayout int + +const ( + NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM + NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP + NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM + NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP + NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT + NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT + NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT + NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT NumberUpLayout = C.GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT +) + +func marshalNumberUpLayout(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return NumberUpLayout(c), nil +} + +// PageOrientation is a representation of GTK's GtkPageOrientation. +type PageOrientation int + +const ( + PAGE_ORIENTATION_PORTRAIT PageOrientation = C.GTK_PAGE_ORIENTATION_PORTRAIT + PAGE_ORIENTATION_LANDSCAPE PageOrientation = C.GTK_PAGE_ORIENTATION_LANDSCAPE + PAGE_ORIENTATION_REVERSE_PORTRAIT PageOrientation = C.GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT + PAGE_ORIENTATION_REVERSE_LANDSCAPE PageOrientation = C.GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE +) + +func marshalPageOrientation(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PageOrientation(c), nil +} + +// PrintDuplex is a representation of GTK's GtkPrintDuplex. +type PrintDuplex int + +const ( + PRINT_DUPLEX_SIMPLEX PrintDuplex = C.GTK_PRINT_DUPLEX_SIMPLEX + PRINT_DUPLEX_HORIZONTAL PrintDuplex = C.GTK_PRINT_DUPLEX_HORIZONTAL + PRINT_DUPLEX_VERTICAL PrintDuplex = C.GTK_PRINT_DUPLEX_VERTICAL +) + +func marshalPrintDuplex(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintDuplex(c), nil +} + +// PrintPages is a representation of GTK's GtkPrintPages. +type PrintPages int + +const ( + PRINT_PAGES_ALL PrintPages = C.GTK_PRINT_PAGES_ALL + PRINT_PAGES_CURRENT PrintPages = C.GTK_PRINT_PAGES_CURRENT + PRINT_PAGES_RANGES PrintPages = C.GTK_PRINT_PAGES_RANGES + PRINT_PAGES_SELECTION PrintPages = C.GTK_PRINT_PAGES_SELECTION +) + +func marshalPrintPages(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintPages(c), nil +} + +// PageSet is a representation of GTK's GtkPageSet. +type PageSet int + +const ( + PAGE_SET_ALL PageSet = C.GTK_PAGE_SET_ALL + PAGE_SET_EVEN PageSet = C.GTK_PAGE_SET_EVEN + PAGE_SET_ODD PageSet = C.GTK_PAGE_SET_ODD +) + +func marshalPageSet(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PageSet(c), nil +} + +// PrintOperationAction is a representation of GTK's GtkPrintError. +type PrintError int + +const ( + PRINT_ERROR_GENERAL PrintError = C.GTK_PRINT_ERROR_GENERAL + PRINT_ERROR_INTERNAL_ERROR PrintError = C.GTK_PRINT_ERROR_INTERNAL_ERROR + PRINT_ERROR_NOMEM PrintError = C.GTK_PRINT_ERROR_NOMEM + PRINT_ERROR_INVALID_FILE PrintError = C.GTK_PRINT_ERROR_INVALID_FILE +) + +func marshalPrintError(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintError(c), nil +} + +// PrintOperationAction is a representation of GTK's GtkPrintOperationAction. +type PrintOperationAction int + +const ( + PRINT_OPERATION_ACTION_PRINT_DIALOG PrintOperationAction = C.GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG + PRINT_OPERATION_ACTION_PRINT PrintOperationAction = C.GTK_PRINT_OPERATION_ACTION_PRINT + PRINT_OPERATION_ACTION_PREVIEW PrintOperationAction = C.GTK_PRINT_OPERATION_ACTION_PREVIEW + PRINT_OPERATION_ACTION_EXPORT PrintOperationAction = C.GTK_PRINT_OPERATION_ACTION_EXPORT +) + +func marshalPrintOperationAction(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintOperationAction(c), nil +} + +// PrintOperationResult is a representation of GTK's GtkPrintOperationResult. +type PrintOperationResult int + +const ( + PRINT_OPERATION_RESULT_ERROR PrintOperationResult = C.GTK_PRINT_OPERATION_RESULT_ERROR + PRINT_OPERATION_RESULT_APPLY PrintOperationResult = C.GTK_PRINT_OPERATION_RESULT_APPLY + PRINT_OPERATION_RESULT_CANCEL PrintOperationResult = C.GTK_PRINT_OPERATION_RESULT_CANCEL + PRINT_OPERATION_RESULT_IN_PROGRESS PrintOperationResult = C.GTK_PRINT_OPERATION_RESULT_IN_PROGRESS +) + +func marshalPrintOperationResult(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintOperationResult(c), nil +} + +// PrintStatus is a representation of GTK's GtkPrintStatus. +type PrintStatus int + +const ( + PRINT_STATUS_INITIAL PrintStatus = C.GTK_PRINT_STATUS_INITIAL + PRINT_STATUS_PREPARING PrintStatus = C.GTK_PRINT_STATUS_PREPARING + PRINT_STATUS_GENERATING_DATA PrintStatus = C.GTK_PRINT_STATUS_GENERATING_DATA + PRINT_STATUS_SENDING_DATA PrintStatus = C.GTK_PRINT_STATUS_SENDING_DATA + PRINT_STATUS_PENDING PrintStatus = C.GTK_PRINT_STATUS_PENDING + PRINT_STATUS_PENDING_ISSUE PrintStatus = C.GTK_PRINT_STATUS_PENDING_ISSUE + PRINT_STATUS_PRINTING PrintStatus = C.GTK_PRINT_STATUS_PRINTING + PRINT_STATUS_FINISHED PrintStatus = C.GTK_PRINT_STATUS_FINISHED + PRINT_STATUS_FINISHED_ABORTED PrintStatus = C.GTK_PRINT_STATUS_FINISHED_ABORTED +) + +func marshalPrintStatus(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintStatus(c), nil +} + +// PrintQuality is a representation of GTK's GtkPrintQuality. +type PrintQuality int + +const ( + PRINT_QUALITY_LOW PrintQuality = C.GTK_PRINT_QUALITY_LOW + PRINT_QUALITY_NORMAL PrintQuality = C.GTK_PRINT_QUALITY_NORMAL + PRINT_QUALITY_HIGH PrintQuality = C.GTK_PRINT_QUALITY_HIGH + PRINT_QUALITY_DRAFT PrintQuality = C.GTK_PRINT_QUALITY_DRAFT +) + +func marshalPrintQuality(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return PrintQuality(c), nil +} + +// Unit is a representation of GTK's GtkUnit. +type Unit int + +const ( + GTK_UNIT_NONE Unit = C.GTK_UNIT_NONE + GTK_UNIT_POINTS Unit = C.GTK_UNIT_POINTS + GTK_UNIT_INCH Unit = C.GTK_UNIT_INCH + GTK_UNIT_MM Unit = C.GTK_UNIT_MM +) + +func marshalUnit(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Unit(c), nil +} + +/* + * GtkPageSetup + */ +type PageSetup struct { + *glib.Object +} + +func (ps *PageSetup) native() *C.GtkPageSetup { + if ps == nil || ps.GObject == nil { + return nil + } + p := unsafe.Pointer(ps.GObject) + return C.toGtkPageSetup(p) +} + +func marshalPageSetup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPageSetup(obj), nil +} + +func wrapPageSetup(obj *glib.Object) *PageSetup { + if obj == nil { + return nil + } + + return &PageSetup{obj} +} + +// PageSetupNew() is a wrapper around gtk_page_setup_new(). +func PageSetupNew() (*PageSetup, error) { + c := C.gtk_page_setup_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPageSetup(obj), nil +} + +// Copy() is a wrapper around gtk_page_setup_copy(). +func (ps *PageSetup) Copy() (*PageSetup, error) { + c := C.gtk_page_setup_copy(ps.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPageSetup(obj), nil +} + +// GetOrientation() is a wrapper around gtk_page_setup_get_orientation(). +func (ps *PageSetup) GetOrientation() PageOrientation { + c := C.gtk_page_setup_get_orientation(ps.native()) + return PageOrientation(c) +} + +// SetOrientation() is a wrapper around gtk_page_setup_set_orientation(). +func (ps *PageSetup) SetOrientation(orientation PageOrientation) { + C.gtk_page_setup_set_orientation(ps.native(), C.GtkPageOrientation(orientation)) +} + +// GetPaperSize() is a wrapper around gtk_page_setup_get_paper_size(). +func (ps *PageSetup) GetPaperSize() *PaperSize { + c := C.gtk_page_setup_get_paper_size(ps.native()) + p := &PaperSize{c} + runtime.SetFinalizer(p, (*PaperSize).free) + return p +} + +// SetPaperSize() is a wrapper around gtk_page_setup_set_paper_size(). +func (ps *PageSetup) SetPaperSize(size *PaperSize) { + C.gtk_page_setup_set_paper_size(ps.native(), size.native()) +} + +// GetTopMargin() is a wrapper around gtk_page_setup_get_top_margin(). +func (ps *PageSetup) GetTopMargin(unit Unit) float64 { + c := C.gtk_page_setup_get_top_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// SetTopMargin() is a wrapper around gtk_page_setup_set_top_margin(). +func (ps *PageSetup) SetTopMargin(margin float64, unit Unit) { + C.gtk_page_setup_set_top_margin(ps.native(), C.gdouble(margin), C.GtkUnit(unit)) +} + +// GetBottomMargin() is a wrapper around gtk_page_setup_get_bottom_margin(). +func (ps *PageSetup) GetBottomMargin(unit Unit) float64 { + c := C.gtk_page_setup_get_bottom_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// SetBottomMargin() is a wrapper around gtk_page_setup_set_bottom_margin(). +func (ps *PageSetup) SetBottomMargin(margin float64, unit Unit) { + C.gtk_page_setup_set_bottom_margin(ps.native(), C.gdouble(margin), C.GtkUnit(unit)) +} + +// GetLeftMargin() is a wrapper around gtk_page_setup_get_left_margin(). +func (ps *PageSetup) GetLeftMargin(unit Unit) float64 { + c := C.gtk_page_setup_get_left_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// SetLeftMargin() is a wrapper around gtk_page_setup_set_left_margin(). +func (ps *PageSetup) SetLeftMargin(margin float64, unit Unit) { + C.gtk_page_setup_set_left_margin(ps.native(), C.gdouble(margin), C.GtkUnit(unit)) +} + +// GetRightMargin() is a wrapper around gtk_page_setup_get_right_margin(). +func (ps *PageSetup) GetRightMargin(unit Unit) float64 { + c := C.gtk_page_setup_get_right_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// SetRightMargin() is a wrapper around gtk_page_setup_set_right_margin(). +func (ps *PageSetup) SetRightMargin(margin float64, unit Unit) { + C.gtk_page_setup_set_right_margin(ps.native(), C.gdouble(margin), C.GtkUnit(unit)) +} + +// SetPaperSizeAndDefaultMargins() is a wrapper around gtk_page_setup_set_paper_size_and_default_margins(). +func (ps *PageSetup) SetPaperSizeAndDefaultMargins(size *PaperSize) { + C.gtk_page_setup_set_paper_size_and_default_margins(ps.native(), size.native()) +} + +// GetPaperWidth() is a wrapper around gtk_page_setup_get_paper_width(). +func (ps *PageSetup) GetPaperWidth(unit Unit) float64 { + c := C.gtk_page_setup_get_paper_width(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetPaperHeight() is a wrapper around gtk_page_setup_get_paper_height(). +func (ps *PageSetup) GetPaperHeight(unit Unit) float64 { + c := C.gtk_page_setup_get_paper_height(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetPageWidth() is a wrapper around gtk_page_setup_get_page_width(). +func (ps *PageSetup) GetPageWidth(unit Unit) float64 { + c := C.gtk_page_setup_get_page_width(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetPageHeight() is a wrapper around gtk_page_setup_get_page_height(). +func (ps *PageSetup) GetPageHeight(unit Unit) float64 { + c := C.gtk_page_setup_get_page_height(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// PageSetupNewFromFile() is a wrapper around gtk_page_setup_new_from_file(). +func PageSetupNewFromFile(fileName string) (*PageSetup, error) { + cstr := C.CString(fileName) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + c := C.gtk_page_setup_new_from_file((*C.gchar)(cstr), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + obj := glib.Take(unsafe.Pointer(c)) + return &PageSetup{obj}, nil + +} + +// PageSetupNewFromKeyFile() is a wrapper around gtk_page_setup_new_from_key_file(). + +// PageSetupLoadFile() is a wrapper around gtk_page_setup_load_file(). +func (ps *PageSetup) PageSetupLoadFile(name string) error { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + res := C.gtk_page_setup_load_file(ps.native(), cstr, &err) + if !gobool(res) { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// PageSetupLoadKeyFile() is a wrapper around gtk_page_setup_load_key_file(). + +// PageSetupToFile() is a wrapper around gtk_page_setup_to_file(). +func (ps *PageSetup) PageSetupToFile(name string) error { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + res := C.gtk_page_setup_to_file(ps.native(), cstr, &err) + if !gobool(res) { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// PageSetupToKeyFile() is a wrapper around gtk_page_setup_to_key_file(). + +/* + * GtkPaperSize + */ + +// PaperSize is a representation of GTK's GtkPaperSize +type PaperSize struct { + GtkPaperSize *C.GtkPaperSize +} + +// native returns a pointer to the underlying GtkPaperSize. +func (ps *PaperSize) native() *C.GtkPaperSize { + if ps == nil { + return nil + } + return ps.GtkPaperSize +} + +func marshalPaperSize(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return &PaperSize{(*C.GtkPaperSize)(unsafe.Pointer(c))}, nil +} + +const ( + UNIT_PIXEL int = C.GTK_UNIT_PIXEL + PAPER_NAME_A3 string = C.GTK_PAPER_NAME_A3 + PAPER_NAME_A4 string = C.GTK_PAPER_NAME_A4 + PAPER_NAME_A5 string = C.GTK_PAPER_NAME_A5 + PAPER_NAME_B5 string = C.GTK_PAPER_NAME_B5 + PAPER_NAME_LETTER string = C.GTK_PAPER_NAME_LETTER + PAPER_NAME_EXECUTIVE string = C.GTK_PAPER_NAME_EXECUTIVE + PAPER_NAME_LEGAL string = C.GTK_PAPER_NAME_LEGAL +) + +// PaperSizeNew() is a wrapper around gtk_paper_size_new(). +func PaperSizeNew(name string) (*PaperSize, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var gName *C.gchar + + if name == "" { + gName = nil + } else { + gName = (*C.gchar)(cstr) + } + + c := C.gtk_paper_size_new(gName) + if c == nil { + return nil, nilPtrErr + } + + t := &PaperSize{c} + runtime.SetFinalizer(t, (*PaperSize).free) + return t, nil +} + +// PaperSizeNewFromPPD() is a wrapper around gtk_paper_size_new_from_ppd(). +func PaperSizeNewFromPPD(name, displayName string, width, height float64) (*PaperSize, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + cDisplayName := C.CString(displayName) + defer C.free(unsafe.Pointer(cDisplayName)) + c := C.gtk_paper_size_new_from_ppd((*C.gchar)(cName), (*C.gchar)(cDisplayName), + C.gdouble(width), C.gdouble(height)) + if c == nil { + return nil, nilPtrErr + } + t := &PaperSize{c} + runtime.SetFinalizer(t, (*PaperSize).free) + return t, nil +} + +// PaperSizeNewCustom() is a wrapper around gtk_paper_size_new_custom(). +func PaperSizeNewCustom(name, displayName string, width, height float64, unit Unit) (*PaperSize, error) { + cName := C.CString(name) + defer C.free(unsafe.Pointer(cName)) + cDisplayName := C.CString(displayName) + defer C.free(unsafe.Pointer(cDisplayName)) + c := C.gtk_paper_size_new_custom((*C.gchar)(cName), (*C.gchar)(cDisplayName), + C.gdouble(width), C.gdouble(height), C.GtkUnit(unit)) + if c == nil { + return nil, nilPtrErr + } + t := &PaperSize{c} + runtime.SetFinalizer(t, (*PaperSize).free) + return t, nil +} + +// Copy() is a wrapper around gtk_paper_size_copy(). +func (ps *PaperSize) Copy() (*PaperSize, error) { + c := C.gtk_paper_size_copy(ps.native()) + if c == nil { + return nil, nilPtrErr + } + t := &PaperSize{c} + runtime.SetFinalizer(t, (*PaperSize).free) + return t, nil +} + +// free() is a wrapper around gtk_paper_size_free(). +func (ps *PaperSize) free() { + C.gtk_paper_size_free(ps.native()) +} + +// IsEqual() is a wrapper around gtk_paper_size_is_equal(). +func (ps *PaperSize) IsEqual(other *PaperSize) bool { + c := C.gtk_paper_size_is_equal(ps.native(), other.native()) + return gobool(c) +} + +// PaperSizeGetPaperSizes() is a wrapper around gtk_paper_size_get_paper_sizes(). +func PaperSizeGetPaperSizes(includeCustom bool) *glib.List { + clist := C.gtk_paper_size_get_paper_sizes(gbool(includeCustom)) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return &PaperSize{(*C.GtkPaperSize)(ptr)} + }) + + runtime.SetFinalizer(glist, func(glist *glib.List) { + glist.FreeFull(func(item interface{}) { + ps := item.(*PaperSize) + C.gtk_paper_size_free(ps.GtkPaperSize) + }) + }) + + return glist +} + +// GetName() is a wrapper around gtk_paper_size_get_name(). +func (ps *PaperSize) GetName() string { + c := C.gtk_paper_size_get_name(ps.native()) + return C.GoString((*C.char)(c)) +} + +// GetDisplayName() is a wrapper around gtk_paper_size_get_display_name(). +func (ps *PaperSize) GetDisplayName() string { + c := C.gtk_paper_size_get_display_name(ps.native()) + return C.GoString((*C.char)(c)) +} + +// GetPPDName() is a wrapper around gtk_paper_size_get_ppd_name(). +func (ps *PaperSize) GetPPDName() (string, error) { + c := C.gtk_paper_size_get_ppd_name(ps.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// GetWidth() is a wrapper around gtk_paper_size_get_width(). +func (ps *PaperSize) GetWidth(unit Unit) float64 { + c := C.gtk_paper_size_get_width(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetHeight() is a wrapper around gtk_paper_size_get_height(). +func (ps *PaperSize) GetHeight(unit Unit) float64 { + c := C.gtk_paper_size_get_width(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// IsCustom() is a wrapper around gtk_paper_size_is_custom(). +func (ps *PaperSize) IsCustom() bool { + c := C.gtk_paper_size_is_custom(ps.native()) + return gobool(c) +} + +// SetSize() is a wrapper around gtk_paper_size_set_size(). +func (ps *PaperSize) SetSize(width, height float64, unit Unit) { + C.gtk_paper_size_set_size(ps.native(), C.gdouble(width), C.gdouble(height), C.GtkUnit(unit)) +} + +// GetDefaultTopMargin() is a wrapper around gtk_paper_size_get_default_top_margin(). +func (ps *PaperSize) GetDefaultTopMargin(unit Unit) float64 { + c := C.gtk_paper_size_get_default_top_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetDefaultBottomMargin() is a wrapper around gtk_paper_size_get_default_bottom_margin(). +func (ps *PaperSize) GetDefaultBottomMargin(unit Unit) float64 { + c := C.gtk_paper_size_get_default_bottom_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetDefaultLeftMargin() is a wrapper around gtk_paper_size_get_default_left_margin(). +func (ps *PaperSize) GetDefaultLeftMargin(unit Unit) float64 { + c := C.gtk_paper_size_get_default_left_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// GetDefaultRightMargin() is a wrapper around gtk_paper_size_get_default_right_margin(). +func (ps *PaperSize) GetDefaultRightMargin(unit Unit) float64 { + c := C.gtk_paper_size_get_default_right_margin(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// PaperSizeGetDefault() is a wrapper around gtk_paper_size_get_default(). +func PaperSizeGetDefaultRightMargin(unit Unit) string { + c := C.gtk_paper_size_get_default() + return C.GoString((*C.char)(c)) +} + +// PaperSizeNewFromKeyFile() is a wrapper around gtk_paper_size_new_from_key_file(). +// PaperSizeToKeyFile() is a wrapper around gtk_paper_size_to_key_file(). + +/* + * GtkPrintContext + */ + +// PrintContext is a representation of GTK's GtkPrintContext. +type PrintContext struct { + *glib.Object +} + +// native() returns a pointer to the underlying GtkPrintContext. +func (pc *PrintContext) native() *C.GtkPrintContext { + if pc == nil || pc.GObject == nil { + return nil + } + p := unsafe.Pointer(pc.GObject) + return C.toGtkPrintContext(p) +} + +func marshalPrintContext(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintContext(obj), nil +} + +func wrapPrintContext(obj *glib.Object) *PrintContext { + if obj == nil { + return nil + } + + return &PrintContext{obj} +} + +// GetCairoContext() is a wrapper around gtk_print_context_get_cairo_context(). +func (pc *PrintContext) GetCairoContext() *cairo.Context { + c := C.gtk_print_context_get_cairo_context(pc.native()) + return cairo.WrapContext(uintptr(unsafe.Pointer(c))) +} + +// SetCairoContext() is a wrapper around gtk_print_context_set_cairo_context(). +func (pc *PrintContext) SetCairoContext(cr *cairo.Context, dpiX, dpiY float64) { + C.gtk_print_context_set_cairo_context(pc.native(), + (*C.cairo_t)(unsafe.Pointer(cr.Native())), + C.double(dpiX), C.double(dpiY)) +} + +// GetPageSetup() is a wrapper around gtk_print_context_get_page_setup(). +func (pc *PrintContext) GetPageSetup() *PageSetup { + c := C.gtk_print_context_get_page_setup(pc.native()) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPageSetup(obj) +} + +// GetWidth() is a wrapper around gtk_print_context_get_width(). +func (pc *PrintContext) GetWidth() float64 { + c := C.gtk_print_context_get_width(pc.native()) + return float64(c) +} + +// GetHeight() is a wrapper around gtk_print_context_get_height(). +func (pc *PrintContext) GetHeight() float64 { + c := C.gtk_print_context_get_height(pc.native()) + return float64(c) +} + +// GetDpiX() is a wrapper around gtk_print_context_get_dpi_x(). +func (pc *PrintContext) GetDpiX() float64 { + c := C.gtk_print_context_get_dpi_x(pc.native()) + return float64(c) +} + +// GetDpiY() is a wrapper around gtk_print_context_get_dpi_y(). +func (pc *PrintContext) GetDpiY() float64 { + c := C.gtk_print_context_get_dpi_y(pc.native()) + return float64(c) +} + +// GetPangoFontMap() is a wrapper around gtk_print_context_get_pango_fontmap(). +func (pc *PrintContext) GetPangoFontMap() *pango.FontMap { + c := C.gtk_print_context_get_pango_fontmap(pc.native()) + return pango.WrapFontMap(uintptr(unsafe.Pointer(c))) +} + +// CreatePangoContext() is a wrapper around gtk_print_context_create_pango_context(). +func (pc *PrintContext) CreatePangoContext() *pango.Context { + c := C.gtk_print_context_create_pango_context(pc.native()) + return pango.WrapContext(uintptr(unsafe.Pointer(c))) +} + +// CreatePangoLayout() is a wrapper around gtk_print_context_create_pango_layout(). +func (pc *PrintContext) CreatePangoLayout() *pango.Layout { + c := C.gtk_print_context_create_pango_layout(pc.native()) + return pango.WrapLayout(uintptr(unsafe.Pointer(c))) +} + +// GetHardMargins() is a wrapper around gtk_print_context_get_hard_margins(). +func (pc *PrintContext) GetHardMargins() (float64, float64, float64, float64, error) { + var top, bottom, left, right C.gdouble + c := C.gtk_print_context_get_hard_margins(pc.native(), &top, &bottom, &left, &right) + if gobool(c) == false { + return 0.0, 0.0, 0.0, 0.0, errors.New("unable to retrieve hard margins") + } + return float64(top), float64(bottom), float64(left), float64(right), nil +} + +/* + * GtkPrintOperation + */ +type PrintOperation struct { + *glib.Object + + // Interfaces + PrintOperationPreview +} + +func (po *PrintOperation) native() *C.GtkPrintOperation { + if po == nil || po.GObject == nil { + return nil + } + p := unsafe.Pointer(po.GObject) + return C.toGtkPrintOperation(p) +} + +func (v *PrintOperation) toPrintOperationPreview() *C.GtkPrintOperationPreview { + if v == nil { + return nil + } + return C.toGtkPrintOperationPreview(unsafe.Pointer(v.GObject)) +} + +func marshalPrintOperation(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintOperation(obj), nil +} + +func wrapPrintOperation(obj *glib.Object) *PrintOperation { + if obj == nil { + return nil + } + + pop := wrapPrintOperationPreview(obj) + return &PrintOperation{obj, *pop} +} + +// PrintOperationNew() is a wrapper around gtk_print_operation_new(). +func PrintOperationNew() (*PrintOperation, error) { + c := C.gtk_print_operation_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintOperation(obj), nil +} + +// SetAllowAsync() is a wrapper around gtk_print_operation_set_allow_async(). +func (po *PrintOperation) PrintOperationSetAllowAsync(allowSync bool) { + C.gtk_print_operation_set_allow_async(po.native(), gbool(allowSync)) +} + +// GetError() is a wrapper around gtk_print_operation_get_error(). +func (po *PrintOperation) PrintOperationGetError() error { + var err *C.GError = nil + C.gtk_print_operation_get_error(po.native(), &err) + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) +} + +// SetDefaultPageSetup() is a wrapper around gtk_print_operation_set_default_page_setup(). +func (po *PrintOperation) SetDefaultPageSetup(ps *PageSetup) { + C.gtk_print_operation_set_default_page_setup(po.native(), ps.native()) +} + +// GetDefaultPageSetup() is a wrapper around gtk_print_operation_get_default_page_setup(). +func (po *PrintOperation) GetDefaultPageSetup() (*PageSetup, error) { + c := C.gtk_print_operation_get_default_page_setup(po.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPageSetup(obj), nil +} + +// SetPrintSettings() is a wrapper around gtk_print_operation_set_print_settings(). +func (po *PrintOperation) SetPrintSettings(ps *PrintSettings) { + C.gtk_print_operation_set_print_settings(po.native(), ps.native()) +} + +// GetPrintSettings() is a wrapper around gtk_print_operation_get_print_settings(). +func (po *PrintOperation) GetPrintSettings(ps *PageSetup) (*PrintSettings, error) { + c := C.gtk_print_operation_get_print_settings(po.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintSettings(obj), nil +} + +// SetJobName() is a wrapper around gtk_print_operation_set_job_name(). +func (po *PrintOperation) SetJobName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_operation_set_job_name(po.native(), (*C.gchar)(cstr)) +} + +// SetNPages() is a wrapper around gtk_print_operation_set_n_pages(). +func (po *PrintOperation) SetNPages(pages int) { + C.gtk_print_operation_set_n_pages(po.native(), C.gint(pages)) +} + +// GetNPagesToPrint() is a wrapper around gtk_print_operation_get_n_pages_to_print(). +func (po *PrintOperation) GetNPagesToPrint() int { + c := C.gtk_print_operation_get_n_pages_to_print(po.native()) + return int(c) +} + +// SetCurrentPage() is a wrapper around gtk_print_operation_set_current_page(). +func (po *PrintOperation) SetCurrentPage(page int) { + C.gtk_print_operation_set_current_page(po.native(), C.gint(page)) +} + +// SetUseFullPage() is a wrapper around gtk_print_operation_set_use_full_page(). +func (po *PrintOperation) SetUseFullPage(full bool) { + C.gtk_print_operation_set_use_full_page(po.native(), gbool(full)) +} + +// SetUnit() is a wrapper around gtk_print_operation_set_unit(). +func (po *PrintOperation) SetUnit(unit Unit) { + C.gtk_print_operation_set_unit(po.native(), C.GtkUnit(unit)) +} + +// SetExportFilename() is a wrapper around gtk_print_operation_set_export_filename(). +func (po *PrintOperation) SetExportFilename(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_operation_set_export_filename(po.native(), (*C.gchar)(cstr)) +} + +// SetShowProgress() is a wrapper around gtk_print_operation_set_show_progress(). +func (po *PrintOperation) SetShowProgress(show bool) { + C.gtk_print_operation_set_show_progress(po.native(), gbool(show)) +} + +// SetTrackPrintStatus() is a wrapper around gtk_print_operation_set_track_print_status(). +func (po *PrintOperation) SetTrackPrintStatus(progress bool) { + C.gtk_print_operation_set_track_print_status(po.native(), gbool(progress)) +} + +// SetCustomTabLabel() is a wrapper around gtk_print_operation_set_custom_tab_label(). +func (po *PrintOperation) SetCustomTabLabel(label string) { + cstr := C.CString(label) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_operation_set_custom_tab_label(po.native(), (*C.gchar)(cstr)) +} + +// Run() is a wrapper around gtk_print_operation_run(). +func (po *PrintOperation) Run(action PrintOperationAction, parent IWindow) (PrintOperationResult, error) { + var err *C.GError = nil + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + c := C.gtk_print_operation_run(po.native(), C.GtkPrintOperationAction(action), w, &err) + res := PrintOperationResult(c) + if res == PRINT_OPERATION_RESULT_ERROR { + defer C.g_error_free(err) + return res, errors.New(C.GoString((*C.char)(err.message))) + } + return res, nil +} + +// Cancel() is a wrapper around gtk_print_operation_cancel(). +func (po *PrintOperation) Cancel() { + C.gtk_print_operation_cancel(po.native()) +} + +// DrawPageFinish() is a wrapper around gtk_print_operation_draw_page_finish(). +func (po *PrintOperation) DrawPageFinish() { + C.gtk_print_operation_draw_page_finish(po.native()) +} + +// SetDeferDrawing() is a wrapper around gtk_print_operation_set_defer_drawing(). +func (po *PrintOperation) SetDeferDrawing() { + C.gtk_print_operation_set_defer_drawing(po.native()) +} + +// GetStatus() is a wrapper around gtk_print_operation_get_status(). +func (po *PrintOperation) GetStatus() PrintStatus { + c := C.gtk_print_operation_get_status(po.native()) + return PrintStatus(c) +} + +// GetStatusString() is a wrapper around gtk_print_operation_get_status_string(). +func (po *PrintOperation) GetStatusString() string { + c := C.gtk_print_operation_get_status_string(po.native()) + return C.GoString((*C.char)(c)) +} + +// IsFinished() is a wrapper around gtk_print_operation_is_finished(). +func (po *PrintOperation) IsFinished() bool { + c := C.gtk_print_operation_is_finished(po.native()) + return gobool(c) +} + +// SetSupportSelection() is a wrapper around gtk_print_operation_set_support_selection(). +func (po *PrintOperation) SetSupportSelection(selection bool) { + C.gtk_print_operation_set_support_selection(po.native(), gbool(selection)) +} + +// GetSupportSelection() is a wrapper around gtk_print_operation_get_support_selection(). +func (po *PrintOperation) GetSupportSelection() bool { + c := C.gtk_print_operation_get_support_selection(po.native()) + return gobool(c) +} + +// SetHasSelection() is a wrapper around gtk_print_operation_set_has_selection(). +func (po *PrintOperation) SetHasSelection(selection bool) { + C.gtk_print_operation_set_has_selection(po.native(), gbool(selection)) +} + +// GetHasSelection() is a wrapper around gtk_print_operation_get_has_selection(). +func (po *PrintOperation) GetHasSelection() bool { + c := C.gtk_print_operation_get_has_selection(po.native()) + return gobool(c) +} + +// SetEmbedPageSetup() is a wrapper around gtk_print_operation_set_embed_page_setup(). +func (po *PrintOperation) SetEmbedPageSetup(embed bool) { + C.gtk_print_operation_set_embed_page_setup(po.native(), gbool(embed)) +} + +// GetEmbedPageSetup() is a wrapper around gtk_print_operation_get_embed_page_setup(). +func (po *PrintOperation) GetEmbedPageSetup() bool { + c := C.gtk_print_operation_get_embed_page_setup(po.native()) + return gobool(c) +} + +// PrintRunPageSetupDialog() is a wrapper around gtk_print_run_page_setup_dialog(). +func PrintRunPageSetupDialog(parent IWindow, pageSetup *PageSetup, settings *PrintSettings) *PageSetup { + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + c := C.gtk_print_run_page_setup_dialog(w, pageSetup.native(), settings.native()) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPageSetup(obj) +} + +type PageSetupDoneCallback func(setup *PageSetup) + +// PrintRunPageSetupDialogAsync() is a wrapper around gtk_print_run_page_setup_dialog_async(). +func PrintRunPageSetupDialogAsync(parent IWindow, setup *PageSetup, + settings *PrintSettings, cb PageSetupDoneCallback) { + + var w *C.GtkWindow = nil + if parent != nil { + w = parent.toWindow() + } + + C._gtk_print_run_page_setup_dialog_async(w, setup.native(), + settings.native(), C.gpointer(callback.Assign(cb))) +} + +/* + * GtkPrintOperationPreview + */ + +// PrintOperationPreview is a representation of GTK's GtkPrintOperationPreview GInterface. +type PrintOperationPreview struct { + *glib.Object +} + +// IPrintOperationPreview is an interface type implemented by all structs +// embedding a PrintOperationPreview. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkPrintOperationPreview. +type IPrintOperationPreview interface { + toPrintOperationPreview() *C.GtkPrintOperationPreview +} + +// native() returns a pointer to the underlying GObject as a GtkPrintOperationPreview. +func (v *PrintOperationPreview) native() *C.GtkPrintOperationPreview { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkPrintOperationPreview(p) +} + +func marshalPrintOperationPreview(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintOperationPreview(obj), nil +} + +func wrapPrintOperationPreview(obj *glib.Object) *PrintOperationPreview { + if obj == nil { + return nil + } + + return &PrintOperationPreview{obj} +} + +func (v *PrintOperationPreview) toPrintOperationPreview() *C.GtkPrintOperationPreview { + if v == nil { + return nil + } + return v.native() +} + +// RenderPage()() is a wrapper around gtk_print_operation_preview_render_page(). +func (pop *PrintOperationPreview) RenderPage(page int) { + C.gtk_print_operation_preview_render_page(pop.native(), C.gint(page)) +} + +// EndPreview()() is a wrapper around gtk_print_operation_preview_end_preview(). +func (pop *PrintOperationPreview) EndPreview() { + C.gtk_print_operation_preview_end_preview(pop.native()) +} + +// IsSelected()() is a wrapper around gtk_print_operation_preview_is_selected(). +func (pop *PrintOperationPreview) IsSelected(page int) bool { + c := C.gtk_print_operation_preview_is_selected(pop.native(), C.gint(page)) + return gobool(c) +} + +/* + * GtkPrintSettings + */ + +type PrintSettings struct { + *glib.Object +} + +func (ps *PrintSettings) native() *C.GtkPrintSettings { + if ps == nil || ps.GObject == nil { + return nil + } + + p := unsafe.Pointer(ps.GObject) + return C.toGtkPrintSettings(p) +} + +func marshalPrintSettings(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapPrintSettings(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapPrintSettings(obj *glib.Object) *PrintSettings { + if obj == nil { + return nil + } + + return &PrintSettings{obj} +} + +const ( + PRINT_SETTINGS_PRINTER string = C.GTK_PRINT_SETTINGS_PRINTER + PRINT_SETTINGS_ORIENTATION string = C.GTK_PRINT_SETTINGS_ORIENTATION + PRINT_SETTINGS_PAPER_FORMAT string = C.GTK_PRINT_SETTINGS_PAPER_FORMAT + PRINT_SETTINGS_PAPER_WIDTH string = C.GTK_PRINT_SETTINGS_PAPER_WIDTH + PRINT_SETTINGS_PAPER_HEIGHT string = C.GTK_PRINT_SETTINGS_PAPER_HEIGHT + PRINT_SETTINGS_USE_COLOR string = C.GTK_PRINT_SETTINGS_USE_COLOR + PRINT_SETTINGS_COLLATE string = C.GTK_PRINT_SETTINGS_COLLATE + PRINT_SETTINGS_REVERSE string = C.GTK_PRINT_SETTINGS_REVERSE + PRINT_SETTINGS_DUPLEX string = C.GTK_PRINT_SETTINGS_DUPLEX + PRINT_SETTINGS_QUALITY string = C.GTK_PRINT_SETTINGS_QUALITY + PRINT_SETTINGS_N_COPIES string = C.GTK_PRINT_SETTINGS_N_COPIES + PRINT_SETTINGS_NUMBER_UP string = C.GTK_PRINT_SETTINGS_NUMBER_UP + PRINT_SETTINGS_NUMBER_UP_LAYOUT string = C.GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT + PRINT_SETTINGS_RESOLUTION string = C.GTK_PRINT_SETTINGS_RESOLUTION + PRINT_SETTINGS_RESOLUTION_X string = C.GTK_PRINT_SETTINGS_RESOLUTION_X + PRINT_SETTINGS_RESOLUTION_Y string = C.GTK_PRINT_SETTINGS_RESOLUTION_Y + PRINT_SETTINGS_PRINTER_LPI string = C.GTK_PRINT_SETTINGS_PRINTER_LPI + PRINT_SETTINGS_SCALE string = C.GTK_PRINT_SETTINGS_SCALE + PRINT_SETTINGS_PRINT_PAGES string = C.GTK_PRINT_SETTINGS_PRINT_PAGES + PRINT_SETTINGS_PAGE_RANGES string = C.GTK_PRINT_SETTINGS_PAGE_RANGES + PRINT_SETTINGS_PAGE_SET string = C.GTK_PRINT_SETTINGS_PAGE_SET + PRINT_SETTINGS_DEFAULT_SOURCE string = C.GTK_PRINT_SETTINGS_DEFAULT_SOURCE + PRINT_SETTINGS_MEDIA_TYPE string = C.GTK_PRINT_SETTINGS_MEDIA_TYPE + PRINT_SETTINGS_DITHER string = C.GTK_PRINT_SETTINGS_DITHER + PRINT_SETTINGS_FINISHINGS string = C.GTK_PRINT_SETTINGS_FINISHINGS + PRINT_SETTINGS_OUTPUT_BIN string = C.GTK_PRINT_SETTINGS_OUTPUT_BIN + PRINT_SETTINGS_OUTPUT_DIR string = C.GTK_PRINT_SETTINGS_OUTPUT_DIR + PRINT_SETTINGS_OUTPUT_BASENAME string = C.GTK_PRINT_SETTINGS_OUTPUT_BASENAME + PRINT_SETTINGS_OUTPUT_FILE_FORMAT string = C.GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT + PRINT_SETTINGS_OUTPUT_URI string = C.GTK_PRINT_SETTINGS_OUTPUT_URI + PRINT_SETTINGS_WIN32_DRIVER_EXTRA string = C.GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA + PRINT_SETTINGS_WIN32_DRIVER_VERSION string = C.GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION +) + +// PrintSettingsNew() is a wrapper around gtk_print_settings_new(). +func PrintSettingsNew() (*PrintSettings, error) { + c := C.gtk_print_settings_new() + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintSettings(obj), nil +} + +// Copy() is a wrapper around gtk_print_settings_copy(). +func (ps *PrintSettings) Copy() (*PrintSettings, error) { + c := C.gtk_print_settings_copy(ps.native()) + if c == nil { + return nil, nilPtrErr + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintSettings(obj), nil +} + +// HasKey() is a wrapper around gtk_print_settings_has_key(). +func (ps *PrintSettings) HasKey(key string) bool { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_has_key(ps.native(), (*C.gchar)(cstr)) + return gobool(c) +} + +// Get() is a wrapper around gtk_print_settings_get(). +func (ps *PrintSettings) Get(key string) string { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get(ps.native(), (*C.gchar)(cstr)) + return C.GoString((*C.char)(c)) +} + +// Set() is a wrapper around gtk_print_settings_set(). +// TODO: Since value can't be nil, we can't unset values here. +func (ps *PrintSettings) Set(key, value string) { + cKey := C.CString(key) + defer C.free(unsafe.Pointer(cKey)) + cValue := C.CString(value) + defer C.free(unsafe.Pointer(cValue)) + C.gtk_print_settings_set(ps.native(), (*C.gchar)(cKey), (*C.gchar)(cValue)) +} + +// Unset() is a wrapper around gtk_print_settings_unset(). +func (ps *PrintSettings) Unset(key string) { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_unset(ps.native(), (*C.gchar)(cstr)) +} + +type PrintSettingsCallback func(key, value string) + +// Foreach() is a wrapper around gtk_print_settings_foreach(). +func (ps *PrintSettings) ForEach(cb PrintSettingsCallback) { + // Clean up callback immediately as we only need it for the duration of this Foreach call + id := callback.Assign(cb) + defer callback.Delete(id) + + C._gtk_print_settings_foreach(ps.native(), C.gpointer(id)) +} + +// GetBool() is a wrapper around gtk_print_settings_get_bool(). +func (ps *PrintSettings) GetBool(key string) bool { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get_bool(ps.native(), (*C.gchar)(cstr)) + return gobool(c) +} + +// SetBool() is a wrapper around gtk_print_settings_set_bool(). +func (ps *PrintSettings) SetBool(key string, value bool) { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_bool(ps.native(), (*C.gchar)(cstr), gbool(value)) +} + +// GetDouble() is a wrapper around gtk_print_settings_get_double(). +func (ps *PrintSettings) GetDouble(key string) float64 { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get_double(ps.native(), (*C.gchar)(cstr)) + return float64(c) +} + +// GetDoubleWithDefault() is a wrapper around gtk_print_settings_get_double_with_default(). +func (ps *PrintSettings) GetDoubleWithDefault(key string, def float64) float64 { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get_double_with_default(ps.native(), + (*C.gchar)(cstr), C.gdouble(def)) + return float64(c) +} + +// SetDouble() is a wrapper around gtk_print_settings_set_double(). +func (ps *PrintSettings) SetDouble(key string, value float64) { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_double(ps.native(), (*C.gchar)(cstr), C.gdouble(value)) +} + +// GetLength() is a wrapper around gtk_print_settings_get_length(). +func (ps *PrintSettings) GetLength(key string, unit Unit) float64 { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get_length(ps.native(), (*C.gchar)(cstr), C.GtkUnit(unit)) + return float64(c) +} + +// SetLength() is a wrapper around gtk_print_settings_set_length(). +func (ps *PrintSettings) SetLength(key string, value float64, unit Unit) { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_length(ps.native(), (*C.gchar)(cstr), C.gdouble(value), C.GtkUnit(unit)) +} + +// GetInt() is a wrapper around gtk_print_settings_get_int(). +func (ps *PrintSettings) GetInt(key string) int { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get_int(ps.native(), (*C.gchar)(cstr)) + return int(c) +} + +// GetIntWithDefault() is a wrapper around gtk_print_settings_get_int_with_default(). +func (ps *PrintSettings) GetIntWithDefault(key string, def int) int { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_print_settings_get_int_with_default(ps.native(), (*C.gchar)(cstr), C.gint(def)) + return int(c) +} + +// SetInt() is a wrapper around gtk_print_settings_set_int(). +func (ps *PrintSettings) SetInt(key string, value int) { + cstr := C.CString(key) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_int(ps.native(), (*C.gchar)(cstr), C.gint(value)) +} + +// GetPrinter() is a wrapper around gtk_print_settings_get_printer(). +func (ps *PrintSettings) GetPrinter() string { + c := C.gtk_print_settings_get_printer(ps.native()) + return C.GoString((*C.char)(c)) +} + +// SetPrinter() is a wrapper around gtk_print_settings_set_printer(). +func (ps *PrintSettings) SetPrinter(printer string) { + cstr := C.CString(printer) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_printer(ps.native(), (*C.gchar)(cstr)) +} + +// GetOrientation() is a wrapper around gtk_print_settings_get_orientation(). +func (ps *PrintSettings) GetOrientation() PageOrientation { + c := C.gtk_print_settings_get_orientation(ps.native()) + return PageOrientation(c) +} + +// SetOrientation() is a wrapper around gtk_print_settings_set_orientation(). +func (ps *PrintSettings) SetOrientation(orientation PageOrientation) { + C.gtk_print_settings_set_orientation(ps.native(), C.GtkPageOrientation(orientation)) +} + +// GetPaperSize() is a wrapper around gtk_print_settings_get_paper_size(). +func (ps *PrintSettings) GetPaperSize() (*PaperSize, error) { + c := C.gtk_print_settings_get_paper_size(ps.native()) + if c == nil { + return nil, nilPtrErr + } + p := &PaperSize{c} + runtime.SetFinalizer(p, (*PaperSize).free) + return p, nil +} + +// SetPaperSize() is a wrapper around gtk_print_settings_set_paper_size(). +func (ps *PrintSettings) SetPaperSize(size *PaperSize) { + C.gtk_print_settings_set_paper_size(ps.native(), size.native()) +} + +// GetPaperWidth() is a wrapper around gtk_print_settings_get_paper_width(). +func (ps *PrintSettings) GetPaperWidth(unit Unit) float64 { + c := C.gtk_print_settings_get_paper_width(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// SetPaperWidth() is a wrapper around gtk_print_settings_set_paper_width(). +func (ps *PrintSettings) SetPaperWidth(width float64, unit Unit) { + C.gtk_print_settings_set_paper_width(ps.native(), C.gdouble(width), C.GtkUnit(unit)) +} + +// GetPaperHeight() is a wrapper around gtk_print_settings_get_paper_height(). +func (ps *PrintSettings) GetPaperHeight(unit Unit) float64 { + c := C.gtk_print_settings_get_paper_height(ps.native(), C.GtkUnit(unit)) + return float64(c) +} + +// SetPaperHeight() is a wrapper around gtk_print_settings_set_paper_height(). +func (ps *PrintSettings) SetPaperHeight(width float64, unit Unit) { + C.gtk_print_settings_set_paper_height(ps.native(), C.gdouble(width), C.GtkUnit(unit)) +} + +// GetUseColor() is a wrapper around gtk_print_settings_get_use_color(). +func (ps *PrintSettings) GetUseColor() bool { + c := C.gtk_print_settings_get_use_color(ps.native()) + return gobool(c) +} + +// SetUseColor() is a wrapper around gtk_print_settings_set_use_color(). +func (ps *PrintSettings) SetUseColor(color bool) { + C.gtk_print_settings_set_use_color(ps.native(), gbool(color)) +} + +// GetCollate() is a wrapper around gtk_print_settings_get_collate(). +func (ps *PrintSettings) GetCollate() bool { + c := C.gtk_print_settings_get_collate(ps.native()) + return gobool(c) +} + +// SetCollate() is a wrapper around gtk_print_settings_set_collate(). +func (ps *PrintSettings) SetCollate(collate bool) { + C.gtk_print_settings_set_collate(ps.native(), gbool(collate)) +} + +// GetReverse() is a wrapper around gtk_print_settings_get_reverse(). +func (ps *PrintSettings) GetReverse() bool { + c := C.gtk_print_settings_get_reverse(ps.native()) + return gobool(c) +} + +// SetReverse() is a wrapper around gtk_print_settings_set_reverse(). +func (ps *PrintSettings) SetReverse(reverse bool) { + C.gtk_print_settings_set_reverse(ps.native(), gbool(reverse)) +} + +// GetDuplex() is a wrapper around gtk_print_settings_get_duplex(). +func (ps *PrintSettings) GetDuplex() PrintDuplex { + c := C.gtk_print_settings_get_duplex(ps.native()) + return PrintDuplex(c) +} + +// SetDuplex() is a wrapper around gtk_print_settings_set_duplex(). +func (ps *PrintSettings) SetDuplex(duplex PrintDuplex) { + C.gtk_print_settings_set_duplex(ps.native(), C.GtkPrintDuplex(duplex)) +} + +// GetQuality() is a wrapper around gtk_print_settings_get_quality(). +func (ps *PrintSettings) GetQuality() PrintQuality { + c := C.gtk_print_settings_get_quality(ps.native()) + return PrintQuality(c) +} + +// SetQuality() is a wrapper around gtk_print_settings_set_quality(). +func (ps *PrintSettings) SetQuality(quality PrintQuality) { + C.gtk_print_settings_set_quality(ps.native(), C.GtkPrintQuality(quality)) +} + +// GetNCopies() is a wrapper around gtk_print_settings_get_n_copies(). +func (ps *PrintSettings) GetNCopies() int { + c := C.gtk_print_settings_get_n_copies(ps.native()) + return int(c) +} + +// SetNCopies() is a wrapper around gtk_print_settings_set_n_copies(). +func (ps *PrintSettings) SetNCopies(copies int) { + C.gtk_print_settings_set_n_copies(ps.native(), C.gint(copies)) +} + +// GetNmberUp() is a wrapper around gtk_print_settings_get_number_up(). +func (ps *PrintSettings) GetNmberUp() int { + c := C.gtk_print_settings_get_number_up(ps.native()) + return int(c) +} + +// SetNumberUp() is a wrapper around gtk_print_settings_set_number_up(). +func (ps *PrintSettings) SetNumberUp(numberUp int) { + C.gtk_print_settings_set_number_up(ps.native(), C.gint(numberUp)) +} + +// GetNumberUpLayout() is a wrapper around gtk_print_settings_get_number_up_layout(). +func (ps *PrintSettings) GetNumberUpLayout() NumberUpLayout { + c := C.gtk_print_settings_get_number_up_layout(ps.native()) + return NumberUpLayout(c) +} + +// SetNumberUpLayout() is a wrapper around gtk_print_settings_set_number_up_layout(). +func (ps *PrintSettings) SetNumberUpLayout(numberUpLayout NumberUpLayout) { + C.gtk_print_settings_set_number_up_layout(ps.native(), C.GtkNumberUpLayout(numberUpLayout)) +} + +// GetResolution() is a wrapper around gtk_print_settings_get_resolution(). +func (ps *PrintSettings) GetResolution() int { + c := C.gtk_print_settings_get_resolution(ps.native()) + return int(c) +} + +// SetResolution() is a wrapper around gtk_print_settings_set_resolution(). +func (ps *PrintSettings) SetResolution(resolution int) { + C.gtk_print_settings_set_resolution(ps.native(), C.gint(resolution)) +} + +// SetResolutionXY() is a wrapper around gtk_print_settings_set_resolution_xy(). +func (ps *PrintSettings) SetResolutionXY(resolutionX, resolutionY int) { + C.gtk_print_settings_set_resolution_xy(ps.native(), C.gint(resolutionX), C.gint(resolutionY)) +} + +// GetResolutionX() is a wrapper around gtk_print_settings_get_resolution_x(). +func (ps *PrintSettings) GetResolutionX() int { + c := C.gtk_print_settings_get_resolution_x(ps.native()) + return int(c) +} + +// GetResolutionY() is a wrapper around gtk_print_settings_get_resolution_y(). +func (ps *PrintSettings) GetResolutionY() int { + c := C.gtk_print_settings_get_resolution_y(ps.native()) + return int(c) +} + +// GetPrinterLpi() is a wrapper around gtk_print_settings_get_printer_lpi(). +func (ps *PrintSettings) GetPrinterLpi() float64 { + c := C.gtk_print_settings_get_printer_lpi(ps.native()) + return float64(c) +} + +// SetPrinterLpi() is a wrapper around gtk_print_settings_set_printer_lpi(). +func (ps *PrintSettings) SetPrinterLpi(lpi float64) { + C.gtk_print_settings_set_printer_lpi(ps.native(), C.gdouble(lpi)) +} + +// GetScale() is a wrapper around gtk_print_settings_get_scale(). +func (ps *PrintSettings) GetScale() float64 { + c := C.gtk_print_settings_get_scale(ps.native()) + return float64(c) +} + +// SetScale() is a wrapper around gtk_print_settings_set_scale(). +func (ps *PrintSettings) SetScale(scale float64) { + C.gtk_print_settings_set_scale(ps.native(), C.gdouble(scale)) +} + +// GetPrintPages() is a wrapper around gtk_print_settings_get_print_pages(). +func (ps *PrintSettings) GetPrintPages() PrintPages { + c := C.gtk_print_settings_get_print_pages(ps.native()) + return PrintPages(c) +} + +// SetPrintPages() is a wrapper around gtk_print_settings_set_print_pages(). +func (ps *PrintSettings) SetPrintPages(pages PrintPages) { + C.gtk_print_settings_set_print_pages(ps.native(), C.GtkPrintPages(pages)) +} + +// GetPageSet() is a wrapper around gtk_print_settings_get_page_set(). +func (ps *PrintSettings) GetPageSet(pages PrintPages) PageSet { + c := C.gtk_print_settings_get_page_set(ps.native()) + return PageSet(c) +} + +// SetPageSet() is a wrapper around gtk_print_settings_set_page_set(). +func (ps *PrintSettings) SetPageSet(pageSet PageSet) { + C.gtk_print_settings_set_page_set(ps.native(), C.GtkPageSet(pageSet)) +} + +// GetDefaultSource() is a wrapper around gtk_print_settings_get_default_source(). +func (ps *PrintSettings) GetDefaultSource() string { + c := C.gtk_print_settings_get_default_source(ps.native()) + return C.GoString((*C.char)(c)) +} + +// SetSefaultSource() is a wrapper around gtk_print_settings_set_default_source(). +func (ps *PrintSettings) SetSefaultSource(defaultSource string) { + cstr := C.CString(defaultSource) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_default_source(ps.native(), (*C.gchar)(cstr)) +} + +// GetMediaType() is a wrapper around gtk_print_settings_get_media_type(). +func (ps *PrintSettings) GetMediaType() string { + c := C.gtk_print_settings_get_media_type(ps.native()) + return C.GoString((*C.char)(c)) +} + +// SetMediaType() is a wrapper around gtk_print_settings_set_media_type(). +func (ps *PrintSettings) SetMediaType(mediaType string) { + cstr := C.CString(mediaType) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_media_type(ps.native(), (*C.gchar)(cstr)) +} + +// GetDither() is a wrapper around gtk_print_settings_get_dither(). +func (ps *PrintSettings) GetDither() string { + c := C.gtk_print_settings_get_dither(ps.native()) + return C.GoString((*C.char)(c)) +} + +// SetDither() is a wrapper around gtk_print_settings_set_dither(). +func (ps *PrintSettings) SetDither(dither string) { + cstr := C.CString(dither) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_dither(ps.native(), (*C.gchar)(cstr)) +} + +// GetFinishings() is a wrapper around gtk_print_settings_get_finishings(). +func (ps *PrintSettings) GetFinishings() string { + c := C.gtk_print_settings_get_finishings(ps.native()) + return C.GoString((*C.char)(c)) +} + +// SetFinishings() is a wrapper around gtk_print_settings_set_finishings(). +func (ps *PrintSettings) SetFinishings(dither string) { + cstr := C.CString(dither) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_finishings(ps.native(), (*C.gchar)(cstr)) +} + +// GetOutputBin() is a wrapper around gtk_print_settings_get_output_bin(). +func (ps *PrintSettings) GetOutputBin() string { + c := C.gtk_print_settings_get_output_bin(ps.native()) + return C.GoString((*C.char)(c)) +} + +// SetOutputBin() is a wrapper around gtk_print_settings_set_output_bin(). +func (ps *PrintSettings) SetOutputBin(bin string) { + cstr := C.CString(bin) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_print_settings_set_output_bin(ps.native(), (*C.gchar)(cstr)) +} + +// PrintSettingsNewFromFile() is a wrapper around gtk_print_settings_new_from_file(). +func PrintSettingsNewFromFile(name string) (*PrintSettings, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + c := C.gtk_print_settings_new_from_file((*C.gchar)(cstr), &err) + if c == nil { + defer C.g_error_free(err) + return nil, errors.New(C.GoString((*C.char)(err.message))) + } + obj := glib.Take(unsafe.Pointer(c)) + return wrapPrintSettings(obj), nil +} + +// PrintSettingsNewFromKeyFile() is a wrapper around gtk_print_settings_new_from_key_file(). + +// LoadFile() is a wrapper around gtk_print_settings_load_file(). +func (ps *PrintSettings) LoadFile(name string) error { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + c := C.gtk_print_settings_load_file(ps.native(), (*C.gchar)(cstr), &err) + if gobool(c) == false { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// LoadKeyFile() is a wrapper around gtk_print_settings_load_key_file(). + +// ToFile() is a wrapper around gtk_print_settings_to_file(). +func (ps *PrintSettings) ToFile(name string) error { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + c := C.gtk_print_settings_to_file(ps.native(), (*C.gchar)(cstr), &err) + if gobool(c) == false { + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// ToKeyFile() is a wrapper around gtk_print_settings_to_key_file(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/print.go.h b/vendor/github.com/gotk3/gotk3/gtk/print.go.h new file mode 100644 index 0000000..fc1587f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/print.go.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include + +extern void goPrintSettings(gchar *key, gchar *value, gpointer user_data); + +static inline void _gtk_print_settings_foreach(GtkPrintSettings *ps, + gpointer user_data) { + gtk_print_settings_foreach(ps, (GtkPrintSettingsFunc)(goPrintSettings), + user_data); +} + +extern void goPageSetupDone(GtkPageSetup *setup, gpointer data); + +static inline void +_gtk_print_run_page_setup_dialog_async(GtkWindow *parent, GtkPageSetup *setup, + GtkPrintSettings *settings, + gpointer data) { + gtk_print_run_page_setup_dialog_async( + parent, setup, settings, (GtkPageSetupDoneFunc)(goPageSetupDone), data); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/print_export.go b/vendor/github.com/gotk3/gotk3/gtk/print_export.go new file mode 100644 index 0000000..388eff2 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/print_export.go @@ -0,0 +1,23 @@ +package gtk + +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +//export goPageSetupDone +func goPageSetupDone(setup *C.GtkPageSetup, data C.gpointer) { + // This callback is only used once, so we can clean up immediately + fn := callback.GetAndDelete(uintptr(data)).(PageSetupDoneCallback) + fn(wrapPageSetup(glib.Take(unsafe.Pointer(setup)))) +} + +//export goPrintSettings +func goPrintSettings(key *C.gchar, value *C.gchar, userData C.gpointer) { + fn := callback.Get(uintptr(userData)).(PrintSettingsCallback) + fn(C.GoString((*C.char)(key)), C.GoString((*C.char)(value))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/print_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/print_since_3_16.go new file mode 100644 index 0000000..486026d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/print_since_3_16.go @@ -0,0 +1,34 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 + +// See: https://developer.gnome.org/gtk3/3.16/api-index-3-16.html + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "runtime" + "unsafe" +) + +// PaperSizeNewFromIpp is a wrapper around gtk_paper_size_new_from_ipp(). +func PaperSizeNewFromIPP(name string, width, height float64) (*PaperSize, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_paper_size_new_from_ipp((*C.gchar)(cstr), C.gdouble(width), C.gdouble(height)) + if c == nil { + return nil, nilPtrErr + } + + t := &PaperSize{c} + runtime.SetFinalizer(t, (*PaperSize).free) + return t, nil +} + +// IsIPP() is a wrapper around gtk_paper_size_is_ipp(). +func (ps *PaperSize) IsIPP() bool { + c := C.gtk_paper_size_is_ipp(ps.native()) + return gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/print_test.go b/vendor/github.com/gotk3/gotk3/gtk/print_test.go new file mode 100644 index 0000000..30d9d3e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/print_test.go @@ -0,0 +1,55 @@ +package gtk + +import ( + "testing" +) + +func init() { + Init(nil) +} + +// TestPageSetup tests creating and manipulating PageSetup +func TestPageSetup(t *testing.T) { + _, err := PageSetupNew() + if err != nil { + t.Error(err) + } +} + +// TestPaperSize tests creating and manipulating PaperSize +func TestPaperSize(t *testing.T) { + _, err := PaperSizeNew(PAPER_NAME_A4) + if err != nil { + t.Error(err) + } +} + +// TestPrintContext tests creating and manipulating PrintContext + +// TestPrintOperation tests creating and manipulating PrintOperation +func TestPrintOperation(t *testing.T) { + _, err := PrintOperationNew() + if err != nil { + t.Error(err) + } +} + +// TestPrintOperationPreview tests creating and manipulating PrintOperationPreview + +// TestPrintSettings tests creating and manipulating PrintSettings +func TestPrintSettings(t *testing.T) { + settings, err := PrintSettingsNew() + if err != nil { + t.Error(err) + } + + settings.Set("Key1", "String1") + settings.SetBool("Key2", true) + settings.Set("Key3", "String2") + settings.SetInt("Key4", 2) + + settings.ForEach(func(key, value string) { + }, 0) +} + +// TestPrintContext tests creating and manipulating PrintContext diff --git a/vendor/github.com/gotk3/gotk3/gtk/settings.go b/vendor/github.com/gotk3/gotk3/gtk/settings.go new file mode 100644 index 0000000..a1727b4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/settings.go @@ -0,0 +1,57 @@ +package gtk + +// #include +// #include "settings.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_settings_get_type()), marshalSettings}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkSettings"] = wrapSettings +} + +//GtkSettings +type Settings struct { + *glib.Object +} + +func (v *Settings) native() *C.GtkSettings { + if v == nil || v.GObject == nil { + return nil + } + + p := unsafe.Pointer(v.GObject) + return C.toGtkSettings(p) +} + +func marshalSettings(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + return wrapSettings(glib.Take(unsafe.Pointer(c))), nil +} + +func wrapSettings(obj *glib.Object) *Settings { + if obj == nil { + return nil + } + + return &Settings{obj} +} + +//Get the global non window specific settings +func SettingsGetDefault() (*Settings, error) { + c := C.gtk_settings_get_default() + if c == nil { + return nil, nilPtrErr + } + + return wrapSettings(glib.Take(unsafe.Pointer(c))), nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/settings.go.h b/vendor/github.com/gotk3/gotk3/gtk/settings.go.h new file mode 100644 index 0000000..a48a24d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/settings.go.h @@ -0,0 +1 @@ +static GtkSettings *toGtkSettings(void *p) { return (GTK_SETTINGS(p)); } diff --git a/vendor/github.com/gotk3/gotk3/gtk/shortcutswindow_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/shortcutswindow_since_3_20.go new file mode 100644 index 0000000..8eb2ef0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/shortcutswindow_since_3_20.go @@ -0,0 +1,156 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18 + +package gtk + +// #include +// #include "gtk.go.h" +// #include "shortcutswindow_since_3_20.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_shortcuts_window_get_type()), marshalShortcutsWindow}, + {glib.Type(C.gtk_shortcuts_section_get_type()), marshalShortcutsSection}, + {glib.Type(C.gtk_shortcuts_group_get_type()), marshalShortcutsGroup}, + {glib.Type(C.gtk_shortcuts_shortcut_get_type()), marshalShortcutsShortcut}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkShortcutsWindow"] = wrapShortcutsWindow + WrapMap["GtkShortcutsSection"] = wrapShortcutsSection + WrapMap["GtkShortcutsGroup"] = wrapShortcutsGroup + WrapMap["GtkShortcutsShortcut"] = wrapShortcutsShortcut +} + +/* + * GtkShortcutsWindow + */ + +// ShortcutsWindow is a representation of GTK's GtkShortcutsWindow. +type ShortcutsWindow struct { + Window +} + +func (v *ShortcutsWindow) native() *C.GtkShortcutsWindow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkShortcutsWindow(p) +} + +func marshalShortcutsWindow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapShortcutsWindow(obj), nil +} + +func wrapShortcutsWindow(obj *glib.Object) *ShortcutsWindow { + if obj == nil { + return nil + } + + return &ShortcutsWindow{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +/* + * GtkShortcutsSection + */ + +// ShortcutsSection is a representation of GTK's GtkShortcutsSection. +type ShortcutsSection struct { + Box +} + +// native returns a pointer to the underlying GtkShortcutsSection. +func (v *ShortcutsSection) native() *C.GtkShortcutsSection { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkShortcutsSection(p) +} + +func marshalShortcutsSection(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapShortcutsSection(obj), nil +} + +func wrapShortcutsSection(obj *glib.Object) *ShortcutsSection { + if obj == nil { + return nil + } + + return &ShortcutsSection{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +/* + * GtkShortcutsGroup + */ + +// ShortcutsGroup is a representation of GTK's GtkShortcutsGroup. +type ShortcutsGroup struct { + Box +} + +// native returns a pointer to the underlying GtkShortcutsGroup. +func (v *ShortcutsGroup) native() *C.GtkShortcutsGroup { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkShortcutsGroup(p) +} + +func marshalShortcutsGroup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapShortcutsGroup(obj), nil +} + +func wrapShortcutsGroup(obj *glib.Object) *ShortcutsGroup { + if obj == nil { + return nil + } + + return &ShortcutsGroup{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +/* + * GtkShortcutsShortcut + */ + +// ShortcutsShortcut is a representation of GTK's GtkShortcutsShortcut. +type ShortcutsShortcut struct { + Box +} + +// native returns a pointer to the underlying GtkShortcutsShortcut. +func (v *ShortcutsShortcut) native() *C.GtkShortcutsShortcut { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkShortcutsShortcut(p) +} + +func marshalShortcutsShortcut(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapShortcutsShortcut(obj), nil +} + +func wrapShortcutsShortcut(obj *glib.Object) *ShortcutsShortcut { + if obj == nil { + return nil + } + + return &ShortcutsShortcut{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/shortcutswindow_since_3_20.go.h b/vendor/github.com/gotk3/gotk3/gtk/shortcutswindow_since_3_20.go.h new file mode 100644 index 0000000..1922177 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/shortcutswindow_since_3_20.go.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +static GtkShortcutsWindow *toGtkShortcutsWindow(void *p) { + return (GTK_SHORTCUTS_WINDOW(p)); +} + +static GtkShortcutsSection *toGtkShortcutsSection(void *p) { + return (GTK_SHORTCUTS_SECTION(p)); +} + +static GtkShortcutsGroup *toGtkShortcutsGroup(void *p) { + return (GTK_SHORTCUTS_GROUP(p)); +} + +static GtkShortcutsShortcut *toGtkShortcutsShortcut(void *p) { + return (GTK_SHORTCUTS_SHORTCUT(p)); +} \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/gtk/socket_plug.go b/vendor/github.com/gotk3/gotk3/gtk/socket_plug.go new file mode 100644 index 0000000..b8a5616 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/socket_plug.go @@ -0,0 +1,205 @@ +// +build linux + +package gtk + +// #include +// #include +// #include +// #include +// #include "socket_plug.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_socket_get_type()), marshalSocket}, + {glib.Type(C.gtk_plug_get_type()), marshalPlug}, + } + + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkSocket"] = wrapSocket + WrapMap["GtkPlug"] = wrapPlug +} + +/* + * GtkSocket + */ + +// Socket is a representation of GTK's GtkSocket +type Socket struct { + Container +} + +// native returns a pointer to the underlying GtkSocket +func (v *Socket) native() *C.GtkSocket { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkSocket(p) +} + +func marshalSocket(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapSocket(obj), nil +} + +func wrapSocket(obj *glib.Object) *Socket { + if obj == nil { + return nil + } + + return &Socket{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// SocketNew is a wrapper around gtk_socket_new(). +// Create a new empty GtkSocket. +func SocketNew() (*Socket, error) { + c := C.gtk_socket_new() + if c == nil { + return nil, nilPtrErr + } + return wrapSocket(glib.Take(unsafe.Pointer(c))), nil +} + +// AddId is a wrapper around gtk_socket_add_id(). +// Adds an XEMBED client, such as a GtkPlug, to the GtkSocket. The client may be in the same process or in a different +// process. +// To embed a GtkPlug in a GtkSocket, you can either create the GtkPlug with gtk_plug_new (0), call gtk_plug_get_id() +// to get the window ID of the plug, and then pass that to the gtk_socket_add_id(), or you can call gtk_socket_get_id() +// to get the window ID for the socket, and call gtk_plug_new() passing in that ID. +// The GtkSocket must have already be added into a toplevel window before you can make this call. +func (v *Socket) AddId(window uint) { + C.gtk_socket_add_id(v.native(), C.Window(window)) +} + +// GetId is a wrapper around gtk_socket_get_id(). +// Gets the window ID of a GtkSocket widget, which can then be used to create a client embedded inside the socket, +// for instance with gtk_plug_new(). +// The GtkSocket must have already be added into a toplevel window before you can make this call. +func (v *Socket) GetId() uint { + c := C.gtk_socket_get_id(v.native()) + return uint(c) +} + +// GetPlugWindow is a wrapper around gtk_socket_get_plug_window(). +// Retrieves the window of the plug. Use this to check if the plug has been created inside of the socket. +func (v *Socket) GetPlugWindow() (*Window, error) { + c := C.gtk_socket_get_plug_window(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapWindow(glib.Take(unsafe.Pointer(c))), nil +} + +/* + * GtkSocket + */ + +// Plug is a representation of GTK's GtkPlug +type Plug struct { + Window +} + +// native returns a pointer to the underlying GtkSocket +func (v *Plug) native() *C.GtkPlug { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkPlug(p) +} + +// native returns a C pointer to the underlying GdkDisplay. +func native(v *gdk.Display) *C.GdkDisplay { + // I'd love to not have to copy native() from gdk/gdk.go, but it appears you can't just + // pass C structs from package to package + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGdkDisplay(p) +} + +func marshalPlug(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapPlug(obj), nil +} + +func wrapPlug(obj *glib.Object) *Plug { + if obj == nil { + return nil + } + + return &Plug{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}} +} + +// PlugNew is a wrapper around gtk_plug_new(). +// Creates a new plug widget inside the GtkSocket identified by socket_id. +// If socket_id is 0, the plug is left “unplugged” and can later be plugged into a GtkSocket by gtk_socket_add_id(). +func PlugNew(socketId uint) (*Plug, error) { + c := C.gtk_plug_new(C.Window(socketId)) + if c == nil { + return nil, nilPtrErr + } + return wrapPlug(glib.Take(unsafe.Pointer(c))), nil +} + +// PlugNewForDisplay is a wrapper around gtk_plug_new_for_display(). +// Creates a new plug widget inside the GtkSocket identified by socket_id. +// If socket_id is 0, the plug is left “unplugged” and can later be plugged into a GtkSocket by gtk_socket_add_id(). +func PlugNewForDisplay(display *gdk.Display, socketId uint) (*Plug, error) { + c := C.gtk_plug_new_for_display(native(display), C.Window(socketId)) + if c == nil { + return nil, nilPtrErr + } + return wrapPlug(glib.Take(unsafe.Pointer(c))), nil +} + +// Construct is a wrapper around gtk_plug_construct(). +// Finish the initialization of plug for a given GtkSocket identified by socket_id. +// This function will generally only be used by classes deriving from GtkPlug. +func (v *Plug) Construct(socketId uint) { + C.gtk_plug_construct(v.native(), C.Window(socketId)) +} + +// ConstructForDisplay is a wrapper around gtk_plug_construct_for_display(). +// Finish the initialization of plug for a given GtkSocket identified by socket_id which is currently +// displayed on display. +// This function will generally only be used by classes deriving from GtkPlug. +func (v *Plug) ConstructForDisplay(display *gdk.Display, socketId uint) { + C.gtk_plug_construct_for_display(v.native(), native(display), C.Window(socketId)) +} + +// GetId is a wrapper around gtk_plug_get_id(). +// Gets the window ID of a GtkPlug widget, which can then be used to embed this window inside another window, +// for instance with gtk_socket_add_id(). +func (v *Plug) GetId() uint { + c := C.gtk_plug_get_id(v.native()) + return uint(c) +} + +// GetEmbedded is a wrapper around gtk_plug_get_embedded(). +// Determines whether the plug is embedded in a socket. +func (v *Plug) GetEmbedded() bool { + c := C.gtk_plug_get_embedded(v.native()) + return gobool(c) +} + +// GetSocketWindow is a wrapper around gtk_plug_get_socket_window(). +// Retrieves the socket the plug is embedded in. +func (v *Plug) GetSocketWindow() (*Window, error) { + c := C.gtk_plug_get_socket_window(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapWindow(glib.Take(unsafe.Pointer(c))), nil +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/socket_plug.go.h b/vendor/github.com/gotk3/gotk3/gtk/socket_plug.go.h new file mode 100644 index 0000000..0de1cbd --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/socket_plug.go.h @@ -0,0 +1,6 @@ + +static GtkSocket *toGtkSocket(void *p) { return (GTK_SOCKET(p)); } + +static GtkPlug *toGtkPlug(void *p) { return (GTK_PLUG(p)); } + +static GdkDisplay *toGdkDisplay(void *p) { return (GDK_DISPLAY(p)); } diff --git a/vendor/github.com/gotk3/gotk3/gtk/stack_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/stack_since_3_12.go new file mode 100644 index 0000000..cce9b12 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/stack_since_3_12.go @@ -0,0 +1,32 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 +// not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10 + +package gtk + +// #include +// #include +// #include "gtk_since_3_10.go.h" +import "C" +import ( + "unsafe" +) + +// GetChildByName is a wrapper around gtk_stack_get_child_by_name(). +func (v *Stack) GetChildByName(name string) (IWidget, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_stack_get_child_by_name(v.native(), (*C.gchar)(cstr)) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// GetTransitionRunning is a wrapper around gtk_stack_get_transition_running(). +func (v *Stack) GetTransitionRunning() bool { + c := C.gtk_stack_get_transition_running(v.native()) + return gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go new file mode 100644 index 0000000..d9dae76 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/stackswitcher_since_3_10.go @@ -0,0 +1,81 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +// +build !gtk_3_6,!gtk_3_8 +// not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10 + +package gtk + +// #include +// #include +// #include "gtk_since_3_10.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + //Contribute to casting + for k, v := range map[string]WrapFn{ + "GtkStackSwitcher": wrapStackSwitcher, + } { + WrapMap[k] = v + } +} + +/* + * GtkStackSwitcher + */ + +// StackSwitcher is a representation of GTK's GtkStackSwitcher +type StackSwitcher struct { + Box +} + +// native returns a pointer to the underlying GtkStackSwitcher. +func (v *StackSwitcher) native() *C.GtkStackSwitcher { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkStackSwitcher(p) +} + +func marshalStackSwitcher(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapStackSwitcher(obj), nil +} + +func wrapStackSwitcher(obj *glib.Object) *StackSwitcher { + if obj == nil { + return nil + } + + return &StackSwitcher{Box{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// StackSwitcherNew is a wrapper around gtk_stack_switcher_new(). +func StackSwitcherNew() (*StackSwitcher, error) { + c := C.gtk_stack_switcher_new() + if c == nil { + return nil, nilPtrErr + } + return wrapStackSwitcher(glib.Take(unsafe.Pointer(c))), nil +} + +// SetStack is a wrapper around gtk_stack_switcher_set_stack(). +func (v *StackSwitcher) SetStack(stack *Stack) { + C.gtk_stack_switcher_set_stack(v.native(), stack.native()) +} + +// GetStack is a wrapper around gtk_stack_switcher_get_stack(). +func (v *StackSwitcher) GetStack() *Stack { + c := C.gtk_stack_switcher_get_stack(v.native()) + if c == nil { + return nil + } + return wrapStack(glib.Take(unsafe.Pointer(c))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/style.go b/vendor/github.com/gotk3/gotk3/gtk/style.go new file mode 100644 index 0000000..c750152 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/style.go @@ -0,0 +1,236 @@ +// Same copyright and license as the rest of the files in this project +// This file contains style related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +type StyleProviderPriority int + +const ( + STYLE_PROVIDER_PRIORITY_FALLBACK StyleProviderPriority = C.GTK_STYLE_PROVIDER_PRIORITY_FALLBACK + STYLE_PROVIDER_PRIORITY_THEME = C.GTK_STYLE_PROVIDER_PRIORITY_THEME + STYLE_PROVIDER_PRIORITY_SETTINGS = C.GTK_STYLE_PROVIDER_PRIORITY_SETTINGS + STYLE_PROVIDER_PRIORITY_APPLICATION = C.GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + STYLE_PROVIDER_PRIORITY_USER = C.GTK_STYLE_PROVIDER_PRIORITY_USER +) + +/* + * GtkStyleContext + */ + +// StyleContext is a representation of GTK's GtkStyleContext. +type StyleContext struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkStyleContext. +func (v *StyleContext) native() *C.GtkStyleContext { + if v == nil || v.Object == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkStyleContext(p) +} + +func wrapStyleContext(obj *glib.Object) *StyleContext { + if obj == nil { + return nil + } + + return &StyleContext{obj} +} + +func (v *StyleContext) AddClass(class_name string) { + cstr := C.CString(class_name) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_style_context_add_class(v.native(), (*C.gchar)(cstr)) +} + +func (v *StyleContext) RemoveClass(class_name string) { + cstr := C.CString(class_name) + defer C.free(unsafe.Pointer(cstr)) + + C.gtk_style_context_remove_class(v.native(), (*C.gchar)(cstr)) +} + +func fromNativeStyleContext(c *C.GtkStyleContext) (*StyleContext, error) { + if c == nil { + return nil, nilPtrErr + } + + obj := glib.Take(unsafe.Pointer(c)) + return wrapStyleContext(obj), nil +} + +// GetStyleContext is a wrapper around gtk_widget_get_style_context(). +func (v *Widget) GetStyleContext() (*StyleContext, error) { + return fromNativeStyleContext(C.gtk_widget_get_style_context(v.native())) +} + +// GetParent is a wrapper around gtk_style_context_get_parent(). +func (v *StyleContext) GetParent() (*StyleContext, error) { + return fromNativeStyleContext(C.gtk_style_context_get_parent(v.native())) +} + +// GetProperty is a wrapper around gtk_style_context_get_property(). +func (v *StyleContext) GetProperty(property string, state StateFlags) (interface{}, error) { + cstr := (*C.gchar)(C.CString(property)) + defer C.free(unsafe.Pointer(cstr)) + + var gval C.GValue + C.gtk_style_context_get_property(v.native(), cstr, C.GtkStateFlags(state), &gval) + val := glib.ValueFromNative(unsafe.Pointer(&gval)) + return val.GoValue() +} + +// GetStyleProperty is a wrapper around gtk_style_context_get_style_property(). +func (v *StyleContext) GetStyleProperty(property string) (interface{}, error) { + cstr := (*C.gchar)(C.CString(property)) + defer C.free(unsafe.Pointer(cstr)) + + var gval C.GValue + C.gtk_style_context_get_style_property(v.native(), cstr, &gval) + val := glib.ValueFromNative(unsafe.Pointer(&gval)) + return val.GoValue() +} + +// GetScreen is a wrapper around gtk_style_context_get_screen(). +func (v *StyleContext) GetScreen() (*gdk.Screen, error) { + c := C.gtk_style_context_get_screen(v.native()) + if c == nil { + return nil, nilPtrErr + } + + d := &gdk.Screen{glib.Take(unsafe.Pointer(c))} + return d, nil +} + +// GetState is a wrapper around gtk_style_context_get_state(). +func (v *StyleContext) GetState() StateFlags { + return StateFlags(C.gtk_style_context_get_state(v.native())) +} + +// GetColor is a wrapper around gtk_style_context_get_color(). +func (v *StyleContext) GetColor(state StateFlags) *gdk.RGBA { + gdkColor := gdk.NewRGBA() + C.gtk_style_context_get_color(v.native(), C.GtkStateFlags(state), (*C.GdkRGBA)(unsafe.Pointer(gdkColor.Native()))) + return gdkColor +} + +// LookupColor is a wrapper around gtk_style_context_lookup_color(). +func (v *StyleContext) LookupColor(colorName string) (*gdk.RGBA, bool) { + cstr := (*C.gchar)(C.CString(colorName)) + defer C.free(unsafe.Pointer(cstr)) + gdkColor := gdk.NewRGBA() + ret := C.gtk_style_context_lookup_color(v.native(), cstr, (*C.GdkRGBA)(unsafe.Pointer(gdkColor.Native()))) + return gdkColor, gobool(ret) +} + +// StyleContextResetWidgets is a wrapper around gtk_style_context_reset_widgets(). +func StyleContextResetWidgets(v *gdk.Screen) { + C.gtk_style_context_reset_widgets((*C.GdkScreen)(unsafe.Pointer(v.Native()))) +} + +// Restore is a wrapper around gtk_style_context_restore(). +func (v *StyleContext) Restore() { + C.gtk_style_context_restore(v.native()) +} + +// Save is a wrapper around gtk_style_context_save(). +func (v *StyleContext) Save() { + C.gtk_style_context_save(v.native()) +} + +// SetParent is a wrapper around gtk_style_context_set_parent(). +func (v *StyleContext) SetParent(p *StyleContext) { + C.gtk_style_context_set_parent(v.native(), p.native()) +} + +// HasClass is a wrapper around gtk_style_context_has_class(). +func (v *StyleContext) HasClass(className string) bool { + cstr := C.CString(className) + defer C.free(unsafe.Pointer(cstr)) + + return gobool(C.gtk_style_context_has_class(v.native(), (*C.gchar)(cstr))) +} + +// SetScreen is a wrapper around gtk_style_context_set_screen(). +func (v *StyleContext) SetScreen(s *gdk.Screen) { + C.gtk_style_context_set_screen(v.native(), (*C.GdkScreen)(unsafe.Pointer(s.Native()))) +} + +// SetState is a wrapper around gtk_style_context_set_state(). +func (v *StyleContext) SetState(state StateFlags) { + C.gtk_style_context_set_state(v.native(), C.GtkStateFlags(state)) +} + +type IStyleProvider interface { + toStyleProvider() *C.GtkStyleProvider +} + +// AddProvider is a wrapper around gtk_style_context_add_provider(). +func (v *StyleContext) AddProvider(provider IStyleProvider, prio uint) { + C.gtk_style_context_add_provider(v.native(), provider.toStyleProvider(), C.guint(prio)) +} + +// AddProviderForScreen is a wrapper around gtk_style_context_add_provider_for_screen(). +func AddProviderForScreen(s *gdk.Screen, provider IStyleProvider, prio uint) { + C.gtk_style_context_add_provider_for_screen((*C.GdkScreen)(unsafe.Pointer(s.Native())), provider.toStyleProvider(), C.guint(prio)) +} + +// RemoveProvider is a wrapper around gtk_style_context_remove_provider(). +func (v *StyleContext) RemoveProvider(provider IStyleProvider) { + C.gtk_style_context_remove_provider(v.native(), provider.toStyleProvider()) +} + +// RemoveProviderForScreen is a wrapper around gtk_style_context_remove_provider_for_screen(). +func RemoveProviderForScreen(s *gdk.Screen, provider IStyleProvider) { + C.gtk_style_context_remove_provider_for_screen((*C.GdkScreen)(unsafe.Pointer(s.Native())), provider.toStyleProvider()) +} + +// GtkStyleContext * gtk_style_context_new () +// void gtk_style_context_get () +// GtkTextDirection gtk_style_context_get_direction () +// GtkJunctionSides gtk_style_context_get_junction_sides () +// const GtkWidgetPath * gtk_style_context_get_path () +// GdkFrameClock * gtk_style_context_get_frame_clock () +// void gtk_style_context_get_style () +// void gtk_style_context_get_style_valist () +// void gtk_style_context_get_valist () +// GtkCssSection * gtk_style_context_get_section () +// void gtk_style_context_get_background_color () +// void gtk_style_context_get_border_color () +// void gtk_style_context_get_border () +// void gtk_style_context_get_padding () +// void gtk_style_context_get_margin () +// const PangoFontDescription * gtk_style_context_get_font () +// void gtk_style_context_invalidate () +// gboolean gtk_style_context_state_is_running () +// GtkIconSet * gtk_style_context_lookup_icon_set () +// void gtk_style_context_cancel_animations () +// void gtk_style_context_scroll_animations () +// void gtk_style_context_notify_state_change () +// void gtk_style_context_pop_animatable_region () +// void gtk_style_context_push_animatable_region () +// void gtk_style_context_set_background () +// void gtk_style_context_set_direction () +// void gtk_style_context_set_junction_sides () +// void gtk_style_context_set_path () +// void gtk_style_context_add_region () +// void gtk_style_context_remove_region () +// gboolean gtk_style_context_has_region () +// GList * gtk_style_context_list_regions () +// void gtk_style_context_set_frame_clock () +// void gtk_style_context_set_scale () +// gint gtk_style_context_get_scale () +// GList * gtk_style_context_list_classes () diff --git a/vendor/github.com/gotk3/gotk3/gtk/testing.go b/vendor/github.com/gotk3/gotk3/gtk/testing.go new file mode 100644 index 0000000..8d53e98 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/testing.go @@ -0,0 +1,161 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "errors" + "os" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + + "github.com/gotk3/gotk3/glib" +) + +// TestFindLabel is a wrapper around gtk_test_find_label(). +// This function will search widget and all its descendants for a GtkLabel widget with a text string matching label_pattern. +// The labelPattern may contain asterisks “*” and question marks “?” as placeholders, g_pattern_match() is used for the matching. +func TestFindLabel(widget IWidget, labelPattern string) (IWidget, error) { + cstr := C.CString(labelPattern) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_test_find_label(widget.toWidget(), (*C.gchar)(cstr)) + if c == nil { + return nil, errors.New("no label with pattern '" + labelPattern + "' found") + } + obj, err := castWidget(c) + if err != nil { + return nil, err + } + return obj, nil +} + +// TestFindSibling is a wrapper around gtk_test_find_sibling(). +// This function will search siblings of base_widget and siblings of its ancestors for all widgets matching widgetType. +// Of the matching widgets, the one that is geometrically closest to base_widget will be returned. +func TestFindSibling(baseWidget IWidget, widgetType glib.Type) (IWidget, error) { + c := C.gtk_test_find_sibling(baseWidget.toWidget(), C.GType(widgetType)) + if c == nil { + return nil, errors.New("no widget of type '" + widgetType.Name() + "' found") + } + obj, err := castWidget(c) + if err != nil { + return nil, err + } + return obj, nil +} + +// TestFindWidget is a wrapper around gtk_test_find_widget(). +// This function will search the descendants of widget for a widget of type widget_type that has a label matching labelPattern next to it. +// This is most useful for automated GUI testing, e.g. to find the “OK” button in a dialog and synthesize clicks on it. +// However see TestFindLabel(), TestFindSibling() and TestWidgetClick() (and their GTK documentation) +// for possible caveats involving the search of such widgets and synthesizing widget events. +func TestFindWidget(widget IWidget, labelPattern string, widgetType glib.Type) (IWidget, error) { + cstr := C.CString(labelPattern) + defer C.free(unsafe.Pointer(cstr)) + c := C.gtk_test_find_widget(widget.toWidget(), (*C.gchar)(cstr), C.GType(widgetType)) + if c == nil { + return nil, errors.New("no widget with label pattern '" + labelPattern + "' and type '" + widgetType.Name() + "' found") + } + obj, err := castWidget(c) + if err != nil { + return nil, err + } + return obj, nil +} + +/* +TestInit is a wrapper around gtk_test_init(). +This function is used to initialize a GTK+ test program. +It will in turn call g_test_init() and gtk_init() to properly initialize the testing framework and graphical toolkit. +It’ll also set the program’s locale to “C” and prevent loading of rc files and Gtk+ modules. +This is done to make tets program environments as deterministic as possible. + +Like gtk_init() and g_test_init(), any known arguments will be processed and stripped from argc and argv. +*/ +func TestInit(args *[]string) { + if args != nil { + argc := C.int(len(*args)) + argv := C.make_strings(argc) + defer C.destroy_strings(argv) + + for i, arg := range *args { + cstr := C.CString(arg) + C.set_string(argv, C.int(i), (*C.gchar)(cstr)) + } + + C._gtk_test_init((*C.int)(unsafe.Pointer(&argc)), + (***C.char)(unsafe.Pointer(&argv))) + + unhandled := make([]string, argc) + for i := 0; i < int(argc); i++ { + cstr := C.get_string(argv, C.int(i)) + unhandled[i] = goString(cstr) + C.free(unsafe.Pointer(cstr)) + } + *args = unhandled + } else { + // gtk_test_init does not take nil, we have to use an empty argument list + // (only containing the first arg, which is the executable name) + argc := C.int(1) + argv := C.make_strings(argc) + defer C.destroy_strings(argv) + + // Add first argument + cstr := C.CString(os.Args[0]) + C.set_string(argv, C.int(0), (*C.gchar)(cstr)) + + C._gtk_test_init((*C.int)(unsafe.Pointer(&argc)), + (***C.char)(unsafe.Pointer(&argv))) + } +} + +// TestListAllTypes is a wrapper around gtk_test_list_all_types(). +// Return the type ids that have been registered after calling TestRegisterAllTypes(). +func TestListAllTypes() []glib.Type { + var types *C.GType + var clen C.guint + + types = C.gtk_test_list_all_types(&clen) + defer C.free(unsafe.Pointer(types)) + + length := uint(clen) + + typeReturn := make([]glib.Type, length) + for i := uint(0); i < length; i++ { + current := (*C.GType)(pointerAtOffset(unsafe.Pointer(types), unsafe.Sizeof(*types), i)) + typeReturn[i] = glib.Type(*current) + } + return typeReturn +} + +// pointerAtOffset adjusts `arrayPointer` (pointer to the first element of a C array) +// to point at the offset `i`, +// to be able to read the value there without having to go through cgo. +func pointerAtOffset(arrayPointer unsafe.Pointer, elementSize uintptr, offset uint) unsafe.Pointer { + return unsafe.Pointer(uintptr(arrayPointer) + elementSize*uintptr(offset)) +} + +// TestRegisterAllTypes is a wrapper around gtk_test_register_all_types(). +// Force registration of all core Gtk+ and Gdk object types. +// This allowes to refer to any of those object types via g_type_from_name() after calling this function. +func TestRegisterAllTypes() { + C.gtk_test_register_all_types() +} + +// TestWidgetSendKey is a wrapper around gtk_test_widget_send_key() +// +// This function will generate keyboard press and release events +// in the middle of the first GdkWindow found that belongs to widget. +// For windowless widgets like GtkButton (which returns FALSE from gtk_widget_get_has_window()), +// this will often be an input-only event window. +// For other widgets, this is usually widget->window. +// +// widget: Widget to generate a key press and release on. +// keyval: A Gdk keyboard value. +// modifiers: Keyboard modifiers the event is setup with. +// +// returns: whether all actions neccessary for the key event simulation were carried out successfully. +func TestWidgetSendKey(widget IWidget, keyval uint, modifiers gdk.ModifierType) bool { + return gobool(C.gtk_test_widget_send_key(widget.toWidget(), C.guint(keyval), C.GdkModifierType(modifiers))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/testing_deprecated_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/testing_deprecated_since_3_20.go new file mode 100644 index 0000000..bc75d3a --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/testing_deprecated_since_3_20.go @@ -0,0 +1,62 @@ +//+build gtk_3_6 gtk_3_8 gtk_3_10 gtk_3_12 gtk_3_14 gtk_3_16 gtk_3_18 gtk_deprecated + +package gtk + +// #include +import "C" +import ( + "github.com/gotk3/gotk3/gdk" +) + +/* +GtkWidget * +gtk_test_create_simple_window (const gchar *window_title, + const gchar *dialog_text); + +GtkWidget * +gtk_test_create_widget (GType widget_type, + const gchar *first_property_name, + ...); + +GtkWidget * +gtk_test_display_button_window (const gchar *window_title, + const gchar *dialog_text, + ...); + +double +gtk_test_slider_get_value (GtkWidget *widget); + +void +gtk_test_slider_set_perc (GtkWidget *widget, + double percentage); + +gboolean +gtk_test_spin_button_click (GtkSpinButton *spinner, + guint button, + gboolean upwards); + +gchar * +gtk_test_text_get (GtkWidget *widget); + +void +gtk_test_text_set (GtkWidget *widget, + const gchar *string); +*/ + +// TestWidgetClick is a wrapper around gtk_test_widget_click() +// Deprecated since 3.20 +// +// This function will generate a button click (button press and button release event) +// in the middle of the first GdkWindow found that belongs to widget. +// For windowless widgets like GtkButton (which returns FALSE from gtk_widget_get_has_window()), +// this will often be an input-only event window. +// For other widgets, this is usually widget->window. +// +// widget: Widget to generate a button click on. +// button: Number of the pointer button for the event, usually 1, 2 or 3. +// modifiers: Keyboard modifiers the event is setup with. +// +// returns: whether all actions neccessary for the button click simulation were carried out successfully. +func TestWidgetClick(widget IWidget, button gdk.Button, modifiers gdk.ModifierType) bool { + return gobool(C.gtk_test_widget_click(widget.toWidget(), C.guint(button), C.GdkModifierType(modifiers))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/testing_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/testing_since_3_10.go new file mode 100644 index 0000000..55ce3d1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/testing_since_3_10.go @@ -0,0 +1,13 @@ +// +build !gtk_3_6,!gtk_3_8 + +package gtk + +// #include +import "C" + +// TestWidgetWaitForDraw is a wrapper around gtk_test_widget_wait_for_draw(). +// Enters the main loop and waits for widget to be “drawn”. In this context that means it waits for the frame clock of widget to have run a full styling, layout and drawing cycle. +// This function is intended to be used for syncing with actions that depend on widget relayouting or on interaction with the display server. +func TestWidgetWaitForDraw(widget IWidget) { + C.gtk_test_widget_wait_for_draw(widget.toWidget()) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/testing_test.go b/vendor/github.com/gotk3/gotk3/gtk/testing_test.go new file mode 100644 index 0000000..df3c8a3 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/testing_test.go @@ -0,0 +1,125 @@ +package gtk + +import ( + "reflect" + "testing" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func TestTestRegisterAllTypes(t *testing.T) { + TestRegisterAllTypes() + types := TestListAllTypes() + + if len(types) == 0 { + t.Error("Expected at least one type to be registered") + } +} + +func TestPointerAtOffset(t *testing.T) { + // Simulate a C array by using a pointer to the first element + intArray := []int{4, 8, 2, 5, 9} + arrayPointer := unsafe.Pointer(&intArray[0]) + elementSize := unsafe.Sizeof(intArray[0]) + + for i, val := range intArray { + intAtOffset := (*int)(pointerAtOffset(arrayPointer, elementSize, uint(i))) + if val != *intAtOffset { + t.Errorf("Expected %d at offset %d, got %d", val, i, *intAtOffset) + } + } +} + +func TestTestFindLabel(t *testing.T) { + // Build a dummy widget + box, _ := BoxNew(ORIENTATION_HORIZONTAL, 0) + label1, _ := LabelNew("First") + label2, _ := LabelNew("Second") + + box.PackStart(label1, true, true, 0) + box.PackStart(label2, true, true, 0) + + // Find a label in the box with text matching Fir* + found, err := TestFindLabel(box, "Fir*") + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + + // Should return the label1 + if found == nil { + t.Error("Return value is nil") + } + foundAsLabel, ok := found.(*Label) + if !ok { + t.Error("Did not return a label. Received type:", reflect.TypeOf(found)) + } + + text, _ := foundAsLabel.GetText() + if text != "First" { + t.Error("Expected: First, Got:", text) + } + +} + +func TestTestFindSibling(t *testing.T) { + // Build a dummy widget + box, _ := BoxNew(ORIENTATION_HORIZONTAL, 0) + label1, _ := LabelNew("First") + label2, _ := LabelNew("Second") + + box.PackStart(label1, true, true, 0) + box.PackStart(label2, true, true, 0) + + // Finx a sibling to label1, of type label + found, err := TestFindSibling(label1, glib.TypeFromName("GtkLabel")) + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + + // Should return the label2 + if found == nil { + t.Error("Return value is nil") + } + foundAsLabel, ok := found.(*Label) + if !ok { + t.Error("Did not return a label. Received type:", reflect.TypeOf(found)) + } + + text, _ := foundAsLabel.GetText() + if text != "Second" { + t.Error("Expected: First, Got:", text) + } + +} + +func TestTestFindWidget(t *testing.T) { + // Build a dummy widget + box, _ := BoxNew(ORIENTATION_HORIZONTAL, 0) + button1, _ := ButtonNewWithLabel("First") + button2, _ := ButtonNewWithLabel("Second") + + box.PackStart(button1, true, true, 0) + box.PackStart(button2, true, true, 0) + + // Find a label in the box with text matching Fir* + found, err := TestFindWidget(box, "Sec*", glib.TypeFromName("GtkButton")) + if err != nil { + t.Error("Unexpected error:", err.Error()) + } + + // Should return the button2 + if found == nil { + t.Error("Return value is nil") + } + foundAsButton, ok := found.(*Button) + if !ok { + t.Error("Did not return a button. Received type:", reflect.TypeOf(found)) + } + + text, _ := foundAsButton.GetLabel() + if text != "Second" { + t.Error("Expected: Second, Got:", text) + } + +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_child_anchor.go b/vendor/github.com/gotk3/gotk3/gtk/text_child_anchor.go new file mode 100644 index 0000000..d6f8fb4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_child_anchor.go @@ -0,0 +1,81 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "text_child_anchor.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Objects/Interfaces + {glib.Type(C.gtk_text_child_anchor_get_type()), marshalTextChildAnchor}, + } + glib.RegisterGValueMarshalers(tm) +} + +/* + * GtkTextChildAnchor + */ + +// TextChildAnchor is a representation of GTK's GtkTextChildAnchor +type TextChildAnchor struct { + glib.InitiallyUnowned +} + +// native returns a pointer to the underlying GtkTextChildAnchor. +func (v *TextChildAnchor) native() *C.GtkTextChildAnchor { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextChildAnchor(p) +} + +func marshalTextChildAnchor(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextChildAnchor(obj), nil +} + +func wrapTextChildAnchor(obj *glib.Object) *TextChildAnchor { + if obj == nil { + return nil + } + + return &TextChildAnchor{glib.InitiallyUnowned{obj}} +} + +// TextChildAnchorNew is a wrapper around gtk_text_child_anchor_new () +func TextChildAnchorNew() (*TextChildAnchor, error) { + c := C.gtk_text_child_anchor_new() + if c == nil { + return nil, nilPtrErr + } + return wrapTextChildAnchor(glib.Take(unsafe.Pointer(c))), nil +} + +// GetWidgets is a wrapper around gtk_text_child_anchor_get_widgets (). +func (v *TextChildAnchor) GetWidgets() *glib.List { + clist := C.gtk_text_child_anchor_get_widgets(v.native()) + if clist == nil { + return nil + } + + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapWidget(glib.Take(ptr)) + }) + + return glist +} + +// GetDeleted is a wrapper around gtk_text_child_anchor_get_deleted(). +func (v *TextChildAnchor) GetDeleted() bool { + return gobool(C.gtk_text_child_anchor_get_deleted(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_child_anchor.go.h b/vendor/github.com/gotk3/gotk3/gtk/text_child_anchor.go.h new file mode 100644 index 0000000..631275d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_child_anchor.go.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +static GtkTextChildAnchor * +toGtkTextChildAnchor(void *p) +{ + return (GTK_TEXT_CHILD_ANCHOR(p)); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_iter.go b/vendor/github.com/gotk3/gotk3/gtk/text_iter.go new file mode 100644 index 0000000..b714c01 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_iter.go @@ -0,0 +1,423 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkTextIter + */ + +// TextIter is a representation of GTK's GtkTextIter +type TextIter C.GtkTextIter + +// native returns a pointer to the underlying GtkTextIter. +func (v *TextIter) native() *C.GtkTextIter { + if v == nil { + return nil + } + return (*C.GtkTextIter)(v) +} + +func marshalTextIter(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + return (*TextIter)(unsafe.Pointer(c)), nil +} + +// GetBuffer is a wrapper around gtk_text_iter_get_buffer(). +func (v *TextIter) GetBuffer() *TextBuffer { + c := C.gtk_text_iter_get_buffer(v.native()) + if c == nil { + return nil + } + return wrapTextBuffer(glib.Take(unsafe.Pointer(c))) +} + +// GetOffset is a wrapper around gtk_text_iter_get_offset(). +func (v *TextIter) GetOffset() int { + return int(C.gtk_text_iter_get_offset(v.native())) +} + +// GetLine is a wrapper around gtk_text_iter_get_line(). +func (v *TextIter) GetLine() int { + return int(C.gtk_text_iter_get_line(v.native())) +} + +// GetLineOffset is a wrapper around gtk_text_iter_get_line_offset(). +func (v *TextIter) GetLineOffset() int { + return int(C.gtk_text_iter_get_line_offset(v.native())) +} + +// GetLineIndex is a wrapper around gtk_text_iter_get_line_index(). +func (v *TextIter) GetLineIndex() int { + return int(C.gtk_text_iter_get_line_index(v.native())) +} + +// GetVisibleLineOffset is a wrapper around gtk_text_iter_get_visible_line_offset(). +func (v *TextIter) GetVisibleLineOffset() int { + return int(C.gtk_text_iter_get_visible_line_offset(v.native())) +} + +// GetVisibleLineIndex is a wrapper around gtk_text_iter_get_visible_line_index(). +func (v *TextIter) GetVisibleLineIndex() int { + return int(C.gtk_text_iter_get_visible_line_index(v.native())) +} + +// GetChar is a wrapper around gtk_text_iter_get_char(). +func (v *TextIter) GetChar() rune { + return rune(C.gtk_text_iter_get_char(v.native())) +} + +// GetSlice is a wrapper around gtk_text_iter_get_slice(). +func (v *TextIter) GetSlice(end *TextIter) string { + c := C.gtk_text_iter_get_slice(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// GetText is a wrapper around gtk_text_iter_get_text(). +func (v *TextIter) GetText(end *TextIter) string { + c := C.gtk_text_iter_get_text(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// GetVisibleSlice is a wrapper around gtk_text_iter_get_visible_slice(). +func (v *TextIter) GetVisibleSlice(end *TextIter) string { + c := C.gtk_text_iter_get_visible_slice(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// GetVisibleText is a wrapper around gtk_text_iter_get_visible_text(). +func (v *TextIter) GetVisibleText(end *TextIter) string { + c := C.gtk_text_iter_get_visible_text(v.native(), end.native()) + return C.GoString((*C.char)(c)) +} + +// EndsTag is a wrapper around gtk_text_iter_ends_tag(). +func (v *TextIter) EndsTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_ends_tag(v.native(), v1.native())) +} + +// TogglesTag is a wrapper around gtk_text_iter_toggles_tag(). +func (v *TextIter) TogglesTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_toggles_tag(v.native(), v1.native())) +} + +// HasTag is a wrapper around gtk_text_iter_has_tag(). +func (v *TextIter) HasTag(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_has_tag(v.native(), v1.native())) +} + +// Editable is a wrapper around gtk_text_iter_editable(). +func (v *TextIter) Editable(v1 bool) bool { + return gobool(C.gtk_text_iter_editable(v.native(), gbool(v1))) +} + +// CanInsert is a wrapper around gtk_text_iter_can_insert(). +func (v *TextIter) CanInsert(v1 bool) bool { + return gobool(C.gtk_text_iter_can_insert(v.native(), gbool(v1))) +} + +// StartsWord is a wrapper around gtk_text_iter_starts_word(). +func (v *TextIter) StartsWord() bool { + return gobool(C.gtk_text_iter_starts_word(v.native())) +} + +// EndsWord is a wrapper around gtk_text_iter_ends_word(). +func (v *TextIter) EndsWord() bool { + return gobool(C.gtk_text_iter_ends_word(v.native())) +} + +// InsideWord is a wrapper around gtk_text_iter_inside_word(). +func (v *TextIter) InsideWord() bool { + return gobool(C.gtk_text_iter_inside_word(v.native())) +} + +// StartsLine is a wrapper around gtk_text_iter_starts_line(). +func (v *TextIter) StartsLine() bool { + return gobool(C.gtk_text_iter_starts_line(v.native())) +} + +// EndsLine is a wrapper around gtk_text_iter_ends_line(). +func (v *TextIter) EndsLine() bool { + return gobool(C.gtk_text_iter_ends_line(v.native())) +} + +// StartsSentence is a wrapper around gtk_text_iter_starts_sentence(). +func (v *TextIter) StartsSentence() bool { + return gobool(C.gtk_text_iter_starts_sentence(v.native())) +} + +// EndsSentence is a wrapper around gtk_text_iter_ends_sentence(). +func (v *TextIter) EndsSentence() bool { + return gobool(C.gtk_text_iter_ends_sentence(v.native())) +} + +// InsideSentence is a wrapper around gtk_text_iter_inside_sentence(). +func (v *TextIter) InsideSentence() bool { + return gobool(C.gtk_text_iter_inside_sentence(v.native())) +} + +// IsCursorPosition is a wrapper around gtk_text_iter_is_cursor_position(). +func (v *TextIter) IsCursorPosition() bool { + return gobool(C.gtk_text_iter_is_cursor_position(v.native())) +} + +// GetCharsInLine is a wrapper around gtk_text_iter_get_chars_in_line(). +func (v *TextIter) GetCharsInLine() int { + return int(C.gtk_text_iter_get_chars_in_line(v.native())) +} + +// GetBytesInLine is a wrapper around gtk_text_iter_get_bytes_in_line(). +func (v *TextIter) GetBytesInLine() int { + return int(C.gtk_text_iter_get_bytes_in_line(v.native())) +} + +// IsEnd is a wrapper around gtk_text_iter_is_end(). +func (v *TextIter) IsEnd() bool { + return gobool(C.gtk_text_iter_is_end(v.native())) +} + +// IsStart is a wrapper around gtk_text_iter_is_start(). +func (v *TextIter) IsStart() bool { + return gobool(C.gtk_text_iter_is_start(v.native())) +} + +// ForwardChar is a wrapper around gtk_text_iter_forward_char(). +func (v *TextIter) ForwardChar() bool { + return gobool(C.gtk_text_iter_forward_char(v.native())) +} + +// BackwardChar is a wrapper around gtk_text_iter_backward_char(). +func (v *TextIter) BackwardChar() bool { + return gobool(C.gtk_text_iter_backward_char(v.native())) +} + +// ForwardChars is a wrapper around gtk_text_iter_forward_chars(). +func (v *TextIter) ForwardChars(v1 int) bool { + return gobool(C.gtk_text_iter_forward_chars(v.native(), C.gint(v1))) +} + +// BackwardChars is a wrapper around gtk_text_iter_backward_chars(). +func (v *TextIter) BackwardChars(v1 int) bool { + return gobool(C.gtk_text_iter_backward_chars(v.native(), C.gint(v1))) +} + +// ForwardLine is a wrapper around gtk_text_iter_forward_line(). +func (v *TextIter) ForwardLine() bool { + return gobool(C.gtk_text_iter_forward_line(v.native())) +} + +// BackwardLine is a wrapper around gtk_text_iter_backward_line(). +func (v *TextIter) BackwardLine() bool { + return gobool(C.gtk_text_iter_backward_line(v.native())) +} + +// ForwardLines is a wrapper around gtk_text_iter_forward_lines(). +func (v *TextIter) ForwardLines(v1 int) bool { + return gobool(C.gtk_text_iter_forward_lines(v.native(), C.gint(v1))) +} + +// BackwardLines is a wrapper around gtk_text_iter_backward_lines(). +func (v *TextIter) BackwardLines(v1 int) bool { + return gobool(C.gtk_text_iter_backward_lines(v.native(), C.gint(v1))) +} + +// ForwardWordEnds is a wrapper around gtk_text_iter_forward_word_ends(). +func (v *TextIter) ForwardWordEnds(v1 int) bool { + return gobool(C.gtk_text_iter_forward_word_ends(v.native(), C.gint(v1))) +} + +// ForwardWordEnd is a wrapper around gtk_text_iter_forward_word_end(). +func (v *TextIter) ForwardWordEnd() bool { + return gobool(C.gtk_text_iter_forward_word_end(v.native())) +} + +// ForwardCursorPosition is a wrapper around gtk_text_iter_forward_cursor_position(). +func (v *TextIter) ForwardCursorPosition() bool { + return gobool(C.gtk_text_iter_forward_cursor_position(v.native())) +} + +// BackwardCursorPosition is a wrapper around gtk_text_iter_backward_cursor_position(). +func (v *TextIter) BackwardCursorPosition() bool { + return gobool(C.gtk_text_iter_backward_cursor_position(v.native())) +} + +// ForwardCursorPositions is a wrapper around gtk_text_iter_forward_cursor_positions(). +func (v *TextIter) ForwardCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_forward_cursor_positions(v.native(), C.gint(v1))) +} + +// BackwardCursorPositions is a wrapper around gtk_text_iter_backward_cursor_positions(). +func (v *TextIter) BackwardCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_backward_cursor_positions(v.native(), C.gint(v1))) +} + +// ForwardSentenceEnds is a wrapper around gtk_text_iter_forward_sentence_ends(). +func (v *TextIter) ForwardSentenceEnds(v1 int) bool { + return gobool(C.gtk_text_iter_forward_sentence_ends(v.native(), C.gint(v1))) +} + +// ForwardSentenceEnd is a wrapper around gtk_text_iter_forward_sentence_end(). +func (v *TextIter) ForwardSentenceEnd() bool { + return gobool(C.gtk_text_iter_forward_sentence_end(v.native())) +} + +// ForwardVisibleWordEnds is a wrapper around gtk_text_iter_forward_word_ends(). +func (v *TextIter) ForwardVisibleWordEnds(v1 int) bool { + return gobool(C.gtk_text_iter_forward_word_ends(v.native(), C.gint(v1))) +} + +// ForwardVisibleWordEnd is a wrapper around gtk_text_iter_forward_visible_word_end(). +func (v *TextIter) ForwardVisibleWordEnd() bool { + return gobool(C.gtk_text_iter_forward_visible_word_end(v.native())) +} + +// ForwardVisibleCursorPosition is a wrapper around gtk_text_iter_forward_visible_cursor_position(). +func (v *TextIter) ForwardVisibleCursorPosition() bool { + return gobool(C.gtk_text_iter_forward_visible_cursor_position(v.native())) +} + +// BackwardVisibleCursorPosition is a wrapper around gtk_text_iter_backward_visible_cursor_position(). +func (v *TextIter) BackwardVisibleCursorPosition() bool { + return gobool(C.gtk_text_iter_backward_visible_cursor_position(v.native())) +} + +// ForwardVisibleCursorPositions is a wrapper around gtk_text_iter_forward_visible_cursor_positions(). +func (v *TextIter) ForwardVisibleCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_forward_visible_cursor_positions(v.native(), C.gint(v1))) +} + +// BackwardVisibleCursorPositions is a wrapper around gtk_text_iter_backward_visible_cursor_positions(). +func (v *TextIter) BackwardVisibleCursorPositions(v1 int) bool { + return gobool(C.gtk_text_iter_backward_visible_cursor_positions(v.native(), C.gint(v1))) +} + +// ForwardVisibleLine is a wrapper around gtk_text_iter_forward_visible_line(). +func (v *TextIter) ForwardVisibleLine() bool { + return gobool(C.gtk_text_iter_forward_visible_line(v.native())) +} + +// BackwardVisibleLine is a wrapper around gtk_text_iter_backward_visible_line(). +func (v *TextIter) BackwardVisibleLine() bool { + return gobool(C.gtk_text_iter_backward_visible_line(v.native())) +} + +// ForwardVisibleLines is a wrapper around gtk_text_iter_forward_visible_lines(). +func (v *TextIter) ForwardVisibleLines(v1 int) bool { + return gobool(C.gtk_text_iter_forward_visible_lines(v.native(), C.gint(v1))) +} + +// BackwardVisibleLines is a wrapper around gtk_text_iter_backward_visible_lines(). +func (v *TextIter) BackwardVisibleLines(v1 int) bool { + return gobool(C.gtk_text_iter_backward_visible_lines(v.native(), C.gint(v1))) +} + +// SetOffset is a wrapper around gtk_text_iter_set_offset(). +func (v *TextIter) SetOffset(v1 int) { + C.gtk_text_iter_set_offset(v.native(), C.gint(v1)) +} + +// SetLine is a wrapper around gtk_text_iter_set_line(). +func (v *TextIter) SetLine(v1 int) { + C.gtk_text_iter_set_line(v.native(), C.gint(v1)) +} + +// SetLineOffset is a wrapper around gtk_text_iter_set_line_offset(). +func (v *TextIter) SetLineOffset(v1 int) { + C.gtk_text_iter_set_line_offset(v.native(), C.gint(v1)) +} + +// SetLineIndex is a wrapper around gtk_text_iter_set_line_index(). +func (v *TextIter) SetLineIndex(v1 int) { + C.gtk_text_iter_set_line_index(v.native(), C.gint(v1)) +} + +// SetVisibleLineOffset is a wrapper around gtk_text_iter_set_visible_line_offset(). +func (v *TextIter) SetVisibleLineOffset(v1 int) { + C.gtk_text_iter_set_visible_line_offset(v.native(), C.gint(v1)) +} + +// SetVisibleLineIndex is a wrapper around gtk_text_iter_set_visible_line_index(). +func (v *TextIter) SetVisibleLineIndex(v1 int) { + C.gtk_text_iter_set_visible_line_index(v.native(), C.gint(v1)) +} + +// ForwardToEnd is a wrapper around gtk_text_iter_forward_to_end(). +func (v *TextIter) ForwardToEnd() { + C.gtk_text_iter_forward_to_end(v.native()) +} + +// ForwardToLineEnd is a wrapper around gtk_text_iter_forward_to_line_end(). +func (v *TextIter) ForwardToLineEnd() bool { + return gobool(C.gtk_text_iter_forward_to_line_end(v.native())) +} + +// ForwardToTagToggle is a wrapper around gtk_text_iter_forward_to_tag_toggle(). +func (v *TextIter) ForwardToTagToggle(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_forward_to_tag_toggle(v.native(), v1.native())) +} + +// BackwardToTagToggle is a wrapper around gtk_text_iter_backward_to_tag_toggle(). +func (v *TextIter) BackwardToTagToggle(v1 *TextTag) bool { + return gobool(C.gtk_text_iter_backward_to_tag_toggle(v.native(), v1.native())) +} + +// Equal is a wrapper around gtk_text_iter_equal(). +func (v *TextIter) Equal(v1 *TextIter) bool { + return gobool(C.gtk_text_iter_equal(v.native(), v1.native())) +} + +// Compare is a wrapper around gtk_text_iter_compare(). +func (v *TextIter) Compare(v1 *TextIter) int { + return int(C.gtk_text_iter_compare(v.native(), v1.native())) +} + +// InRange is a wrapper around gtk_text_iter_in_range(). +func (v *TextIter) InRange(v1 *TextIter, v2 *TextIter) bool { + return gobool(C.gtk_text_iter_in_range(v.native(), v1.native(), v2.native())) +} + +// ForwardSearch is a wrapper around gtk_text_iter_forward_search(). +func (v *TextIter) ForwardSearch(text string, flags TextSearchFlags, limit *TextIter) (matchStart, matchEnd *TextIter, ok bool) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + + matchStart, matchEnd = new(TextIter), new(TextIter) + cbool := C.gtk_text_iter_forward_search(v.native(), (*C.gchar)(cstr), (C.GtkTextSearchFlags)(flags), + (*C.GtkTextIter)(matchStart), (*C.GtkTextIter)(matchEnd), (*C.GtkTextIter)(limit)) + return matchStart, matchEnd, gobool(cbool) +} + +// BackwardSearch is a wrapper around gtk_text_iter_backward_search(). +func (v *TextIter) BackwardSearch(text string, flags TextSearchFlags, limit *TextIter) (matchStart, matchEnd *TextIter, ok bool) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + + matchStart, matchEnd = new(TextIter), new(TextIter) + cbool := C.gtk_text_iter_backward_search(v.native(), (*C.gchar)(cstr), (C.GtkTextSearchFlags)(flags), + (*C.GtkTextIter)(matchStart), (*C.GtkTextIter)(matchEnd), (*C.GtkTextIter)(limit)) + return matchStart, matchEnd, gobool(cbool) +} + +// void gtk_text_iter_order () +// gboolean (*GtkTextCharPredicate) () +// gboolean gtk_text_iter_forward_find_char () +// gboolean gtk_text_iter_backward_find_char () +// gboolean gtk_text_iter_get_attributes () +// GtkTextIter * gtk_text_iter_copy () +// void gtk_text_iter_assign () +// void gtk_text_iter_free () +// GdkPixbuf * gtk_text_iter_get_pixbuf () +// GSList * gtk_text_iter_get_marks () +// GSList * gtk_text_iter_get_toggled_tags () +// GtkTextChildAnchor * gtk_text_iter_get_child_anchor () +// GSList * gtk_text_iter_get_tags () +// PangoLanguage * gtk_text_iter_get_language () diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_mark.go b/vendor/github.com/gotk3/gotk3/gtk/text_mark.go new file mode 100644 index 0000000..dd48581 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_mark.go @@ -0,0 +1,97 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" + +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + + WrapMap["GtkTextMark"] = wrapTextMark +} + +/* + * GtkTextMark + */ + +// TextMark is a representation of GTK's GtkTextMark. +// A position in the buffer preserved across buffer modifications +type TextMark struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkTextMark. +func (v *TextMark) native() *C.GtkTextMark { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextMark(p) +} + +func marshalTextMark(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextMark(obj), nil +} + +func wrapTextMark(obj *glib.Object) *TextMark { + if obj == nil { + return nil + } + + return &TextMark{obj} +} + +// TextMarkNew is a wrapper around gtk_text_mark_new(). +func TextMarkNew(name string, leftGravity bool) (*TextMark, error) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + + c := C.gtk_text_mark_new((*C.gchar)(cstr), gbool(leftGravity)) + if c == nil { + return nil, nilPtrErr + } + return wrapTextMark(glib.Take(unsafe.Pointer(c))), nil +} + +// SetVisible is a wrapper around gtk_text_mark_set_visible(). +func (v *TextMark) SetVisible(setting bool) { + C.gtk_text_mark_set_visible(v.native(), gbool(setting)) +} + +// GetVisible is a wrapper around gtk_text_mark_get_visible(). +func (v *TextMark) GetVisible() bool { + return gobool(C.gtk_text_mark_get_visible(v.native())) +} + +// GetDeleted is a wrapper around gtk_text_mark_get_deleted(). +func (v *TextMark) GetDeleted() bool { + return gobool(C.gtk_text_mark_get_deleted(v.native())) +} + +// GetName is a wrapper around gtk_text_mark_get_name(). +func (v *TextMark) GetName() string { + return goString(C.gtk_text_mark_get_name(v.native())) +} + +// GetBuffer is a wrapper around gtk_text_mark_get_buffer(). +func (v *TextMark) GetBuffer() (*TextBuffer, error) { + c := C.gtk_text_mark_get_buffer(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapTextBuffer(glib.Take(unsafe.Pointer(c))), nil +} + +// GetLeftGravity is a wrapper around gtk_text_mark_get_left_gravity(). +func (v *TextMark) GetLeftGravity() bool { + return gobool(C.gtk_text_mark_get_left_gravity(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/text_view.go b/vendor/github.com/gotk3/gotk3/gtk/text_view.go new file mode 100644 index 0000000..5450304 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/text_view.go @@ -0,0 +1,448 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/pango" +) + +func init() { + + tm := []glib.TypeMarshaler{ + {glib.Type(C.gtk_text_window_type_get_type()), marshalTextWindowType}, + } + + glib.RegisterGValueMarshalers(tm) +} + +// TextWindowType is a representation of GTK's GtkTextWindowType. +type TextWindowType int + +const ( + TEXT_WINDOW_PRIVATE TextWindowType = C.GTK_TEXT_WINDOW_PRIVATE + TEXT_WINDOW_WIDGET TextWindowType = C.GTK_TEXT_WINDOW_WIDGET + TEXT_WINDOW_TEXT TextWindowType = C.GTK_TEXT_WINDOW_TEXT + TEXT_WINDOW_LEFT TextWindowType = C.GTK_TEXT_WINDOW_LEFT + TEXT_WINDOW_RIGHT TextWindowType = C.GTK_TEXT_WINDOW_RIGHT + TEXT_WINDOW_TOP TextWindowType = C.GTK_TEXT_WINDOW_TOP + TEXT_WINDOW_BOTTOM TextWindowType = C.GTK_TEXT_WINDOW_BOTTOM +) + +func marshalTextWindowType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TextWindowType(c), nil +} + +/* + * GtkTextView + */ + +// TextView is a representation of GTK's GtkTextView +type TextView struct { + Container +} + +// native returns a pointer to the underlying GtkTextView. +func (v *TextView) native() *C.GtkTextView { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTextView(p) +} + +func marshalTextView(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTextView(obj), nil +} + +func wrapTextView(obj *glib.Object) *TextView { + if obj == nil { + return nil + } + + return &TextView{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +// TextViewNew is a wrapper around gtk_text_view_new(). +func TextViewNew() (*TextView, error) { + c := C.gtk_text_view_new() + if c == nil { + return nil, nilPtrErr + } + return wrapTextView(glib.Take(unsafe.Pointer(c))), nil +} + +// TextViewNewWithBuffer is a wrapper around gtk_text_view_new_with_buffer(). +func TextViewNewWithBuffer(buf *TextBuffer) (*TextView, error) { + cbuf := buf.native() + c := C.gtk_text_view_new_with_buffer(cbuf) + return wrapTextView(glib.Take(unsafe.Pointer(c))), nil +} + +// GetBuffer is a wrapper around gtk_text_view_get_buffer(). +func (v *TextView) GetBuffer() (*TextBuffer, error) { + c := C.gtk_text_view_get_buffer(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapTextBuffer(glib.Take(unsafe.Pointer(c))), nil +} + +// SetBuffer is a wrapper around gtk_text_view_set_buffer(). +func (v *TextView) SetBuffer(buffer *TextBuffer) { + C.gtk_text_view_set_buffer(v.native(), buffer.native()) +} + +// SetEditable is a wrapper around gtk_text_view_set_editable(). +func (v *TextView) SetEditable(editable bool) { + C.gtk_text_view_set_editable(v.native(), gbool(editable)) +} + +// GetEditable is a wrapper around gtk_text_view_get_editable(). +func (v *TextView) GetEditable() bool { + c := C.gtk_text_view_get_editable(v.native()) + return gobool(c) +} + +// SetWrapMode is a wrapper around gtk_text_view_set_wrap_mode(). +func (v *TextView) SetWrapMode(wrapMode WrapMode) { + C.gtk_text_view_set_wrap_mode(v.native(), C.GtkWrapMode(wrapMode)) +} + +// GetWrapMode is a wrapper around gtk_text_view_get_wrap_mode(). +func (v *TextView) GetWrapMode() WrapMode { + return WrapMode(C.gtk_text_view_get_wrap_mode(v.native())) +} + +// SetCursorVisible is a wrapper around gtk_text_view_set_cursor_visible(). +func (v *TextView) SetCursorVisible(visible bool) { + C.gtk_text_view_set_cursor_visible(v.native(), gbool(visible)) +} + +// GetCursorVisible is a wrapper around gtk_text_view_get_cursor_visible(). +func (v *TextView) GetCursorVisible() bool { + c := C.gtk_text_view_get_cursor_visible(v.native()) + return gobool(c) +} + +// SetOverwrite is a wrapper around gtk_text_view_set_overwrite(). +func (v *TextView) SetOverwrite(overwrite bool) { + C.gtk_text_view_set_overwrite(v.native(), gbool(overwrite)) +} + +// GetOverwrite is a wrapper around gtk_text_view_get_overwrite(). +func (v *TextView) GetOverwrite() bool { + c := C.gtk_text_view_get_overwrite(v.native()) + return gobool(c) +} + +// SetJustification is a wrapper around gtk_text_view_set_justification(). +func (v *TextView) SetJustification(justify Justification) { + C.gtk_text_view_set_justification(v.native(), C.GtkJustification(justify)) +} + +// GetJustification is a wrapper around gtk_text_view_get_justification(). +func (v *TextView) GetJustification() Justification { + c := C.gtk_text_view_get_justification(v.native()) + return Justification(c) +} + +// SetAcceptsTab is a wrapper around gtk_text_view_set_accepts_tab(). +func (v *TextView) SetAcceptsTab(acceptsTab bool) { + C.gtk_text_view_set_accepts_tab(v.native(), gbool(acceptsTab)) +} + +// GetAcceptsTab is a wrapper around gtk_text_view_get_accepts_tab(). +func (v *TextView) GetAcceptsTab() bool { + c := C.gtk_text_view_get_accepts_tab(v.native()) + return gobool(c) +} + +// SetPixelsAboveLines is a wrapper around gtk_text_view_set_pixels_above_lines(). +func (v *TextView) SetPixelsAboveLines(px int) { + C.gtk_text_view_set_pixels_above_lines(v.native(), C.gint(px)) +} + +// GetPixelsAboveLines is a wrapper around gtk_text_view_get_pixels_above_lines(). +func (v *TextView) GetPixelsAboveLines() int { + c := C.gtk_text_view_get_pixels_above_lines(v.native()) + return int(c) +} + +// SetPixelsBelowLines is a wrapper around gtk_text_view_set_pixels_below_lines(). +func (v *TextView) SetPixelsBelowLines(px int) { + C.gtk_text_view_set_pixels_below_lines(v.native(), C.gint(px)) +} + +// GetPixelsBelowLines is a wrapper around gtk_text_view_get_pixels_below_lines(). +func (v *TextView) GetPixelsBelowLines() int { + c := C.gtk_text_view_get_pixels_below_lines(v.native()) + return int(c) +} + +// SetPixelsInsideWrap is a wrapper around gtk_text_view_set_pixels_inside_wrap(). +func (v *TextView) SetPixelsInsideWrap(px int) { + C.gtk_text_view_set_pixels_inside_wrap(v.native(), C.gint(px)) +} + +// GetPixelsInsideWrap is a wrapper around gtk_text_view_get_pixels_inside_wrap(). +func (v *TextView) GetPixelsInsideWrap() int { + c := C.gtk_text_view_get_pixels_inside_wrap(v.native()) + return int(c) +} + +// SetLeftMargin is a wrapper around gtk_text_view_set_left_margin(). +func (v *TextView) SetLeftMargin(margin int) { + C.gtk_text_view_set_left_margin(v.native(), C.gint(margin)) +} + +// GetLeftMargin is a wrapper around gtk_text_view_get_left_margin(). +func (v *TextView) GetLeftMargin() int { + c := C.gtk_text_view_get_left_margin(v.native()) + return int(c) +} + +// SetRightMargin is a wrapper around gtk_text_view_set_right_margin(). +func (v *TextView) SetRightMargin(margin int) { + C.gtk_text_view_set_right_margin(v.native(), C.gint(margin)) +} + +// GetRightMargin is a wrapper around gtk_text_view_get_right_margin(). +func (v *TextView) GetRightMargin() int { + c := C.gtk_text_view_get_right_margin(v.native()) + return int(c) +} + +// SetIndent is a wrapper around gtk_text_view_set_indent(). +func (v *TextView) SetIndent(indent int) { + C.gtk_text_view_set_indent(v.native(), C.gint(indent)) +} + +// GetIndent is a wrapper around gtk_text_view_get_indent(). +func (v *TextView) GetIndent() int { + c := C.gtk_text_view_get_indent(v.native()) + return int(c) +} + +// SetTabs is a wrapper around gtk_text_view_set_tabs(). +func (v *TextView) SetTabs(tabs *pango.TabArray) { + C.gtk_text_view_set_tabs(v.native(), (*C.PangoTabArray)(unsafe.Pointer(tabs.Native()))) +} + +// GetTabs is a wrapper around gtk_text_view_get_tabs(). +func (v *TextView) GetTabs() (*pango.TabArray, error) { + c := C.gtk_text_view_get_tabs(v.native()) + if c == nil { + return nil, nilPtrErr + } + ta := pango.WrapTabArray(uintptr(unsafe.Pointer(c))) + runtime.SetFinalizer(ta, (*pango.TabArray).Free) + return ta, nil +} + +// SetInputHints is a wrapper around gtk_text_view_set_input_hints(). +func (v *TextView) SetInputHints(hints InputHints) { + C.gtk_text_view_set_input_hints(v.native(), C.GtkInputHints(hints)) +} + +// GetInputHints is a wrapper around gtk_text_view_get_input_hints(). +func (v *TextView) GetInputHints() InputHints { + c := C.gtk_text_view_get_input_hints(v.native()) + return InputHints(c) +} + +// SetInputPurpose is a wrapper around gtk_text_view_set_input_purpose(). +func (v *TextView) SetInputPurpose(purpose InputPurpose) { + C.gtk_text_view_set_input_purpose(v.native(), + C.GtkInputPurpose(purpose)) +} + +// GetInputPurpose is a wrapper around gtk_text_view_get_input_purpose(). +func (v *TextView) GetInputPurpose() InputPurpose { + c := C.gtk_text_view_get_input_purpose(v.native()) + return InputPurpose(c) +} + +// ScrollToMark is a wrapper around gtk_text_view_scroll_to_mark(). +func (v *TextView) ScrollToMark(mark *TextMark, within_margin float64, use_align bool, xalign, yalign float64) { + C.gtk_text_view_scroll_to_mark(v.native(), mark.native(), C.gdouble(within_margin), gbool(use_align), C.gdouble(xalign), C.gdouble(yalign)) +} + +// ScrollToIter is a wrapper around gtk_text_view_scroll_to_iter(). +func (v *TextView) ScrollToIter(iter *TextIter, within_margin float64, use_align bool, xalign, yalign float64) bool { + return gobool(C.gtk_text_view_scroll_to_iter(v.native(), iter.native(), C.gdouble(within_margin), gbool(use_align), C.gdouble(xalign), C.gdouble(yalign))) +} + +// ScrollMarkOnscreen is a wrapper around gtk_text_view_scroll_mark_onscreen(). +func (v *TextView) ScrollMarkOnscreen(mark *TextMark) { + C.gtk_text_view_scroll_mark_onscreen(v.native(), mark.native()) +} + +// MoveMarkOnscreen is a wrapper around gtk_text_view_move_mark_onscreen(). +func (v *TextView) MoveMarkOnscreen(mark *TextMark) bool { + return gobool(C.gtk_text_view_move_mark_onscreen(v.native(), mark.native())) +} + +// PlaceCursorOnscreen is a wrapper around gtk_text_view_place_cursor_onscreen(). +func (v *TextView) PlaceCursorOnscreen() bool { + return gobool(C.gtk_text_view_place_cursor_onscreen(v.native())) +} + +// GetVisibleRect is a wrapper around gtk_text_view_get_visible_rect(). +func (v *TextView) GetVisibleRect() *gdk.Rectangle { + var rect C.GdkRectangle + C.gtk_text_view_get_visible_rect(v.native(), &rect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&rect))) +} + +// GetIterLocation is a wrapper around gtk_text_view_get_iter_location(). +func (v *TextView) GetIterLocation(iter *TextIter) *gdk.Rectangle { + var rect C.GdkRectangle + C.gtk_text_view_get_iter_location(v.native(), iter.native(), &rect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&rect))) +} + +// GetCursorLocations is a wrapper around gtk_text_view_get_cursor_locations(). +func (v *TextView) GetCursorLocations(iter *TextIter) (strong, weak *gdk.Rectangle) { + var strongRect, weakRect C.GdkRectangle + C.gtk_text_view_get_cursor_locations(v.native(), iter.native(), &strongRect, &weakRect) + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&strongRect))), gdk.WrapRectangle(uintptr(unsafe.Pointer(&weakRect))) +} + +// GetLineAtY is a wrapper around gtk_text_view_get_line_at_y(). +func (v *TextView) GetLineAtY(y int) (*TextIter, int) { + var iter TextIter + var line_top C.gint + iiter := (C.GtkTextIter)(iter) + C.gtk_text_view_get_line_at_y(v.native(), &iiter, C.gint(y), &line_top) + return &iter, int(line_top) +} + +// GetLineYrange is a wrapper around gtk_text_view_get_line_yrange(). +func (v *TextView) GetLineYrange(iter *TextIter) (y, height int) { + var yx, heightx C.gint + C.gtk_text_view_get_line_yrange(v.native(), iter.native(), &yx, &heightx) + return int(yx), int(heightx) +} + +// GetIterAtLocation is a wrapper around gtk_text_view_get_iter_at_location(). +func (v *TextView) GetIterAtLocation(x, y int) *TextIter { + var iter C.GtkTextIter + C.gtk_text_view_get_iter_at_location(v.native(), &iter, C.gint(x), C.gint(y)) + return (*TextIter)(&iter) +} + +// GetIterAtPosition is a wrapper around gtk_text_view_get_iter_at_position(). +func (v *TextView) GetIterAtPosition(x, y int) (*TextIter, int) { + var iter C.GtkTextIter + var trailing C.gint + C.gtk_text_view_get_iter_at_position(v.native(), &iter, &trailing, C.gint(x), C.gint(y)) + return (*TextIter)(&iter), int(trailing) +} + +// BufferToWindowCoords is a wrapper around gtk_text_view_buffer_to_window_coords(). +func (v *TextView) BufferToWindowCoords(win TextWindowType, buffer_x, buffer_y int) (window_x, window_y int) { + var wx, wy C.gint + C.gtk_text_view_buffer_to_window_coords(v.native(), C.GtkTextWindowType(win), C.gint(buffer_x), C.gint(buffer_y), &wx, &wy) + return int(wx), int(wy) +} + +// WindowToBufferCoords is a wrapper around gtk_text_view_window_to_buffer_coords(). +func (v *TextView) WindowToBufferCoords(win TextWindowType, window_x, window_y int) (buffer_x, buffer_y int) { + var bx, by C.gint + C.gtk_text_view_window_to_buffer_coords(v.native(), C.GtkTextWindowType(win), C.gint(window_x), C.gint(window_y), &bx, &by) + return int(bx), int(by) +} + +// GetWindow is a wrapper around gtk_text_view_get_window(). +func (v *TextView) GetWindow(win TextWindowType) *gdk.Window { + c := C.gtk_text_view_get_window(v.native(), C.GtkTextWindowType(win)) + if c == nil { + return nil + } + return &gdk.Window{glib.Take(unsafe.Pointer(c))} +} + +// GetWindowType is a wrapper around gtk_text_view_get_window_type(). +func (v *TextView) GetWindowType(w *gdk.Window) TextWindowType { + return TextWindowType(C.gtk_text_view_get_window_type(v.native(), (*C.GdkWindow)(unsafe.Pointer(w.Native())))) +} + +// SetBorderWindowSize is a wrapper around gtk_text_view_set_border_window_size(). +func (v *TextView) SetBorderWindowSize(tp TextWindowType, size int) { + C.gtk_text_view_set_border_window_size(v.native(), C.GtkTextWindowType(tp), C.gint(size)) +} + +// GetBorderWindowSize is a wrapper around gtk_text_view_get_border_window_size(). +func (v *TextView) GetBorderWindowSize(tp TextWindowType) int { + return int(C.gtk_text_view_get_border_window_size(v.native(), C.GtkTextWindowType(tp))) +} + +// ForwardDisplayLine is a wrapper around gtk_text_view_forward_display_line(). +func (v *TextView) ForwardDisplayLine(iter *TextIter) bool { + return gobool(C.gtk_text_view_forward_display_line(v.native(), iter.native())) +} + +// BackwardDisplayLine is a wrapper around gtk_text_view_backward_display_line(). +func (v *TextView) BackwardDisplayLine(iter *TextIter) bool { + return gobool(C.gtk_text_view_backward_display_line(v.native(), iter.native())) +} + +// ForwardDisplayLineEnd is a wrapper around gtk_text_view_forward_display_line_end(). +func (v *TextView) ForwardDisplayLineEnd(iter *TextIter) bool { + return gobool(C.gtk_text_view_forward_display_line_end(v.native(), iter.native())) +} + +// BackwardDisplayLineStart is a wrapper around gtk_text_view_backward_display_line_start(). +func (v *TextView) BackwardDisplayLineStart(iter *TextIter) bool { + return gobool(C.gtk_text_view_backward_display_line_start(v.native(), iter.native())) +} + +// StartsDisplayLine is a wrapper around gtk_text_view_starts_display_line(). +func (v *TextView) StartsDisplayLine(iter *TextIter) bool { + return gobool(C.gtk_text_view_starts_display_line(v.native(), iter.native())) +} + +// MoveVisually is a wrapper around gtk_text_view_move_visually(). +func (v *TextView) MoveVisually(iter *TextIter, count int) bool { + return gobool(C.gtk_text_view_move_visually(v.native(), iter.native(), C.gint(count))) +} + +// AddChildInWindow is a wrapper around gtk_text_view_add_child_in_window(). +func (v *TextView) AddChildInWindow(child IWidget, tp TextWindowType, xpos, ypos int) { + C.gtk_text_view_add_child_in_window(v.native(), child.toWidget(), C.GtkTextWindowType(tp), C.gint(xpos), C.gint(ypos)) +} + +// MoveChild is a wrapper around gtk_text_view_move_child(). +func (v *TextView) MoveChild(child IWidget, xpos, ypos int) { + C.gtk_text_view_move_child(v.native(), child.toWidget(), C.gint(xpos), C.gint(ypos)) +} + +// ImContextFilterKeypress is a wrapper around gtk_text_view_im_context_filter_keypress(). +func (v *TextView) ImContextFilterKeypress(event *gdk.EventKey) bool { + return gobool(C.gtk_text_view_im_context_filter_keypress(v.native(), (*C.GdkEventKey)(unsafe.Pointer(event.Native())))) +} + +// ResetImContext is a wrapper around gtk_text_view_reset_im_context(). +func (v *TextView) ResetImContext() { + C.gtk_text_view_reset_im_context(v.native()) +} + +// AddChildAtAnchor is a wrapper around gtk_text_view_add_child_at_anchor(). +func (v *TextView) AddChildAtAnchor(child IWidget, anchor *TextChildAnchor) { + C.gtk_text_view_add_child_at_anchor(v.native(), child.toWidget(), anchor.native()) +} + +// TODO: +// GtkTextAttributes * gtk_text_view_get_default_attributes () -- GtkTextAttributes +// GtkTextViewLayer diff --git a/vendor/github.com/gotk3/gotk3/gtk/toolshell.go b/vendor/github.com/gotk3/gotk3/gtk/toolshell.go new file mode 100644 index 0000000..11f651f --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/toolshell.go @@ -0,0 +1,13 @@ +package gtk + +// TODO: +// GtkToolShellIface +// gtk_tool_shell_get_ellipsize_mode(). +// gtk_tool_shell_get_icon_size(). +// gtk_tool_shell_get_orientation(). +// gtk_tool_shell_get_relief_style(). +// gtk_tool_shell_get_style(). +// gtk_tool_shell_get_text_alignment(). +// gtk_tool_shell_get_text_orientation(). +// gtk_tool_shell_rebuild_menu(). +// gtk_tool_shell_get_text_size_group(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/tooltip.go b/vendor/github.com/gotk3/gotk3/gtk/tooltip.go new file mode 100644 index 0000000..9283b2e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/tooltip.go @@ -0,0 +1,83 @@ +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkTooltip + */ + +type Tooltip struct { + Widget +} + +// native returns a pointer to the underlying GtkIconView. +func (t *Tooltip) native() *C.GtkTooltip { + if t == nil || t.GObject == nil { + return nil + } + p := unsafe.Pointer(t.GObject) + return C.toGtkTooltip(p) +} + +func marshalTooltip(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTooltip(obj), nil +} + +func wrapTooltip(obj *glib.Object) *Tooltip { + if obj == nil { + return nil + } + + return &Tooltip{Widget{glib.InitiallyUnowned{obj}}} +} + +// SetMarkup is a wrapper around gtk_tooltip_set_markup(). +func (t *Tooltip) SetMarkup(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tooltip_set_markup(t.native(), (*C.gchar)(cstr)) +} + +// SetText is a wrapper around gtk_tooltip_set_text(). +func (t *Tooltip) SetText(str string) { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tooltip_set_text(t.native(), (*C.gchar)(cstr)) +} + +// SetIcon is a wrapper around gtk_tooltip_set_icon(). +func (t *Tooltip) SetIcon(pixbuf *gdk.Pixbuf) { + C.gtk_tooltip_set_icon(t.native(), + (*C.GdkPixbuf)(unsafe.Pointer(pixbuf.Native()))) +} + +// SetIconFromIconName is a wrapper around gtk_tooltip_set_icon_from_icon_name(). +func (t *Tooltip) SetIconFromIconName(iconName string, size IconSize) { + cstr := C.CString(iconName) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tooltip_set_icon_from_icon_name(t.native(), + (*C.gchar)(cstr), + C.GtkIconSize(size)) +} + +// func (t *Tooltip) SetIconFromGIcon() { } + +// SetCustom is a wrapper around gtk_tooltip_set_custom(). +func (t *Tooltip) SetCustom(w *Widget) { + C.gtk_tooltip_set_custom(t.native(), w.native()) +} + +// SetTipArea is a wrapper around gtk_tooltip_set_tip_area(). +func (t *Tooltip) SetTipArea(rect gdk.Rectangle) { + C.gtk_tooltip_set_tip_area(t.native(), nativeGdkRectangle(rect)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/tree_view.go b/vendor/github.com/gotk3/gotk3/gtk/tree_view.go new file mode 100644 index 0000000..96817f7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/tree_view.go @@ -0,0 +1,657 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "runtime" + "strings" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +/* + * GtkTreeView + */ + +// TreeView is a representation of GTK's GtkTreeView. +type TreeView struct { + Container +} + +// native returns a pointer to the underlying GtkTreeView. +func (v *TreeView) native() *C.GtkTreeView { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeView(p) +} + +func marshalTreeView(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeView(obj), nil +} + +func wrapTreeView(obj *glib.Object) *TreeView { + if obj == nil { + return nil + } + + return &TreeView{Container{Widget{glib.InitiallyUnowned{obj}}}} +} + +func setupTreeView(c unsafe.Pointer) (*TreeView, error) { + if c == nil { + return nil, nilPtrErr + } + + return wrapTreeView(glib.Take(c)), nil +} + +// TreeViewNew is a wrapper around gtk_tree_view_new(). +func TreeViewNew() (*TreeView, error) { + return setupTreeView(unsafe.Pointer(C.gtk_tree_view_new())) +} + +// TreeViewNewWithModel is a wrapper around gtk_tree_view_new_with_model(). +func TreeViewNewWithModel(model ITreeModel) (*TreeView, error) { + return setupTreeView(unsafe.Pointer(C.gtk_tree_view_new_with_model(model.toTreeModel()))) +} + +// GetModel is a wrapper around gtk_tree_view_get_model(). +func (v *TreeView) GetModel() (ITreeModel, error) { + c := C.gtk_tree_view_get_model(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castTreeModel(c) +} + +// SetModel is a wrapper around gtk_tree_view_set_model(). +func (v *TreeView) SetModel(model ITreeModel) { + var mptr *C.GtkTreeModel + if model != nil { + mptr = model.toTreeModel() + } + C.gtk_tree_view_set_model(v.native(), mptr) +} + +// GetSelection is a wrapper around gtk_tree_view_get_selection(). +func (v *TreeView) GetSelection() (*TreeSelection, error) { + c := C.gtk_tree_view_get_selection(v.native()) + if c == nil { + return nil, nilPtrErr + } + return wrapTreeSelection(glib.Take(unsafe.Pointer(c))), nil +} + +// AppendColumn is a wrapper around gtk_tree_view_append_column(). +func (v *TreeView) AppendColumn(column *TreeViewColumn) int { + c := C.gtk_tree_view_append_column(v.native(), column.native()) + return int(c) +} + +// GetPathAtPos is a wrapper around gtk_tree_view_get_path_at_pos(). +func (v *TreeView) GetPathAtPos(x, y int) (*TreePath, *TreeViewColumn, int, int, bool) { + var ( + cpath *C.GtkTreePath + ccol *C.GtkTreeViewColumn + ccellX, ccellY *C.gint + cellX, cellY int + ) + path := new(TreePath) + column := new(TreeViewColumn) + + cbool := C.gtk_tree_view_get_path_at_pos( + v.native(), + (C.gint)(x), + (C.gint)(y), + &cpath, + &ccol, + ccellX, + ccellY) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + if ccol != nil { + column = wrapTreeViewColumn(glib.Take(unsafe.Pointer(ccol))) + } + if ccellX != nil { + cellX = int(*((*C.gint)(unsafe.Pointer(ccellX)))) + } + if ccellY != nil { + cellY = int(*((*C.gint)(unsafe.Pointer(ccellY)))) + } + return path, column, cellX, cellY, gobool(cbool) +} + +// GetCellArea is a wrapper around gtk_tree_view_get_cell_area(). +func (v *TreeView) GetCellArea(path *TreePath, column *TreeViewColumn) *gdk.Rectangle { + ctp := path.native() + pctvcol := column.native() + + var rect C.GdkRectangle + + C.gtk_tree_view_get_cell_area(v.native(), ctp, pctvcol, &rect) + + return gdk.WrapRectangle(uintptr(unsafe.Pointer(&rect))) +} + +// GetLevelIndentation is a wrapper around gtk_tree_view_get_level_indentation(). +func (v *TreeView) GetLevelIndentation() int { + return int(C.gtk_tree_view_get_level_indentation(v.native())) +} + +// GetShowExpanders is a wrapper around gtk_tree_view_get_show_expanders(). +func (v *TreeView) GetShowExpanders() bool { + return gobool(C.gtk_tree_view_get_show_expanders(v.native())) +} + +// SetLevelIndentation is a wrapper around gtk_tree_view_set_level_indentation(). +func (v *TreeView) SetLevelIndentation(indent int) { + C.gtk_tree_view_set_level_indentation(v.native(), C.gint(indent)) +} + +// SetShowExpanders is a wrapper around gtk_tree_view_set_show_expanders(). +func (v *TreeView) SetShowExpanders(show bool) { + C.gtk_tree_view_set_show_expanders(v.native(), gbool(show)) +} + +// GetHeadersVisible is a wrapper around gtk_tree_view_get_headers_visible(). +func (v *TreeView) GetHeadersVisible() bool { + return gobool(C.gtk_tree_view_get_headers_visible(v.native())) +} + +// SetHeadersVisible is a wrapper around gtk_tree_view_set_headers_visible(). +func (v *TreeView) SetHeadersVisible(show bool) { + C.gtk_tree_view_set_headers_visible(v.native(), gbool(show)) +} + +// ColumnsAutosize is a wrapper around gtk_tree_view_columns_autosize(). +func (v *TreeView) ColumnsAutosize() { + C.gtk_tree_view_columns_autosize(v.native()) +} + +// GetHeadersClickable is a wrapper around gtk_tree_view_get_headers_clickable(). +func (v *TreeView) GetHeadersClickable() bool { + return gobool(C.gtk_tree_view_get_headers_clickable(v.native())) +} + +// SetHeadersClickable is a wrapper around gtk_tree_view_set_headers_clickable(). +func (v *TreeView) SetHeadersClickable(show bool) { + C.gtk_tree_view_set_headers_clickable(v.native(), gbool(show)) +} + +// GetActivateOnSingleClick is a wrapper around gtk_tree_view_get_activate_on_single_click(). +func (v *TreeView) GetActivateOnSingleClick() bool { + return gobool(C.gtk_tree_view_get_activate_on_single_click(v.native())) +} + +// SetActivateOnSingleClick is a wrapper around gtk_tree_view_set_activate_on_single_click(). +func (v *TreeView) SetActivateOnSingleClick(show bool) { + C.gtk_tree_view_set_activate_on_single_click(v.native(), gbool(show)) +} + +// RemoveColumn is a wrapper around gtk_tree_view_remove_column(). +func (v *TreeView) RemoveColumn(column *TreeViewColumn) int { + return int(C.gtk_tree_view_remove_column(v.native(), column.native())) +} + +// InsertColumn is a wrapper around gtk_tree_view_insert_column(). +func (v *TreeView) InsertColumn(column *TreeViewColumn, pos int) int { + return int(C.gtk_tree_view_insert_column(v.native(), column.native(), C.gint(pos))) +} + +// GetNColumns is a wrapper around gtk_tree_view_get_n_columns(). +func (v *TreeView) GetNColumns() uint { + return uint(C.gtk_tree_view_get_n_columns(v.native())) +} + +// GetColumn is a wrapper around gtk_tree_view_get_column(). +func (v *TreeView) GetColumn(n int) *TreeViewColumn { + c := C.gtk_tree_view_get_column(v.native(), C.gint(n)) + if c == nil { + return nil + } + return wrapTreeViewColumn(glib.Take(unsafe.Pointer(c))) +} + +// GetColumns is a wrapper around gtk_tree_view_get_columns(). +func (v *TreeView) GetColumns() *glib.List { + clist := C.gtk_tree_view_get_columns(v.native()) + if clist == nil { + return nil + } + + list := glib.WrapList(uintptr(unsafe.Pointer(clist))) + list.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapTreeViewColumn(glib.Take(unsafe.Pointer(ptr))) + }) + runtime.SetFinalizer(list, func(glist *glib.List) { + glist.Free() + }) + + return list +} + +// MoveColumnAfter is a wrapper around gtk_tree_view_move_column_after(). +func (v *TreeView) MoveColumnAfter(column *TreeViewColumn, baseColumn *TreeViewColumn) { + C.gtk_tree_view_move_column_after(v.native(), column.native(), baseColumn.native()) +} + +// SetExpanderColumn is a wrapper around gtk_tree_view_set_expander_column(). +func (v *TreeView) SetExpanderColumn(column *TreeViewColumn) { + C.gtk_tree_view_set_expander_column(v.native(), column.native()) +} + +// GetExpanderColumn is a wrapper around gtk_tree_view_get_expander_column(). +func (v *TreeView) GetExpanderColumn() *TreeViewColumn { + c := C.gtk_tree_view_get_expander_column(v.native()) + if c == nil { + return nil + } + return wrapTreeViewColumn(glib.Take(unsafe.Pointer(c))) +} + +// ScrollToPoint is a wrapper around gtk_tree_view_scroll_to_point(). +func (v *TreeView) ScrollToPoint(treeX, treeY int) { + C.gtk_tree_view_scroll_to_point(v.native(), C.gint(treeX), C.gint(treeY)) +} + +// SetCursor is a wrapper around gtk_tree_view_set_cursor(). +func (v *TreeView) SetCursor(path *TreePath, focusColumn *TreeViewColumn, startEditing bool) { + C.gtk_tree_view_set_cursor(v.native(), path.native(), focusColumn.native(), gbool(startEditing)) +} + +// SetCursorOnCell is a wrapper around gtk_tree_view_set_cursor_on_cell(). +func (v *TreeView) SetCursorOnCell(path *TreePath, focusColumn *TreeViewColumn, focusCell *CellRenderer, startEditing bool) { + C.gtk_tree_view_set_cursor_on_cell(v.native(), path.native(), focusColumn.native(), focusCell.native(), gbool(startEditing)) +} + +// GetCursor is a wrapper around gtk_tree_view_get_cursor(). +func (v *TreeView) GetCursor() (p *TreePath, c *TreeViewColumn) { + var path *C.GtkTreePath + var col *C.GtkTreeViewColumn + + C.gtk_tree_view_get_cursor(v.native(), &path, &col) + + if path != nil { + p = &TreePath{path} + runtime.SetFinalizer(p, (*TreePath).free) + } + + if col != nil { + c = wrapTreeViewColumn(glib.Take(unsafe.Pointer(col))) + } + + return +} + +// RowActivated is a wrapper around gtk_tree_view_row_activated(). +func (v *TreeView) RowActivated(path *TreePath, column *TreeViewColumn) { + C.gtk_tree_view_row_activated(v.native(), path.native(), column.native()) +} + +// ExpandAll is a wrapper around gtk_tree_view_expand_all(). +func (v *TreeView) ExpandAll() { + C.gtk_tree_view_expand_all(v.native()) +} + +// CollapseAll is a wrapper around gtk_tree_view_collapse_all(). +func (v *TreeView) CollapseAll() { + C.gtk_tree_view_collapse_all(v.native()) +} + +// ExpandToPath is a wrapper around gtk_tree_view_expand_to_path(). +func (v *TreeView) ExpandToPath(path *TreePath) { + C.gtk_tree_view_expand_to_path(v.native(), path.native()) +} + +// ExpandRow is a wrapper around gtk_tree_view_expand_row(). +func (v *TreeView) ExpandRow(path *TreePath, openAll bool) bool { + return gobool(C.gtk_tree_view_expand_row(v.native(), path.native(), gbool(openAll))) +} + +// CollapseRow is a wrapper around gtk_tree_view_collapse_row(). +func (v *TreeView) CollapseRow(path *TreePath) bool { + return gobool(C.gtk_tree_view_collapse_row(v.native(), path.native())) +} + +// RowExpanded is a wrapper around gtk_tree_view_row_expanded(). +func (v *TreeView) RowExpanded(path *TreePath) bool { + return gobool(C.gtk_tree_view_row_expanded(v.native(), path.native())) +} + +// SetReorderable is a wrapper around gtk_tree_view_set_reorderable(). +func (v *TreeView) SetReorderable(b bool) { + C.gtk_tree_view_set_reorderable(v.native(), gbool(b)) +} + +// GetReorderable is a wrapper around gtk_tree_view_get_reorderable(). +func (v *TreeView) GetReorderable() bool { + return gobool(C.gtk_tree_view_get_reorderable(v.native())) +} + +// GetBinWindow is a wrapper around gtk_tree_view_get_bin_window(). +func (v *TreeView) GetBinWindow() *gdk.Window { + c := C.gtk_tree_view_get_bin_window(v.native()) + if c == nil { + return nil + } + + w := &gdk.Window{glib.Take(unsafe.Pointer(c))} + return w +} + +// ConvertWidgetToBinWindowCoords is a rapper around gtk_tree_view_convert_widget_to_bin_window_coords(). +func (v *TreeView) ConvertWidgetToBinWindowCoords(wx, wy int, bx, by *int) { + C.gtk_tree_view_convert_widget_to_bin_window_coords( + v.native(), + (C.gint)(wx), + (C.gint)(wy), + (*C.gint)(unsafe.Pointer(bx)), + (*C.gint)(unsafe.Pointer(by))) +} + +// ConvertBinWindowToWidgetCoords is a rapper around gtk_tree_view_convert_bin_window_to_widget_coords(). +func (v *TreeView) ConvertBinWindowToWidgetCoords(bx, by int, wx, wy *int) { + C.gtk_tree_view_convert_bin_window_to_widget_coords(v.native(), + (C.gint)(bx), + (C.gint)(by), + (*C.gint)(unsafe.Pointer(wx)), + (*C.gint)(unsafe.Pointer(wy))) +} + +// ConvertBinWindowToTreeCoords is a wrapper around gtk_tree_view_convert_bin_window_to_tree_coords(). +func (v *TreeView) ConvertBinWindowToTreeCoords(bx, by int, tx, ty *int) { + C.gtk_tree_view_convert_bin_window_to_tree_coords(v.native(), + (C.gint)(bx), + (C.gint)(by), + (*C.gint)(unsafe.Pointer(tx)), + (*C.gint)(unsafe.Pointer(ty))) +} + +// SetEnableSearch is a wrapper around gtk_tree_view_set_enable_search(). +func (v *TreeView) SetEnableSearch(b bool) { + C.gtk_tree_view_set_enable_search(v.native(), gbool(b)) +} + +// GetEnableSearch is a wrapper around gtk_tree_view_get_enable_search(). +func (v *TreeView) GetEnableSearch() bool { + return gobool(C.gtk_tree_view_get_enable_search(v.native())) +} + +// SetSearchColumn is a wrapper around gtk_tree_view_set_search_column(). +func (v *TreeView) SetSearchColumn(c int) { + C.gtk_tree_view_set_search_column(v.native(), C.gint(c)) +} + +// GetSearchColumn is a wrapper around gtk_tree_view_get_search_column(). +func (v *TreeView) GetSearchColumn() int { + return int(C.gtk_tree_view_get_search_column(v.native())) +} + +// GetSearchEntry is a wrapper around gtk_tree_view_get_search_entry(). +func (v *TreeView) GetSearchEntry() *Entry { + c := C.gtk_tree_view_get_search_entry(v.native()) + if c == nil { + return nil + } + return wrapEntry(glib.Take(unsafe.Pointer(c))) +} + +// SetSearchEntry is a wrapper around gtk_tree_view_set_search_entry(). +func (v *TreeView) SetSearchEntry(e *Entry) { + C.gtk_tree_view_set_search_entry(v.native(), e.native()) +} + +// TreeViewSearchEqualFunc is the callback type for TreeView's +// SetSearchEqualFunc. It is worth noting that the returned boolean should be +// false if the row matches. +type TreeViewSearchEqualFunc func(model *TreeModel, column int, key string, iter *TreeIter) (notMatch bool) + +// SetSearchEqualFunc is a wrapper around gtk_tree_view_set_search_equal_func(). +func (v *TreeView) SetSearchEqualFunc(f TreeViewSearchEqualFunc) { + C._gtk_tree_view_set_search_equal_func(v.native(), C.gpointer(callback.Assign(f))) +} + +// SetSearchEqualSubstringMatch calls SetSearchEqualFunc with a strings.Contains +// adapter. +func (v *TreeView) SetSearchEqualSubstringMatch() { + v.SetSearchEqualFunc(func(model *TreeModel, column int, key string, iter *TreeIter) bool { + return !strings.Contains(model.GetStringFromIter(iter), key) + }) +} + +// SetFixedHeightMode is a wrapper around gtk_tree_view_set_fixed_height_mode(). +func (v *TreeView) SetFixedHeightMode(b bool) { + C.gtk_tree_view_set_fixed_height_mode(v.native(), gbool(b)) +} + +// GetFixedHeightMode is a wrapper around gtk_tree_view_get_fixed_height_mode(). +func (v *TreeView) GetFixedHeightMode() bool { + return gobool(C.gtk_tree_view_get_fixed_height_mode(v.native())) +} + +// SetHoverSelection is a wrapper around gtk_tree_view_set_hover_selection(). +func (v *TreeView) SetHoverSelection(b bool) { + C.gtk_tree_view_set_hover_selection(v.native(), gbool(b)) +} + +// GetHoverSelection is a wrapper around gtk_tree_view_get_hover_selection(). +func (v *TreeView) GetHoverSelection() bool { + return gobool(C.gtk_tree_view_get_hover_selection(v.native())) +} + +// SetHoverExpand is a wrapper around gtk_tree_view_set_hover_expand(). +func (v *TreeView) SetHoverExpand(b bool) { + C.gtk_tree_view_set_hover_expand(v.native(), gbool(b)) +} + +// GetHoverExpand is a wrapper around gtk_tree_view_get_hover_expand(). +func (v *TreeView) GetHoverExpand() bool { + return gobool(C.gtk_tree_view_get_hover_expand(v.native())) +} + +// SetRubberBanding is a wrapper around gtk_tree_view_set_rubber_banding(). +func (v *TreeView) SetRubberBanding(b bool) { + C.gtk_tree_view_set_rubber_banding(v.native(), gbool(b)) +} + +// GetRubberBanding is a wrapper around gtk_tree_view_get_rubber_banding(). +func (v *TreeView) GetRubberBanding() bool { + return gobool(C.gtk_tree_view_get_rubber_banding(v.native())) +} + +// IsRubberBandingActive is a wrapper around gtk_tree_view_is_rubber_banding_active(). +func (v *TreeView) IsRubberBandingActive() bool { + return gobool(C.gtk_tree_view_is_rubber_banding_active(v.native())) +} + +// SetEnableTreeLines is a wrapper around gtk_tree_view_set_enable_tree_lines(). +func (v *TreeView) SetEnableTreeLines(b bool) { + C.gtk_tree_view_set_enable_tree_lines(v.native(), gbool(b)) +} + +// GetEnableTreeLines is a wrapper around gtk_tree_view_get_enable_tree_lines(). +func (v *TreeView) GetEnableTreeLines() bool { + return gobool(C.gtk_tree_view_get_enable_tree_lines(v.native())) +} + +// GetTooltipColumn is a wrapper around gtk_tree_view_get_tooltip_column(). +func (v *TreeView) GetTooltipColumn() int { + return int(C.gtk_tree_view_get_tooltip_column(v.native())) +} + +// SetTooltipColumn is a wrapper around gtk_tree_view_set_tooltip_column(). +func (v *TreeView) SetTooltipColumn(c int) { + C.gtk_tree_view_set_tooltip_column(v.native(), C.gint(c)) +} + +// SetGridLines is a wrapper around gtk_tree_view_set_grid_lines(). +func (v *TreeView) SetGridLines(gridLines TreeViewGridLines) { + C.gtk_tree_view_set_grid_lines(v.native(), C.GtkTreeViewGridLines(gridLines)) +} + +// GetGridLines is a wrapper around gtk_tree_view_get_grid_lines(). +func (v *TreeView) GetGridLines() TreeViewGridLines { + return TreeViewGridLines(C.gtk_tree_view_get_grid_lines(v.native())) +} + +// IsBlankAtPos is a wrapper around gtk_tree_view_is_blank_at_pos(). +func (v *TreeView) IsBlankAtPos(x, y int) (*TreePath, *TreeViewColumn, int, int, bool) { + var ( + cpath *C.GtkTreePath + ccol *C.GtkTreeViewColumn + ccellX, ccellY *C.gint + cellX, cellY int + ) + path := new(TreePath) + column := new(TreeViewColumn) + + cbool := C.gtk_tree_view_is_blank_at_pos( + v.native(), + (C.gint)(x), + (C.gint)(y), + &cpath, + &ccol, + ccellX, + ccellY) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + if ccol != nil { + column = wrapTreeViewColumn(glib.Take(unsafe.Pointer(ccol))) + } + if ccellX != nil { + cellX = int(*((*C.gint)(unsafe.Pointer(ccellX)))) + } + if ccellY != nil { + cellY = int(*((*C.gint)(unsafe.Pointer(ccellY)))) + } + return path, column, cellX, cellY, gobool(cbool) +} + +// ScrollToCell() is a wrapper around gtk_tree_view_scroll_to_cell(). +func (v *TreeView) ScrollToCell(path *TreePath, column *TreeViewColumn, align bool, xAlign, yAlign float32) { + C.gtk_tree_view_scroll_to_cell(v.native(), path.native(), column.native(), gbool(align), C.gfloat(xAlign), C.gfloat(yAlign)) +} + +// SetTooltipCell() is a wrapper around gtk_tree_view_set_tooltip_cell(). +func (v *TreeView) SetTooltipCell(tooltip *Tooltip, path *TreePath, column *TreeViewColumn, cell *CellRenderer) { + C.gtk_tree_view_set_tooltip_cell(v.native(), tooltip.native(), path.native(), column.native(), cell.native()) +} + +// SetTooltipRow() is a wrapper around gtk_tree_view_set_tooltip_row(). +func (v *TreeView) SetTooltipRow(tooltip *Tooltip, path *TreePath) { + C.gtk_tree_view_set_tooltip_row(v.native(), tooltip.native(), path.native()) +} + +// TreeViewDropPosition describes GtkTreeViewDropPosition. +type TreeViewDropPosition int + +const ( + TREE_VIEW_DROP_BEFORE TreeViewDropPosition = C.GTK_TREE_VIEW_DROP_BEFORE + TREE_VIEW_DROP_AFTER TreeViewDropPosition = C.GTK_TREE_VIEW_DROP_AFTER + TREE_VIEW_DROP_INTO_OR_BEFORE TreeViewDropPosition = C.GTK_TREE_VIEW_DROP_INTO_OR_BEFORE + TREE_VIEW_DROP_INTO_OR_AFTER TreeViewDropPosition = C.GTK_TREE_VIEW_DROP_INTO_OR_AFTER +) + +// TODO: +// GtkTreeViewDropPosition +// gboolean gtk_tree_view_get_tooltip_context () +// void (*GtkTreeDestroyCountFunc) () +// gboolean (*GtkTreeViewRowSeparatorFunc) () +// GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func () +// void gtk_tree_view_set_row_separator_func () +// void (*GtkTreeViewSearchPositionFunc) () +// GtkTreeViewSearchPositionFunc gtk_tree_view_get_search_position_func () +// void gtk_tree_view_set_search_position_func () +// GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func () +// void gtk_tree_view_map_expanded_rows () +// gint gtk_tree_view_insert_column_with_attributes () +// gint gtk_tree_view_insert_column_with_data_func () +// void gtk_tree_view_set_column_drag_function () +// void gtk_tree_view_get_background_area () +// void gtk_tree_view_get_visible_rect () +// gboolean gtk_tree_view_get_visible_range () +// void gtk_tree_view_convert_tree_to_bin_window_coords () +// void gtk_tree_view_convert_tree_to_widget_coords () +// void gtk_tree_view_convert_widget_to_tree_coords () +// cairo_surface_t * gtk_tree_view_create_row_drag_icon () + +// EnableModelDragDest is a wrapper around gtk_tree_view_enable_model_drag_dest(). +func (v *TreeView) EnableModelDragDest(targets []TargetEntry, actions gdk.DragAction) { + C.gtk_tree_view_enable_model_drag_dest(v.native(), (*C.GtkTargetEntry)(&targets[0]), C.gint(len(targets)), C.GdkDragAction(actions)) +} + +// EnableModelDragSource is a wrapper around gtk_tree_view_enable_model_drag_source(). +func (v *TreeView) EnableModelDragSource(startButtonMask gdk.ModifierType, targets []TargetEntry, actions gdk.DragAction) { + C.gtk_tree_view_enable_model_drag_source(v.native(), C.GdkModifierType(startButtonMask), (*C.GtkTargetEntry)(&targets[0]), C.gint(len(targets)), C.GdkDragAction(actions)) +} + +// UnsetRowsDragSource is a wrapper around gtk_tree_view_unset_rows_drag_source(). +func (v *TreeView) UnsetRowsDragSource() { + C.gtk_tree_view_unset_rows_drag_source(v.native()) +} + +// UnsetRowsDragDest is a wrapper around gtk_tree_view_unset_rows_drag_dest(). +func (v *TreeView) UnsetRowsDragDest() { + C.gtk_tree_view_unset_rows_drag_dest(v.native()) +} + +// SetDragDestRow is a wrapper around gtk_tree_view_set_drag_dest_row(). +func (v *TreeView) SetDragDestRow(path *TreePath, pos TreeViewDropPosition) { + C.gtk_tree_view_set_drag_dest_row(v.native(), path.native(), C.GtkTreeViewDropPosition(pos)) +} + +// GetDragDestRow is a wrapper around gtk_tree_view_get_drag_dest_row(). +func (v *TreeView) GetDragDestRow() (path *TreePath, pos TreeViewDropPosition) { + var ( + cpath *C.GtkTreePath + cpos C.GtkTreeViewDropPosition + ) + + C.gtk_tree_view_get_drag_dest_row(v.native(), &cpath, &cpos) + + pos = TreeViewDropPosition(cpos) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + + return +} + +// GetDestRowAtPos is a wrapper around gtk_tree_view_get_dest_row_at_pos(). +func (v *TreeView) GetDestRowAtPos(dragX, dragY int) (path *TreePath, pos TreeViewDropPosition, ok bool) { + var ( + cpath *C.GtkTreePath + cpos C.GtkTreeViewDropPosition + ) + + cbool := C.gtk_tree_view_get_dest_row_at_pos(v.native(), C.gint(dragX), C.gint(dragY), &cpath, &cpos) + + ok = gobool(cbool) + pos = TreeViewDropPosition(cpos) + + if cpath != nil { + path = &TreePath{cpath} + runtime.SetFinalizer(path, (*TreePath).free) + } + + return +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/tree_view_column.go b/vendor/github.com/gotk3/gotk3/gtk/tree_view_column.go new file mode 100644 index 0000000..e489b72 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/tree_view_column.go @@ -0,0 +1,323 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkTreeViewColumn + */ + +// TreeViewColumns is a representation of GTK's GtkTreeViewColumn. +type TreeViewColumn struct { + glib.InitiallyUnowned +} + +// native returns a pointer to the underlying GtkTreeViewColumn. +func (v *TreeViewColumn) native() *C.GtkTreeViewColumn { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkTreeViewColumn(p) +} + +func marshalTreeViewColumn(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapTreeViewColumn(obj), nil +} + +func wrapTreeViewColumn(obj *glib.Object) *TreeViewColumn { + if obj == nil { + return nil + } + + return &TreeViewColumn{glib.InitiallyUnowned{obj}} +} + +// TreeViewColumnNew() is a wrapper around gtk_tree_view_column_new(). +func TreeViewColumnNew() (*TreeViewColumn, error) { + c := C.gtk_tree_view_column_new() + if c == nil { + return nil, nilPtrErr + } + return wrapTreeViewColumn(glib.Take(unsafe.Pointer(c))), nil +} + +// TreeViewColumnNewWithArea is a wrapper around gtk_tree_view_column_new_with_area(). +func TreeViewColumnNewWithArea(area ICellArea) (*TreeViewColumn, error) { + c := C.gtk_tree_view_column_new_with_area(area.toCellArea()) + if c == nil { + return nil, nilPtrErr + } + return wrapTreeViewColumn(glib.Take(unsafe.Pointer(c))), nil +} + +// TreeViewColumnNewWithAttribute() is a wrapper around +// gtk_tree_view_column_new_with_attributes() that only sets one +// attribute for one column. +func TreeViewColumnNewWithAttribute(title string, renderer ICellRenderer, attribute string, column int) (*TreeViewColumn, error) { + t_cstr := C.CString(title) + defer C.free(unsafe.Pointer(t_cstr)) + a_cstr := C.CString(attribute) + defer C.free(unsafe.Pointer(a_cstr)) + c := C._gtk_tree_view_column_new_with_attributes_one((*C.gchar)(t_cstr), + renderer.toCellRenderer(), (*C.gchar)(a_cstr), C.gint(column)) + if c == nil { + return nil, nilPtrErr + } + return wrapTreeViewColumn(glib.Take(unsafe.Pointer(c))), nil +} + +// AddAttribute() is a wrapper around gtk_tree_view_column_add_attribute(). +func (v *TreeViewColumn) AddAttribute(renderer ICellRenderer, attribute string, column int) { + cstr := C.CString(attribute) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tree_view_column_add_attribute(v.native(), + renderer.toCellRenderer(), (*C.gchar)(cstr), C.gint(column)) +} + +// SetExpand() is a wrapper around gtk_tree_view_column_set_expand(). +func (v *TreeViewColumn) SetExpand(expand bool) { + C.gtk_tree_view_column_set_expand(v.native(), gbool(expand)) +} + +// GetExpand() is a wrapper around gtk_tree_view_column_get_expand(). +func (v *TreeViewColumn) GetExpand() bool { + c := C.gtk_tree_view_column_get_expand(v.native()) + return gobool(c) +} + +// SetMinWidth() is a wrapper around gtk_tree_view_column_set_min_width(). +func (v *TreeViewColumn) SetMinWidth(minWidth int) { + C.gtk_tree_view_column_set_min_width(v.native(), C.gint(minWidth)) +} + +// GetMinWidth() is a wrapper around gtk_tree_view_column_get_min_width(). +func (v *TreeViewColumn) GetMinWidth() int { + c := C.gtk_tree_view_column_get_min_width(v.native()) + return int(c) +} + +// PackStart() is a wrapper around gtk_tree_view_column_pack_start(). +func (v *TreeViewColumn) PackStart(cell ICellRenderer, expand bool) { + C.gtk_tree_view_column_pack_start(v.native(), cell.toCellRenderer(), gbool(expand)) +} + +// PackEnd() is a wrapper around gtk_tree_view_column_pack_end(). +func (v *TreeViewColumn) PackEnd(cell ICellRenderer, expand bool) { + C.gtk_tree_view_column_pack_end(v.native(), cell.toCellRenderer(), gbool(expand)) +} + +// Clear() is a wrapper around gtk_tree_view_column_clear(). +func (v *TreeViewColumn) Clear() { + C.gtk_tree_view_column_clear(v.native()) +} + +// ClearAttributes() is a wrapper around gtk_tree_view_column_clear_attributes(). +func (v *TreeViewColumn) ClearAttributes(cell *CellRenderer) { + C.gtk_tree_view_column_clear_attributes(v.native(), cell.native()) +} + +// SetSpacing() is a wrapper around gtk_tree_view_column_set_spacing(). +func (v *TreeViewColumn) SetSpacing(spacing int) { + C.gtk_tree_view_column_set_spacing(v.native(), C.gint(spacing)) +} + +// GetSpacing() is a wrapper around gtk_tree_view_column_get_spacing(). +func (v *TreeViewColumn) GetSpacing() int { + return int(C.gtk_tree_view_column_get_spacing(v.native())) +} + +// SetVisible() is a wrapper around gtk_tree_view_column_set_visible(). +func (v *TreeViewColumn) SetVisible(visible bool) { + C.gtk_tree_view_column_set_visible(v.native(), gbool(visible)) +} + +// GetVisible() is a wrapper around gtk_tree_view_column_get_visible(). +func (v *TreeViewColumn) GetVisible() bool { + return gobool(C.gtk_tree_view_column_get_visible(v.native())) +} + +// SetResizable() is a wrapper around gtk_tree_view_column_set_resizable(). +func (v *TreeViewColumn) SetResizable(resizable bool) { + C.gtk_tree_view_column_set_resizable(v.native(), gbool(resizable)) +} + +// GetResizable() is a wrapper around gtk_tree_view_column_get_resizable(). +func (v *TreeViewColumn) GetResizable() bool { + return gobool(C.gtk_tree_view_column_get_resizable(v.native())) +} + +// GetWidth() is a wrapper around gtk_tree_view_column_get_width(). +func (v *TreeViewColumn) GetWidth() int { + return int(C.gtk_tree_view_column_get_width(v.native())) +} + +// SetFixedWidth() is a wrapper around gtk_tree_view_column_set_fixed_width(). +func (v *TreeViewColumn) SetFixedWidth(w int) { + C.gtk_tree_view_column_set_fixed_width(v.native(), C.gint(w)) +} + +// GetFixedWidth() is a wrapper around gtk_tree_view_column_get_fixed_width(). +func (v *TreeViewColumn) GetFixedWidth() int { + return int(C.gtk_tree_view_column_get_fixed_width(v.native())) +} + +// SetMaxWidth() is a wrapper around gtk_tree_view_column_set_max_width(). +func (v *TreeViewColumn) SetMaxWidth(w int) { + C.gtk_tree_view_column_set_max_width(v.native(), C.gint(w)) +} + +// GetMaxWidth() is a wrapper around gtk_tree_view_column_get_max_width(). +func (v *TreeViewColumn) GetMaxWidth() int { + return int(C.gtk_tree_view_column_get_max_width(v.native())) +} + +// Clicked() is a wrapper around gtk_tree_view_column_clicked(). +func (v *TreeViewColumn) Clicked() { + C.gtk_tree_view_column_clicked(v.native()) +} + +// SetTitle() is a wrapper around gtk_tree_view_column_set_title(). +func (v *TreeViewColumn) SetTitle(t string) { + cstr := (*C.gchar)(C.CString(t)) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_tree_view_column_set_title(v.native(), cstr) +} + +// GetTitle() is a wrapper around gtk_tree_view_column_get_title(). +func (v *TreeViewColumn) GetTitle() string { + return C.GoString((*C.char)(C.gtk_tree_view_column_get_title(v.native()))) +} + +// SetClickable() is a wrapper around gtk_tree_view_column_set_clickable(). +func (v *TreeViewColumn) SetClickable(clickable bool) { + C.gtk_tree_view_column_set_clickable(v.native(), gbool(clickable)) +} + +// GetClickable() is a wrapper around gtk_tree_view_column_get_clickable(). +func (v *TreeViewColumn) GetClickable() bool { + return gobool(C.gtk_tree_view_column_get_clickable(v.native())) +} + +// SetReorderable() is a wrapper around gtk_tree_view_column_set_reorderable(). +func (v *TreeViewColumn) SetReorderable(reorderable bool) { + C.gtk_tree_view_column_set_reorderable(v.native(), gbool(reorderable)) +} + +// GetReorderable() is a wrapper around gtk_tree_view_column_get_reorderable(). +func (v *TreeViewColumn) GetReorderable() bool { + return gobool(C.gtk_tree_view_column_get_reorderable(v.native())) +} + +// SetSortIndicator() is a wrapper around gtk_tree_view_column_set_sort_indicator(). +func (v *TreeViewColumn) SetSortIndicator(reorderable bool) { + C.gtk_tree_view_column_set_sort_indicator(v.native(), gbool(reorderable)) +} + +// GetSortIndicator() is a wrapper around gtk_tree_view_column_get_sort_indicator(). +func (v *TreeViewColumn) GetSortIndicator() bool { + return gobool(C.gtk_tree_view_column_get_sort_indicator(v.native())) +} + +// SetSortColumnID() is a wrapper around gtk_tree_view_column_set_sort_column_id(). +func (v *TreeViewColumn) SetSortColumnID(w int) { + C.gtk_tree_view_column_set_sort_column_id(v.native(), C.gint(w)) +} + +// GetSortColumnID() is a wrapper around gtk_tree_view_column_get_sort_column_id(). +func (v *TreeViewColumn) GetSortColumnID() int { + return int(C.gtk_tree_view_column_get_sort_column_id(v.native())) +} + +// CellIsVisible() is a wrapper around gtk_tree_view_column_cell_is_visible(). +func (v *TreeViewColumn) CellIsVisible() bool { + return gobool(C.gtk_tree_view_column_cell_is_visible(v.native())) +} + +// FocusCell() is a wrapper around gtk_tree_view_column_focus_cell(). +func (v *TreeViewColumn) FocusCell(cell *CellRenderer) { + C.gtk_tree_view_column_focus_cell(v.native(), cell.native()) +} + +// QueueResize() is a wrapper around gtk_tree_view_column_queue_resize(). +func (v *TreeViewColumn) QueueResize() { + C.gtk_tree_view_column_queue_resize(v.native()) +} + +// GetXOffset() is a wrapper around gtk_tree_view_column_get_x_offset(). +func (v *TreeViewColumn) GetXOffset() int { + return int(C.gtk_tree_view_column_get_x_offset(v.native())) +} + +// void gtk_tree_view_column_set_attributes () +// void gtk_tree_view_column_set_cell_data_func () + +type TreeViewColumnSizing int + +const ( + TREE_VIEW_COLUMN_GROW_ONLY TreeViewColumnSizing = C.GTK_TREE_VIEW_COLUMN_GROW_ONLY + TREE_VIEW_COLUMN_AUTOSIZE = C.GTK_TREE_VIEW_COLUMN_AUTOSIZE + TREE_VIEW_COLUMN_FIXED = C.GTK_TREE_VIEW_COLUMN_FIXED +) + +// void gtk_tree_view_column_set_sizing () +func (v *TreeViewColumn) SetSizing(sizing TreeViewColumnSizing) { + C.gtk_tree_view_column_set_sizing(v.native(), C.GtkTreeViewColumnSizing(sizing)) +} + +// GtkTreeViewColumnSizing gtk_tree_view_column_get_sizing () +func (v *TreeViewColumn) GetSizing() TreeViewColumnSizing { + return TreeViewColumnSizing(C.gtk_tree_view_column_get_sizing(v.native())) +} + +// SetWidget() is a wrapper around gtk_tree_view_column_set_widget(). +func (v *TreeViewColumn) SetWidget(widget IWidget) { + C.gtk_tree_view_column_set_widget(v.native(), widget.toWidget()) +} + +// GetButton() is a wrapper around gtk_tree_view_column_get_button(). +func (v *TreeViewColumn) GetButton() (IWidget, error) { + widget := C.gtk_tree_view_column_get_button(v.native()) + if widget == nil { + return nil, nilPtrErr + } + return castWidget(widget) +} + +// GetWidget() is a wrapper around gtk_tree_view_column_get_widget(). +func (v *TreeViewColumn) GetWidget() (IWidget, error) { + widget := C.gtk_tree_view_column_get_widget(v.native()) + if widget == nil { + return nil, nil + } + return castWidget(widget) +} + +// void gtk_tree_view_column_set_alignment () +// gfloat gtk_tree_view_column_get_alignment () + +// void gtk_tree_view_column_set_sort_order () +func (v *TreeViewColumn) SetSortOrder(order SortType) { + C.gtk_tree_view_column_set_sort_order(v.native(), C.GtkSortType(order)) +} + +// GtkSortType gtk_tree_view_column_get_sort_order () +func (v *TreeViewColumn) GetSortOrder() SortType { + return SortType(C.gtk_tree_view_column_get_sort_order(v.native())) +} + +// void gtk_tree_view_column_cell_set_cell_data () +// void gtk_tree_view_column_cell_get_size () +// gboolean gtk_tree_view_column_cell_get_position () +// GtkWidget * gtk_tree_view_column_get_tree_view () diff --git a/vendor/github.com/gotk3/gotk3/gtk/version.go b/vendor/github.com/gotk3/gotk3/gtk/version.go new file mode 100644 index 0000000..0c20162 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/version.go @@ -0,0 +1,29 @@ +package gtk + +// #include +import "C" +import "errors" + +func CheckVersion(major, minor, micro uint) error { + errChar := C.gtk_check_version(C.guint(major), C.guint(minor), C.guint(micro)) + if errChar == nil { + return nil + } + + return errors.New(C.GoString((*C.char)(errChar))) +} + +func GetMajorVersion() uint { + v := C.gtk_get_major_version() + return uint(v) +} + +func GetMinorVersion() uint { + v := C.gtk_get_minor_version() + return uint(v) +} + +func GetMicroVersion() uint { + v := C.gtk_get_micro_version() + return uint(v) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/version_test.go b/vendor/github.com/gotk3/gotk3/gtk/version_test.go new file mode 100644 index 0000000..d68387c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/version_test.go @@ -0,0 +1,20 @@ +package gtk + +import "testing" + +func TestCheckVersion(t *testing.T) { + err := CheckVersion(GetMajorVersion(), GetMinorVersion(), GetMicroVersion()) + if err != nil { + t.Error(err) + } + + err = CheckVersion(GetMajorVersion(), GetMinorVersion(), GetMicroVersion()-1) + if err != nil { + t.Error(err) + } + + err = CheckVersion(GetMajorVersion(), GetMinorVersion(), GetMicroVersion()+1) + if err == nil { + t.Error("Expected to fail when an more recent version is expected") + } +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget.go b/vendor/github.com/gotk3/gotk3/gtk/widget.go new file mode 100644 index 0000000..8842dc0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget.go @@ -0,0 +1,962 @@ +// Same copyright and license as the rest of the files in this project +// This file contains accelerator related functions and structures + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "errors" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/cairo" + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkWidget + */ + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.gtk_size_request_mode_get_type()), marshalSizeRequestMode}, + + // Boxed + {glib.Type(C.gtk_requisition_get_type()), marshalRequisition}, + } + glib.RegisterGValueMarshalers(tm) + + WrapMap["GtkRequisition"] = wrapRequisition +} + +// SizeRequestMode is a representation of GTK's GtkSizeRequestMode. +type SizeRequestMode int + +const ( + SIZE_REQUEST_HEIGHT_FOR_WIDTH SizeRequestMode = C.GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH + SIZE_REQUEST_WIDTH_FOR_HEIGHT SizeRequestMode = C.GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT + SIZE_REQUEST_CONSTANT_SIZE SizeRequestMode = C.GTK_SIZE_REQUEST_CONSTANT_SIZE +) + +func marshalSizeRequestMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return SizeRequestMode(c), nil +} + +// Widget is a representation of GTK's GtkWidget. +type Widget struct { + glib.InitiallyUnowned +} + +// IWidget is an interface type implemented by all structs +// embedding a Widget. It is meant to be used as an argument type +// for wrapper functions that wrap around a C GTK function taking a +// GtkWidget. +type IWidget interface { + toWidget() *C.GtkWidget + ToWidget() *Widget + Set(string, interface{}) error +} + +type IWidgetable interface { + toWidget() *C.GtkWidget +} + +func nullableWidget(v IWidgetable) *C.GtkWidget { + if v == nil { + return nil + } + + return v.toWidget() +} + +// native returns a pointer to the underlying GtkWidget. +func (v *Widget) native() *C.GtkWidget { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkWidget(p) +} + +func (v *Widget) toWidget() *C.GtkWidget { + if v == nil { + return nil + } + return v.native() +} + +// ToWidget is a helper getter, e.g.: it returns *gtk.Label as a *gtk.Widget. +// In other cases, where you have a gtk.IWidget, use the type assertion. +func (v *Widget) ToWidget() *Widget { + return v +} + +// Cast changes the widget to an object of interface type IWidget. +// This is only useful if you don't already have an object of type IWidget at hand (see example below). +// This func is similar to gtk.Builder.GetObject(): +// The returned value needs to be type-asserted, before it can be used. +// +// Example: +// // you know that the parent is an object of type *gtk.ApplicationWindow, +// // or you want to check just in case +// parentWindow, _ := myWindow.GetTransientFor() +// intermediate, _ := parentWindow.Cast() +// appWindow, typeAssertSuccessful := intermediate.(*gtk.ApplicationWindow) +func (v *Widget) Cast() (IWidget, error) { + return castWidget(v.native()) +} + +func marshalWidget(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapWidget(obj), nil +} + +func wrapWidget(obj *glib.Object) *Widget { + if obj == nil { + return nil + } + + return &Widget{glib.InitiallyUnowned{obj}} +} + +// TODO: +// GtkCallback(). +// gtk_widget_new(). + +// Destroy is a wrapper around gtk_widget_destroy(). +func (v *Widget) Destroy() { + C.gtk_widget_destroy(v.native()) +} + +// HideOnDelete is a wrapper around gtk_widget_hide_on_delete(). +// Calling this func adds gtk_widget_hide_on_delete to the widget's "delete-event" signal. +func (v *Widget) HideOnDelete() { + C._gtk_widget_hide_on_delete(v.native()) +} + +// TODO: +// gtk_widget_set_direction(). +// gtk_widget_get_direction(). +// gtk_widget_set_default_direction(). +// gtk_widget_get_default_direction(). +// gtk_widget_input_shape_combine_region(). +// gtk_widget_create_pango_context(). +// gtk_widget_create_pango_context(). +// gtk_widget_get_pango_context(). +// gtk_widget_create_pango_layout(). + +// QueueDrawArea is a wrapper aroung gtk_widget_queue_draw_area(). +func (v *Widget) QueueDrawArea(x, y, w, h int) { + C.gtk_widget_queue_draw_area(v.native(), C.gint(x), C.gint(y), C.gint(w), C.gint(h)) +} + +// QueueDrawRegion is a wrapper aroung gtk_widget_queue_draw_region(). +func (v *Widget) QueueDrawRegion(region *cairo.Region) { + C.gtk_widget_queue_draw_region(v.native(), (*C.cairo_region_t)(unsafe.Pointer(region.Native()))) +} + +// TODO: +// gtk_widget_set_redraw_on_allocate(). +// gtk_widget_mnemonic_activate(). +// gtk_widget_class_install_style_property(). +// gtk_widget_class_install_style_property_parser(). +// gtk_widget_class_find_style_property(). +// gtk_widget_class_list_style_properties(). +// gtk_widget_send_focus_change(). +// gtk_widget_style_get(). +// gtk_widget_style_get_property(). +// gtk_widget_style_get_valist(). +// gtk_widget_class_set_accessible_type(). +// gtk_widget_get_accessible(). +// gtk_widget_child_focus(). +// gtk_widget_child_notify(). +// gtk_widget_get_child_visible(). +// gtk_widget_get_settings(). +// gtk_widget_get_clipboard(). + +// GetDisplay is a wrapper around gtk_widget_get_display(). +func (v *Widget) GetDisplay() (*gdk.Display, error) { + c := C.gtk_widget_get_display(v.native()) + if c == nil { + return nil, nilPtrErr + } + s := &gdk.Display{glib.Take(unsafe.Pointer(c))} + return s, nil +} + +// GetScreen is a wrapper around gtk_widget_get_screen(). +func (v *Widget) GetScreen() (*gdk.Screen, error) { + c := C.gtk_widget_get_screen(v.native()) + if c == nil { + return nil, nilPtrErr + } + s := &gdk.Screen{glib.Take(unsafe.Pointer(c))} + return s, nil +} + +// TODO: +// gtk_widget_has_screen(). +// gtk_widget_get_size_request(). +// gtk_widget_set_child_visible(). +// gtk_widget_list_mnemonic_labels(). +// gtk_widget_add_mnemonic_label(). +// gtk_widget_remove_mnemonic_label(). +// gtk_widget_error_bell(). +// gtk_widget_keynav_failed(). +// gtk_widget_get_tooltip_window(). +// gtk_widget_get_has_tooltip(). +// gtk_widget_set_has_tooltip(). +// gtk_widget_trigger_tooltip_query(). +// gtk_cairo_should_draw_window(). +// gtk_cairo_transform_to_window(). + +// DragDestSet is a wrapper around gtk_drag_dest_set(). +func (v *Widget) DragDestSet(flags DestDefaults, targets []TargetEntry, actions gdk.DragAction) { + C.gtk_drag_dest_set(v.native(), C.GtkDestDefaults(flags), (*C.GtkTargetEntry)(&targets[0]), C.gint(len(targets)), C.GdkDragAction(actions)) +} + +// DragSourceSet is a wrapper around gtk_drag_source_set(). +func (v *Widget) DragSourceSet(startButtonMask gdk.ModifierType, targets []TargetEntry, actions gdk.DragAction) { + C.gtk_drag_source_set(v.native(), C.GdkModifierType(startButtonMask), (*C.GtkTargetEntry)(&targets[0]), C.gint(len(targets)), C.GdkDragAction(actions)) +} + +// ResetStyle is a wrapper around gtk_widget_reset_style(). +func (v *Widget) ResetStyle() { + C.gtk_widget_reset_style(v.native()) +} + +// InDestruction is a wrapper around gtk_widget_in_destruction(). +func (v *Widget) InDestruction() bool { + return gobool(C.gtk_widget_in_destruction(v.native())) +} + +// TODO(jrick) this may require some rethinking +/* +// Destroyed is a wrapper around gtk_widget_destroyed(). +func (v *Widget) Destroyed(widgetPointer **Widget) { +} +*/ + +// Unparent is a wrapper around gtk_widget_unparent(). +func (v *Widget) Unparent() { + C.gtk_widget_unparent(v.native()) +} + +// Show is a wrapper around gtk_widget_show(). +func (v *Widget) Show() { + C.gtk_widget_show(v.native()) +} + +// Hide is a wrapper around gtk_widget_hide(). +func (v *Widget) Hide() { + C.gtk_widget_hide(v.native()) +} + +// GetCanFocus is a wrapper around gtk_widget_get_can_focus(). +func (v *Widget) GetCanFocus() bool { + c := C.gtk_widget_get_can_focus(v.native()) + return gobool(c) +} + +// SetCanFocus is a wrapper around gtk_widget_set_can_focus(). +func (v *Widget) SetCanFocus(canFocus bool) { + C.gtk_widget_set_can_focus(v.native(), gbool(canFocus)) +} + +// GetCanDefault is a wrapper around gtk_widget_get_can_default(). +func (v *Widget) GetCanDefault() bool { + c := C.gtk_widget_get_can_default(v.native()) + return gobool(c) +} + +// SetCanDefault is a wrapper around gtk_widget_set_can_default(). +func (v *Widget) SetCanDefault(canDefault bool) { + C.gtk_widget_set_can_default(v.native(), gbool(canDefault)) +} + +// SetMapped is a wrapper around gtk_widget_set_mapped(). +func (v *Widget) SetMapped(mapped bool) { + C.gtk_widget_set_mapped(v.native(), gbool(mapped)) +} + +// GetMapped is a wrapper around gtk_widget_get_mapped(). +func (v *Widget) GetMapped() bool { + c := C.gtk_widget_get_mapped(v.native()) + return gobool(c) +} + +// TODO: +// gtk_widget_device_is_shadowed(). +// gtk_widget_get_modifier_mask(). + +// InsertActionGroup is a wrapper around gtk_widget_insert_action_group(). +func (v *Widget) InsertActionGroup(name string, group glib.IActionGroup) { + C.gtk_widget_insert_action_group(v.native(), (*C.gchar)(C.CString(name)), C.toGActionGroup(unsafe.Pointer(group.Native()))) +} + +// TODO: +// gtk_widget_get_path(). + +// GetPreferredHeight is a wrapper around gtk_widget_get_preferred_height(). +func (v *Widget) GetPreferredHeight() (int, int) { + var minimum, natural C.gint + C.gtk_widget_get_preferred_height(v.native(), &minimum, &natural) + return int(minimum), int(natural) +} + +// GetPreferredWidth is a wrapper around gtk_widget_get_preferred_width(). +func (v *Widget) GetPreferredWidth() (int, int) { + var minimum, natural C.gint + C.gtk_widget_get_preferred_width(v.native(), &minimum, &natural) + return int(minimum), int(natural) +} + +// GetPreferredHeightForWidth is a wrapper around gtk_widget_get_preferred_height_for_width(). +func (v *Widget) GetPreferredHeightForWidth(width int) (int, int) { + + var minimum, natural C.gint + + C.gtk_widget_get_preferred_height_for_width( + v.native(), + C.gint(width), + &minimum, + &natural) + return int(minimum), int(natural) +} + +// GetPreferredWidthForHeight is a wrapper around gtk_widget_get_preferred_width_for_height(). +func (v *Widget) GetPreferredWidthForHeight(height int) (int, int) { + + var minimum, natural C.gint + + C.gtk_widget_get_preferred_width_for_height( + v.native(), + C.gint(height), + &minimum, + &natural) + return int(minimum), int(natural) +} + +// GetRequestMode is a wrapper around gtk_widget_get_request_mode(). +func (v *Widget) GetRequestMode() SizeRequestMode { + return SizeRequestMode(C.gtk_widget_get_request_mode(v.native())) +} + +// GetPreferredSize is a wrapper around gtk_widget_get_preferred_size(). +func (v *Widget) GetPreferredSize() (*Requisition, *Requisition) { + + minimum_size := new(C.GtkRequisition) + natural_size := new(C.GtkRequisition) + + C.gtk_widget_get_preferred_size(v.native(), minimum_size, natural_size) + + minR, err := requisitionFromNative(minimum_size) + if err != nil { + minR = nil + } + natR, err := requisitionFromNative(natural_size) + if err != nil { + natR = nil + } + + return minR, natR +} + +// TODO: +/* +gint +gtk_distribute_natural_allocation (gint extra_space, + guint n_requested_sizes, + GtkRequestedSize *sizes); +*/ + +// GetHAlign is a wrapper around gtk_widget_get_halign(). +func (v *Widget) GetHAlign() Align { + c := C.gtk_widget_get_halign(v.native()) + return Align(c) +} + +// SetHAlign is a wrapper around gtk_widget_set_halign(). +func (v *Widget) SetHAlign(align Align) { + C.gtk_widget_set_halign(v.native(), C.GtkAlign(align)) +} + +// GetVAlign is a wrapper around gtk_widget_get_valign(). +func (v *Widget) GetVAlign() Align { + c := C.gtk_widget_get_valign(v.native()) + return Align(c) +} + +// SetVAlign is a wrapper around gtk_widget_set_valign(). +func (v *Widget) SetVAlign(align Align) { + C.gtk_widget_set_valign(v.native(), C.GtkAlign(align)) +} + +// GetMarginTop is a wrapper around gtk_widget_get_margin_top(). +func (v *Widget) GetMarginTop() int { + c := C.gtk_widget_get_margin_top(v.native()) + return int(c) +} + +// SetMarginTop is a wrapper around gtk_widget_set_margin_top(). +func (v *Widget) SetMarginTop(margin int) { + C.gtk_widget_set_margin_top(v.native(), C.gint(margin)) +} + +// GetMarginBottom is a wrapper around gtk_widget_get_margin_bottom(). +func (v *Widget) GetMarginBottom() int { + c := C.gtk_widget_get_margin_bottom(v.native()) + return int(c) +} + +// SetMarginBottom is a wrapper around gtk_widget_set_margin_bottom(). +func (v *Widget) SetMarginBottom(margin int) { + C.gtk_widget_set_margin_bottom(v.native(), C.gint(margin)) +} + +// GetHExpand is a wrapper around gtk_widget_get_hexpand(). +func (v *Widget) GetHExpand() bool { + c := C.gtk_widget_get_hexpand(v.native()) + return gobool(c) +} + +// SetHExpand is a wrapper around gtk_widget_set_hexpand(). +func (v *Widget) SetHExpand(expand bool) { + C.gtk_widget_set_hexpand(v.native(), gbool(expand)) +} + +// TODO: +// gtk_widget_get_hexpand_set(). +// gtk_widget_set_hexpand_set(). + +// GetVExpand is a wrapper around gtk_widget_get_vexpand(). +func (v *Widget) GetVExpand() bool { + c := C.gtk_widget_get_vexpand(v.native()) + return gobool(c) +} + +// SetVExpand is a wrapper around gtk_widget_set_vexpand(). +func (v *Widget) SetVExpand(expand bool) { + C.gtk_widget_set_vexpand(v.native(), gbool(expand)) +} + +// TODO: +// gtk_widget_get_vexpand_set(). +// gtk_widget_set_vexpand_set(). +// gtk_widget_queue_compute_expand(). +// gtk_widget_compute_expand(). + +// GetRealized is a wrapper around gtk_widget_get_realized(). +func (v *Widget) GetRealized() bool { + c := C.gtk_widget_get_realized(v.native()) + return gobool(c) +} + +// SetRealized is a wrapper around gtk_widget_set_realized(). +func (v *Widget) SetRealized(realized bool) { + C.gtk_widget_set_realized(v.native(), gbool(realized)) +} + +// GetHasWindow is a wrapper around gtk_widget_get_has_window(). +func (v *Widget) GetHasWindow() bool { + c := C.gtk_widget_get_has_window(v.native()) + return gobool(c) +} + +// SetHasWindow is a wrapper around gtk_widget_set_has_window(). +func (v *Widget) SetHasWindow(hasWindow bool) { + C.gtk_widget_set_has_window(v.native(), gbool(hasWindow)) +} + +// ShowNow is a wrapper around gtk_widget_show_now(). +func (v *Widget) ShowNow() { + C.gtk_widget_show_now(v.native()) +} + +// ShowAll is a wrapper around gtk_widget_show_all(). +func (v *Widget) ShowAll() { + C.gtk_widget_show_all(v.native()) +} + +// SetNoShowAll is a wrapper around gtk_widget_set_no_show_all(). +func (v *Widget) SetNoShowAll(noShowAll bool) { + C.gtk_widget_set_no_show_all(v.native(), gbool(noShowAll)) +} + +// GetNoShowAll is a wrapper around gtk_widget_get_no_show_all(). +func (v *Widget) GetNoShowAll() bool { + c := C.gtk_widget_get_no_show_all(v.native()) + return gobool(c) +} + +// Map is a wrapper around gtk_widget_map(). +func (v *Widget) Map() { + C.gtk_widget_map(v.native()) +} + +// Unmap is a wrapper around gtk_widget_unmap(). +func (v *Widget) Unmap() { + C.gtk_widget_unmap(v.native()) +} + +// TODO: +//void gtk_widget_realize(GtkWidget *widget); +//void gtk_widget_unrealize(GtkWidget *widget); +//void gtk_widget_draw(GtkWidget *widget, cairo_t *cr); +//void gtk_widget_queue_resize(GtkWidget *widget); +//void gtk_widget_queue_resize_no_redraw(GtkWidget *widget); +// gtk_widget_queue_allocate(). + +// Event() is a wrapper around gtk_widget_event(). +func (v *Widget) Event(event *gdk.Event) bool { + c := C.gtk_widget_event(v.native(), + (*C.GdkEvent)(unsafe.Pointer(event.Native()))) + return gobool(c) +} + +// Activate() is a wrapper around gtk_widget_activate(). +func (v *Widget) Activate() bool { + return gobool(C.gtk_widget_activate(v.native())) +} + +// Intersect is a wrapper around gtk_widget_intersect(). +func (v *Widget) Intersect(area gdk.Rectangle) (*gdk.Rectangle, bool) { + var cRect *C.GdkRectangle + hadIntersection := C.gtk_widget_intersect(v.native(), nativeGdkRectangle(area), cRect) + intersection := gdk.WrapRectangle(uintptr(unsafe.Pointer(cRect))) + return intersection, gobool(hadIntersection) +} + +// IsFocus() is a wrapper around gtk_widget_is_focus(). +func (v *Widget) IsFocus() bool { + return gobool(C.gtk_widget_is_focus(v.native())) +} + +// GrabFocus() is a wrapper around gtk_widget_grab_focus(). +func (v *Widget) GrabFocus() { + C.gtk_widget_grab_focus(v.native()) +} + +// GrabDefault() is a wrapper around gtk_widget_grab_default(). +func (v *Widget) GrabDefault() { + C.gtk_widget_grab_default(v.native()) +} + +// SetName() is a wrapper around gtk_widget_set_name(). +func (v *Widget) SetName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_widget_set_name(v.native(), (*C.gchar)(cstr)) +} + +// GetName() is a wrapper around gtk_widget_get_name(). A non-nil +// error is returned in the case that gtk_widget_get_name returns NULL to +// differentiate between NULL and an empty string. +func (v *Widget) GetName() (string, error) { + c := C.gtk_widget_get_name(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// GetSensitive is a wrapper around gtk_widget_get_sensitive(). +func (v *Widget) GetSensitive() bool { + c := C.gtk_widget_get_sensitive(v.native()) + return gobool(c) +} + +// IsSensitive is a wrapper around gtk_widget_is_sensitive(). +func (v *Widget) IsSensitive() bool { + c := C.gtk_widget_is_sensitive(v.native()) + return gobool(c) +} + +// SetSensitive is a wrapper around gtk_widget_set_sensitive(). +func (v *Widget) SetSensitive(sensitive bool) { + C.gtk_widget_set_sensitive(v.native(), gbool(sensitive)) +} + +// GetVisible is a wrapper around gtk_widget_get_visible(). +func (v *Widget) GetVisible() bool { + c := C.gtk_widget_get_visible(v.native()) + return gobool(c) +} + +// SetVisible is a wrapper around gtk_widget_set_visible(). +func (v *Widget) SetVisible(visible bool) { + C.gtk_widget_set_visible(v.native(), gbool(visible)) +} + +// SetParent is a wrapper around gtk_widget_set_parent(). +func (v *Widget) SetParent(parent IWidget) { + C.gtk_widget_set_parent(v.native(), parent.toWidget()) +} + +// GetParent is a wrapper around gtk_widget_get_parent(). +func (v *Widget) GetParent() (IWidget, error) { + c := C.gtk_widget_get_parent(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetSizeRequest is a wrapper around gtk_widget_set_size_request(). +func (v *Widget) SetSizeRequest(width, height int) { + C.gtk_widget_set_size_request(v.native(), C.gint(width), C.gint(height)) +} + +// GetSizeRequest is a wrapper around gtk_widget_get_size_request(). +func (v *Widget) GetSizeRequest() (width, height int) { + var w, h C.gint + C.gtk_widget_get_size_request(v.native(), &w, &h) + return int(w), int(h) +} + +// SetParentWindow is a wrapper around gtk_widget_set_parent_window(). +func (v *Widget) SetParentWindow(parentWindow *gdk.Window) { + C.gtk_widget_set_parent_window(v.native(), + (*C.GdkWindow)(unsafe.Pointer(parentWindow.Native()))) +} + +// GetParentWindow is a wrapper around gtk_widget_get_parent_window(). +func (v *Widget) GetParentWindow() (*gdk.Window, error) { + c := C.gtk_widget_get_parent_window(v.native()) + if v == nil { + return nil, nilPtrErr + } + + w := &gdk.Window{glib.Take(unsafe.Pointer(c))} + return w, nil +} + +// SetEvents is a wrapper around gtk_widget_set_events(). +func (v *Widget) SetEvents(events int) { + C.gtk_widget_set_events(v.native(), C.gint(events)) +} + +// GetEvents is a wrapper around gtk_widget_get_events(). +func (v *Widget) GetEvents() int { + return int(C.gtk_widget_get_events(v.native())) +} + +// AddEvents is a wrapper around gtk_widget_add_events(). +func (v *Widget) AddEvents(events int) { + C.gtk_widget_add_events(v.native(), C.gint(events)) +} + +// TODO: +/* +// gtk_widget_set_device_events(). +func (v *Widget) SetDeviceEvents() { +} +*/ + +/* +// gtk_widget_get_device_events(). +func (v *Widget) GetDeviceEvents() { +} +*/ + +/* +// gtk_widget_add_device_events(). +func (v *Widget) AddDeviceEvents() { +} +*/ + +// FreezeChildNotify is a wrapper around gtk_widget_freeze_child_notify(). +func (v *Widget) FreezeChildNotify() { + C.gtk_widget_freeze_child_notify(v.native()) +} + +// ThawChildNotify is a wrapper around gtk_widget_thaw_child_notify(). +func (v *Widget) ThawChildNotify() { + C.gtk_widget_thaw_child_notify(v.native()) +} + +// HasDefault is a wrapper around gtk_widget_has_default(). +func (v *Widget) HasDefault() bool { + c := C.gtk_widget_has_default(v.native()) + return gobool(c) +} + +// HasFocus is a wrapper around gtk_widget_has_focus(). +func (v *Widget) HasFocus() bool { + c := C.gtk_widget_has_focus(v.native()) + return gobool(c) +} + +// HasVisibleFocus is a wrapper around gtk_widget_has_visible_focus(). +func (v *Widget) HasVisibleFocus() bool { + c := C.gtk_widget_has_visible_focus(v.native()) + return gobool(c) +} + +// HasGrab is a wrapper around gtk_widget_has_grab(). +func (v *Widget) HasGrab() bool { + c := C.gtk_widget_has_grab(v.native()) + return gobool(c) +} + +// IsDrawable is a wrapper around gtk_widget_is_drawable(). +func (v *Widget) IsDrawable() bool { + c := C.gtk_widget_is_drawable(v.native()) + return gobool(c) +} + +// IsToplevel is a wrapper around gtk_widget_is_toplevel(). +func (v *Widget) IsToplevel() bool { + c := C.gtk_widget_is_toplevel(v.native()) + return gobool(c) +} + +// FIXME: +// gtk_widget_set_window(). +// gtk_widget_set_receives_default(). +// gtk_widget_get_receives_default(). +// gtk_widget_set_support_multidevice(). +// gtk_widget_get_support_multidevice(). + +// SetDeviceEnabled is a wrapper around gtk_widget_set_device_enabled(). +func (v *Widget) SetDeviceEnabled(device *gdk.Device, enabled bool) { + C.gtk_widget_set_device_enabled(v.native(), + (*C.GdkDevice)(unsafe.Pointer(device.Native())), gbool(enabled)) +} + +// GetDeviceEnabled is a wrapper around gtk_widget_get_device_enabled(). +func (v *Widget) GetDeviceEnabled(device *gdk.Device) bool { + c := C.gtk_widget_get_device_enabled(v.native(), + (*C.GdkDevice)(unsafe.Pointer(device.Native()))) + return gobool(c) +} + +// GetToplevel is a wrapper around gtk_widget_get_toplevel(). +func (v *Widget) GetToplevel() (IWidget, error) { + c := C.gtk_widget_get_toplevel(v.native()) + if c == nil { + return nil, nilPtrErr + } + return castWidget(c) +} + +// TODO: +// gtk_widget_get_ancestor(). +// gtk_widget_get_visual(). +// gtk_widget_is_ancestor(). + +// GetTooltipMarkup is a wrapper around gtk_widget_get_tooltip_markup(). +// A non-nil error is returned in the case that gtk_widget_get_tooltip_markup +// returns NULL to differentiate between NULL and an empty string. +func (v *Widget) GetTooltipMarkup() (string, error) { + c := C.gtk_widget_get_tooltip_markup(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// SetTooltipMarkup is a wrapper around gtk_widget_set_tooltip_markup(). +func (v *Widget) SetTooltipMarkup(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_widget_set_tooltip_markup(v.native(), (*C.gchar)(cstr)) +} + +// GetTooltipText is a wrapper around gtk_widget_get_tooltip_text(). +// A non-nil error is returned in the case that +// gtk_widget_get_tooltip_text returns NULL to differentiate between NULL +// and an empty string. +func (v *Widget) GetTooltipText() (string, error) { + c := C.gtk_widget_get_tooltip_text(v.native()) + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// SetTooltipText is a wrapper around gtk_widget_set_tooltip_text(). +func (v *Widget) SetTooltipText(text string) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_widget_set_tooltip_text(v.native(), (*C.gchar)(cstr)) +} + +// TranslateCoordinates is a wrapper around gtk_widget_translate_coordinates(). +func (v *Widget) TranslateCoordinates(dest IWidget, srcX, srcY int) (destX, destY int, e error) { + cdest := nullableWidget(dest) + + var cdestX, cdestY C.gint + c := C.gtk_widget_translate_coordinates(v.native(), cdest, C.gint(srcX), C.gint(srcY), &cdestX, &cdestY) + if !gobool(c) { + return 0, 0, errors.New("translate coordinates failed") + } + return int(cdestX), int(cdestY), nil +} + +// SetVisual is a wrapper around gtk_widget_set_visual(). +func (v *Widget) SetVisual(visual *gdk.Visual) { + C.gtk_widget_set_visual(v.native(), + (*C.GdkVisual)(unsafe.Pointer(visual.Native()))) +} + +// SetAppPaintable is a wrapper around gtk_widget_set_app_paintable(). +func (v *Widget) SetAppPaintable(paintable bool) { + C.gtk_widget_set_app_paintable(v.native(), gbool(paintable)) +} + +// GetAppPaintable is a wrapper around gtk_widget_get_app_paintable(). +func (v *Widget) GetAppPaintable() bool { + c := C.gtk_widget_get_app_paintable(v.native()) + return gobool(c) +} + +// QueueDraw is a wrapper around gtk_widget_queue_draw(). +func (v *Widget) QueueDraw() { + C.gtk_widget_queue_draw(v.native()) +} + +// GetAllocation is a wrapper around gtk_widget_get_allocation(). +func (v *Widget) GetAllocation() *Allocation { + var a Allocation + C.gtk_widget_get_allocation(v.native(), a.native()) + return &a +} + +// SetAllocation is a wrapper around gtk_widget_set_allocation(). +func (v *Widget) SetAllocation(allocation *Allocation) { + C.gtk_widget_set_allocation(v.native(), allocation.native()) +} + +// SizeAllocate is a wrapper around gtk_widget_size_allocate(). +func (v *Widget) SizeAllocate(allocation *Allocation) { + C.gtk_widget_size_allocate(v.native(), allocation.native()) +} + +// TODO: +// gtk_widget_size_allocate_with_baseline(). + +// SetStateFlags is a wrapper around gtk_widget_set_state_flags(). +func (v *Widget) SetStateFlags(stateFlags StateFlags, clear bool) { + C.gtk_widget_set_state_flags(v.native(), C.GtkStateFlags(stateFlags), gbool(clear)) +} + +// TODO: +// gtk_widget_unset_state_flags(). +// gtk_widget_get_state_flags(). + +// GetWindow is a wrapper around gtk_widget_get_window(). +func (v *Widget) GetWindow() (*gdk.Window, error) { + c := C.gtk_widget_get_window(v.native()) + if c == nil { + return nil, nilPtrErr + } + + w := &gdk.Window{glib.Take(unsafe.Pointer(c))} + return w, nil +} + +/* + * GtkRequisition + */ + +// Requisition is a representation of GTK's GtkRequisition +type Requisition struct { + requisition *C.GtkRequisition + Width, + Height int +} + +func (v *Requisition) native() *C.GtkRequisition { + if v == nil { + return nil + } + v.requisition.width = C.int(v.Width) + v.requisition.height = C.int(v.Height) + return v.requisition +} + +// Native returns a pointer to the underlying GtkRequisition. +func (v *Requisition) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func marshalRequisition(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + requisition := (*C.GtkRequisition)(unsafe.Pointer(c)) + return wrapRequisition(requisition), nil +} + +func wrapRequisition(requisition *C.GtkRequisition) *Requisition { + if requisition == nil { + return nil + } + return &Requisition{requisition, int(requisition.width), int(requisition.height)} +} + +// requisitionFromNative that handle finalizer. +func requisitionFromNative(requisitionNative *C.GtkRequisition) (*Requisition, error) { + requisition := wrapRequisition(requisitionNative) + if requisition == nil { + return nil, nilPtrErr + } + runtime.SetFinalizer(requisition, (*Requisition).free) + return requisition, nil +} + +// RequisitionNew is a wrapper around gtk_requisition_new(). +func RequisitionNew() (*Requisition, error) { + c := C.gtk_requisition_new() + if c == nil { + return nil, nilPtrErr + } + return requisitionFromNative(c) +} + +// free is a wrapper around gtk_requisition_free(). +func (v *Requisition) free() { + C.gtk_requisition_free(v.native()) +} + +// Copy is a wrapper around gtk_requisition_copy(). +func (v *Requisition) Copy() (*Requisition, error) { + c := C.gtk_requisition_copy(v.native()) + if c == nil { + return nil, nilPtrErr + } + return requisitionFromNative(c) +} + +/* + * GtkAllocation + */ + +// Allocation is a representation of GTK's GtkAllocation type. +type Allocation struct { + gdk.Rectangle +} + +// Native returns a pointer to the underlying GtkAllocation. +func (v *Allocation) native() *C.GtkAllocation { + return (*C.GtkAllocation)(unsafe.Pointer(&v.GdkRectangle)) +} + +// GetAllocatedWidth() is a wrapper around gtk_widget_get_allocated_width(). +func (v *Widget) GetAllocatedWidth() int { + return int(C.gtk_widget_get_allocated_width(v.native())) +} + +// GetAllocatedHeight() is a wrapper around gtk_widget_get_allocated_height(). +func (v *Widget) GetAllocatedHeight() int { + return int(C.gtk_widget_get_allocated_height(v.native())) +} + +// TODO: +// gtk_widget_get_allocated_baseline(). +// gtk_widget_get_allocated_size(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_export_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/widget_export_since_3_8.go new file mode 100644 index 0000000..63ba965 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_export_since_3_8.go @@ -0,0 +1,23 @@ +// +build !gtk_3_6 + +package gtk + +// #include +// #include +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/internal/callback" +) + +//export goTickCallbacks +func goTickCallbacks(widget *C.GtkWidget, frameClock *C.GdkFrameClock, userData C.gpointer) C.gboolean { + fn := callback.Get(uintptr(userData)).(TickCallback) + return gbool(fn( + wrapWidget(glib.Take(unsafe.Pointer(widget))), + gdk.WrapFrameClock(unsafe.Pointer(frameClock)), + )) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_10.go new file mode 100644 index 0000000..6d6a1c8 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_10.go @@ -0,0 +1,44 @@ +// +build !gtk_3_6,!gtk_3_8 + +package gtk + +// #include +import "C" + +// GetPreferredHeightAndBaselineForWidth is a wrapper around gtk_widget_get_preferred_height_and_baseline_for_width(). +func (v *Widget) GetPreferredHeightAndBaselineForWidth(height int) (int, int, int, int) { + + var minimum, natural, minimum_baseline, natural_baseline C.gint + + C.gtk_widget_get_preferred_height_and_baseline_for_width( + v.native(), + C.gint(height), + &minimum, + &natural, + &minimum_baseline, + &natural_baseline) + return int(minimum), + int(natural), + int(minimum_baseline), + int(natural_baseline) +} + +// TODO: +// gtk_widget_get_valign_with_baseline(). +// gtk_widget_init_template(). +// gtk_widget_class_set_template(). +// gtk_widget_class_set_template_from_resource(). +// gtk_widget_get_template_child(). +// gtk_widget_class_bind_template_child(). +// gtk_widget_class_bind_template_child_internal(). +// gtk_widget_class_bind_template_child_private(). +// gtk_widget_class_bind_template_child_internal_private(). +// gtk_widget_class_bind_template_child_full(). +// gtk_widget_class_bind_template_callback(). +// gtk_widget_class_bind_template_callback_full(). +// gtk_widget_class_set_connect_func(). + +// GetScaleFactor is a wrapper around gtk_widget_get_scale_factor(). +func (v *Widget) GetScaleFactor() int { + return int(C.gtk_widget_get_scale_factor(v.native())) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_12.go new file mode 100644 index 0000000..893fc1e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_12.go @@ -0,0 +1,49 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols included since GTK 3.12, and +// and should not be included in a build intended to target any older GTK +// versions. To target an older build, such as 3.10, use +// 'go build -tags gtk_3_10'. Otherwise, if no build tags are used, GTK 3.12 +// is assumed and this file is built. +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +package gtk + +// #include +import "C" + +// SetMarginStart is a wrapper around gtk_widget_set_margin_start(). +func (v *Widget) SetMarginStart(margin int) { + C.gtk_widget_set_margin_start(v.native(), C.gint(margin)) +} + +// GetMarginStart is a wrapper around gtk_widget_get_margin_start(). +func (v *Widget) GetMarginStart() int { + c := C.gtk_widget_get_margin_start(v.native()) + return int(c) +} + +// SetMarginEnd is a wrapper around gtk_widget_set_margin_end(). +func (v *Widget) SetMarginEnd(margin int) { + C.gtk_widget_set_margin_end(v.native(), C.gint(margin)) +} + +// GetMarginEnd is a wrapper around gtk_widget_get_margin_end(). +func (v *Widget) GetMarginEnd() int { + c := C.gtk_widget_get_margin_end(v.native()) + return int(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_14.go new file mode 100644 index 0000000..c777127 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_14.go @@ -0,0 +1,20 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +// See: https://developer.gnome.org/gtk3/3.14/api-index-3-14.html + +package gtk + +// #include +import "C" + +// GetClip is a wrapper around gtk_widget_get_clip(). +func (v *Widget) GetClip() *Allocation { + var clip Allocation + C.gtk_widget_get_clip(v.native(), clip.native()) + return &clip +} + +// SetClip is a wrapper around gtk_widget_set_clip(). +func (v *Widget) SetClip(clip *Allocation) { + C.gtk_widget_set_clip(v.native(), clip.native()) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_16.go new file mode 100644 index 0000000..d25f961 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_16.go @@ -0,0 +1,10 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 + +package gtk + +// #include +import "C" + +// TODO: +// gtk_widget_list_action_prefixes(). +// gtk_widget_get_action_group(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_18.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_18.go new file mode 100644 index 0000000..0891470 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_18.go @@ -0,0 +1,12 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16 + +package gtk + +// #include +import "C" + +// TODO: +// gtk_widget_set_font_options(). +// gtk_widget_get_font_options(). +// gtk_widget_set_font_map(). +// gtk_widget_get_font_map(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_20.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_20.go new file mode 100644 index 0000000..1365034 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_20.go @@ -0,0 +1,21 @@ +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16,!gtk_3_18 + +package gtk + +// #include +import "C" + +// GetFocusOnClick is a wrapper around gtk_widget_get_focus_on_click(). +func (v *Widget) GetFocusOnClick() bool { + c := C.gtk_widget_get_focus_on_click(v.native()) + return gobool(c) +} + +// SetFocusOnClick is a wrapper around gtk_widget_set_focus_on_click(). +func (v *Widget) SetFocusOnClick(focusOnClick bool) { + C.gtk_widget_set_focus_on_click(v.native(), gbool(focusOnClick)) +} + +// TODO: +// gtk_widget_class_get_css_name(). +// gtk_widget_class_set_css_name(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go new file mode 100644 index 0000000..34db307 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go @@ -0,0 +1,83 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// This file includes wrapers for symbols included since GTK 3.8, and +// and should not be included in a build intended to target any older GTK +// versions. To target an older build, such as 3.8, use +// 'go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.18 +// is assumed and this file is built. +// +build !gtk_3_6 + +package gtk + +// #include +// #include "widget_since_3_8.go.h" +import "C" + +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/internal/callback" +) + +/* + * GtkTickCallback + */ + +// TickCallback is a representation of GtkTickCallback +type TickCallback func(widget *Widget, frameClock *gdk.FrameClock) bool + +/* + * GtkWidget + */ + +// IsVisible is a wrapper around gtk_widget_is_visible(). +func (v *Widget) IsVisible() bool { + c := C.gtk_widget_is_visible(v.native()) + return gobool(c) +} + +// SetOpacity is a wrapper around gtk_widget_set_opacity() +func (v *Widget) SetOpacity(opacity float64) { + C.gtk_widget_set_opacity(v.native(), C.double(opacity)) +} + +// GetOpacity is a wrapper around gtk_widget_get_opacity() +func (v *Widget) GetOpacity() float64 { + c := C.gtk_widget_get_opacity(v.native()) + return float64(c) +} + +// GetFrameClock is a wrapper around gtk_widget_get_frame_clock(). +func (v *Widget) GetFrameClock() *gdk.FrameClock { + c := C.gtk_widget_get_frame_clock(v.native()) + return gdk.WrapFrameClock(unsafe.Pointer(c)) +} + +// AddTickCallback is a wrapper around gtk_widget_add_tick_callback(). +func (v *Widget) AddTickCallback(fn TickCallback) int { + return int(C._gtk_widget_add_tick_callback(v.native(), C.gpointer(callback.Assign(fn)))) +} + +// RemoveTickCallback is a wrapper around gtk_widget_remove_tick_callback(). +func (v *Widget) RemoveTickCallback(id int) { + C.gtk_widget_remove_tick_callback(v.native(), C.guint(id)) +} + +// TODO: +// gtk_widget_register_window(). +// gtk_widget_unregister_window(). diff --git a/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go.h b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go.h new file mode 100644 index 0000000..f9627f4 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/widget_since_3_8.go.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2013-2014 Conformal Systems + * + * This file originated from: http://opensource.conformal.com/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "gtk.go.h" // for gotk3_callbackDelete +#include + +extern gboolean goTickCallbacks(GtkWidget *widget, GdkFrameClock *frame_clock, + gpointer user_data); + +static inline guint _gtk_widget_add_tick_callback(GtkWidget *widget, + gpointer user_data) { + return gtk_widget_add_tick_callback( + widget, (GtkTickCallback)(goTickCallbacks), user_data, + (GDestroyNotify)(gotk3_callbackDelete)); +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window.go b/vendor/github.com/gotk3/gotk3/gtk/window.go new file mode 100644 index 0000000..7e56e39 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window.go @@ -0,0 +1,727 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "errors" + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkWindow + */ + +// gtk_window_set_has_user_ref_count is NOT included, see GTK documentation for why that is. + +// Window is a representation of GTK's GtkWindow. +type Window struct { + Bin +} + +// IWindow is an interface type implemented by all structs embedding a +// Window. It is meant to be used as an argument type for wrapper +// functions that wrap around a C GTK function taking a GtkWindow. +type IWindow interface { + toWindow() *C.GtkWindow + ToWindow() *Window +} + +// native returns a pointer to the underlying GtkWindow. +func (v *Window) native() *C.GtkWindow { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkWindow(p) +} + +func (v *Window) toWindow() *C.GtkWindow { + if v == nil { + return nil + } + return v.native() +} + +// ToWindow is a helper getter, e.g.: it returns *gtk.ApplicationWindow as a *gtk.Window. +// In other cases, where you have a gtk.IWindow, use the type assertion. +func (v *Window) ToWindow() *Window { + return v +} + +func marshalWindow(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapWindow(obj), nil +} + +func wrapWindow(obj *glib.Object) *Window { + if obj == nil { + return nil + } + + return &Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}} +} + +// WindowNew is a wrapper around gtk_window_new(). +func WindowNew(t WindowType) (*Window, error) { + c := C.gtk_window_new(C.GtkWindowType(t)) + if c == nil { + return nil, nilPtrErr + } + return wrapWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// SetTitle is a wrapper around gtk_window_set_title(). +func (v *Window) SetTitle(title string) { + cstr := C.CString(title) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_window_set_title(v.native(), (*C.gchar)(cstr)) +} + +// SetResizable is a wrapper around gtk_window_set_resizable(). +func (v *Window) SetResizable(resizable bool) { + C.gtk_window_set_resizable(v.native(), gbool(resizable)) +} + +// GetResizable is a wrapper around gtk_window_get_resizable(). +func (v *Window) GetResizable() bool { + c := C.gtk_window_get_resizable(v.native()) + return gobool(c) +} + +// ActivateFocus is a wrapper around gtk_window_activate_focus(). +func (v *Window) ActivateFocus() bool { + c := C.gtk_window_activate_focus(v.native()) + return gobool(c) +} + +// ActivateDefault is a wrapper around gtk_window_activate_default(). +func (v *Window) ActivateDefault() bool { + c := C.gtk_window_activate_default(v.native()) + return gobool(c) +} + +// SetModal is a wrapper around gtk_window_set_modal(). +func (v *Window) SetModal(modal bool) { + C.gtk_window_set_modal(v.native(), gbool(modal)) +} + +// SetDefaultSize is a wrapper around gtk_window_set_default_size(). +func (v *Window) SetDefaultSize(width, height int) { + C.gtk_window_set_default_size(v.native(), C.gint(width), C.gint(height)) +} + +// SetIcon is a wrapper around gtk_window_set_icon(). +func (v *Window) SetIcon(icon *gdk.Pixbuf) { + iconPtr := (*C.GdkPixbuf)(unsafe.Pointer(icon.Native())) + C.gtk_window_set_icon(v.native(), iconPtr) +} + +// WindowSetDefaultIcon is a wrapper around gtk_window_set_default_icon(). +func WindowSetDefaultIcon(icon *gdk.Pixbuf) { + iconPtr := (*C.GdkPixbuf)(unsafe.Pointer(icon.Native())) + C.gtk_window_set_default_icon(iconPtr) +} + +// SetGeometryHints is a wrapper around gtk_window_set_geometry_hints(). +func (v *Window) SetGeometryHints(geometryWidget IWidget, geometry gdk.Geometry, geometryMask gdk.WindowHints) { + var gW *C.GtkWidget = nil + if geometryWidget != nil { + gW = geometryWidget.toWidget() + } + C.gtk_window_set_geometry_hints(v.native(), gW, nativeGdkGeometry(geometry), C.GdkWindowHints(geometryMask)) +} + +// SetGravity is a wrapper around gtk_window_set_gravity(). +func (v *Window) SetGravity(gravity gdk.Gravity) { + C.gtk_window_set_gravity(v.native(), C.GdkGravity(gravity)) +} + +// GetGravity is a wrapper around gtk_window_get_gravity(). +func (v *Window) GetGravity() gdk.Gravity { + c := C.gtk_window_get_gravity(v.native()) + return gdk.Gravity(c) +} + +// SetPosition is a wrapper around gtk_window_set_position(). +func (v *Window) SetPosition(position WindowPosition) { + C.gtk_window_set_position(v.native(), C.GtkWindowPosition(position)) +} + +// SetTransientFor is a wrapper around gtk_window_set_transient_for(). +func (v *Window) SetTransientFor(parent IWindow) { + var pw *C.GtkWindow = nil + if parent != nil { + pw = parent.toWindow() + } + C.gtk_window_set_transient_for(v.native(), pw) +} + +// SetAttachedTo is a wrapper around gtk_window_set_attached_to(). +func (v *Window) SetAttachedTo(attachWidget IWidget) { + var aW *C.GtkWidget = nil + if attachWidget != nil { + aW = attachWidget.toWidget() + } + C.gtk_window_set_attached_to(v.native(), aW) +} + +// SetDestroyWithParent is a wrapper around +// gtk_window_set_destroy_with_parent(). +func (v *Window) SetDestroyWithParent(setting bool) { + C.gtk_window_set_destroy_with_parent(v.native(), gbool(setting)) +} + +// SetHideTitlebarWhenMaximized is a wrapper around +// gtk_window_set_hide_titlebar_when_maximized(). +func (v *Window) SetHideTitlebarWhenMaximized(setting bool) { + C.gtk_window_set_hide_titlebar_when_maximized(v.native(), + gbool(setting)) +} + +// IsActive is a wrapper around gtk_window_is_active(). +func (v *Window) IsActive() bool { + c := C.gtk_window_is_active(v.native()) + return gobool(c) +} + +// HasToplevelFocus is a wrapper around gtk_window_has_toplevel_focus(). +func (v *Window) HasToplevelFocus() bool { + c := C.gtk_window_has_toplevel_focus(v.native()) + return gobool(c) +} + +// GetFocus is a wrapper around gtk_window_get_focus(). +func (v *Window) GetFocus() (IWidget, error) { + c := C.gtk_window_get_focus(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetFocus is a wrapper around gtk_window_set_focus(). +func (v *Window) SetFocus(w *Widget) { + C.gtk_window_set_focus(v.native(), w.native()) +} + +// GetDefaultWidget is a wrapper around gtk_window_get_default_widget(). +// See SetDefault() for the setter. +func (v *Window) GetDefaultWidget() (IWidget, error) { + c := C.gtk_window_get_default_widget(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// SetDefault is a wrapper around gtk_window_set_default(). +// See GetDefaultWidget() for the getter. +func (v *Window) SetDefault(widget IWidget) { + C.gtk_window_set_default(v.native(), widget.toWidget()) +} + +// Present is a wrapper around gtk_window_present(). +func (v *Window) Present() { + C.gtk_window_present(v.native()) +} + +// PresentWithTime is a wrapper around gtk_window_present_with_time(). +func (v *Window) PresentWithTime(ts uint32) { + C.gtk_window_present_with_time(v.native(), C.guint32(ts)) +} + +// Iconify is a wrapper around gtk_window_iconify(). +func (v *Window) Iconify() { + C.gtk_window_iconify(v.native()) +} + +// Deiconify is a wrapper around gtk_window_deiconify(). +func (v *Window) Deiconify() { + C.gtk_window_deiconify(v.native()) +} + +// Stick is a wrapper around gtk_window_stick(). +func (v *Window) Stick() { + C.gtk_window_stick(v.native()) +} + +// Unstick is a wrapper around gtk_window_unstick(). +func (v *Window) Unstick() { + C.gtk_window_unstick(v.native()) +} + +// Maximize is a wrapper around gtk_window_maximize(). +func (v *Window) Maximize() { + C.gtk_window_maximize(v.native()) +} + +// Unmaximize is a wrapper around gtk_window_unmaximize(). +func (v *Window) Unmaximize() { + C.gtk_window_unmaximize(v.native()) +} + +// Fullscreen is a wrapper around gtk_window_fullscreen(). +func (v *Window) Fullscreen() { + C.gtk_window_fullscreen(v.native()) +} + +// Unfullscreen is a wrapper around gtk_window_unfullscreen(). +func (v *Window) Unfullscreen() { + C.gtk_window_unfullscreen(v.native()) +} + +// SetKeepAbove is a wrapper around gtk_window_set_keep_above(). +func (v *Window) SetKeepAbove(setting bool) { + C.gtk_window_set_keep_above(v.native(), gbool(setting)) +} + +// SetKeepBelow is a wrapper around gtk_window_set_keep_below(). +func (v *Window) SetKeepBelow(setting bool) { + C.gtk_window_set_keep_below(v.native(), gbool(setting)) +} + +// SetDecorated is a wrapper around gtk_window_set_decorated(). +func (v *Window) SetDecorated(setting bool) { + C.gtk_window_set_decorated(v.native(), gbool(setting)) +} + +// SetDeletable is a wrapper around gtk_window_set_deletable(). +func (v *Window) SetDeletable(setting bool) { + C.gtk_window_set_deletable(v.native(), gbool(setting)) +} + +// SetTypeHint is a wrapper around gtk_window_set_type_hint(). +func (v *Window) SetTypeHint(typeHint gdk.WindowTypeHint) { + C.gtk_window_set_type_hint(v.native(), C.GdkWindowTypeHint(typeHint)) +} + +// SetSkipTaskbarHint is a wrapper around gtk_window_set_skip_taskbar_hint(). +func (v *Window) SetSkipTaskbarHint(setting bool) { + C.gtk_window_set_skip_taskbar_hint(v.native(), gbool(setting)) +} + +// SetSkipPagerHint is a wrapper around gtk_window_set_skip_pager_hint(). +func (v *Window) SetSkipPagerHint(setting bool) { + C.gtk_window_set_skip_pager_hint(v.native(), gbool(setting)) +} + +// SetUrgencyHint is a wrapper around gtk_window_set_urgency_hint(). +func (v *Window) SetUrgencyHint(setting bool) { + C.gtk_window_set_urgency_hint(v.native(), gbool(setting)) +} + +// SetAcceptFocus is a wrapper around gtk_window_set_accept_focus(). +func (v *Window) SetAcceptFocus(setting bool) { + C.gtk_window_set_accept_focus(v.native(), gbool(setting)) +} + +// SetFocusOnMap is a wrapper around gtk_window_set_focus_on_map(). +func (v *Window) SetFocusOnMap(setting bool) { + C.gtk_window_set_focus_on_map(v.native(), gbool(setting)) +} + +// SetStartupID is a wrapper around gtk_window_set_startup_id(). +func (v *Window) SetStartupID(sid string) { + cstr := (*C.gchar)(C.CString(sid)) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_window_set_startup_id(v.native(), cstr) +} + +// SetRole is a wrapper around gtk_window_set_role(). +func (v *Window) SetRole(s string) { + cstr := (*C.gchar)(C.CString(s)) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_window_set_role(v.native(), cstr) +} + +// GetDecorated is a wrapper around gtk_window_get_decorated(). +func (v *Window) GetDecorated() bool { + c := C.gtk_window_get_decorated(v.native()) + return gobool(c) +} + +// GetDeletable is a wrapper around gtk_window_get_deletable(). +func (v *Window) GetDeletable() bool { + c := C.gtk_window_get_deletable(v.native()) + return gobool(c) +} + +// WindowGetDefaultIconName is a wrapper around gtk_window_get_default_icon_name(). +func WindowGetDefaultIconName() (string, error) { + return stringReturn(C.gtk_window_get_default_icon_name()) +} + +// GetDefaultSize is a wrapper around gtk_window_get_default_size(). +func (v *Window) GetDefaultSize() (width, height int) { + var w, h C.gint + C.gtk_window_get_default_size(v.native(), &w, &h) + return int(w), int(h) +} + +// GetDestroyWithParent is a wrapper around +// gtk_window_get_destroy_with_parent(). +func (v *Window) GetDestroyWithParent() bool { + c := C.gtk_window_get_destroy_with_parent(v.native()) + return gobool(c) +} + +// GetHideTitlebarWhenMaximized is a wrapper around +// gtk_window_get_hide_titlebar_when_maximized(). +func (v *Window) GetHideTitlebarWhenMaximized() bool { + c := C.gtk_window_get_hide_titlebar_when_maximized(v.native()) + return gobool(c) +} + +// GetIcon is a wrapper around gtk_window_get_icon(). +func (v *Window) GetIcon() (*gdk.Pixbuf, error) { + c := C.gtk_window_get_icon(v.native()) + if c == nil { + return nil, nil + } + return &gdk.Pixbuf{glib.Take(unsafe.Pointer(c))}, nil +} + +// GetIconName is a wrapper around gtk_window_get_icon_name(). +func (v *Window) GetIconName() (string, error) { + return stringReturn(C.gtk_window_get_icon_name(v.native())) +} + +// GetModal is a wrapper around gtk_window_get_modal(). +func (v *Window) GetModal() bool { + c := C.gtk_window_get_modal(v.native()) + return gobool(c) +} + +// GetPosition is a wrapper around gtk_window_get_position(). +func (v *Window) GetPosition() (int, int) { + var x, y C.gint + C.gtk_window_get_position(v.native(), &x, &y) + return int(x), int(y) +} + +func stringReturn(c *C.gchar) (string, error) { + if c == nil { + return "", nilPtrErr + } + return C.GoString((*C.char)(c)), nil +} + +// GetRole is a wrapper around gtk_window_get_role(). +func (v *Window) GetRole() (string, error) { + return stringReturn(C.gtk_window_get_role(v.native())) +} + +// GetSize is a wrapper around gtk_window_get_size(). +func (v *Window) GetSize() (width, height int) { + var w, h C.gint + C.gtk_window_get_size(v.native(), &w, &h) + return int(w), int(h) +} + +// GetTitle is a wrapper around gtk_window_get_title(). +func (v *Window) GetTitle() (string, error) { + return stringReturn(C.gtk_window_get_title(v.native())) +} + +// GetTransientFor is a wrapper around gtk_window_get_transient_for(). +func (v *Window) GetTransientFor() (*Window, error) { + c := C.gtk_window_get_transient_for(v.native()) + if c == nil { + return nil, nil + } + return wrapWindow(glib.Take(unsafe.Pointer(c))), nil +} + +// GetAttachedTo is a wrapper around gtk_window_get_attached_to(). +func (v *Window) GetAttachedTo() (IWidget, error) { + c := C.gtk_window_get_attached_to(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetTypeHint is a wrapper around gtk_window_get_type_hint(). +func (v *Window) GetTypeHint() gdk.WindowTypeHint { + c := C.gtk_window_get_type_hint(v.native()) + return gdk.WindowTypeHint(c) +} + +// GetSkipTaskbarHint is a wrapper around gtk_window_get_skip_taskbar_hint(). +func (v *Window) GetSkipTaskbarHint() bool { + c := C.gtk_window_get_skip_taskbar_hint(v.native()) + return gobool(c) +} + +// GetSkipPagerHint is a wrapper around gtk_window_get_skip_pager_hint(). +func (v *Window) GetSkipPagerHint() bool { + c := C.gtk_window_get_skip_pager_hint(v.native()) + return gobool(c) +} + +// GetUrgencyHint is a wrapper around gtk_window_get_urgency_hint(). +func (v *Window) GetUrgencyHint() bool { + c := C.gtk_window_get_urgency_hint(v.native()) + return gobool(c) +} + +// GetAcceptFocus is a wrapper around gtk_window_get_accept_focus(). +func (v *Window) GetAcceptFocus() bool { + c := C.gtk_window_get_accept_focus(v.native()) + return gobool(c) +} + +// GetFocusOnMap is a wrapper around gtk_window_get_focus_on_map(). +func (v *Window) GetFocusOnMap() bool { + c := C.gtk_window_get_focus_on_map(v.native()) + return gobool(c) +} + +// GetWindowType is a wrapper around gtk_window_get_window_type(). +func (v *Window) GetWindowType() WindowType { + c := C.gtk_window_get_window_type(v.native()) + return WindowType(c) +} + +// HasGroup is a wrapper around gtk_window_has_group(). +func (v *Window) HasGroup() bool { + c := C.gtk_window_has_group(v.native()) + return gobool(c) +} + +// Move is a wrapper around gtk_window_move(). +func (v *Window) Move(x, y int) { + C.gtk_window_move(v.native(), C.gint(x), C.gint(y)) +} + +// Resize is a wrapper around gtk_window_resize(). +func (v *Window) Resize(width, height int) { + C.gtk_window_resize(v.native(), C.gint(width), C.gint(height)) +} + +// WindowSetDefaultIconFromFile is a wrapper around gtk_window_set_default_icon_from_file(). +func WindowSetDefaultIconFromFile(file string) error { + cstr := C.CString(file) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + res := C.gtk_window_set_default_icon_from_file((*C.gchar)(cstr), &err) + if res == 0 { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// WindowSetDefaultIconName is a wrapper around gtk_window_set_default_icon_name(). +func WindowSetDefaultIconName(s string) { + cstr := (*C.gchar)(C.CString(s)) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_window_set_default_icon_name(cstr) +} + +// SetIconFromFile is a wrapper around gtk_window_set_icon_from_file(). +func (v *Window) SetIconFromFile(file string) error { + cstr := C.CString(file) + defer C.free(unsafe.Pointer(cstr)) + var err *C.GError = nil + res := C.gtk_window_set_icon_from_file(v.native(), (*C.gchar)(cstr), &err) + if res == 0 { + defer C.g_error_free(err) + return errors.New(C.GoString((*C.char)(err.message))) + } + return nil +} + +// SetIconName is a wrapper around gtk_window_set_icon_name(). +func (v *Window) SetIconName(name string) { + cstr := C.CString(name) + defer C.free(unsafe.Pointer(cstr)) + C.gtk_window_set_icon_name(v.native(), (*C.gchar)(cstr)) +} + +// WindowSetAutoStartupNotification is a wrapper around +// gtk_window_set_auto_startup_notification(). +func WindowSetAutoStartupNotification(setting bool) { + C.gtk_window_set_auto_startup_notification(gbool(setting)) +} + +// GetMnemonicsVisible is a wrapper around +// gtk_window_get_mnemonics_visible(). +func (v *Window) GetMnemonicsVisible() bool { + c := C.gtk_window_get_mnemonics_visible(v.native()) + return gobool(c) +} + +// SetMnemonicsVisible is a wrapper around +// gtk_window_set_mnemonics_visible(). +func (v *Window) SetMnemonicsVisible(setting bool) { + C.gtk_window_set_mnemonics_visible(v.native(), gbool(setting)) +} + +// GetFocusVisible is a wrapper around gtk_window_get_focus_visible(). +func (v *Window) GetFocusVisible() bool { + c := C.gtk_window_get_focus_visible(v.native()) + return gobool(c) +} + +// SetFocusVisible is a wrapper around gtk_window_set_focus_visible(). +func (v *Window) SetFocusVisible(setting bool) { + C.gtk_window_set_focus_visible(v.native(), gbool(setting)) +} + +// GetApplication is a wrapper around gtk_window_get_application(). +func (v *Window) GetApplication() (*Application, error) { + c := C.gtk_window_get_application(v.native()) + if c == nil { + return nil, nil + } + return wrapApplication(glib.Take(unsafe.Pointer(c))), nil +} + +// SetApplication is a wrapper around gtk_window_set_application(). +func (v *Window) SetApplication(a *Application) { + C.gtk_window_set_application(v.native(), a.native()) +} + +// ActivateKey is a wrapper around gtk_window_activate_key(). +func (v *Window) ActivateKey(event *gdk.EventKey) bool { + c := C.gtk_window_activate_key(v.native(), (*C.GdkEventKey)(unsafe.Pointer(event.Native()))) + return gobool(c) +} + +// AddMnemonic is a wrapper around gtk_window_add_mnemonic(). +func (v *Window) AddMnemonic(keyval uint, target *Widget) { + C.gtk_window_add_mnemonic(v.native(), C.guint(keyval), target.native()) +} + +// RemoveMnemonic is a wrapper around gtk_window_remove_mnemonic(). +func (v *Window) RemoveMnemonic(keyval uint, target *Widget) { + C.gtk_window_remove_mnemonic(v.native(), C.guint(keyval), target.native()) +} + +// ActivateMnemonic is a wrapper around gtk_window_mnemonic_activate(). +func (v *Window) ActivateMnemonic(keyval uint, mods gdk.ModifierType) bool { + c := C.gtk_window_mnemonic_activate(v.native(), C.guint(keyval), C.GdkModifierType(mods)) + return gobool(c) +} + +// GetMnemonicModifier is a wrapper around gtk_window_get_mnemonic_modifier(). +func (v *Window) GetMnemonicModifier() gdk.ModifierType { + c := C.gtk_window_get_mnemonic_modifier(v.native()) + return gdk.ModifierType(c) +} + +// SetMnemonicModifier is a wrapper around gtk_window_set_mnemonic_modifier(). +func (v *Window) SetMnemonicModifier(mods gdk.ModifierType) { + C.gtk_window_set_mnemonic_modifier(v.native(), C.GdkModifierType(mods)) +} + +// SetScreen is a wrapper around gtk_window_set_screen(). +func (v *Window) SetScreen(screen *gdk.Screen) { + C.gtk_window_set_screen(v.native(), C.toGdkScreen(unsafe.Pointer(screen.Native()))) +} + +// GetScreen is a wrapper around gtk_window_get_screen(). +func (v *Window) GetScreen() *gdk.Screen { + c := C.gtk_window_get_screen(v.native()) + return &gdk.Screen{glib.Take(unsafe.Pointer(c))} +} + +// PropagateKeyEvent is a wrapper around gtk_window_propagate_key_event(). +func (v *Window) PropagateKeyEvent(event *gdk.EventKey) bool { + c := C.gtk_window_propagate_key_event(v.native(), (*C.GdkEventKey)(unsafe.Pointer(event.Native()))) + return gobool(c) +} + +// WindowListToplevels is a wrapper around gtk_window_list_toplevels(). +// Returned list is wrapped to return *gtk.Window elements. +// TODO: Use IWindow and wrap to correct type +func WindowListToplevels() *glib.List { + clist := C.gtk_window_list_toplevels() + if clist == nil { + return nil + } + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapWindow(glib.Take(ptr)) + }) + runtime.SetFinalizer(glist, func(l *glib.List) { + l.Free() + }) + return glist +} + +// WindowGetDefaultIconList is a wrapper around gtk_window_get_default_icon_list(). +// Returned list is wrapped to return *gdk.Pixbuf elements. +func WindowGetDefaultIconList() *glib.List { + clist := C.gtk_window_get_default_icon_list() + if clist == nil { + return nil + } + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return &gdk.Pixbuf{glib.Take(ptr)} + }) + runtime.SetFinalizer(glist, func(l *glib.List) { + l.Free() + }) + return glist +} + +// GetIconList is a wrapper around gtk_window_get_icon_list(). +// Returned list is wrapped to return *gdk.Pixbuf elements. +func (v *Window) GetIconList() *glib.List { + clist := C.gtk_window_get_icon_list(v.native()) + if clist == nil { + return nil + } + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return &gdk.Pixbuf{glib.Take(ptr)} + }) + runtime.SetFinalizer(glist, func(l *glib.List) { + l.Free() + }) + return glist +} + +// WindowSetDefaultIconList is a wrapper around gtk_window_set_default_icon_list(). +// List should only contain *gdk.Pixbuf elements! +func WindowSetDefaultIconList(list *glib.List) { + native := (*C.struct__GList)(unsafe.Pointer(list.Native())) + C.gtk_window_set_default_icon_list(native) +} + +// SetIconList is a wrapper around gtk_window_set_icon_list(). +// List should only contain *gdk.Pixbuf elements! +func (v *Window) SetIconList(list *glib.List) { + native := (*C.struct__GList)(unsafe.Pointer(list.Native())) + C.gtk_window_set_icon_list(v.native(), native) +} + +// BeginResizeDrag is a wrapper around gtk_window_begin_resize_drag(). +func (v *Window) BeginResizeDrag(edge gdk.WindowEdge, button gdk.Button, rootX, rootY int, timestamp uint32) { + C.gtk_window_begin_resize_drag(v.native(), C.GdkWindowEdge(edge), C.gint(button), C.gint(rootX), C.gint(rootY), C.guint32(timestamp)) +} + +// BeginMoveDrag is a wrapper around gtk_window_begin_move_drag(). +func (v *Window) BeginMoveDrag(button gdk.Button, rootX, rootY int, timestamp uint32) { + C.gtk_window_begin_move_drag(v.native(), C.gint(button), C.gint(rootX), C.gint(rootY), C.guint32(timestamp)) +} + +// GetGroup is a wrapper around gtk_window_get_group(). +func (v *Window) GetGroup() *WindowGroup { + c := C.gtk_window_get_group(v.native()) + if c == nil { + return nil + } + return wrapWindowGroup(glib.Take(unsafe.Pointer(c))) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_since_3_10.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_10.go new file mode 100644 index 0000000..032d6cb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_10.go @@ -0,0 +1,25 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8 +// not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10 + +package gtk + +// #include +// #include +// #include "gtk_since_3_10.go.h" +import "C" + +/* + * GtkWindow + */ + +// SetTitlebar is a wrapper around gtk_window_set_titlebar(). +func (v *Window) SetTitlebar(titlebar IWidget) { + C.gtk_window_set_titlebar(v.native(), titlebar.toWidget()) +} + +// Close is a wrapper around gtk_window_close(). +func (v *Window) Close() { + C.gtk_window_close(v.native()) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_since_3_12.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_12.go new file mode 100644 index 0000000..4ab9475 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_12.go @@ -0,0 +1,14 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10 + +package gtk + +// #include +import "C" + +// IsMaximized is a wrapper around gtk_window_is_maximized(). +func (v *Window) IsMaximized() bool { + c := C.gtk_window_is_maximized(v.native()) + return gobool(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_since_3_14.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_14.go new file mode 100644 index 0000000..0904370 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_14.go @@ -0,0 +1,13 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12 + +package gtk + +// #include +import "C" + +// SetInteractiveDebugging is a wrapper around gtk_window_set_interactive_debugging(). +func SetInteractiveDebugging(enable bool) { + C.gtk_window_set_interactive_debugging(gbool(enable)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_since_3_16.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_16.go new file mode 100644 index 0000000..d19494d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_16.go @@ -0,0 +1,17 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 + +package gtk + +// #include +import "C" + +// GetTitlebar is a wrapper around gtk_window_get_titlebar(). +func (v *Window) GetTitlebar() (IWidget, error) { + c := C.gtk_window_get_titlebar(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_since_3_16_test.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_16_test.go new file mode 100644 index 0000000..94c740d --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_16_test.go @@ -0,0 +1,34 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14 + +// Package gtk_test is a separate package for unit tests. +// Doing this actually utilizes the go build cache +// for package gtk when changing unit test code. +package gtk_test + +import ( + "testing" + + "github.com/gotk3/gotk3/gtk" +) + +func TestWindowGetSetTitlebar(t *testing.T) { + win := createTestWindow(t) + + // Create test button, SetCanDefault is required for SetDefault to work + expected, err := gtk.ButtonNew() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + win.SetTitlebar(expected) + + a, err := win.GetTitlebar() + if err != nil { + t.Error("unexpected cast failure:", err.Error()) + } + actual := a.ToWidget() + if expected.Native() != actual.Native() { + t.Errorf("Expected '0x%x'; Got '0x%x'", expected.Native(), actual.Native()) + } +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_since_3_18.go b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_18.go new file mode 100644 index 0000000..343b42e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_since_3_18.go @@ -0,0 +1,19 @@ +// Same copyright and license as the rest of the files in this project + +// +build !gtk_3_6,!gtk_3_8,!gtk_3_10,!gtk_3_12,!gtk_3_14,!gtk_3_16 + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/gdk" +) + +// FullscreenOnMonitor is a wrapper around gtk_window_fullscreen_on_monitor(). +func (v *Window) FullscreenOnMonitor(screen *gdk.Screen, monitor int) { + C.gtk_window_fullscreen_on_monitor(v.native(), C.toGdkScreen(unsafe.Pointer(screen.Native())), C.gint(monitor)) +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/window_test.go b/vendor/github.com/gotk3/gotk3/gtk/window_test.go new file mode 100644 index 0000000..15b7618 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/window_test.go @@ -0,0 +1,548 @@ +// Same copyright and license as the rest of the files in this project + +// Package gtk_test is a separate package for unit tests. +// Doing this actually utilizes the go build cache +// for package gtk when changing unit test code. +package gtk_test + +import ( + "testing" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" +) + +func TestWindowNew(t *testing.T) { + cut, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL) + if err != nil { + t.Error("unexpected error:", err.Error()) + } + + actual := cut.GetWindowType() + if gtk.WINDOW_TOPLEVEL != actual { + t.Errorf("Expected WindowType '%d'; Got '%d'", gtk.WINDOW_TOPLEVEL, actual) + } +} + +func createTestWindow(t *testing.T) *gtk.Window { + win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL) + if err != nil { + t.Error("unexpected error:", err.Error()) + } + + return win +} + +func TestWindowGetSetTitle(t *testing.T) { + win := createTestWindow(t) + + expected := "Unit Test Window" + win.SetTitle(expected) + + actual, err := win.GetTitle() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + if expected != actual { + t.Errorf("Expected '%s'; Got '%s'", expected, actual) + } +} + +func TestWindowGetSetIconName(t *testing.T) { + win := createTestWindow(t) + + expected := "unit-icon-symbolic" + win.SetIconName(expected) + + actual, err := win.GetIconName() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + if expected != actual { + t.Errorf("Expected '%s'; Got '%s'", expected, actual) + } +} + +func TestWindowGetSetDefaultIconName(t *testing.T) { + expected := "unit-icon-symbolic" + gtk.WindowSetDefaultIconName(expected) + + actual, err := gtk.WindowGetDefaultIconName() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + if expected != actual { + t.Errorf("Expected '%s'; Got '%s'", expected, actual) + } +} + +func TestWindowGetSetRole(t *testing.T) { + win := createTestWindow(t) + + expected := "Unit Test Role" + win.SetRole(expected) + + actual, err := win.GetRole() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + if expected != actual { + t.Errorf("Expected '%s'; Got '%s'", expected, actual) + } +} + +func TestWindowGetSetTransientFor(t *testing.T) { + win := createTestWindow(t) + + expected := createTestWindow(t) + win.SetTransientFor(expected) + + actual, err := win.GetTransientFor() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + if expected.Native() != actual.Native() { + t.Errorf("Expected '0x%x'; Got '0x%x'", expected.Native(), actual.Native()) + } +} + +func TestWindowGetSetAttachedTo(t *testing.T) { + win := createTestWindow(t) + + expected := createTestWindow(t) + win.SetAttachedTo(expected) + + a, err := win.GetAttachedTo() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + actual := a.ToWidget() + if expected.Native() != actual.Native() { + t.Errorf("Expected '0x%x'; Got '0x%x'", expected.Native(), actual.Native()) + } +} + +func TestWindowGetSetDefaultSize(t *testing.T) { + win := createTestWindow(t) + + expectedW, expectedH := 123, 345 + win.SetDefaultSize(expectedW, expectedH) + + actualW, actualH := win.GetDefaultSize() + + if expectedW != actualW || expectedH != actualH { + t.Errorf("Expected %dx%d; Got %dx%d", expectedW, expectedH, actualW, actualH) + } +} + +func TestWindowGetSetGravity(t *testing.T) { + win := createTestWindow(t) + + var expected gdk.Gravity + expected = gdk.GDK_GRAVITY_EAST + win.SetGravity(expected) + + actual := win.GetGravity() + if expected != actual { + t.Errorf("Expected '%d'; Got '%d'", expected, actual) + } +} + +func TestWindowGetSetDefaultWidget(t *testing.T) { + win := createTestWindow(t) + + // Create test button, SetCanDefault is required for SetDefault to work + expected, err := gtk.ButtonNew() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + expected.SetCanDefault(true) + + win.SetDefault(expected) + + a, err := win.GetDefaultWidget() + if err != nil { + t.Error("unexpected error:", err.Error()) + } + actual := a.ToWidget() + if expected.Native() != actual.Native() { + t.Errorf("Expected '0x%x'; Got '0x%x'", expected.Native(), actual.Native()) + } +} + +func TestWindowGetSetDestroyWithParent(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetDestroyWithParent(tC.value) + + actual := win.GetDestroyWithParent() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetHideTitlebarWhenMaximized(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetHideTitlebarWhenMaximized(tC.value) + + actual := win.GetHideTitlebarWhenMaximized() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetResizable(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetResizable(tC.value) + + actual := win.GetResizable() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetModal(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetModal(tC.value) + + actual := win.GetModal() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetDecorated(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetDecorated(tC.value) + + actual := win.GetDecorated() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetDeletable(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetDeletable(tC.value) + + actual := win.GetDeletable() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetSkipTaskbarHint(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetSkipTaskbarHint(tC.value) + + actual := win.GetSkipTaskbarHint() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetSkipPagerHint(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetSkipPagerHint(tC.value) + + actual := win.GetSkipPagerHint() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetUrgencyHint(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetUrgencyHint(tC.value) + + actual := win.GetUrgencyHint() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetAcceptFocus(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetAcceptFocus(tC.value) + + actual := win.GetAcceptFocus() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetFocusOnMap(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetFocusOnMap(tC.value) + + actual := win.GetFocusOnMap() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetMnemonicsVisible(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetMnemonicsVisible(tC.value) + + actual := win.GetMnemonicsVisible() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetFocusVisible(t *testing.T) { + win := createTestWindow(t) + + testCases := []struct { + desc string + value bool + }{ + { + desc: "true", + value: true, + }, + { + desc: "true", + value: false, + }, + } + for _, tC := range testCases { + t.Run(tC.desc, func(t *testing.T) { + win.SetFocusVisible(tC.value) + + actual := win.GetFocusVisible() + if tC.value != actual { + t.Errorf("Expected '%t'; Got '%t'", tC.value, actual) + } + }) + } +} + +func TestWindowGetSetTypeHint(t *testing.T) { + win := createTestWindow(t) + + var expected gdk.WindowTypeHint + expected = gdk.WINDOW_TYPE_HINT_UTILITY + win.SetTypeHint(expected) + + actual := win.GetTypeHint() + if expected != actual { + t.Errorf("Expected '%d'; Got '%d'", expected, actual) + } +} diff --git a/vendor/github.com/gotk3/gotk3/gtk/windowgroup.go b/vendor/github.com/gotk3/gotk3/gtk/windowgroup.go new file mode 100644 index 0000000..1f60b9c --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/gtk/windowgroup.go @@ -0,0 +1,108 @@ +// Same copyright and license as the rest of the files in this project + +package gtk + +// #include +// #include "gtk.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/glib" +) + +/* + * GtkWindowGroup + */ + +type WindowGroup struct { + *glib.Object +} + +// native returns a pointer to the underlying GtkWindowGroup. +func (v *WindowGroup) native() *C.GtkWindowGroup { + if v == nil || v.GObject == nil { + return nil + } + p := unsafe.Pointer(v.GObject) + return C.toGtkWindowGroup(p) +} + +func marshalWindowGroup(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := glib.Take(unsafe.Pointer(c)) + return wrapWindowGroup(obj), nil +} + +func wrapWindowGroup(obj *glib.Object) *WindowGroup { + if obj == nil { + return nil + } + + return &WindowGroup{obj} +} + +// WindowGroupNew is a wrapper around gtk_window_group_new(). +func WindowGroupNew() (*WindowGroup, error) { + c := C.gtk_window_group_new() + if c == nil { + return nil, nilPtrErr + } + return wrapWindowGroup(glib.Take(unsafe.Pointer(c))), nil +} + +// AddWindow is a wrapper around gtk_window_group_add_window(). +func (v *WindowGroup) AddWindow(window IWindow) { + var pw *C.GtkWindow = nil + if window != nil { + pw = window.toWindow() + } + C.gtk_window_group_add_window(v.native(), pw) +} + +// RemoveWindow is a wrapper around gtk_window_group_remove_window(). +func (v *WindowGroup) RemoveWindow(window IWindow) { + var pw *C.GtkWindow = nil + if window != nil { + pw = window.toWindow() + } + C.gtk_window_group_remove_window(v.native(), pw) +} + +// ListWindows is a wrapper around gtk_window_group_list_windows(). +// Returned list is wrapped to return *gtk.Window elements. +// TODO: Use IWindow and wrap to correct type +func (v *WindowGroup) ListWindows() *glib.List { + clist := C.gtk_window_group_list_windows(v.native()) + if clist == nil { + return nil + } + glist := glib.WrapList(uintptr(unsafe.Pointer(clist))) + glist.DataWrapper(func(ptr unsafe.Pointer) interface{} { + return wrapWindow(glib.Take(ptr)) + }) + runtime.SetFinalizer(glist, func(l *glib.List) { + l.Free() + }) + return glist +} + +// GetCurrentGrab is a wrapper around gtk_window_group_get_current_grab(). +func (v *WindowGroup) GetCurrentGrab() (IWidget, error) { + c := C.gtk_window_group_get_current_grab(v.native()) + if c == nil { + return nil, nil + } + return castWidget(c) +} + +// GetCurrentDeviceGrab is a wrapper around gtk_window_group_get_current_device_grab(). +func (v *WindowGroup) GetCurrentDeviceGrab(device *gdk.Device) (IWidget, error) { + c := C.gtk_window_group_get_current_device_grab(v.native(), C.toGdkDevice(unsafe.Pointer(device.Native()))) + if c == nil { + return nil, nil + } + return castWidget(c) +} diff --git a/vendor/github.com/gotk3/gotk3/internal/callback/callback.go b/vendor/github.com/gotk3/gotk3/internal/callback/callback.go new file mode 100644 index 0000000..47142aa --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/internal/callback/callback.go @@ -0,0 +1,37 @@ +package callback + +import ( + "sync" + + "github.com/gotk3/gotk3/internal/slab" +) + +var ( + mutex sync.RWMutex + registry slab.Slab +) + +func Assign(callback interface{}) uintptr { + mutex.Lock() + defer mutex.Unlock() + + return registry.Put(callback) +} + +func Get(ptr uintptr) interface{} { + mutex.RLock() + defer mutex.RUnlock() + + return registry.Get(ptr) +} + +func Delete(ptr uintptr) { + GetAndDelete(ptr) +} + +func GetAndDelete(ptr uintptr) interface{} { + mutex.Lock() + defer mutex.Unlock() + + return registry.Pop(ptr) +} diff --git a/vendor/github.com/gotk3/gotk3/internal/closure/closure.go b/vendor/github.com/gotk3/gotk3/internal/closure/closure.go new file mode 100644 index 0000000..d06c907 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/internal/closure/closure.go @@ -0,0 +1,79 @@ +package closure + +import ( + "sync" + "unsafe" +) + +var ( + closures = sync.Map{} // unsafe.Pointer(*GClosure) -> reflect.Value + + // use a bi-directional map to allow lookup of the closure value from both + // the SourceHandle and the closure ID in constant time. + signalMu sync.Mutex + signalClosures = map[uint]unsafe.Pointer{} // uint(SourceHandle) -> uintptr (closure key, callbackID) + closureSignals = map[unsafe.Pointer]uint{} // unsafe.Pointer(*GClosure) -> uint(SourceHandle) +) + +// RegisterSignal registers the given signal handle to be associated with the +// closure pointer. This association allows the closure to be removed as well +// when the signal removal is requested from the user using DisconnectSignal. +func RegisterSignal(handle uint, closure unsafe.Pointer) { + // Safety check omitted until the race condition in glib/connect.go is + // fixed. Check that file for more info. + + signalMu.Lock() + defer signalMu.Unlock() + + signalClosures[handle] = closure + closureSignals[closure] = handle +} + +// DisconnectSignal removes both the signal and the closure associated with it +// from the internal registry. Since this function will also remove the closure +// itself from the internal registry, Gtk's disconnect functions should be +// called first. +func DisconnectSignal(handle uint) { + signalMu.Lock() + defer signalMu.Unlock() + + closure, ok := signalClosures[handle] + if ok { + closures.Delete(closure) + delete(closureSignals, closure) + delete(signalClosures, handle) + } +} + +// Assign assigns the given FuncStack to the given closure. +func Assign(closure unsafe.Pointer, fs FuncStack) { + closures.Store(closure, fs) +} + +// Get gets the reflect-value callback from the closure pointer. +func Get(closure unsafe.Pointer) FuncStack { + v, ok := closures.Load(closure) + if ok { + return v.(FuncStack) + } + return zeroFuncStack +} + +// Delete deletes the closure pointer from the registry while also checking for +// any existing signal handler associated with the given callback ID. If a +// signal handler is found, then its behavior is similar to DisconnectSignal. +func Delete(closure unsafe.Pointer) { + funcStack := getAndDeleteClosure(closure) + if !funcStack.IsValid() { + return + } + + signalMu.Lock() + defer signalMu.Unlock() + + handle, ok := closureSignals[closure] + if ok { + delete(closureSignals, closure) + delete(signalClosures, handle) + } +} diff --git a/vendor/github.com/gotk3/gotk3/internal/closure/closure_go_1_14.go b/vendor/github.com/gotk3/gotk3/internal/closure/closure_go_1_14.go new file mode 100644 index 0000000..df85755 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/internal/closure/closure_go_1_14.go @@ -0,0 +1,14 @@ +// +build !go1.15 + +package closure + +import "unsafe" + +func getAndDeleteClosure(closure unsafe.Pointer) FuncStack { + v, ok := closures.Load(closure) + if ok { + closures.Delete(closure) + return v.(FuncStack) + } + return zeroFuncStack +} diff --git a/vendor/github.com/gotk3/gotk3/internal/closure/closure_go_1_15.go b/vendor/github.com/gotk3/gotk3/internal/closure/closure_go_1_15.go new file mode 100644 index 0000000..b862314 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/internal/closure/closure_go_1_15.go @@ -0,0 +1,13 @@ +// +build go1.15 + +package closure + +import "unsafe" + +func getAndDeleteClosure(closure unsafe.Pointer) FuncStack { + v, ok := closures.LoadAndDelete(closure) + if ok { + return v.(FuncStack) + } + return zeroFuncStack +} diff --git a/vendor/github.com/gotk3/gotk3/internal/closure/funcstack.go b/vendor/github.com/gotk3/gotk3/internal/closure/funcstack.go new file mode 100644 index 0000000..b7fef23 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/internal/closure/funcstack.go @@ -0,0 +1,94 @@ +package closure + +import ( + "fmt" + "reflect" + "runtime" + "strconv" + "strings" +) + +// FrameSize is the number of frames that FuncStack should trace back from. +const FrameSize = 3 + +// FuncStack wraps a function value and provides function frames containing the +// caller trace for debugging. +type FuncStack struct { + Func reflect.Value + Frames []uintptr +} + +var zeroFuncStack = FuncStack{} + +// NewFuncStack creates a new FuncStack. It panics if fn is not a function. The +// given frameSkip is added 2, meaning the first frame from 0 will start from +// the caller of NewFuncStack. +func NewFuncStack(fn interface{}, frameSkip int) FuncStack { + // Create a reflect.Value from f. This is called when the returned + // GClosure runs. + rf := reflect.ValueOf(fn) + + // Closures can only be created from funcs. + if rf.Type().Kind() != reflect.Func { + panic("closure value is not a func") + } + + frames := make([]uintptr, FrameSize) + frames = frames[:runtime.Callers(frameSkip+2, frames)] + + return FuncStack{ + Func: rf, + Frames: frames, + } +} + +// IsValid returns true if the given FuncStack is not a zero-value i.e. valid. +func (fs FuncStack) IsValid() bool { + return fs.Frames != nil +} + +const headerSignature = "closure error: " + +// Panicf panics with the given FuncStack printed to standard error. +func (fs FuncStack) Panicf(msgf string, v ...interface{}) { + msg := strings.Builder{} + msg.WriteString(headerSignature) + fmt.Fprintf(&msg, msgf, v...) + + msg.WriteString("\n\nClosure added at:") + + frames := runtime.CallersFrames(fs.Frames) + for { + frame, more := frames.Next() + msg.WriteString("\n\t") + msg.WriteString(frame.Function) + msg.WriteString(" at ") + msg.WriteString(frame.File) + msg.WriteByte(':') + msg.WriteString(strconv.Itoa(frame.Line)) + + if !more { + break + } + } + + panic(msg.String()) +} + +// TryRepanic attempts to recover a panic. If successful, it will re-panic with +// the trace, or none if there is already one. +func (fs FuncStack) TryRepanic() { + panicking := recover() + if panicking == nil { + return + } + + if msg, ok := panicking.(string); ok { + if strings.HasPrefix(msg, headerSignature) { + // We can just repanic as-is. + panic(msg) + } + } + + fs.Panicf("unexpected panic caught: %v", panicking) +} diff --git a/vendor/github.com/gotk3/gotk3/internal/slab/slab.go b/vendor/github.com/gotk3/gotk3/internal/slab/slab.go new file mode 100644 index 0000000..d7d99e0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/internal/slab/slab.go @@ -0,0 +1,52 @@ +package slab + +type slabEntry struct { + Value interface{} + Index uintptr +} + +func (entry slabEntry) IsValid() bool { + return entry.Value != nil +} + +// Slab is an implementation of the internal registry free list. A zero-value +// instance is a valid instance. This data structure is not thread-safe. +type Slab struct { + entries []slabEntry + free uintptr +} + +func (s *Slab) Put(entry interface{}) uintptr { + if s.free == uintptr(len(s.entries)) { + index := uintptr(len(s.entries)) + s.entries = append(s.entries, slabEntry{entry, 0}) + s.free++ + return index + } + + index := s.free + + s.free = s.entries[index].Index + s.entries[index] = slabEntry{entry, 0} + + return index +} + +func (s *Slab) Get(i uintptr) interface{} { + // Perform bound check. + if i >= uintptr(len(s.entries)) { + return nil + } + // Perform validity check in case of invalid ID. + if entry := s.entries[i]; entry.IsValid() { + return entry.Value + } + return nil +} + +func (s *Slab) Pop(i uintptr) interface{} { + popped := s.entries[i].Value + s.entries[i] = slabEntry{nil, s.free} + s.free = i + return popped +} diff --git a/vendor/github.com/gotk3/gotk3/pango/fontconfig.go.h b/vendor/github.com/gotk3/gotk3/pango/fontconfig.go.h new file mode 100644 index 0000000..5d07873 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/fontconfig.go.h @@ -0,0 +1,7 @@ + +#include + +static int addFont(unsigned char *font) { + FcBool fontAddStatus = FcConfigAppFontAddFile(FcConfigGetCurrent(), font); + return fontAddStatus; +} \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go new file mode 100644 index 0000000..75ac4bb --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go @@ -0,0 +1,367 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.pango_attr_type_get_type()), marshalAttrType}, + {glib.Type(C.pango_underline_get_type()), marshalUnderline}, + } + glib.RegisterGValueMarshalers(tm) +} + +/* PangoColor */ + +// Color is a representation of PangoColor. +type Color struct { + pangoColor *C.PangoColor +} + +// Native returns a pointer to the underlying PangoColor. +func (v *Color) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Color) native() *C.PangoColor { + return (*C.PangoColor)(unsafe.Pointer(v.pangoColor)) +} + +func (v *Color) Set(red, green, blue uint16) { + v.native().red = C.guint16(red) + v.native().green = C.guint16(green) + v.native().blue = C.guint16(blue) +} + +func (v *Color) Get() (red, green, blue uint16) { + return uint16(v.native().red), uint16(v.native().green), uint16(v.native().blue) +} + +//PangoColor *pango_color_copy (const PangoColor *src); +func (v *Color) Copy(c *Color) *Color { + w := new(Color) + w.pangoColor = C.pango_color_copy(v.native()) + return w +} + +//void pango_color_free (PangoColor *color); +func (v *Color) Free() { + C.pango_color_free(v.native()) +} + +//gboolean pango_color_parse (PangoColor *color, +// const char *spec); +func (v *Color) Parse(spec string) bool { + cstr := C.CString(spec) + defer C.free(unsafe.Pointer(cstr)) + c := C.pango_color_parse(v.native(), (*C.char)(cstr)) + return gobool(c) +} + +//gchar *pango_color_to_string(const PangoColor *color); +func (v *Color) ToString() string { + c := C.pango_color_to_string(v.native()) + return C.GoString((*C.char)(c)) +} + +/* --- --- --- Attributes --- --- --- */ + +// AttrList is a representation of PangoAttrList. +type AttrList struct { + pangoAttrList *C.PangoAttrList +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *AttrList) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *AttrList) native() *C.PangoAttrList { + return (*C.PangoAttrList)(unsafe.Pointer(v.pangoAttrList)) +} + +func (v *AttrList) Insert(attribute *Attribute) { + C.pango_attr_list_insert(v.pangoAttrList, attribute.native()) +} + +func AttrListNew() *AttrList { + c := C.pango_attr_list_new() + attrList := new(AttrList) + attrList.pangoAttrList = c + return attrList +} + +// AttrType is a representation of Pango's PangoAttrType. +type AttrType int + +const ( + ATTR_INVALID AttrType = C.PANGO_ATTR_INVALID /* 0 is an invalid attribute type */ + ATTR_LANGUAGE AttrType = C.PANGO_ATTR_LANGUAGE /* PangoAttrLanguage */ + ATTR_FAMILY AttrType = C.PANGO_ATTR_FAMILY /* PangoAttrString */ + ATTR_STYLE AttrType = C.PANGO_ATTR_STYLE /* PangoAttrInt */ + ATTR_WEIGHT AttrType = C.PANGO_ATTR_WEIGHT /* PangoAttrInt */ + ATTR_VARIANT AttrType = C.PANGO_ATTR_VARIANT /* PangoAttrInt */ + ATTR_STRETCH AttrType = C.PANGO_ATTR_STRETCH /* PangoAttrInt */ + ATTR_SIZE AttrType = C.PANGO_ATTR_SIZE /* PangoAttrSize */ + ATTR_FONT_DESC AttrType = C.PANGO_ATTR_FONT_DESC /* PangoAttrFontDesc */ + ATTR_FOREGROUND AttrType = C.PANGO_ATTR_FOREGROUND /* PangoAttrColor */ + ATTR_BACKGROUND AttrType = C.PANGO_ATTR_BACKGROUND /* PangoAttrColor */ + ATTR_UNDERLINE AttrType = C.PANGO_ATTR_UNDERLINE /* PangoAttrInt */ + ATTR_STRIKETHROUGH AttrType = C.PANGO_ATTR_STRIKETHROUGH /* PangoAttrInt */ + ATTR_RISE AttrType = C.PANGO_ATTR_RISE /* PangoAttrInt */ + ATTR_SHAPE AttrType = C.PANGO_ATTR_SHAPE /* PangoAttrShape */ + ATTR_SCALE AttrType = C.PANGO_ATTR_SCALE /* PangoAttrFloat */ + ATTR_FALLBACK AttrType = C.PANGO_ATTR_FALLBACK /* PangoAttrInt */ + ATTR_LETTER_SPACING AttrType = C.PANGO_ATTR_LETTER_SPACING /* PangoAttrInt */ + ATTR_UNDERLINE_COLOR AttrType = C.PANGO_ATTR_UNDERLINE_COLOR /* PangoAttrColor */ + ATTR_STRIKETHROUGH_COLOR AttrType = C.PANGO_ATTR_STRIKETHROUGH_COLOR /* PangoAttrColor */ + ATTR_ABSOLUTE_SIZE AttrType = C.PANGO_ATTR_ABSOLUTE_SIZE /* PangoAttrSize */ + ATTR_GRAVITY AttrType = C.PANGO_ATTR_GRAVITY /* PangoAttrInt */ + ATTR_GRAVITY_HINT AttrType = C.PANGO_ATTR_GRAVITY_HINT /* PangoAttrInt */ + +) + +func marshalAttrType(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return AttrType(c), nil +} + +// Underline is a representation of Pango's PangoUnderline. +type Underline int + +const ( + UNDERLINE_NONE Underline = C.PANGO_UNDERLINE_NONE + UNDERLINE_SINGLE Underline = C.PANGO_UNDERLINE_SINGLE + UNDERLINE_DOUBLE Underline = C.PANGO_UNDERLINE_DOUBLE + UNDERLINE_LOW Underline = C.PANGO_UNDERLINE_LOW + UNDERLINE_ERROR Underline = C.PANGO_UNDERLINE_ERROR +) + +func marshalUnderline(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Underline(c), nil +} + +const ( + ATTR_INDEX_FROM_TEXT_BEGINNING uint = 0 + ATTR_INDEX_TO_TEXT_END uint = C.G_MAXUINT +) + +// Attribute is a representation of Pango's PangoAttribute. +type Attribute struct { + pangoAttribute *C.PangoAttribute + //start_index, end_index uint +} + +// Native returns a pointer to the underlying PangoColor. +func (v *Attribute) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Attribute) native() *C.PangoAttribute { + return (*C.PangoAttribute)(unsafe.Pointer(v.pangoAttribute)) +} + +/* +//typedef gboolean (*PangoAttrFilterFunc) (PangoAttribute *attribute, +// gpointer user_data); +func (v *Attribute) AttrFilterFunc(user_data uintptr) bool { + c := C.PangoAttrFilterFunc(Attribute.native(), C.gpointer(user_data)) + return gobool(c) +} + +//typedef gpointer (*PangoAttrDataCopyFunc) (gconstpointer user_data); +func AttrDataCopyFunc(user_data uintptr) uintptr { + c := C.PangoAttrDataCopyFunc(C.gpointer(user_data)) + return uintptr(c) +} +*/ + +// AttrClass is a representation of Pango's PangoAttrClass. +type AttrClass struct { + //PangoAttrType type; +} + +// AttrString is a representation of Pango's PangoAttrString. +type AttrString struct { + Attribute + //char *value; +} + +// AttrLanguage is a representation of Pango's PangoAttrLanguage. +type AttrLanguage struct { + Attribute + //PangoLanguage *value; +} + +// AttrInt is a representation of Pango's PangoAttrInt. +type AttrInt struct { + Attribute + //int value; +} + +// AttrFloat is a representation of Pango's PangoAttrFloat. +type AttrFloat struct { + Attribute + //double value; +} + +// AttrColor is a representation of Pango's AttrColor. +type AttrColor struct { + Attribute + Color +} + +// AttrSize is a representation of Pango's PangoAttrSize. +type AttrSize struct { + Attribute + //int size; + //guint absolute : 1; +} + +// AttrShape is a representation of Pango's PangoAttrShape. +type AttrShape struct { + Attribute + //PangoRectangle ink_rect; + //PangoRectangle logical_rect; + + //gpointer data; + //PangoAttrDataCopyFunc copy_func; + //GDestroyNotify destroy_func; +} + +// AttrFontDesc is a representation of Pango's PangoAttrFontDesc. +type AttrFontDesc struct { + Attribute + //PangoFontDescription *desc; +} + +/* +PangoAttrType pango_attr_type_register (const gchar *name); +const char * pango_attr_type_get_name (PangoAttrType type) G_GNUC_CONST; + +void pango_attribute_init (PangoAttribute *attr, + const PangoAttrClass *klass); +PangoAttribute * pango_attribute_copy (const PangoAttribute *attr); +void pango_attribute_destroy (PangoAttribute *attr); +gboolean pango_attribute_equal (const PangoAttribute *attr1, + const PangoAttribute *attr2) G_GNUC_PURE; + +PangoAttribute *pango_attr_language_new (PangoLanguage *language); +PangoAttribute *pango_attr_family_new (const char *family); +PangoAttribute *pango_attr_foreground_new (guint16 red, + guint16 green, + guint16 blue); +PangoAttribute *pango_attr_background_new (guint16 red, + guint16 green, + guint16 blue); +PangoAttribute *pango_attr_size_new (int size); +PangoAttribute *pango_attr_size_new_absolute (int size); +PangoAttribute *pango_attr_style_new (PangoStyle style); +PangoAttribute *pango_attr_weight_new (PangoWeight weight); +PangoAttribute *pango_attr_variant_new (PangoVariant variant); +PangoAttribute *pango_attr_stretch_new (PangoStretch stretch); +PangoAttribute *pango_attr_font_desc_new (const PangoFontDescription *desc); + +PangoAttribute *pango_attr_underline_new (PangoUnderline underline); +PangoAttribute *pango_attr_underline_color_new (guint16 red, + guint16 green, + guint16 blue); +PangoAttribute *pango_attr_strikethrough_new (gboolean strikethrough); +PangoAttribute *pango_attr_strikethrough_color_new (guint16 red, + guint16 green, + guint16 blue); + +PangoAttribute *pango_attr_rise_new (int rise); +PangoAttribute *pango_attr_scale_new (double scale_factor); +PangoAttribute *pango_attr_fallback_new (gboolean enable_fallback); +PangoAttribute *pango_attr_letter_spacing_new (int letter_spacing); + +PangoAttribute *pango_attr_shape_new (const PangoRectangle *ink_rect, + const PangoRectangle *logical_rect); +PangoAttribute *pango_attr_shape_new_with_data (const PangoRectangle *ink_rect, + const PangoRectangle *logical_rect, + gpointer data, + PangoAttrDataCopyFunc copy_func, + GDestroyNotify destroy_func); + +PangoAttribute *pango_attr_gravity_new (PangoGravity gravity); +PangoAttribute *pango_attr_gravity_hint_new (PangoGravityHint hint); + +GType pango_attr_list_get_type (void) G_GNUC_CONST; +PangoAttrList * pango_attr_list_new (void); +PangoAttrList * pango_attr_list_ref (PangoAttrList *list); +void pango_attr_list_unref (PangoAttrList *list); +PangoAttrList * pango_attr_list_copy (PangoAttrList *list); +void pango_attr_list_insert (PangoAttrList *list, + PangoAttribute *attr); +void pango_attr_list_insert_before (PangoAttrList *list, + PangoAttribute *attr); +void pango_attr_list_change (PangoAttrList *list, + PangoAttribute *attr); +void pango_attr_list_splice (PangoAttrList *list, + PangoAttrList *other, + gint pos, + gint len); + +PangoAttrList *pango_attr_list_filter (PangoAttrList *list, + PangoAttrFilterFunc func, + gpointer data); + +PangoAttrIterator *pango_attr_list_get_iterator (PangoAttrList *list); + +void pango_attr_iterator_range (PangoAttrIterator *iterator, + gint *start, + gint *end); +gboolean pango_attr_iterator_next (PangoAttrIterator *iterator); +PangoAttrIterator *pango_attr_iterator_copy (PangoAttrIterator *iterator); +void pango_attr_iterator_destroy (PangoAttrIterator *iterator); +PangoAttribute * pango_attr_iterator_get (PangoAttrIterator *iterator, + PangoAttrType type); +void pango_attr_iterator_get_font (PangoAttrIterator *iterator, + PangoFontDescription *desc, + PangoLanguage **language, + GSList **extra_attrs); +GSList * pango_attr_iterator_get_attrs (PangoAttrIterator *iterator); + + +gboolean pango_parse_markup (const char *markup_text, + int length, + gunichar accel_marker, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error); + +GMarkupParseContext * pango_markup_parser_new (gunichar accel_marker); +gboolean pango_markup_parser_finish (GMarkupParseContext *context, + PangoAttrList **attr_list, + char **text, + gunichar *accel_char, + GError **error); +*/ diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go.h b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go.h new file mode 100644 index 0000000..5f77732 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-attributes.go.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +static PangoColor *toPangoColor(void *p) { return ((PangoColor *)(p)); } diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-attributes_since_1_44.go b/vendor/github.com/gotk3/gotk3/pango/pango-attributes_since_1_44.go new file mode 100644 index 0000000..3dd44f0 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-attributes_since_1_44.go @@ -0,0 +1,18 @@ +// +build !pango_1_42 + +package pango + +// #include +// #include "pango.go.h" +import "C" + +var ( + ATTR_INSERT_HYPHENS AttrType = C.PANGO_ATTR_INSERT_HYPHENS +) + +func AttrInsertHyphensNew(insertHyphens bool) *Attribute { + c := C.pango_attr_insert_hyphens_new(gbool(insertHyphens)) + attr := new(Attribute) + attr.pangoAttribute = c + return attr +} diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-context.go b/vendor/github.com/gotk3/gotk3/pango/pango-context.go new file mode 100644 index 0000000..41b7e57 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-context.go @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +import "C" +import ( + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + // {glib.Type(C.pango_alignment_get_type()), marshalAlignment}, + // {glib.Type(C.pango_ellipsize_mode_get_type()), marshalEllipsizeMode}, + // {glib.Type(C.pango_wrap_mode_get_type()), marshalWrapMode}, + + // Objects/Interfaces + // {glib.Type(C.pango_context_get_type()), marshalContext}, + } + glib.RegisterGValueMarshalers(tm) +} + +// Context is a representation of PangoContext. +type Context struct { + pangoContext *C.PangoContext +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *Context) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Context) native() *C.PangoContext { + return (*C.PangoContext)(unsafe.Pointer(v.pangoContext)) +} + +/* +func marshalContext(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := wrapObject(unsafe.Pointer(c)) + return wrapContext(obj), nil +} + +func wrapContext(obj *glib.Object) *Context { + return &Context{obj} +} +*/ +func WrapContext(p uintptr) *Context { + context := new(Context) + context.pangoContext = (*C.PangoContext)(unsafe.Pointer(p)) + return context +} + +//PangoContext *pango_context_new (void); +func ContextNew() *Context { + c := C.pango_context_new() + + context := new(Context) + context.pangoContext = (*C.PangoContext)(c) + + return context +} + +//void pango_context_changed (PangoContext *context); +//void pango_context_set_font_map (PangoContext *context, +// PangoFontMap *font_map); +//PangoFontMap *pango_context_get_font_map (PangoContext *context); +//guint pango_context_get_serial (PangoContext *context); +//void pango_context_list_families (PangoContext *context, +// PangoFontFamily ***families, +// int *n_families); +//PangoFont * pango_context_load_font (PangoContext *context, +// const PangoFontDescription *desc); +//PangoFontset *pango_context_load_fontset (PangoContext *context, +// const PangoFontDescription *desc, +// PangoLanguage *language); +// +//PangoFontMetrics *pango_context_get_metrics (PangoContext *context, +// const PangoFontDescription *desc, +// PangoLanguage *language); +// +//void pango_context_set_font_description (PangoContext *context, +// const PangoFontDescription *desc); +//PangoFontDescription * pango_context_get_font_description (PangoContext *context); +//PangoLanguage *pango_context_get_language (PangoContext *context); +//void pango_context_set_language (PangoContext *context, +// PangoLanguage *language); +//void pango_context_set_base_dir (PangoContext *context, +// PangoDirection direction); +//PangoDirection pango_context_get_base_dir (PangoContext *context); +//void pango_context_set_base_gravity (PangoContext *context, +// PangoGravity gravity); +//PangoGravity pango_context_get_base_gravity (PangoContext *context); +//PangoGravity pango_context_get_gravity (PangoContext *context); +//void pango_context_set_gravity_hint (PangoContext *context, +// PangoGravityHint hint); +//PangoGravityHint pango_context_get_gravity_hint (PangoContext *context); +// +//void pango_context_set_matrix (PangoContext *context, +// const PangoMatrix *matrix); +//const PangoMatrix * pango_context_get_matrix (PangoContext *context); + +/* Break a string of Unicode characters into segments with + * consistent shaping/language engine and bidrectional level. + * Returns a #GList of #PangoItem's + */ +//GList *pango_itemize (PangoContext *context, +// const char *text, +// int start_index, +// int length, +// PangoAttrList *attrs, +// PangoAttrIterator *cached_iter); +//GList *pango_itemize_with_base_dir (PangoContext *context, +// PangoDirection base_dir, +// const char *text, +// int start_index, +// int length, +// PangoAttrList *attrs, +// PangoAttrIterator *cached_iter); diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-font.go b/vendor/github.com/gotk3/gotk3/pango/pango-font.go new file mode 100644 index 0000000..dd3640e --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-font.go @@ -0,0 +1,720 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +// #include "fontconfig.go.h" +import "C" +import ( + // "github.com/andre-hub/gotk3/glib" + // "github.com/andre-hub/gotk3/cairo" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + // Objects/Interfaces + {glib.Type(C.pango_font_description_get_type()), marshalFontDescription}, + } + glib.RegisterGValueMarshalers(tm) +} + +// AddFont adds the font to the configuration. +func AddFont(fontPath string) { + path := (*C.uchar)(unsafe.Pointer(C.CString(fontPath))) + C.addFont(path) +} + +// FontDescription is a representation of PangoFontDescription. +type FontDescription struct { + pangoFontDescription *C.PangoFontDescription +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *FontDescription) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *FontDescription) native() *C.PangoFontDescription { + return (*C.PangoFontDescription)(unsafe.Pointer(v.pangoFontDescription)) +} + +// FontMetrics is a representation of PangoFontMetrics. +type FontMetrics struct { + pangoFontMetrics *C.PangoFontMetrics +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *FontMetrics) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *FontMetrics) native() *C.PangoFontMetrics { + return (*C.PangoFontMetrics)(unsafe.Pointer(v.pangoFontMetrics)) +} + +const ( + PANGO_SCALE = C.PANGO_SCALE +) + +type Style int + +const ( + STYLE_NORMAL Style = C.PANGO_STYLE_NORMAL + STYLE_OBLIQUE Style = C.PANGO_STYLE_OBLIQUE + STYLE_ITALIC Style = C.PANGO_STYLE_ITALIC +) + +type Variant int + +const ( + VARIANT_NORMAL Variant = C.PANGO_VARIANT_NORMAL + VARIANT_SMALL_CAPS Variant = C.PANGO_VARIANT_SMALL_CAPS +) + +type Weight int + +const ( + WEIGHT_THIN Weight = C.PANGO_WEIGHT_THIN /* 100 */ + WEIGHT_ULTRALIGHT Weight = C.PANGO_WEIGHT_ULTRALIGHT /* 200 */ + WEIGHT_LIGHT Weight = C.PANGO_WEIGHT_LIGHT /* 300 */ + WEIGHT_SEMILIGHT Weight = 350 /* 350 */ + WEIGHT_BOOK Weight = C.PANGO_WEIGHT_BOOK /* 380 */ + WEIGHT_NORMAL Weight = C.PANGO_WEIGHT_NORMAL /* 400 */ + WEIGHT_MEDIUM Weight = C.PANGO_WEIGHT_MEDIUM /* 500 */ + WEIGHT_SEMIBOLD Weight = C.PANGO_WEIGHT_SEMIBOLD /* 600 */ + WEIGHT_BOLD Weight = C.PANGO_WEIGHT_BOLD /* 700 */ + WEIGHT_ULTRABOLD Weight = C.PANGO_WEIGHT_ULTRABOLD /* 800 */ + WEIGHT_HEAVY Weight = C.PANGO_WEIGHT_HEAVY /* 900 */ + WEIGHT_ULTRAHEAVY Weight = C.PANGO_WEIGHT_ULTRAHEAVY /* 1000 */ + +) + +type Stretch int + +const ( + STRETCH_ULTRA_CONDENSED Stretch = C.PANGO_STRETCH_ULTRA_CONDENSED + STRETCH_EXTRA_CONDENSEDStretch Stretch = C.PANGO_STRETCH_EXTRA_CONDENSED + STRETCH_CONDENSEDStretch Stretch = C.PANGO_STRETCH_CONDENSED + STRETCH_SEMI_CONDENSEDStretch Stretch = C.PANGO_STRETCH_SEMI_CONDENSED + STRETCH_NORMALStretch Stretch = C.PANGO_STRETCH_NORMAL + STRETCH_SEMI_EXPANDEDStretch Stretch = C.PANGO_STRETCH_SEMI_EXPANDED + STRETCH_EXPANDEDStretch Stretch = C.PANGO_STRETCH_EXPANDED + STRETCH_EXTRA_EXPANDEDStretch Stretch = C.PANGO_STRETCH_EXTRA_EXPANDED + STRETCH_ULTRA_EXPANDEDStretch Stretch = C.PANGO_STRETCH_ULTRA_EXPANDED +) + +type FontMask int + +const ( + FONT_MASK_FAMILY FontMask = C.PANGO_FONT_MASK_FAMILY /* 1 << 0 */ + FONT_MASK_STYLEFontMask FontMask = C.PANGO_FONT_MASK_STYLE /* 1 << 1 */ + FONT_MASK_VARIANTFontMask FontMask = C.PANGO_FONT_MASK_VARIANT /* 1 << 2 */ + FONT_MASK_WEIGHTFontMask FontMask = C.PANGO_FONT_MASK_WEIGHT /* 1 << 3 */ + FONT_MASK_STRETCHFontMask FontMask = C.PANGO_FONT_MASK_STRETCH /* 1 << 4 */ + FONT_MASK_SIZEFontMask FontMask = C.PANGO_FONT_MASK_SIZE /* 1 << 5 */ + FONT_MASK_GRAVITYFontMask FontMask = C.PANGO_FONT_MASK_GRAVITY /* 1 << 6 */ +) + +type Scale float64 + +const ( + SCALE_XX_SMALL Scale = /* C.PANGO_SCALE_XX_SMALL */ 0.5787037037037 + SCALE_X_SMALL Scale = /*C.PANGO_SCALE_X_SMALL */ 0.6444444444444 + SCALE_SMALL Scale = /*C.PANGO_SCALE_SMALL */ 0.8333333333333 + SCALE_MEDIUM Scale = /*C.PANGO_SCALE_MEDIUM */ 1.0 + SCALE_LARGE Scale = /*C.PANGO_SCALE_LARGE */ 1.2 + SCALE_X_LARGE Scale = /*C.PANGO_SCALE_X_LARGE */ 1.4399999999999 + SCALE_XX_LARGE Scale = /*C.PANGO_SCALE_XX_LARGE */ 1.728 +) + +/* + * PangoFontDescription + */ + +func marshalFontDescription(p uintptr) (interface{}, error) { + c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p))) + c2 := (*C.PangoFontDescription)(unsafe.Pointer(c)) + return wrapFontDescription(c2), nil +} + +func wrapFontDescription(obj *C.PangoFontDescription) *FontDescription { + return &FontDescription{obj} +} + +//PangoFontDescription *pango_font_description_new (void); +func FontDescriptionNew() *FontDescription { + c := C.pango_font_description_new() + v := new(FontDescription) + v.pangoFontDescription = c + return v +} + +//PangoFontDescription *pango_font_description_copy (const PangoFontDescription *desc); +func (v *FontDescription) Copy() *FontDescription { + c := C.pango_font_description_copy(v.native()) + v2 := new(FontDescription) + v2.pangoFontDescription = c + return v2 +} + +//PangoFontDescription *pango_font_description_copy_static (const PangoFontDescription *desc); +func (v *FontDescription) CopyStatic() *FontDescription { + c := C.pango_font_description_copy_static(v.native()) + v2 := new(FontDescription) + v2.pangoFontDescription = c + return v2 +} + +//guint pango_font_description_hash (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) Hash() uint { + c := C.pango_font_description_hash(v.native()) + return uint(c) +} + +//gboolean pango_font_description_equal (const PangoFontDescription *desc1, +// const PangoFontDescription *desc2) G_GNUC_PURE; +func (v *FontDescription) Equal(v2 *FontDescription) bool { + c := C.pango_font_description_equal(v.native(), v2.native()) + return gobool(c) +} + +//void pango_font_description_free (PangoFontDescription *desc); +func (v *FontDescription) Free() { + C.pango_font_description_free(v.native()) +} + +//void pango_font_descriptions_free (PangoFontDescription **descs, +// int n_descs); +//func (v *FontDescription) FontDescriptionsFree(n_descs int) { +// C.pango_font_descriptions_free(v.native(), C.int(n_descs)) +//} + +//void pango_font_description_set_family (PangoFontDescription *desc, +// const char *family); +func (v *FontDescription) SetFamily(family string) { + cstr := C.CString(family) + defer C.free(unsafe.Pointer(cstr)) + C.pango_font_description_set_family(v.native(), (*C.char)(cstr)) +} + +//void pango_font_description_set_family_static (PangoFontDescription *desc, +// const char *family); +func (v *FontDescription) SetFamilyStatic(family string) { + cstr := C.CString(family) + defer C.free(unsafe.Pointer(cstr)) + C.pango_font_description_set_family_static(v.native(), (*C.char)(cstr)) +} + +//const char *pango_font_description_get_family (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetFamily() string { + c := C.pango_font_description_get_family(v.native()) + return C.GoString((*C.char)(c)) +} + +//void pango_font_description_set_style (PangoFontDescription *desc, +// PangoStyle style); +func (v *FontDescription) SetStyle(style Style) { + C.pango_font_description_set_style(v.native(), (C.PangoStyle)(style)) +} + +//PangoStyle pango_font_description_get_style (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetStyle() Style { + c := C.pango_font_description_get_style(v.native()) + return Style(c) +} + +//void pango_font_description_set_variant (PangoFontDescription *desc, +// PangoVariant variant); +func (v *FontDescription) SetVariant(variant Variant) { + C.pango_font_description_set_variant(v.native(), (C.PangoVariant)(variant)) +} + +//PangoVariant pango_font_description_get_variant (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetVariant() Variant { + c := C.pango_font_description_get_variant(v.native()) + return Variant(c) +} + +//void pango_font_description_set_weight (PangoFontDescription *desc, +// PangoWeight weight); +func (v *FontDescription) SetWeight(weight Weight) { + C.pango_font_description_set_weight(v.native(), (C.PangoWeight)(weight)) +} + +//PangoWeight pango_font_description_get_weight (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetWeight() Weight { + c := C.pango_font_description_get_weight(v.native()) + return Weight(c) +} + +//void pango_font_description_set_stretch (PangoFontDescription *desc, +// PangoStretch stretch); +func (v *FontDescription) SetStretch(stretch Stretch) { + C.pango_font_description_set_stretch(v.native(), (C.PangoStretch)(stretch)) +} + +//PangoStretch pango_font_description_get_stretch (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetStretch() Stretch { + c := C.pango_font_description_get_stretch(v.native()) + return Stretch(c) +} + +//void pango_font_description_set_size (PangoFontDescription *desc, +// gint size); +func (v *FontDescription) SetSize(size int) { + C.pango_font_description_set_size(v.native(), (C.gint)(size)) +} + +//gint pango_font_description_get_size (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetSize() int { + c := C.pango_font_description_get_size(v.native()) + return int(c) +} + +//void pango_font_description_set_absolute_size (PangoFontDescription *desc, +// double size); +func (v *FontDescription) SetAbsoluteSize(size float64) { + C.pango_font_description_set_absolute_size(v.native(), (C.double)(size)) +} + +//gboolean pango_font_description_get_size_is_absolute (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetSizeIsAbsolute() bool { + c := C.pango_font_description_get_size_is_absolute(v.native()) + return gobool(c) +} + +//void pango_font_description_set_gravity (PangoFontDescription *desc, +// PangoGravity gravity); +func (v *FontDescription) SetGravity(gravity Gravity) { + C.pango_font_description_set_gravity(v.native(), (C.PangoGravity)(gravity)) +} + +//PangoGravity pango_font_description_get_gravity (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetGravity() Gravity { + c := C.pango_font_description_get_gravity(v.native()) + return Gravity(c) +} + +//PangoFontMask pango_font_description_get_set_fields (const PangoFontDescription *desc) G_GNUC_PURE; +func (v *FontDescription) GetSetFields() FontMask { + c := C.pango_font_description_get_set_fields(v.native()) + return FontMask(c) +} + +//void pango_font_description_unset_fields (PangoFontDescription *desc, +// PangoFontMask to_unset); +func (v *FontDescription) GetUnsetFields(to_unset FontMask) { + C.pango_font_description_unset_fields(v.native(), (C.PangoFontMask)(to_unset)) +} + +//void pango_font_description_merge (PangoFontDescription *desc, +// const PangoFontDescription *desc_to_merge, +// gboolean replace_existing); +func (v *FontDescription) Merge(desc_to_merge *FontDescription, replace_existing bool) { + C.pango_font_description_merge(v.native(), desc_to_merge.native(), gbool(replace_existing)) +} + +//void pango_font_description_merge_static (PangoFontDescription *desc, +// const PangoFontDescription *desc_to_merge, +// gboolean replace_existing); +func (v *FontDescription) MergeStatic(desc_to_merge *FontDescription, replace_existing bool) { + C.pango_font_description_merge_static(v.native(), desc_to_merge.native(), gbool(replace_existing)) +} + +//gboolean pango_font_description_better_match (const PangoFontDescription *desc, +// const PangoFontDescription *old_match, +// const PangoFontDescription *new_match) G_GNUC_PURE; +func (v *FontDescription) BetterMatch(old_match, new_match *FontDescription) bool { + c := C.pango_font_description_better_match(v.native(), old_match.native(), new_match.native()) + return gobool(c) +} + +//PangoFontDescription *pango_font_description_from_string (const char *str); +func FontDescriptionFromString(str string) *FontDescription { + cstr := C.CString(str) + defer C.free(unsafe.Pointer(cstr)) + c := C.pango_font_description_from_string((*C.char)(cstr)) + v := new(FontDescription) + v.pangoFontDescription = c + return v +} + +//char * pango_font_description_to_string (const PangoFontDescription *desc); +func (v *FontDescription) ToString() string { + c := C.pango_font_description_to_string(v.native()) + return C.GoString((*C.char)(c)) +} + +//char * pango_font_description_to_filename (const PangoFontDescription *desc); +func (v *FontDescription) ToFilename() string { + c := C.pango_font_description_to_filename(v.native()) + return C.GoString((*C.char)(c)) +} + +///* +// * PangoFontMetrics +// */ +// +///** +// * PANGO_TYPE_FONT_METRICS: +// * +// * The #GObject type for #PangoFontMetrics. +// */ +//#define PANGO_TYPE_FONT_METRICS (pango_font_metrics_get_type ()) +//GType pango_font_metrics_get_type (void) G_GNUC_CONST; +//PangoFontMetrics *pango_font_metrics_ref (PangoFontMetrics *metrics); +//void pango_font_metrics_unref (PangoFontMetrics *metrics); +//int pango_font_metrics_get_ascent (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_descent (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_approximate_char_width (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_approximate_digit_width (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_underline_position (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_underline_thickness (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_strikethrough_position (PangoFontMetrics *metrics) G_GNUC_PURE; +//int pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) G_GNUC_PURE; +// +//#ifdef PANGO_ENABLE_BACKEND +// +//PangoFontMetrics *pango_font_metrics_new (void); +// +//struct _PangoFontMetrics +//{ +// guint ref_count; +// +// int ascent; +// int descent; +// int approximate_char_width; +// int approximate_digit_width; +// int underline_position; +// int underline_thickness; +// int strikethrough_position; +// int strikethrough_thickness; +//}; +// +//#endif /* PANGO_ENABLE_BACKEND */ +// +///* +// * PangoFontFamily +// */ +// +///** +// * PANGO_TYPE_FONT_FAMILY: +// * +// * The #GObject type for #PangoFontFamily. +// */ +///** +// * PANGO_FONT_FAMILY: +// * @object: a #GObject. +// * +// * Casts a #GObject to a #PangoFontFamily. +// */ +///** +// * PANGO_IS_FONT_FAMILY: +// * @object: a #GObject. +// * +// * Returns: %TRUE if @object is a #PangoFontFamily. +// */ +//#define PANGO_TYPE_FONT_FAMILY (pango_font_family_get_type ()) +//#define PANGO_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FAMILY, PangoFontFamily)) +//#define PANGO_IS_FONT_FAMILY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FAMILY)) +// +//typedef struct _PangoFontFamily PangoFontFamily; +//typedef struct _PangoFontFace PangoFontFace; +// +//GType pango_font_family_get_type (void) G_GNUC_CONST; +// +//void pango_font_family_list_faces (PangoFontFamily *family, +// PangoFontFace ***faces, +// int *n_faces); +//const char *pango_font_family_get_name (PangoFontFamily *family) G_GNUC_PURE; +//gboolean pango_font_family_is_monospace (PangoFontFamily *family) G_GNUC_PURE; +// +//#ifdef PANGO_ENABLE_BACKEND +// +//#define PANGO_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass)) +//#define PANGO_IS_FONT_FAMILY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FAMILY)) +//#define PANGO_FONT_FAMILY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FAMILY, PangoFontFamilyClass)) +// +//typedef struct _PangoFontFamilyClass PangoFontFamilyClass; +// +// +///** +// * PangoFontFamily: +// * +// * The #PangoFontFamily structure is used to represent a family of related +// * font faces. The faces in a family share a common design, but differ in +// * slant, weight, width and other aspects. +// */ +//struct _PangoFontFamily +//{ +// GObject parent_instance; +//}; +// +//struct _PangoFontFamilyClass +//{ +// GObjectClass parent_class; +// +// /*< public >*/ +// +// void (*list_faces) (PangoFontFamily *family, +// PangoFontFace ***faces, +// int *n_faces); +// const char * (*get_name) (PangoFontFamily *family); +// gboolean (*is_monospace) (PangoFontFamily *family); +// +// /*< private >*/ +// +// /* Padding for future expansion */ +// void (*_pango_reserved2) (void); +// void (*_pango_reserved3) (void); +// void (*_pango_reserved4) (void); +//}; +// +//#endif /* PANGO_ENABLE_BACKEND */ +// +///* +// * PangoFontFace +// */ +// +///** +// * PANGO_TYPE_FONT_FACE: +// * +// * The #GObject type for #PangoFontFace. +// */ +///** +// * PANGO_FONT_FACE: +// * @object: a #GObject. +// * +// * Casts a #GObject to a #PangoFontFace. +// */ +///** +// * PANGO_IS_FONT_FACE: +// * @object: a #GObject. +// * +// * Returns: %TRUE if @object is a #PangoFontFace. +// */ +//#define PANGO_TYPE_FONT_FACE (pango_font_face_get_type ()) +//#define PANGO_FONT_FACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT_FACE, PangoFontFace)) +//#define PANGO_IS_FONT_FACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT_FACE)) +// +//GType pango_font_face_get_type (void) G_GNUC_CONST; +// +//PangoFontDescription *pango_font_face_describe (PangoFontFace *face); +//const char *pango_font_face_get_face_name (PangoFontFace *face) G_GNUC_PURE; +//void pango_font_face_list_sizes (PangoFontFace *face, +// int **sizes, +// int *n_sizes); +//gboolean pango_font_face_is_synthesized (PangoFontFace *face) G_GNUC_PURE; +// +//#ifdef PANGO_ENABLE_BACKEND +// +//#define PANGO_FONT_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT_FACE, PangoFontFaceClass)) +//#define PANGO_IS_FONT_FACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT_FACE)) +//#define PANGO_FONT_FACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT_FACE, PangoFontFaceClass)) +// +//typedef struct _PangoFontFaceClass PangoFontFaceClass; +// +///** +// * PangoFontFace: +// * +// * The #PangoFontFace structure is used to represent a group of fonts with +// * the same family, slant, weight, width, but varying sizes. +// */ +//struct _PangoFontFace +//{ +// GObject parent_instance; +//}; +// +//struct _PangoFontFaceClass +//{ +// GObjectClass parent_class; +// +// /*< public >*/ +// +// const char * (*get_face_name) (PangoFontFace *face); +// PangoFontDescription * (*describe) (PangoFontFace *face); +// void (*list_sizes) (PangoFontFace *face, +// int **sizes, +// int *n_sizes); +// gboolean (*is_synthesized) (PangoFontFace *face); +// +// /*< private >*/ +// +// /* Padding for future expansion */ +// void (*_pango_reserved3) (void); +// void (*_pango_reserved4) (void); +//}; +// +//#endif /* PANGO_ENABLE_BACKEND */ +// +///* +// * PangoFont +// */ +// +///** +// * PANGO_TYPE_FONT: +// * +// * The #GObject type for #PangoFont. +// */ +///** +// * PANGO_FONT: +// * @object: a #GObject. +// * +// * Casts a #GObject to a #PangoFont. +// */ +///** +// * PANGO_IS_FONT: +// * @object: a #GObject. +// * +// * Returns: %TRUE if @object is a #PangoFont. +// */ +//#define PANGO_TYPE_FONT (pango_font_get_type ()) +//#define PANGO_FONT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_FONT, PangoFont)) +//#define PANGO_IS_FONT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_FONT)) +// +//GType pango_font_get_type (void) G_GNUC_CONST; +// +//PangoFontDescription *pango_font_describe (PangoFont *font); +//PangoFontDescription *pango_font_describe_with_absolute_size (PangoFont *font); +//PangoCoverage * pango_font_get_coverage (PangoFont *font, +// PangoLanguage *language); +//PangoEngineShape * pango_font_find_shaper (PangoFont *font, +// PangoLanguage *language, +// guint32 ch); +//PangoFontMetrics * pango_font_get_metrics (PangoFont *font, +// PangoLanguage *language); +//void pango_font_get_glyph_extents (PangoFont *font, +// PangoGlyph glyph, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//PangoFontMap *pango_font_get_font_map (PangoFont *font); +// +//#ifdef PANGO_ENABLE_BACKEND +// +//#define PANGO_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_FONT, PangoFontClass)) +//#define PANGO_IS_FONT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_FONT)) +//#define PANGO_FONT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_FONT, PangoFontClass)) +// +//typedef struct _PangoFontClass PangoFontClass; +// +///** +// * PangoFont: +// * +// * The #PangoFont structure is used to represent +// * a font in a rendering-system-independent matter. +// * To create an implementation of a #PangoFont, +// * the rendering-system specific code should allocate +// * a larger structure that contains a nested +// * #PangoFont, fill in the klass member of +// * the nested #PangoFont with a pointer to +// * a appropriate #PangoFontClass, then call +// * pango_font_init() on the structure. +// * +// * The #PangoFont structure contains one member +// * which the implementation fills in. +// */ +//struct _PangoFont +//{ +// GObject parent_instance; +//}; +// +//struct _PangoFontClass +//{ +// GObjectClass parent_class; +// +// /*< public >*/ +// +// PangoFontDescription *(*describe) (PangoFont *font); +// PangoCoverage * (*get_coverage) (PangoFont *font, +// PangoLanguage *lang); +// PangoEngineShape * (*find_shaper) (PangoFont *font, +// PangoLanguage *lang, +// guint32 ch); +// void (*get_glyph_extents) (PangoFont *font, +// PangoGlyph glyph, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +// PangoFontMetrics * (*get_metrics) (PangoFont *font, +// PangoLanguage *language); +// PangoFontMap * (*get_font_map) (PangoFont *font); +// PangoFontDescription *(*describe_absolute) (PangoFont *font); +// /*< private >*/ +// +// /* Padding for future expansion */ +// void (*_pango_reserved1) (void); +// void (*_pango_reserved2) (void); +//}; +// +///* used for very rare and miserable situtations that we cannot even +// * draw a hexbox +// */ +//#define PANGO_UNKNOWN_GLYPH_WIDTH 10 +//#define PANGO_UNKNOWN_GLYPH_HEIGHT 14 +// +//#endif /* PANGO_ENABLE_BACKEND */ +// +///** +// * PANGO_GLYPH_EMPTY: +// * +// * The %PANGO_GLYPH_EMPTY macro represents a #PangoGlyph value that has a +// * special meaning, which is a zero-width empty glyph. This is useful for +// * example in shaper modules, to use as the glyph for various zero-width +// * Unicode characters (those passing pango_is_zero_width()). +// */ +///** +// * PANGO_GLYPH_INVALID_INPUT: +// * +// * The %PANGO_GLYPH_INVALID_INPUT macro represents a #PangoGlyph value that has a +// * special meaning of invalid input. #PangoLayout produces one such glyph +// * per invalid input UTF-8 byte and such a glyph is rendered as a crossed +// * box. +// * +// * Note that this value is defined such that it has the %PANGO_GLYPH_UNKNOWN_FLAG +// * on. +// * +// * Since: 1.20 +// */ +///** +// * PANGO_GLYPH_UNKNOWN_FLAG: +// * +// * The %PANGO_GLYPH_UNKNOWN_FLAG macro is a flag value that can be added to +// * a #gunichar value of a valid Unicode character, to produce a #PangoGlyph +// * value, representing an unknown-character glyph for the respective #gunichar. +// */ +///** +// * PANGO_GET_UNKNOWN_GLYPH: +// * @wc: a Unicode character +// * +// * The way this unknown glyphs are rendered is backend specific. For example, +// * a box with the hexadecimal Unicode code-point of the character written in it +// * is what is done in the most common backends. +// * +// * Returns: a #PangoGlyph value that means no glyph was found for @wc. +// */ +//#define PANGO_GLYPH_EMPTY ((PangoGlyph)0x0FFFFFFF) +//#define PANGO_GLYPH_INVALID_INPUT ((PangoGlyph)0xFFFFFFFF) +//#define PANGO_GLYPH_UNKNOWN_FLAG ((PangoGlyph)0x10000000) +//#define PANGO_GET_UNKNOWN_GLYPH(wc) ((PangoGlyph)(wc)|PANGO_GLYPH_UNKNOWN_FLAG) +// +// diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-glyph-item.go b/vendor/github.com/gotk3/gotk3/pango/pango-glyph-item.go new file mode 100644 index 0000000..bed9fc2 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-glyph-item.go @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +// #include +import "C" +import ( + // "github.com/andre-hub/gotk3/glib" + // "github.com/andre-hub/gotk3/cairo" + "unsafe" +) + +// GlyphItem is a representation of PangoGlyphItem. +type GlyphItem struct { + pangoGlyphItem *C.PangoGlyphItem +} + +// Native returns a pointer to the underlying PangoGlyphItem. +func (v *GlyphItem) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *GlyphItem) native() *C.PangoGlyphItem { + return (*C.PangoGlyphItem)(unsafe.Pointer(v.pangoGlyphItem)) +} diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go b/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go new file mode 100644 index 0000000..2ea29f7 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-glyph.go @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +// #include +import "C" +import ( + // "github.com/andre-hub/gotk3/glib" + // "github.com/andre-hub/gotk3/cairo" + "unsafe" +) + +// GlyphGeometry is a representation of PangoGlyphGeometry. +type GlyphGeometry struct { + pangoGlyphGeometry *C.PangoGlyphGeometry +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *GlyphGeometry) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *GlyphGeometry) native() *C.PangoGlyphGeometry { + return (*C.PangoGlyphGeometry)(unsafe.Pointer(v.pangoGlyphGeometry)) +} + +// GlyphVisAttr is a representation of PangoGlyphVisAttr. +type GlyphVisAttr struct { + pangoGlyphVisAttr *C.PangoGlyphGeometry +} + +// Native returns a pointer to the underlying PangoGlyphVisAttr. +func (v *GlyphVisAttr) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *GlyphVisAttr) native() *C.PangoGlyphVisAttr { + return (*C.PangoGlyphVisAttr)(unsafe.Pointer(v.pangoGlyphVisAttr)) +} + +// GlyphInfo is a representation of PangoGlyphInfo. +type GlyphInfo struct { + pangoGlyphInfo *C.PangoGlyphInfo +} + +// Native returns a pointer to the underlying PangoGlyphInfo. +func (v *GlyphInfo) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *GlyphInfo) native() *C.PangoGlyphInfo { + return (*C.PangoGlyphInfo)(unsafe.Pointer(v.pangoGlyphInfo)) +} + +// GlyphGeometry is a representation of PangoGlyphString. +type GlyphString struct { + pangoGlyphString *C.PangoGlyphString +} + +// Native returns a pointer to the underlying PangoGlyphString. +func (v *GlyphString) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *GlyphString) native() *C.PangoGlyphString { + return (*C.PangoGlyphString)(unsafe.Pointer(v.pangoGlyphString)) +} diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-gravity.go b/vendor/github.com/gotk3/gotk3/pango/pango-gravity.go new file mode 100644 index 0000000..7bd3800 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-gravity.go @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +import "C" + +// "github.com/andre-hub/gotk3/glib" +// "github.com/andre-hub/gotk3/cairo" +// "unsafe" + +type Gravity int + +const ( + GRAVITY_SOUTH Gravity = C.PANGO_GRAVITY_SOUTH + GRAVITY_EAST Gravity = C.PANGO_GRAVITY_EAST + GRAVITY_NORTH Gravity = C.PANGO_GRAVITY_NORTH + GRAVITY_WEST Gravity = C.PANGO_GRAVITY_WEST + GRAVITY_AUTO Gravity = C.PANGO_GRAVITY_AUTO +) + +type GravityHint int + +const ( + GRAVITY_HINT_NATURAL GravityHint = C.PANGO_GRAVITY_HINT_NATURAL + GRAVITY_HINT_STRONG GravityHint = C.PANGO_GRAVITY_HINT_STRONG + GRAVITY_HINT_LINE GravityHint = C.PANGO_GRAVITY_HINT_LINE +) + +//double pango_gravity_to_rotation (PangoGravity gravity) G_GNUC_CONST; +func GravityToRotation(gravity Gravity) float64 { + c := C.pango_gravity_to_rotation((C.PangoGravity)(gravity)) + return float64(c) +} + +//PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix) G_GNUC_PURE; + +//PangoGravity pango_gravity_get_for_script (PangoScript script, +// PangoGravity base_gravity, +// PangoGravityHint hint) G_GNUC_CONST; + +//PangoGravity pango_gravity_get_for_script_and_width +// (PangoScript script, +// gboolean wide, +// PangoGravity base_gravity, +// PangoGravityHint hint) G_GNUC_CONST; diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-layout.go b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go new file mode 100644 index 0000000..6ac05c6 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go @@ -0,0 +1,613 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +import "C" +import ( + "runtime" + "unsafe" + + "github.com/gotk3/gotk3/glib" +) + +func init() { + tm := []glib.TypeMarshaler{ + // Enums + {glib.Type(C.pango_alignment_get_type()), marshalAlignment}, + {glib.Type(C.pango_ellipsize_mode_get_type()), marshalEllipsizeMode}, + {glib.Type(C.pango_wrap_mode_get_type()), marshalWrapMode}, + {glib.Type(C.pango_tab_align_get_type()), marshalTabAlign}, + + // Objects/Interfaces + // {glib.Type(C.pango_layout_get_type()), marshalLayout}, + } + glib.RegisterGValueMarshalers(tm) +} + +// Layout is a representation of PangoLayout. +type Layout struct { + pangoLayout *C.PangoLayout +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *Layout) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Layout) native() *C.PangoLayout { + if v == nil { + return nil + } + return (*C.PangoLayout)(unsafe.Pointer(v.pangoLayout)) +} + +func WrapLayout(p uintptr) *Layout { + layout := new(Layout) + layout.pangoLayout = (*C.PangoLayout)(unsafe.Pointer(p)) + return layout +} + +// LayoutLine is a representation of PangoLayoutLine. +type LayoutLine struct { + pangoLayoutLine *C.PangoLayout +} + +// Native returns a pointer to the underlying PangoLayoutLine. +func (v *LayoutLine) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *LayoutLine) native() *C.PangoLayoutLine { + if v == nil { + return nil + } + return (*C.PangoLayoutLine)(unsafe.Pointer(v.pangoLayoutLine)) +} + +/* + * Constants + */ + +// Alignment is a representation of Pango's PangoAlignment. +type Alignment int + +const ( + ALIGN_LEFT Alignment = C.PANGO_ALIGN_LEFT + ALIGN_CENTER Alignment = C.PANGO_ALIGN_CENTER + ALIGN_RIGHT Alignment = C.PANGO_ALIGN_RIGHT +) + +func marshalAlignment(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return Alignment(c), nil +} + +// WrapMode is a representation of Pango's PangoWrapMode. +type WrapMode int + +const ( + WRAP_WORD WrapMode = C.PANGO_WRAP_WORD + WRAP_CHAR WrapMode = C.PANGO_WRAP_CHAR + WRAP_WORD_CHAR WrapMode = C.PANGO_WRAP_WORD_CHAR +) + +func marshalWrapMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return WrapMode(c), nil +} + +// EllipsizeMode is a representation of Pango's PangoEllipsizeMode. +type EllipsizeMode int + +const ( + ELLIPSIZE_NONE EllipsizeMode = C.PANGO_ELLIPSIZE_NONE + ELLIPSIZE_START EllipsizeMode = C.PANGO_ELLIPSIZE_START + ELLIPSIZE_MIDDLE EllipsizeMode = C.PANGO_ELLIPSIZE_MIDDLE + ELLIPSIZE_END EllipsizeMode = C.PANGO_ELLIPSIZE_END +) + +func marshalEllipsizeMode(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return EllipsizeMode(c), nil +} + +type TabAlign int + +const ( + TAB_LEFT TabAlign = C.PANGO_TAB_LEFT +) + +func marshalTabAlign(p uintptr) (interface{}, error) { + c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p))) + return TabAlign(c), nil +} + +/* +func marshalLayout(p uintptr) (interface{}, error) { + c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p))) + obj := wrapObject(unsafe.Pointer(c)) + return wrapLayout(obj), nil +} + +func wrapLayout(obj *glib.Object) *Layout { + return &Layout{obj} +} +*/ + +// LayoutNew is a wrapper around pango_layout_new(). +func LayoutNew(context *Context) *Layout { + c := C.pango_layout_new(context.native()) + + layout := new(Layout) + layout.pangoLayout = (*C.PangoLayout)(c) + return layout +} + +// Copy is a wrapper around pango_layout_copy(). +func (v *Layout) Copy() *Layout { + c := C.pango_layout_copy(v.native()) + + layout := new(Layout) + layout.pangoLayout = (*C.PangoLayout)(c) + return layout +} + +// GetContext is a wrapper around pango_layout_get_context(). +func (v *Layout) GetContext() *Context { + c := C.pango_layout_get_context(v.native()) + + context := new(Context) + context.pangoContext = (*C.PangoContext)(c) + + return context +} + +// SetAttributes is a wrapper around pango_layout_set_attributes(). +func (v *Layout) SetAttributes(attrs *AttrList) { + C.pango_layout_set_attributes(v.native(), attrs.native()) +} + +// GetAttributes is a wrapper around pango_layout_get_attributes(). +func (v *Layout) GetAttributes() *AttrList { + c := C.pango_layout_get_attributes(v.native()) + + attrList := new(AttrList) + attrList.pangoAttrList = (*C.PangoAttrList)(c) + + return attrList +} + +// SetText is a wrapper around pango_layout_set_text(). +func (v *Layout) SetText(text string, length int) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.pango_layout_set_text(v.native(), (*C.char)(cstr), (C.int)(length)) +} + +// GetText is a wrapper around pango_layout_get_text(). +func (v *Layout) GetText() string { + c := C.pango_layout_get_text(v.native()) + return C.GoString((*C.char)(c)) +} + +// GetCharacterCount is a wrapper around pango_layout_get_character_count(). +func (v *Layout) GetCharacterCount() int { + c := C.pango_layout_get_character_count(v.native()) + return int(c) +} + +// SetMarkup is a wrapper around pango_layout_set_markup(). +func (v *Layout) SetMarkup(text string, length int) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.pango_layout_set_markup(v.native(), (*C.char)(cstr), (C.int)(length)) +} + +//void pango_layout_set_markup_with_accel (PangoLayout *layout, +// const char *markup, +// int length, +// gunichar accel_marker, +// gunichar *accel_char); + +/* +func (v *Layout) SetMarkupWithAccel (text string, length int, accel_marker, accel_char rune){ + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.pango_layout_set_markup_with_accel (v.native(), (*C.char)(cstr), (C.int)(length), (C.gunichar)(accel_marker), (C.gunichar)(accel_char) ) +} +*/ + +// SetFontDescription is a wrapper around pango_layout_set_font_description(). +func (v *Layout) SetFontDescription(desc *FontDescription) { + C.pango_layout_set_font_description(v.native(), desc.native()) +} + +// GetFontDescription is a wrapper around pango_layout_get_font_description(). +func (v *Layout) GetFontDescription() *FontDescription { + c := C.pango_layout_get_font_description(v.native()) + + desc := new(FontDescription) + desc.pangoFontDescription = (*C.PangoFontDescription)(c) + + return desc +} + +// SetWidth is a wrapper around pango_layout_set_width(). +func (v *Layout) SetWidth(width int) { + C.pango_layout_set_width(v.native(), C.int(width)) +} + +// GetWidth is a wrapper around pango_layout_get_width(). +func (v *Layout) GetWidth() int { + c := C.pango_layout_get_width(v.native()) + return int(c) +} + +// SetHeight is a wrapper around pango_layout_set_height(). +func (v *Layout) SetHeight(width int) { + C.pango_layout_set_height(v.native(), C.int(width)) +} + +// GetHeight is a wrapper around pango_layout_get_height(). +func (v *Layout) GetHeight() int { + c := C.pango_layout_get_height(v.native()) + return int(c) +} + +// SetWrap is a wrapper around pango_layout_set_wrap(). +func (v *Layout) SetWrap(wrap WrapMode) { + C.pango_layout_set_wrap(v.native(), C.PangoWrapMode(wrap)) +} + +// WrapMode is a wrapper around pango_layout_get_wrap(). +func (v *Layout) GetWrap() WrapMode { + c := C.pango_layout_get_wrap(v.native()) + return WrapMode(c) +} + +// IsWrapped is a wrapper around pango_layout_is_wrapped(). +func (v *Layout) IsWrapped() bool { + c := C.pango_layout_is_wrapped(v.native()) + return gobool(c) +} + +// SetIndent is a wrapper around pango_layout_set_indent(). +func (v *Layout) SetIndent(indent int) { + C.pango_layout_set_indent(v.native(), C.int(indent)) +} + +// GetIndent is a wrapper around pango_layout_get_indent(). +func (v *Layout) GetIndent() int { + c := C.pango_layout_get_indent(v.native()) + return int(c) +} + +// SetTabs is a wrapper around pango_layout_set_tabs(). +func (v *Layout) SetTabs(tabs *TabArray) { + C.pango_layout_set_tabs(v.native(), tabs.native()) +} + +// GetTabs is a wrapper around pango_layout_get_tabs(). +func (v *Layout) GetTabs() (*TabArray, error) { + c := C.pango_layout_get_tabs(v.native()) + if c == nil { + return nil, nilPtrErr + } + ta := wrapTabArray(c) + runtime.SetFinalizer(ta, (*TabArray).free) + return ta, nil +} + +// GetSize is a wrapper around pango_layout_get_size(). +func (v *Layout) GetSize() (int, int) { + var w, h C.int + C.pango_layout_get_size(v.native(), &w, &h) + return int(w), int(h) +} + +/* + * TabArray + */ + +// TabArray is a representation of PangoTabArray. +type TabArray struct { + pangoTabArray *C.PangoTabArray +} + +// Native returns a pointer to the underlying PangoTabArray. +func (v *TabArray) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *TabArray) native() *C.PangoTabArray { + if v == nil { + return nil + } + return (*C.PangoTabArray)(unsafe.Pointer(v.pangoTabArray)) +} + +func wrapTabArray(tabArray *C.PangoTabArray) *TabArray { + return &TabArray{tabArray} +} + +func WrapTabArray(p uintptr) *TabArray { + tabArray := new(TabArray) + tabArray.pangoTabArray = (*C.PangoTabArray)(unsafe.Pointer(p)) + return tabArray +} + +// TabArrayNew is a wrapper around pango_tab_array_new(). +func TabArrayNew(initialSize int, positionsInPixels bool) *TabArray { + c := C.pango_tab_array_new(C.gint(initialSize), gbool(positionsInPixels)) + + tabArray := new(TabArray) + runtime.SetFinalizer(tabArray, (*TabArray).free) + tabArray.pangoTabArray = (*C.PangoTabArray)(c) + return tabArray +} + +// TabArrayNewWithPositions is a wrapper around pango_tab_array_new_with_positions(). +// func TabArrayNewWithPositions(size int, positionsInPixels bool, ...) *TabArray { +// c := C.pango_tab_array_new_with_positions(C.gint(size), gbool(positionsInPixels), ...) + +// tabArray := new(TabArray) +// runtime.SetFinalizer(e, (*TabArray).free) +// tabArray.pangoTabArray = (*C.PangoTabArray)(c) +// return tabArray +// } + +// Copy is a wrapper around pango_tab_array_copy(). +func (v *TabArray) Copy() (*TabArray, error) { + c := C.pango_tab_array_copy(v.native()) + if c == nil { + return nil, nilPtrErr + } + ta := wrapTabArray(c) + runtime.SetFinalizer(ta, (*TabArray).free) + return ta, nil +} + +// free is a wrapper around pango_tab_array_free(). +func (v *TabArray) free() { + C.pango_tab_array_free(v.native()) +} + +// free is a wrapper around pango_tab_array_free(). +// This is only to enable other packages within gotk. Should not be used outside the gotk library. +func (v *TabArray) Free() { + C.pango_tab_array_free(v.native()) +} + +// GetSize is a wrapper around pango_tab_array_get_size(). +func (v *TabArray) GetSize() int { + return int(C.pango_tab_array_get_size(v.native())) +} + +// Resize is a wrapper around pango_tab_array_resize(). +func (v *TabArray) Resize(newSize int) { + C.pango_tab_array_resize(v.native(), C.gint(newSize)) +} + +// SetTab is a wrapper around pango_tab_array_set_tab(). +func (v *TabArray) SetTab(tabIndex int, alignment TabAlign, location int) { + C.pango_tab_array_set_tab(v.native(), C.gint(tabIndex), C.PangoTabAlign(alignment), C.gint(location)) +} + +// GetTab is a wrapper around pango_tab_array_get_tab(). +func (v *TabArray) GetTab(tabIndex int) (TabAlign, int) { + var alignment C.PangoTabAlign + var location C.gint + C.pango_tab_array_get_tab(v.native(), C.gint(tabIndex), &alignment, &location) + return TabAlign(alignment), int(location) +} + +// GetTabs is a wrapper around pango_tab_array_get_tabs(). +// func (v *TabArray) GetTabs() ([]TabAlign, []int) { +// var alignment *C.PangoTabAlign +// var location *C.gint + +// C.pango_tab_array_get_tabs(v.native(), &alignment, &location) + +// size := v.GetSize() + +// var goAlignments []TabAlign +// var goLocations []int + +// if &alignment != nil { +// var ginthelp C.gint +// sizeOf := unsafe.Sizeof(ginthelp) +// for i := 0; i < int(size); i++ { +// goAlignmentElement := TabAlign(*((*C.gint)(unsafe.Pointer(location)))) +// goAlignments = append(goAlignments, goAlignmentElement) +// location += sizeOf +// } +// } + +// if &location != nil { +// var ginthelp C.gint +// sizeOf := unsafe.Sizeof(ginthelp) +// for i := 0; i < int(size); i++ { +// goLocationElement := int(*((*C.gint)(unsafe.Pointer(location)))) +// goLocations = append(goLocations, goLocationElement) +// location += sizeOf +// } + +// // TODO: free locations +// } + +// return goAlignments, goLocations +// } + +// GetPositionsInPixels is a wrapper around pango_tab_array_get_positions_in_pixels(). +func (v *TabArray) GetPositionsInPixels() bool { + return gobool(C.pango_tab_array_get_positions_in_pixels(v.native())) +} + +//void pango_layout_set_spacing (PangoLayout *layout, +// int spacing); +//int pango_layout_get_spacing (PangoLayout *layout); +//void pango_layout_set_justify (PangoLayout *layout, +// gboolean justify); +//gboolean pango_layout_get_justify (PangoLayout *layout); +//void pango_layout_set_auto_dir (PangoLayout *layout, +// gboolean auto_dir); +//gboolean pango_layout_get_auto_dir (PangoLayout *layout); +//void pango_layout_set_alignment (PangoLayout *layout, +// PangoAlignment alignment); +//PangoAlignment pango_layout_get_alignment (PangoLayout *layout); +// +//void pango_layout_set_single_paragraph_mode (PangoLayout *layout, +// gboolean setting); +//gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout); +// +//void pango_layout_set_ellipsize (PangoLayout *layout, +// PangoEllipsizeMode ellipsize); +//PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout); +//gboolean pango_layout_is_ellipsized (PangoLayout *layout); +// +//int pango_layout_get_unknown_glyphs_count (PangoLayout *layout); +// +//void pango_layout_context_changed (PangoLayout *layout); +//guint pango_layout_get_serial (PangoLayout *layout); +// +//void pango_layout_get_log_attrs (PangoLayout *layout, +// PangoLogAttr **attrs, +// gint *n_attrs); +// +//const PangoLogAttr *pango_layout_get_log_attrs_readonly (PangoLayout *layout, +// gint *n_attrs); +// +//void pango_layout_index_to_pos (PangoLayout *layout, +// int index_, +// PangoRectangle *pos); +//void pango_layout_index_to_line_x (PangoLayout *layout, +// int index_, +// gboolean trailing, +// int *line, +// int *x_pos); +//void pango_layout_get_cursor_pos (PangoLayout *layout, +// int index_, +// PangoRectangle *strong_pos, +// PangoRectangle *weak_pos); +//void pango_layout_move_cursor_visually (PangoLayout *layout, +// gboolean strong, +// int old_index, +// int old_trailing, +// int direction, +// int *new_index, +// int *new_trailing); +//gboolean pango_layout_xy_to_index (PangoLayout *layout, +// int x, +// int y, +// int *index_, +// int *trailing); +//void pango_layout_get_extents (PangoLayout *layout, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//void pango_layout_get_pixel_extents (PangoLayout *layout, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//void pango_layout_get_pixel_size (PangoLayout *layout, +// int *width, +// int *height); +//int pango_layout_get_baseline (PangoLayout *layout); +// +//int pango_layout_get_line_count (PangoLayout *layout); +//PangoLayoutLine *pango_layout_get_line (PangoLayout *layout, +// int line); +//PangoLayoutLine *pango_layout_get_line_readonly (PangoLayout *layout, +// int line); +//GSList * pango_layout_get_lines (PangoLayout *layout); +//GSList * pango_layout_get_lines_readonly (PangoLayout *layout); +// +// +//#define PANGO_TYPE_LAYOUT_LINE (pango_layout_line_get_type ()) +// +//GType pango_layout_line_get_type (void) G_GNUC_CONST; +// +//PangoLayoutLine *pango_layout_line_ref (PangoLayoutLine *line); +//void pango_layout_line_unref (PangoLayoutLine *line); +// +//gboolean pango_layout_line_x_to_index (PangoLayoutLine *line, +// int x_pos, +// int *index_, +// int *trailing); +//void pango_layout_line_index_to_x (PangoLayoutLine *line, +// int index_, +// gboolean trailing, +// int *x_pos); +//void pango_layout_line_get_x_ranges (PangoLayoutLine *line, +// int start_index, +// int end_index, +// int **ranges, +// int *n_ranges); +//void pango_layout_line_get_extents (PangoLayoutLine *line, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +// +//typedef struct _PangoLayoutIter PangoLayoutIter; +// +//#define PANGO_TYPE_LAYOUT_ITER (pango_layout_iter_get_type ()) +// +//GType pango_layout_iter_get_type (void) G_GNUC_CONST; +// +//PangoLayoutIter *pango_layout_get_iter (PangoLayout *layout); +//PangoLayoutIter *pango_layout_iter_copy (PangoLayoutIter *iter); +//void pango_layout_iter_free (PangoLayoutIter *iter); +// +//int pango_layout_iter_get_index (PangoLayoutIter *iter); +//PangoLayoutRun *pango_layout_iter_get_run (PangoLayoutIter *iter); +//PangoLayoutRun *pango_layout_iter_get_run_readonly (PangoLayoutIter *iter); +//PangoLayoutLine *pango_layout_iter_get_line (PangoLayoutIter *iter); +//PangoLayoutLine *pango_layout_iter_get_line_readonly (PangoLayoutIter *iter); +//gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter); +//PangoLayout *pango_layout_iter_get_layout (PangoLayoutIter *iter); +// +//gboolean pango_layout_iter_next_char (PangoLayoutIter *iter); +//gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter); +//gboolean pango_layout_iter_next_run (PangoLayoutIter *iter); +//gboolean pango_layout_iter_next_line (PangoLayoutIter *iter); +// +//void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, +// PangoRectangle *logical_rect); +//void pango_layout_iter_get_cluster_extents (PangoLayoutIter *iter, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +/* All the yranges meet, unlike the logical_rect's (i.e. the yranges + * assign between-line spacing to the nearest line) + */ +//void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, +// int *y0_, +// int *y1_); +//void pango_layout_iter_get_layout_extents (PangoLayoutIter *iter, +// PangoRectangle *ink_rect, +// PangoRectangle *logical_rect); +//int pango_layout_iter_get_baseline (PangoLayoutIter *iter); +// diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-layout.go.h b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go.h new file mode 100644 index 0000000..8aa70b2 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-layout.go.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +static PangoLayout *toPangoLayout(void *p) { return ((PangoLayout *)(p)); } diff --git a/vendor/github.com/gotk3/gotk3/pango/pango-types.go b/vendor/github.com/gotk3/gotk3/pango/pango-types.go new file mode 100644 index 0000000..fb08656 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango-types.go @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include "pango.go.h" +// #include +import "C" +import ( + "unsafe" +) + +// LogAttr is a representation of PangoLogAttr. +type LogAttr struct { + pangoLogAttr *C.PangoLogAttr +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *LogAttr) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *LogAttr) native() *C.PangoLogAttr { + return (*C.PangoLogAttr)(unsafe.Pointer(v.pangoLogAttr)) +} + +// EngineLang is a representation of PangoEngineLang. +type EngineLang struct { + pangoEngineLang *C.PangoEngineLang +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *EngineLang) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EngineLang) native() *C.PangoEngineLang { + return (*C.PangoEngineLang)(unsafe.Pointer(v.pangoEngineLang)) +} + +// EngineShape is a representation of PangoEngineShape. +type EngineShape struct { + pangoEngineShape *C.PangoEngineShape +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *EngineShape) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *EngineShape) native() *C.PangoEngineShape { + return (*C.PangoEngineShape)(unsafe.Pointer(v.pangoEngineShape)) +} + +// Font is a representation of PangoFont. +type Font struct { + pangoFont *C.PangoFont +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *Font) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Font) native() *C.PangoFont { + return (*C.PangoFont)(unsafe.Pointer(v.pangoFont)) +} + +// FontMap is a representation of PangoFontMap. +type FontMap struct { + pangoFontMap *C.PangoFontMap +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *FontMap) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *FontMap) native() *C.PangoFontMap { + return (*C.PangoFontMap)(unsafe.Pointer(v.pangoFontMap)) +} + +func wrapFontMap(fontMap *C.PangoFontMap) *FontMap { + return &FontMap{fontMap} +} + +func WrapFontMap(p uintptr) *FontMap { + fontMap := (*C.PangoFontMap)(unsafe.Pointer(p)) + return wrapFontMap(fontMap) +} + +// Rectangle is a representation of PangoRectangle. +type Rectangle struct { + pangoRectangle *C.PangoRectangle +} + +// Native returns a pointer to the underlying PangoLayout. +func (v *Rectangle) Native() uintptr { + return uintptr(unsafe.Pointer(v.native())) +} + +func (v *Rectangle) native() *C.PangoRectangle { + return (*C.PangoRectangle)(unsafe.Pointer(v.pangoRectangle)) +} + +// Glyph is a representation of PangoGlyph +type Glyph uint32 + +//void pango_extents_to_pixels (PangoRectangle *inclusive, +// PangoRectangle *nearest); +func (inclusive *Rectangle) ExtentsToPixels(nearest *Rectangle) { + C.pango_extents_to_pixels(inclusive.native(), nearest.native()) +} + +func RectangleNew(x, y, width, height int) *Rectangle { + r := new(Rectangle) + r.pangoRectangle = C.createPangoRectangle((C.int)(x), (C.int)(y), (C.int)(width), (C.int)(height)) + return r +} diff --git a/vendor/github.com/gotk3/gotk3/pango/pango.go b/vendor/github.com/gotk3/gotk3/pango/pango.go new file mode 100644 index 0000000..4745ec1 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango.go @@ -0,0 +1,62 @@ +// Copyright (c) 2013-2014 Conformal Systems +// +// This file originated from: http://opensource.conformal.com/ +// +// Permission to use, copy, modify, and distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +// Go bindings for Pango. +package pango + +// #cgo pkg-config: fontconfig gobject-2.0 glib-2.0 pango pangocairo +// #include +// #include "pango.go.h" +import "C" +import "errors" + +// "github.com/andre-hub/gotk3/glib" +// "unsafe" + +func init() { + +} + +/* + * Type conversions + */ + +func gbool(b bool) C.gboolean { + if b { + return C.gboolean(1) + } + return C.gboolean(0) +} +func gobool(b C.gboolean) bool { + if b != 0 { + return true + } + return false +} + +/* + * Unexported vars + */ + +var nilPtrErr = errors.New("cgo returned unexpected nil pointer") + +/* + * Constantes + */ + +const ( + SCALE int = 1024 +) diff --git a/vendor/github.com/gotk3/gotk3/pango/pango.go.h b/vendor/github.com/gotk3/gotk3/pango/pango.go.h new file mode 100644 index 0000000..68e4159 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pango.go.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include "pango-attributes.go.h" +#include "pango-layout.go.h" + +#include "pangocairo.go.h" + +static PangoRectangle *createPangoRectangle(int x, int y, int width, + int height) { + PangoRectangle *r = (PangoRectangle *)malloc(sizeof(PangoRectangle)); + r->x = x; + r->y = y; + r->width = width; + r->height = height; + return r; +} \ No newline at end of file diff --git a/vendor/github.com/gotk3/gotk3/pango/pangocairo.go b/vendor/github.com/gotk3/gotk3/pango/pangocairo.go new file mode 100644 index 0000000..260e345 --- /dev/null +++ b/vendor/github.com/gotk3/gotk3/pango/pangocairo.go @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2015- terrak + * + * This file originated from: http://www.terrak.net/ + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +package pango + +// #include +// #include +// #include +// #include "pango.go.h" +import "C" +import ( + // "github.com/gotk3/gotk3/glib" + "unsafe" + + "github.com/gotk3/gotk3/cairo" +) + +func init() { + // tm := []glib.TypeMarshaler{ + // // Enums + // {glib.Type(C.pango_alignement_get_type()), marshalAlignment}, + // {glib.Type(C.pango_ellipsize_mode_get_type()), marshalEllipsizeMode}, + // {glib.Type(C.pango_wrap_mode_get_type()), marshalWrapMode}, + // } + // glib.RegisterGValueMarshalers(tm) +} + +func cairo_context(cr *cairo.Context) *C.cairo_t { + return (*C.cairo_t)(cr.GetCContext()) +} + +/* Convenience + */ +//PangoContext *pango_cairo_create_context (cairo_t *cr); +func CairoCreateContext(cr *cairo.Context) *Context { + c := C.pango_cairo_create_context(cairo_context(cr)) + context := new(Context) + context.pangoContext = (*C.PangoContext)(c) + return context +} + +//PangoLayout *pango_cairo_create_layout (cairo_t *cr); +func CairoCreateLayout(cr *cairo.Context) *Layout { + c := C.pango_cairo_create_layout(cairo_context(cr)) + layout := new(Layout) + layout.pangoLayout = (*C.PangoLayout)(c) + return layout +} + +//void pango_cairo_update_layout (cairo_t *cr, +// PangoLayout *layout); +func CairoUpdateLayout(cr *cairo.Context, v *Layout) { + C.pango_cairo_update_layout(cairo_context(cr), v.native()) +} + +/* + * Rendering + */ +//void pango_cairo_show_glyph_string (cairo_t *cr, +// PangoFont *font, +// PangoGlyphString *glyphs); +func CairoShowGlyphString(cr *cairo.Context, font *Font, glyphs *GlyphString) { + C.pango_cairo_show_glyph_string(cairo_context(cr), font.native(), glyphs.native()) +} + +//void pango_cairo_show_glyph_item (cairo_t *cr, +// const char *text, +// PangoGlyphItem *glyph_item); +func CairoShowGlyphItem(cr *cairo.Context, text string, glyph_item *GlyphItem) { + cstr := C.CString(text) + defer C.free(unsafe.Pointer(cstr)) + C.pango_cairo_show_glyph_item(cairo_context(cr), (*C.char)(cstr), glyph_item.native()) +} + +//void pango_cairo_show_layout_line (cairo_t *cr, +// PangoLayoutLine *line); +func CairoShowLayoutLine(cr *cairo.Context, line *LayoutLine) { + C.pango_cairo_show_layout_line(cairo_context(cr), line.native()) +} + +//void pango_cairo_show_layout (cairo_t *cr, +// PangoLayout *layout); +func CairoShowLayout(cr *cairo.Context, layout *Layout) { + C.pango_cairo_show_layout(cairo_context(cr), layout.native()) +} + +//void pango_cairo_show_error_underline (cairo_t *cr, +// double x, +// double y, +// double width, +// double height); + +/* + * Rendering to a path + */ + +//void pango_cairo_glyph_string_path (cairo_t *cr, +// PangoFont *font, +// PangoGlyphString *glyphs); +func CairoGlyphStringPath(cr *cairo.Context, font *Font, glyphs *GlyphString) { + C.pango_cairo_glyph_string_path(cairo_context(cr), font.native(), glyphs.native()) +} + +//void pango_cairo_layout_line_path (cairo_t *cr, +// PangoLayoutLine *line); +func CairoLayoutLinePath(cr *cairo.Context, line *LayoutLine) { + C.pango_cairo_layout_line_path(cairo_context(cr), line.native()) +} + +//void pango_cairo_layout_path (cairo_t *cr, +// PangoLayout *layout); +func CairoLayoutPath(cr *cairo.Context, layout *Layout) { + C.pango_cairo_layout_path(cairo_context(cr), layout.native()) +} + +//void pango_cairo_error_underline_path (cairo_t *cr, +// double x, +// double y, +// double width, +// double height); +func CairoErrorUnderlinePath(cr *cairo.Context, x, y, width, height float64) { + C.pango_cairo_error_underline_path(cairo_context(cr), C.double(x), C.double(y), C.double(width), C.double(height)) +} diff --git a/vendor/github.com/gotk3/gotk3/pango/pangocairo.go.h b/vendor/github.com/gotk3/gotk3/pango/pangocairo.go.h new file mode 100644 index 0000000..e69de29 diff --git a/vendor/github.com/hfmrow/genLib/strings/eol.go b/vendor/github.com/hfmrow/genLib/strings/eol.go new file mode 100644 index 0000000..d2e532e --- /dev/null +++ b/vendor/github.com/hfmrow/genLib/strings/eol.go @@ -0,0 +1,87 @@ +// eol.go + +/* +* Some end of line functions used by different OS + */ + +package strings + +import ( + "bytes" + "errors" + "io/ioutil" + "os" + "runtime" +) + +// GetOsLineEnd: Get current OS line-feed +func GetOsLineEnd() string { + if "windows" == runtime.GOOS { + return "\r\n" + } + return "\n" +} + +// GetTextEOL: Get EOL from text bytes (CR, LF, CRLF) +func GetTextEOL(inTextBytes []byte) (outString string) { + bCR := []byte{0x0D} + bLF := []byte{0x0A} + bCRLF := []byte{0x0D, 0x0A} + switch { + case bytes.Contains(inTextBytes, bCRLF): + outString = string(bCRLF) + case bytes.Contains(inTextBytes, bCR): + outString = string(bCR) + default: + outString = string(bLF) + } + return +} + +// SetTextEOL: Get EOL from text bytes and convert it to another EOL (CR, LF, CRLF) +func SetTextEOL(inTextBytes []byte, eol string) (outTextBytes []byte, err error) { + bCR := []byte{0x0D} + bLF := []byte{0x0A} + bCRLF := []byte{0x0D, 0x0A} + var outEol []byte + switch eol { + case "CR": + outEol = bCR + case "LF": + outEol = bLF + case "CRLF": + outEol = bCRLF + default: + return outTextBytes, errors.New("EOL convert error: Undefined end of line") + } + // Handle end of line + outTextBytes = bytes.Replace(inTextBytes, []byte(GetTextEOL(inTextBytes)), outEol, -1) + return outTextBytes, nil +} + +// GetFileEOL: Open file and get (CR, LF, CRLF) > string or get OS line end. +func GetFileEOL(filename string) (outString string, err error) { + textFileBytes, err := ioutil.ReadFile(filename) + if err != nil { + return outString, err + } + return GetTextEOL(textFileBytes), nil +} + +// SetFileEOL: Open file and convert EOL (CR, LF, CRLF) then write it back. +func SetFileEOL(filename, eol string) error { + textFileBytes, err := ioutil.ReadFile(filename) + if err != nil { + return err + } + // Handle end of line + textFileBytes, err = SetTextEOL(textFileBytes, eol) + if err != nil { + return err + } + err = ioutil.WriteFile(filename, textFileBytes, os.ModePerm) + if err != nil { + return err + } + return nil +} diff --git a/vendor/github.com/hfmrow/genLib/strings/formatText.go b/vendor/github.com/hfmrow/genLib/strings/formatText.go new file mode 100644 index 0000000..356614f --- /dev/null +++ b/vendor/github.com/hfmrow/genLib/strings/formatText.go @@ -0,0 +1,145 @@ +// formatText.go + +package strings + +import ( + "fmt" + "regexp" + "strconv" + "strings" +) + +// An unwanted behavior may occur on string where word's length > max... +func FormatTextQuoteBlankLines(str string) (out string) { + outStrings := strings.Split(str, GetTextEOL([]byte(str))) + for _, line := range outStrings { + if len(line) != 0 { + out += strings.TrimSuffix(strings.TrimPrefix(strconv.Quote(line+"\n"), `"`), `"`) + } else { + out += `\n` + } + } + return `"` + out + `"` +} + +// FormatTextParagraphFormatting: +func FormatTextParagraphFormatting(str string, max int, truncateWordOverMaxSize bool, indentFirstLinetr ...string) string { + var tmpParag, tmpFinal, indent string + eol := GetTextEOL([]byte(str)) + var addLine = func() { + tmpFinal += FormatText(tmpParag, max, truncateWordOverMaxSize, indent) + } + if len(indentFirstLinetr) != 0 { + indent = indentFirstLinetr[0] + } + lines := strings.Split(str, eol) + for _, line := range lines { + if len(line) != 0 { + tmpParag += line + } else { + addLine() + tmpFinal += eol + eol + tmpParag = tmpParag[:0] + } + } + addLine() + return strings.TrimSuffix(tmpFinal, eol) +} + +// FormatText: Format words text to fit (column/windows with limited width) "max" +// chars. An unwanted behavior may occur on string where word's length > max... +func FormatText(str string, max int, truncateWordOverMaxSize bool, indenT ...string) string { + var indent string + if len(indenT) != 0 { + indent = indenT[0] + } + if len(str) > 0 { + eol := GetTextEOL([]byte(str)) + var tmpLines, tmpWordTooLong []string + space := regexp.MustCompile(`[[:space:]]`) + var outText []string + var countChar, length int + // in case where string does not contain any [[:space:]] char + var cutLongString = func(inStr string, inMax int, truncate bool) (outSliceText []string) { + if !truncate { + length = len(inStr) + for count := 0; count < length; count = count + inMax { + if count+inMax < length { + outSliceText = append(outSliceText, inStr[count:count+inMax]) + } else { + outSliceText = append(outSliceText, inStr[count:length]) + } + } + } else { + outSliceText = append(outSliceText, TruncateString(inStr, "...", inMax, 1)) + } + return outSliceText + } + text := space.Split(str, -1) // Split str at each blank char + for idxWord := 0; idxWord < len(text); idxWord++ { + length = len(text[idxWord]) + 1 + if length >= max { + tmpWordTooLong = cutLongString(text[idxWord], max-1, truncateWordOverMaxSize) + text = append(text[:idxWord], text[idxWord+1:]...) // Remove slice entry + // Insert slices entries + text = append(text[:idxWord], append(tmpWordTooLong, text[idxWord:]...)...) + length = len(text[idxWord]) // Calculate new length + } + + if countChar+length <= max { + tmpLines = append(tmpLines, text[idxWord]) + countChar += length + } else { + outText = append(outText, indent+strings.Join(tmpLines, " ")) + tmpLines = tmpLines[:0] // Clear slice + countChar = 0 + idxWord-- + } + } + // Get the rest of the text. + outText = append(outText, indent+strings.Join(tmpLines, " ")) + return strings.Join(outText, eol) + } + return "" +} + +// TruncateString: Reduce string length for display (prefix is separator like: "...", +// option=0 -> put separator at the begining of output string. Option=1 -> center, +// is where separation is placed. option=2 -> line feed, trunc the whole string +// using LF without shorting it. Max, is max char length of the output string. +func TruncateString(inString, prefix string, max, option int) string { + var center, cutAt bool + var outText string + switch option { + case 1: + center = true + cutAt = false + max = max - len(prefix) + case 2: + center = false + cutAt = true + default: + center = false + cutAt = false + max = max - len(prefix) + } + length := len(inString) + if length > max { + if cutAt { + for count := 0; count < length; count = count + max { + if count+max < length { + outText += fmt.Sprintln(inString[count : count+max]) + } else { + outText += fmt.Sprintln(inString[count:length]) + } + } + return outText + } else if center { + midLength := max / 2 + inString = inString[:midLength] + prefix + inString[length-midLength-1:] + } else { + inString = prefix + inString[length-max:] + } + } + return inString +} diff --git a/vendor/github.com/hfmrow/genLib/strings/stringOperations.go b/vendor/github.com/hfmrow/genLib/strings/stringOperations.go new file mode 100644 index 0000000..c73d2be --- /dev/null +++ b/vendor/github.com/hfmrow/genLib/strings/stringOperations.go @@ -0,0 +1,248 @@ +// stringOperations.go + +/* + Part of H.F.M personal GenLib p akage (not published) + Copyright ©2020 H.F.M github.com/hfmrow + This program comes with absolutely no warranty. See the The MIT License (MIT) for details: + https://opensource.org/licenses/mit-license.php +*/ + +package strings + +import ( + "crypto/md5" + "fmt" + "log" + "math/rand" + "os" + "path/filepath" + "regexp" + "strconv" + "strings" + "time" + "unicode" +) + +// UnescapeToUtf8: Convert raw string that contain escaped values to +// utf-8 literal string. +func UnescapeToUtf8(inStr string) string { + + var escRawConv = map[string]string{ + `\n`: "\u000A", // line feed or newline + `\t`: "\u0009", // horizontal tab + `\"`: "\u0022", // double quote + `\r`: "\u000D", // carriage return + `\\`: "\u005c", // backslash + `\f`: "\u000C", // form feed + `\v`: "\u000b", // vertical tab + `\b`: "\u0008", // backspace + `\a`: "\u0007", // alert or bell (little joke) + } + for esc, uni := range escRawConv { + inStr = strings.ReplaceAll(inStr, esc, uni) + } + + return inStr +} + +// UnEscapeString: Convert raw string that contain escaped values to +// literal string. +func UnEscapeString(inString string) string { + inString = strings.ReplaceAll(inString, `"`, `\"`) + outString, err := strconv.Unquote(`"` + inString + `"`) + if err != nil { + log.Fatalf("UnEscapeString/Unquote: %v [%v]\n", inString, err) + } + return outString +} + +// LowercaseAtFirst: true if 1st char is lowercase +func LowercaseAtFirst(inString string) bool { + + if len(inString) != 0 { + charType, _ := regexp.Compile("[[:lower:]]") + return charType.MatchString(inString[:1]) + } + return true +} + +// toCamel: Turn string into camelCase or PascalCase style (Go). +func ToCamel(inString string, lowerAtFirst ...bool) string { + + lAtFirst := false + regNonAlNum := regexp.MustCompile("[^[:alnum:]]+") + + if len(lowerAtFirst) > 0 && lowerAtFirst[0] { + lAtFirst = lowerAtFirst[0] + } + tmpString := regNonAlNum.Split(SeparateUpper(inString, " "), -1) + sl := make([]string, len(tmpString)) + + for idx, word := range tmpString { + if lAtFirst && idx < 1 { + sl[idx] = strings.ToLower(word) + } else { + sl[idx] = strings.Title(word) + } + } + return strings.Join(sl, "") +} + +// toSnake: Turn string into snake_case style (C). +func ToSnake(inString string, allCaps ...bool) string { + return toSnakeOrKebab(inString, "_", allCaps...) +} + +// toKebab: Turn string into kebab-case style (URLs). +func ToKebab(inString string, allCaps ...bool) string { + return toSnakeOrKebab(inString, "-", allCaps...) +} + +// toSnakeOrKebab: +func toSnakeOrKebab(inString, sep string, allCaps ...bool) string { + + allC := false + regNonAlNum := regexp.MustCompile("[^[:alnum:]]+") + + if len(allCaps) > 0 { + allC = allCaps[0] + } + tmpString := regNonAlNum.Split(SeparateUpper(strings.TrimSpace(inString), " "), -1) + var sl []string + for _, word := range tmpString { + if len(word) > 0 { + if !allC { + sl = append(sl, strings.ToLower(word)) + } else { + sl = append(sl, strings.ToUpper(word)) + } + } + } + return strings.Join(sl, sep) +} + +// SeparateUpper: Add a 'sep' before each upper case char +// except the first. +func SeparateUpper(inString, sep string) string { + + var words []string + l := 0 + for s := inString; s != ""; s = s[l:] { + l = strings.IndexFunc(s[1:], unicode.IsUpper) + 1 + if l <= 0 { + l = len(s) + } + words = append(words, s[:l]) + } + if len(words) > 0 { + return strings.Join(words, sep) + } + return inString +} + +// GenFileName: Generate a randomized file name +func GenFileName() string { + r := rand.New(rand.NewSource(time.Now().UnixNano())) + return fmt.Sprintf("%x", md5.Sum([]byte(fmt.Sprint(r.Int63n(time.Now().UnixNano()))))) +} + +// RemoveNonAlNum: Remove all non alpha-numeric char +func RemoveNonAlNum(inString string) string { + nonAlNum := regexp.MustCompile(`[[:punct:]]`) + return nonAlNum.ReplaceAllString(inString, "") +} + +// RemoveNonNum: Remove all non numeric char +func RemoveNonNum(inString string) string { + nonAlNum := regexp.MustCompile(`[[:punct:][:alpha:]]`) + return nonAlNum.ReplaceAllString(inString, "") +} + +// ReplaceSpace: replace all [[:space::]] with 'repl' +func ReplaceSpace(inString, repl string) string { + spaceRegex := regexp.MustCompile(`[[:space:]]`) + return spaceRegex.ReplaceAllString(inString, repl) +} + +// RemoveDupSpace: Remove duplicated space/tab in string +func RemoveDupSpace(inString string) string { + remInside := regexp.MustCompile(`[\s\p{Zs}]{2,}`) // to match 2 or more whitespace symbols inside a string + return strings.TrimSpace(remInside.ReplaceAllString(inString, " ")) +} + +// RemoveSpace: remove all [[:space::]] +func RemoveSpace(inString string) string { + spaceRegex := regexp.MustCompile(`[[:space:]]`) + return spaceRegex.ReplaceAllString(inString, "") +} + +// ReplacePunct: replace all [[:punct::]] with 'repl' +func ReplacePunct(inString, repl string) string { + spaceRegex := regexp.MustCompile(`[[:punct:]]`) + return spaceRegex.ReplaceAllString(inString, repl) +} + +// SplitNumeric: Split and keep all numeric values in a string +func SplitNumeric(inString string) (outText []string, err error) { + toSplit := regexp.MustCompile(`[[:alpha:][:punct:]]`) + spaceSepared := toSplit.ReplaceAllString(inString, " ") + outText = strings.Split(RemoveDupSpace(spaceSepared), " ") + return outText, err +} + +// ReducePath: Reduce path length by preserving count element from the end +func TruncatePath(fullpath string, count ...int) (reduced string) { + elemCnt := 2 + if len(count) != 0 { + elemCnt = count[0] + } + splited := strings.Split(fullpath, string(os.PathSeparator)) + if len(splited) > elemCnt+1 { + return "..." + string(os.PathSeparator) + filepath.Join(splited[len(splited)-elemCnt:]...) + } + return fullpath +} + +// // TrimSpace: Some multiple way to trim strings. cmds is optionnal or accept multiples args +// func TrimSpace(inputString string, cmds ...string) (newstring string, err error) { + +// osForbiden := regexp.MustCompile(`[<>:"/\\|?*]`) +// remInside := regexp.MustCompile(`[\s\p{Zs}]{2,}`) // to match 2 or more whitespace symbols inside a string +// remInsideNoTab := regexp.MustCompile(`[\p{Zs}]{2,}`) // (preserve \t) to match 2 or more space symbols inside a string + +// if len(cmds) != 0 { +// for _, command := range cmds { +// switch command { +// case "+h": // Escape html +// inputString = html.EscapeString(inputString) +// case "-h": // UnEscape html +// inputString = html.UnescapeString(inputString) +// case "+e": // Escape specials chars +// inputString = fmt.Sprintf("%q", inputString) +// case "-e": // Un-Escape specials chars +// tmpString, err := strconv.Unquote(`"` + inputString + `"`) +// if err != nil { +// return inputString, err +// } +// inputString = tmpString +// case "-w": // Change all illegals chars (for path in linux and windows) into "-" +// inputString = osForbiden.ReplaceAllString(inputString, "-") +// case "+w": // clean all illegals chars (for path in linux and windows) +// inputString = osForbiden.ReplaceAllString(inputString, "") +// case "-c": // Trim [[:space:]] and clean multi [[:space:]] inside +// inputString = strings.TrimSpace(remInside.ReplaceAllString(inputString, " ")) +// case "-ct": // Trim [[:space:]] and clean multi [[:space:]] inside (preserve TAB) +// inputString = strings.Trim(remInsideNoTab.ReplaceAllString(inputString, " "), " ") +// case "-s": // To match 2 or more whitespace leading/ending/inside a string (include \t, \n) +// inputString = strings.Join(strings.Fields(inputString), " ") +// case "-&": // Replace ampersand CHAR with ampersand HTML code +// inputString = strings.Replace(inputString, "&", "&", -1) +// case "+&": // Replace ampersand HTML code with ampersand CHAR +// inputString = strings.Replace(inputString, "&", "&", -1) +// default: +// return inputString, errors.New("TrimSpace, " + command + ", does not exist") +// } +// } +// } +// return inputString, nil +// } diff --git a/vendor/github.com/hfmrow/genLib/tools/errors/errors.go b/vendor/github.com/hfmrow/genLib/tools/errors/errors.go new file mode 100644 index 0000000..2e75819 --- /dev/null +++ b/vendor/github.com/hfmrow/genLib/tools/errors/errors.go @@ -0,0 +1,200 @@ +// errors.go + +package errors + +import ( + "bufio" + "fmt" + "os" + "path/filepath" + "regexp" + "runtime" + "runtime/debug" + "strings" + "time" +) + +// WarnCallerMess: return information about caller that can be interpreted and +// clickable inside LiteIde. Output format: "./main.go:114 Warning!," +func WarnCallerMess(skip ...int) string { + var s int = 2 + if len(skip) > 0 { + s = s + skip[0] + } + _, file, line, _ := runtime.Caller(s) // error callback type handling + return fmt.Sprintf("./%s:%d Warning!,", filepath.Base(file), line) +} + +// Check: Display errors in convenient way with stack display +// "options" set to true -> exit on error. +// NOTICE: exit option must not be used if a "defer" function +// is initiated, otherwise, defer will never be applied ! +func Check(err error, options ...bool) (isError bool) { + if err != nil { + type errorInf struct { + fn string // function + f string // file + } + var stacked []errorInf + var outStrErr string + isError = true + stack := strings.Split(string(debug.Stack()), "\n") + for errIdx := 5; errIdx < len(stack)-1; errIdx++ { + stacked = append(stacked, errorInf{fn: stack[errIdx], f: strings.TrimSpace(stack[errIdx+1])}) + errIdx++ + } + baseMessage := strings.Split(err.Error(), "\n\n") + for _, mess := range baseMessage { + outStrErr += fmt.Sprintf("[%s]\n", mess) + } + for errIdx := 1; errIdx < len(stacked); errIdx++ { + outStrErr += fmt.Sprintf("[%s]*[%s]\n", strings.SplitN(stacked[errIdx].fn, "(", 2)[0], stacked[errIdx].f) + } + fmt.Print(outStrErr) + if len(options) > 0 { + if options[0] { + os.Exit(1) + } + } + } + return +} + +// Get all informations on runtime from callers functions +// include memory, processor, Goroutine ... +type FuncTracer struct { + filename string + file *os.File + writer *bufio.Writer + frames *runtime.Frames + delay time.Duration + lastNow time.Time + FiltersInclude, + FiltersExclude []string +} + +func FuncTracerNew(filename string, delay float64) (*FuncTracer, error) { + var err error + ft := new(FuncTracer) + + ft.delay = time.Duration(float64(time.Second) * delay) + ft.lastNow = time.Now() + + ft.FiltersExclude = []string{"/usr/local/go/src/"} + + if ft.file, err = os.Create(filename); err == nil { + ft.writer = bufio.NewWriter(ft.file) + err = ft.Write(fmt.Sprintf("Time;Alloc;SysMem;NumGc;nCgoCall;nGortn;Cpu%%;Rss;Line;Func;File;\n")) + } + return ft, err +} + +func (ft *FuncTracer) memStats() *runtime.MemStats { + m := new(runtime.MemStats) + runtime.ReadMemStats(m) + return m +} + +func (ft *FuncTracer) Close() (err error) { + if err = ft.writer.Flush(); err == nil { + err = ft.file.Close() + } + return +} + +func (ft *FuncTracer) Write(line string) error { + count, err := ft.writer.WriteString(line) + if count != len(line) { + err = fmt.Errorf("[Missing written bytes], Recieved bytes: %d, Written: %d", len(line), count) + } + return err +} + +func (ft *FuncTracer) match(name string) bool { + for _, excl := range ft.FiltersExclude { + if strings.Contains(name, excl) { + return true + } + } + return false +} + +// DebugFunc: Retrieve informations about the caller function +// include filename, function name and line number. +type DebugFunc struct { + Frames *runtime.Frames + + File, + Caller string + Line, + + Skip int +} + +func DebugFuncNew(skip ...int) (d *DebugFunc) { + d = new(DebugFunc) + d.Skip = 1 + if len(skip) > 0 { + d.Skip = skip[0] + } + d.details() + return +} + +func (d *DebugFunc) details() (file, fnct string, line int, ok bool) { + + var pc uintptr + pc, d.File, d.Line, ok = runtime.Caller(d.Skip) + details := runtime.FuncForPC(pc) + if ok && details != nil { + d.Caller = details.Name() + } + return d.File, d.Caller, d.Line, ok +} + +func (d *DebugFunc) GetCurrentFunctionName() string { + // Skip GetCurrentFunctionName + return d.getFrame(d.Skip).Function +} + +func (d *DebugFunc) GetCallerFunctionName() string { + // Skip GetCallerFunctionName and the function to get the caller of + return d.getFrame(d.Skip + 1).Function +} + +func (d *DebugFunc) getFrame(skipFrames int) runtime.Frame { + // We need the frame at index skipFrames+2, since we never want runtime.Callers and getFrame + targetFrameIndex := skipFrames + 2 + + // Set size to targetFrameIndex+2 to ensure we have room for one more caller than we need + programCounters := make([]uintptr, targetFrameIndex+2) + n := runtime.Callers(0, programCounters) + + frame := runtime.Frame{Function: "unknown"} + if n > 0 { + d.Frames = runtime.CallersFrames(programCounters[:n]) + for more, frameIndex := true, 0; more && frameIndex <= targetFrameIndex; frameIndex++ { + var frameCandidate runtime.Frame + frameCandidate, more = d.Frames.Next() + if frameIndex == targetFrameIndex { + frame = frameCandidate + } + } + } + + return frame +} + +var nonAlNum = regexp.MustCompile(`[[:punct:][:alpha:]]`) + +// Get current timestamp +func timeStamp() string { + date := nonAlNum.ReplaceAllString(time.Now().Format(time.RFC3339), "")[:14] + return date[:8] + "-" + date[8:] +} + +// humanReadableSize: +func humanReadableSize(size interface{}) string { + + return fmt.Sprintf("%.2fMiB", float64(size.(uint64))/1024e3) +} diff --git a/vendor/github.com/hfmrow/gtk3Import/dialog/aboutBox.go b/vendor/github.com/hfmrow/gtk3Import/dialog/aboutBox.go new file mode 100755 index 0000000..20dc529 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/dialog/aboutBox.go @@ -0,0 +1,226 @@ +// aboutBox.go + +/* + Source file auto-generated on Sat, 19 Oct 2019 22:06:16 using Gotk3ObjHandler v1.3.9 ©2018-19 H.F.M + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019 H.F.M - about box v2.0 + This program comes with absolutely no warranty. See the The MIT License (MIT) for details: + https://opensource.org/licenses/mit-license.php + +Usage: + About := new(AboutInfos) + About.InitFillInfos( + mainObjects.MainWindow, + "About "+Name, + Name, + Vers, + Creat, + YearCreat, + LicenseAbrv, + LicenseShort, + Repository, + Descr, + searchAndReplaceTop27,// As []byte or a filename + signSelect20) // As []byte or a filename + About.Width = 400 + + if err := About.Show(); err != nil { + log.Fatal(err) + } +*/ + +package gtk3Import + +import ( + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" + + glsg "github.com/hfmrow/genLib/strings" + + gipops "github.com/hfmrow/gtk3Import/pango/pangoSimple" + gipf "github.com/hfmrow/gtk3Import/pixbuff" +) + +/* +* Aboutbox implementation + */ + +type AboutInfos struct { + TitleWindow, + AppName, + AppVers, + AppCreats, + YearCreat, + LicenseAbrv, + LicenseShort, + Repository, + CssName, // Used to access dialog fromm CSS + Description string + + ImageTop, + ImageOkButton interface{} + + MaxCharWidthText, + ImageOkButtonSize, + Width, + HttpKeepFromEnd, // how many elements from end of http adress will be displayed in description and licence text. + Height int + + Resizable, + KeepAbove bool + + parentWindow *gtk.Window + DlgBoxStruct *DialogBoxStructure +} + +func AboutInfosNew(parentWindow *gtk.Window, titleWindow, appName, appVers, appCreat, yearCreat, licenseAbrv, + licenseShort, repository, description string, topImage, okBtnIcon interface{}) (ab *AboutInfos) { + ab = new(AboutInfos) + ab.InitFillInfos(parentWindow, titleWindow, appName, appVers, appCreat, yearCreat, + licenseAbrv, licenseShort, repository, description, topImage, okBtnIcon) + return +} + +// InitFillInfos: Initialize structure +func (ab *AboutInfos) InitFillInfos(parentWindow *gtk.Window, titleWindow, appName, appVers, appCreat, + yearCreat, licenseAbrv, licenseShort, repository, description string, topImage, okBtnIcon interface{}) { + + if ab.MaxCharWidthText == 0 { + ab.MaxCharWidthText = 80 + } + + ab.parentWindow = parentWindow + ab.TitleWindow = titleWindow + ab.AppName = appName + ab.AppVers = appVers + ab.AppCreats = appCreat + ab.YearCreat = "©" + yearCreat + ab.LicenseAbrv = licenseAbrv + ab.LicenseShort = licenseShort + ab.Repository = repository + ab.Description = glsg.FormatText(description, ab.MaxCharWidthText, true) + ab.ImageTop = topImage + ab.ImageOkButton = okBtnIcon + ab.CssName = "AboutBox" + ab.HttpKeepFromEnd = 2 + ab.Width = 425 + ab.Height = 100 + ab.ImageOkButtonSize = 24 + ab.Resizable = false +} + +// Show: Display about box +func (ab *AboutInfos) Show() (err error) { + if err = ab.build(); err == nil { + + ab.DlgBoxStruct.CssName = ab.CssName + ab.DlgBoxStruct.KeepAbove = ab.KeepAbove + // ab.DlgBoxStruct.WidgetExpend = true + ab.DlgBoxStruct.SetSize(ab.Width, ab.Height) + ab.DlgBoxStruct.Resizable = ab.Resizable + ab.DlgBoxStruct.IconsSize = ab.ImageOkButtonSize + ab.DlgBoxStruct.Run() + } + return +} + +// build: +func (ab *AboutInfos) build() (err error) { + var labelAppName, labelVersion, labelYearCreator, labelDescriptionLbl, + labelDescription, labelRepolinkLbl, labelRepolink, labelLicense *gtk.Label + var sep1, sep2, sep3 *gtk.Separator + var box *gtk.Box + var pixbuf *gdk.Pixbuf + var imageTop *gtk.Image + + ps := gipops.PangoSimpleNew() + pc := gipops.PangoColorNew() + + // Create new dialogbox structure + ab.DlgBoxStruct = DialogBoxNew(ab.parentWindow, box, ab.TitleWindow, "Ok") + ab.DlgBoxStruct.ButtonsImages = []interface{}{ab.ImageOkButton} + + // Add markup for some elements + name, repo, lic := doMarkup(ab.AppName, ab.Repository, ab.LicenseShort, ab.HttpKeepFromEnd) + + // Build widgets used to this About box window + pixbuf, _ = gipf.GetPixBuf(ab.ImageTop, nil) // If an error occurs pixbuf will be nul and imageTop too. So, no image displayed. + if imageTop, err = gtk.ImageNewFromPixbuf(pixbuf); err == nil { + if labelAppName, err = gtk.LabelNew(""); err == nil { + labelAppName.SetMarkup("\n" + name) + + if labelVersion, err = gtk.LabelNew(ab.AppVers + "\n"); err == nil { + if labelYearCreator, err = gtk.LabelNew(ab.YearCreat + " " + ab.AppCreats + "\n"); err == nil { + + if labelDescriptionLbl, err = gtk.LabelNew(""); err == nil { + labelDescriptionLbl.SetMarkup("\n" + ps.ApplyMarkup(``, `Description:`) + "") + + if labelDescription, err = gtk.LabelNew(""); err == nil { + labelDescription.SetMarkup(ps.MarkupHttpClickable(ab.Description+"\n", ab.HttpKeepFromEnd)) + + if labelRepolinkLbl, err = gtk.LabelNew(""); err == nil { + labelRepolinkLbl.SetMarkup("\n" + ps.ApplyMarkup(``, `Source repository:`) + "") + + if labelRepolink, err = gtk.LabelNew(""); err == nil { + labelRepolink.SetMarkup(repo + "\n") + + if labelLicense, err = gtk.LabelNew(""); err == nil { + labelLicense.SetMarkup("\n" + lic + "\n") + + if sep1, err = gtk.SeparatorNew(gtk.ORIENTATION_HORIZONTAL); err == nil { + if sep2, err = gtk.SeparatorNew(gtk.ORIENTATION_HORIZONTAL); err == nil { + if sep3, err = gtk.SeparatorNew(gtk.ORIENTATION_HORIZONTAL); err == nil { + + // Add some properties + ab.DlgBoxStruct.WidgetsProps.AddProperty("margin-top", 2) + ab.DlgBoxStruct.WidgetsProps.AddProperty("justify", gtk.JUSTIFY_CENTER) + ab.DlgBoxStruct.WidgetsProps.AddProperty("wrap", true) + + // Add widgets to the [DialogBox] structure + ab.DlgBoxStruct.Widgets = []gtk.IWidget{ + imageTop, + labelAppName, + labelVersion, + labelYearCreator, + sep1, + labelDescriptionLbl, + labelDescription, + labelRepolinkLbl, + labelRepolink, + sep2, + labelLicense, + sep3} + } + } + } + } + } + } + } + } + } + } + } + } + return +} + +func doMarkup(appName, repo, licence string, keepFromEnd ...int) (outAppName, outRepo, outLicense string) { + kfe := 2 + if len(keepFromEnd) > 0 { + kfe = keepFromEnd[0] + } + ps := gipops.PangoSimpleNew() + pc := gipops.PangoColorNew() + + outAppName = ps.ApplyMarkup(``, appName) + outAppName = ps.ApplyMarkupAgain(``, outAppName) + outAppName = ps.ApplyMarkupAgain(``, outAppName) + + outRepo = ps.ApplyMarkup(``, repo) + + outLicense = ps.MarkupHttpClickable(licence, kfe) + return +} diff --git a/vendor/github.com/hfmrow/gtk3Import/dialog/dialogBox.go b/vendor/github.com/hfmrow/gtk3Import/dialog/dialogBox.go new file mode 100644 index 0000000..b9ab405 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/dialog/dialogBox.go @@ -0,0 +1,295 @@ +// dialogBox.go + +/* + Create a Dialog, who accept GtkWidgets defined into structure. + The Structure contain all needed options to fill most of usages, + including scrolling capabilities. + +Usage: + if tw, err := gtk.TreeViewNew(); err == nil { + dbs := gi.DialogBoxNew(MainWindow, gtk.DIALOG_DESTROY_WITH_PARENT, tw, "test Title", "No", "Yes", "why") + dbs.ButtonsImages = dbs.ValuesToInterfaceSlice("assets/images/Sign-cancel-20.png", "", signSelect20) // "signSelect20" is []byte of image + dbs.ScrolledArea = true + result=dbs.Run() + // Do what you want with "result" + } + + - A full examples: + - In file "aboutBox.go", that use the majority of the functionalities allowed by the code below. + - Another full example in file "calendar.go" +*/ + +package gtk3Import + +import ( + "log" + + "github.com/gotk3/gotk3/gtk" + "github.com/gotk3/gotk3/pango" + + gipf "github.com/hfmrow/gtk3Import/pixbuff" + gitsws "github.com/hfmrow/gtk3Import/tools/widgets" +) + +// DialogBoxStructure: Wrap a Dialog with desired count of +// buttons and widgets. The structure have defaults parameters +type DialogBoxStructure struct { + BoxHAlign, + BoxVAlign gtk.Align + + BoxOrientation gtk.Orientation + + BoxHExpand, + BoxVExpand, + WidgetExpend, + SkipTaskbarHint, + KeepAbove, + Resizable, + ScrolledArea, + WidgetFill, + MarkupLabel, + LabelLineWrap bool + Padding uint + + width, + height, + posX, + posY, + Response, + IconsSize int + + Title, + Text, + CssName string + + Buttons []string + ButtonsImages []interface{} // image representation from file or []byte, depending on type + Dialog *gtk.Dialog + ButtonReliefStyle gtk.ReliefStyle + Widgets []gtk.IWidget + WidgetsProps gitsws.WidgetProperties // each property applyed to each object + // Widgets below will be added after scrolled window without any property, + // they must be applyed mlanually on creation by the caller (useful to add + // some checkboxes or others after a TreeView). + WidgetsOutOfScrolledArea []gtk.IWidget + + // Function used when a button is clicked or window is closed + // This public function is wrapped with "internalResponseCallBack" + ResponseCallBack func(dlg *gtk.Dialog, response int) + + dialogFlag gtk.DialogFlags + + modal, + buttonsWithImages bool + + label *gtk.Label + box *gtk.Box + scrolledWindow *gtk.ScrolledWindow + window *gtk.Window + + internalResponseCallBack func(dlg *gtk.Dialog, response int) +} + +// DialogBoxNew: Create a new structure to wrap a GtkDialog including +// defaults parameters. "widget" can be "nul" to only display "text". +func DialogBoxNew(window *gtk.Window, widget gtk.IWidget, title string, buttons ...string) *DialogBoxStructure { + dbs := new(DialogBoxStructure) + dbs.DialogBoxInit(window, widget, title, buttons...) + return dbs +} + +func (dbs *DialogBoxStructure) DialogBoxInit(window *gtk.Window, widget gtk.IWidget, title string, buttons ...string) { + dbs.window = window + dbs.ButtonReliefStyle = gtk.RELIEF_NONE + dbs.BoxHAlign = gtk.ALIGN_FILL + dbs.BoxVAlign = gtk.ALIGN_FILL + dbs.BoxOrientation = gtk.ORIENTATION_VERTICAL + dbs.dialogFlag = gtk.DIALOG_DESTROY_WITH_PARENT + dbs.width, dbs.height, + dbs.posX, dbs.posY = 640, 480, -1, -1 + dbs.IconsSize = 18 + dbs.BoxHExpand = true + dbs.BoxVExpand = true + dbs.WidgetExpend = true + dbs.WidgetFill = true + dbs.SkipTaskbarHint = true + dbs.KeepAbove = true + dbs.Resizable = true + dbs.Title = title + dbs.LabelLineWrap = true + dbs.Padding = 0 + dbs.CssName = "CustomDialog" + dbs.ResponseCallBack = func(dlg *gtk.Dialog, response int) { // Init default callback + } + dbs.internalResponseCallBack = func(dlg *gtk.Dialog, response int) { // Init internal and wrap default callback + dbs.Response = response + dbs.ResponseCallBack(dlg, response) + } + + if widget != nil { + dbs.Widgets = append([]gtk.IWidget{widget}, dbs.Widgets...) // Prepend + } + if len(buttons) == 0 { + dbs.Buttons = []string{"Ok"} + } else { + dbs.Buttons = buttons + } +} + +// Run: function return "value" < 0 for cross closed or >= 0 +// corresponding to buttons order representation starting with 0 at left. +// The dialog is destroyed at the end of process. +// Only the Modal Dialog window is allowed with this function. +// Use RunForResults() to allow non Modal usage. +func (dbs *DialogBoxStructure) Run() (value int) { + dbs.modal = true + dbs.buildDialog() + value = int(dbs.Dialog.Run()) + dbs.Dialog.Destroy() + return +} + +// RunNonModal: allow non modal Dialog "respCallBack()" is executed on button click or exit window +func (dbs *DialogBoxStructure) RunNonModal(respCallBack ...func(dlg *gtk.Dialog, response int)) { + dbs.modal = false + if len(respCallBack) > 0 { + dbs.ResponseCallBack = respCallBack[0] + } + dbs.internalResponseCallBack = func(dlg *gtk.Dialog, response int) { // Default callback function + dbs.Response = response + dbs.ResponseCallBack(dlg, response) + dbs.Dialog.Destroy() + } + dbs.buildDialog() +} + +// SetSize: +func (dbs *DialogBoxStructure) SetSize(width, height int) { + dbs.width = width + dbs.height = height +} + +// SetPosition: +func (dbs *DialogBoxStructure) SetPosition(posX, posY int) { + dbs.posX = posX + dbs.posY = posY +} + +// GetSize: +func (dbs *DialogBoxStructure) GetSize() (width, height int) { + return dbs.Dialog.GetSize() +} + +// GetPosition: +func (dbs *DialogBoxStructure) GetPosition() (posX, posY int) { + return dbs.Dialog.GetPosition() +} + +// BringToFront: Set window position to be over all others windows +// without staying on top whether another window come to be selected. +func (dbs *DialogBoxStructure) BringToFront() { + dbs.Dialog.Deiconify() + dbs.Dialog.ShowAll() + dbs.Dialog.GrabFocus() +} + +// buildDialog: Create the dialog window with defined parameters. +func (dbs *DialogBoxStructure) buildDialog() (err error) { + var btnObj *gtk.Button + + // Build Dialog + if dbs.modal { + dbs.dialogFlag = gtk.DIALOG_MODAL + } + if dbs.Dialog, err = gtk.DialogNewWithButtons(dbs.Title, dbs.window, dbs.dialogFlag); err == nil { + // Dialog options + dbs.Dialog.SetDefaultSize(dbs.width, dbs.height) + + if dbs.posX != -1 && dbs.posY != -1 { + dbs.Dialog.Move(dbs.posX, dbs.posY) + } + + dbs.Dialog.SetName(dbs.CssName) + dbs.Dialog.SetSkipTaskbarHint(dbs.SkipTaskbarHint) + dbs.Dialog.SetKeepAbove(dbs.KeepAbove) + dbs.Dialog.SetResizable(dbs.Resizable) + dbs.Dialog.SetModal(dbs.modal) + dbs.Dialog.Connect("response", dbs.internalResponseCallBack) // Default callback function + + if dbs.box, err = dbs.Dialog.GetContentArea(); err == nil { + if dbs.label, err = gtk.LabelNew(""); err == nil { + // Markup & Label options + dbs.label.SetSizeRequest(dbs.box.GetSizeRequest()) // Size, same as parent + dbs.label.SetLineWrap(dbs.LabelLineWrap) + dbs.label.SetLineWrapMode(pango.WRAP_WORD) + if dbs.MarkupLabel { + dbs.label.SetLabel(dbs.Text) + } else { + dbs.label.SetMarkup(dbs.Text) + } + } + } + } + + if err != nil { + return + } + + // Control + dbs.buttonsWithImages = len(dbs.ButtonsImages) != 0 + if len(dbs.Buttons) != len(dbs.ButtonsImages) && dbs.buttonsWithImages { + log.Fatalf("You must provide an image or an empty string for each button\nButton(s) count: %d, Image(s) count: %d\n", + len(dbs.Buttons), len(dbs.ButtonsImages)) + } + + // Box options + dbs.box.SetHAlign(dbs.BoxHAlign) + dbs.box.SetVAlign(dbs.BoxVAlign) + dbs.box.SetOrientation(dbs.BoxOrientation) + dbs.box.SetHExpand(dbs.BoxHExpand) + dbs.box.SetVExpand(dbs.BoxVExpand) + + // Buttons + for idxBtn, btnLbl := range dbs.Buttons { + if btnObj, err = dbs.Dialog.AddButton(btnLbl, gtk.ResponseType(idxBtn)); err == nil { + if dbs.buttonsWithImages { + gipf.SetPict(btnObj, dbs.ButtonsImages[idxBtn], dbs.IconsSize) + btnObj.SetRelief(dbs.ButtonReliefStyle) + } + } + } + + // Packing + if len(dbs.Text) > 0 { + dbs.box.PackStart(dbs.label, dbs.WidgetExpend, dbs.WidgetFill, dbs.Padding) + } + if len(dbs.Widgets) > 0 { + if dbs.ScrolledArea { + if dbs.scrolledWindow, err = gtk.ScrolledWindowNew(nil, nil); err == nil { + dbs.box.PackStart(dbs.scrolledWindow, dbs.WidgetExpend, dbs.WidgetFill, dbs.Padding) // Add ScrolledWindow to box + } else { + return + } + } + + for _, wdg := range dbs.Widgets { + if wdg != nil { + dbs.WidgetsProps.PropsToWidget(wdg) // Set properties to widget + + if dbs.ScrolledArea { + dbs.scrolledWindow.Add(wdg) // Add objects to ScrolledWindow + } else { + dbs.box.PackStart(wdg, dbs.WidgetExpend, dbs.WidgetFill, dbs.Padding) // Add objects to box + } + } + } + if len(dbs.WidgetsOutOfScrolledArea) > 0 { + for _, wdg := range dbs.WidgetsOutOfScrolledArea { + dbs.box.PackEnd(wdg, false, false, dbs.Padding) // Add objects to box + } + } + } + // The show must go on + dbs.Dialog.ShowAll() + return +} diff --git a/vendor/github.com/hfmrow/gtk3Import/dialog/dialogError.go b/vendor/github.com/hfmrow/gtk3Import/dialog/dialogError.go new file mode 100644 index 0000000..5fa234b --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/dialog/dialogError.go @@ -0,0 +1,76 @@ +// dialogError.go + +package gtk3Import + +import ( + "fmt" + "os" + + "github.com/gotk3/gotk3/gtk" + + gler "github.com/hfmrow/genLib/tools/errors" +) + +// DialogError: Display error messaged dialog returning true in error case. +// options: devMode, forceExit, markupEnabled bool +// NOTICE: exit option must not be used if a "defer" function is initiated ! +func DialogError(window *gtk.Window, title, text string, err error, options ...bool) bool { + + var ( + devMode, + forceExit, + markupEnabled = true, false, false + ) + + switch { + case len(options) == 1: + devMode = options[0] + + case len(options) == 2: + devMode = options[0] + forceExit = options[1] + + case len(options) == 3: + devMode = options[0] + forceExit = options[1] + markupEnabled = options[2] + + case len(options) > 3: + fmt.Printf("DialogError: Bad, number of arguments, %v\n", options) + os.Exit(1) + + } + + dialogType := "error" + if markupEnabled { + dialogType = "errorWithMarkup" + } + + if gler.Check(err) { + if devMode { + if DialogMessage( + window, + dialogType, + title, + fmt.Sprintf("\n\n"+text+":\n\n%s", err.Error()), + "", + "Stop", + "Continue") == 0 { + os.Exit(1) + } + } else { + DialogMessage( + window, + dialogType, + title, + fmt.Sprintf("\n\n"+text+":\n\n%s", err.Error()), + "", + "Ok") + if forceExit { + os.Exit(1) + } + } + return true + } + return false +} diff --git a/vendor/github.com/hfmrow/gtk3Import/dialog/dialogMessage.go b/vendor/github.com/hfmrow/gtk3Import/dialog/dialogMessage.go new file mode 100644 index 0000000..4234523 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/dialog/dialogMessage.go @@ -0,0 +1,92 @@ +// msgDlg.go + +/* +* ©2018 H.F.M. MIT license +* Handle gtk3 Dialogs. +* +* Message, Question/Response dialogs, file/dir dialogs, Notifications. + */ + +package gtk3Import + +import ( + "fmt" + "log" + "strings" + + "github.com/gotk3/gotk3/gtk" + + gipf "github.com/hfmrow/gtk3Import/pixbuff" +) + +/*************************** +* DlgMessage implementation. + ***************************/ +var dialogType = map[string]gtk.MessageType{ + "info": gtk.MESSAGE_INFO, "inf": gtk.MESSAGE_INFO, + "warning": gtk.MESSAGE_WARNING, "wrn": gtk.MESSAGE_WARNING, + "question": gtk.MESSAGE_QUESTION, "qst": gtk.MESSAGE_QUESTION, + "error": gtk.MESSAGE_ERROR, "err": gtk.MESSAGE_ERROR, + "other": gtk.MESSAGE_OTHER, "oth": gtk.MESSAGE_OTHER, + "infoWithMarkup": gtk.MESSAGE_INFO, "infMU": gtk.MESSAGE_INFO, + "warningWithMarkup": gtk.MESSAGE_WARNING, "wrMUn": gtk.MESSAGE_WARNING, + "questionWithMarkup": gtk.MESSAGE_QUESTION, "qstMU": gtk.MESSAGE_QUESTION, + "errorWithMarkup": gtk.MESSAGE_ERROR, "errMU": gtk.MESSAGE_ERROR, + "otherWithMarkup": gtk.MESSAGE_OTHER, "othMU": gtk.MESSAGE_OTHER, +} + +// DlgMessage: Display message dialog with multiples buttons. +// return get <0 for cross closed or >-1 correspondig to buttons order representation. +// dlgType accepte: "info", "warning", "question", "error", "other", by adding "WithMarkup" you enable it. +// iconFileName: can be a []byte or a string. '' or nil -> No image +func DialogMessage(window *gtk.Window, dlgType, title, text string, iconFileName interface{}, buttons ...string) (value int) { + var msgDialog *gtk.MessageDialog + var box *gtk.Box + var err error + + msgDialog = gtk.MessageDialogNew(window, + gtk.DIALOG_MODAL, + dialogType[dlgType], + gtk.BUTTONS_NONE, + "") + + // Image + switch iconFileName.(type) { + case string: + if len(iconFileName.(string)) != 0 { + if box, err = msgDialog.GetContentArea(); err == nil { + gipf.SetPict(box, iconFileName, 18) + } else { + fmt.Println(fmt.Sprintf("DlgMessage, could not get content area: %s", err)) + } + } + } + + msgDialog.SetSkipTaskbarHint(true) + msgDialog.SetKeepAbove(true) + // Check for link to make it clickable + // reg := regexp.MustCompile(`(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?`) + // if reg.MatchString(text) { + // } + if strings.Contains(dlgType, "WithMarkup") { + msgDialog.SetProperty("use-markup", true) + } + msgDialog.SetProperty("text", text) + msgDialog.SetTitle(title) + // Add button(s) + for idx, btn := range buttons { + button, err := msgDialog.AddButton(btn, gtk.ResponseType(idx)) + if err != nil { + log.Fatal(btn+" button could not be created: ", err) + } + if iWidget, err := button.GetParent(); err == nil { + parent := iWidget.ToWidget() + parent.SetHAlign(gtk.ALIGN_END) + } + button.SetSizeRequest(100, 1) + button.SetBorderWidth(2) + } + result := msgDialog.Run() + msgDialog.Destroy() + return int(result) +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/clipboard.go b/vendor/github.com/hfmrow/gtk3Import/misc/clipboard.go new file mode 100644 index 0000000..88eecd0 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/clipboard.go @@ -0,0 +1,48 @@ +// clipboard.go + +/* +* ©2019 H.F.M. MIT license +* This is a simple clipboard handler to use with gotk3 "https://github.com/gotk3/gotk3" + */ + +package gtk3Import + +import ( + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" +) + +type Clipboard struct { + Entity *gtk.Clipboard +} + +// ClipboardNew: Create new clipboard structure +func ClipboardNew() (c *Clipboard, err error) { + + c = new(Clipboard) + err = c.Init() + return +} + +// Init: Initialise clipboard +func (c *Clipboard) Init() (err error) { + + c.Entity, err = gtk.ClipboardGet(gdk.SELECTION_CLIPBOARD) + return +} + +// GetText: Get text from clipboard +func (c *Clipboard) GetText() (clipboardContent string, err error) { + return c.Entity.WaitForText() +} + +// SetText: Set text to clipboard +func (c *Clipboard) SetText(clipboardContent string) { + c.Entity.SetText(clipboardContent) +} + +// Store: the current clipboard data somewhere so that it will stay around +// after the application has quit. +func (c *Clipboard) Store() { + c.Entity.Store() +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/cssWdgScnLoad.go b/vendor/github.com/hfmrow/gtk3Import/misc/cssWdgScnLoad.go new file mode 100644 index 0000000..5f22a58 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/cssWdgScnLoad.go @@ -0,0 +1,49 @@ +// cssWdgScnLoad.go + +/* + Load or read from data css style for an object(widget) or for entire screen. +*/ + +package gtk3Import + +import ( + "io/ioutil" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" +) + +// CssWidgetLoad: Load or read from data and apply css to +// widget if it's provided. Apply to screen otherwise. +func CssWdgScnLoad(filename string, wdgt ...*gtk.Widget) (err error) { + + data := []byte(filename) + + if data, err = ioutil.ReadFile(filename); err == nil { + err = CssWdgScnBytes(data, wdgt...) + } + return +} + +func CssWdgScnBytes(data []byte, wdgt ...*gtk.Widget) (err error) { + + var cssProv *gtk.CssProvider + + if cssProv, err = gtk.CssProviderNew(); err == nil { + + if err = cssProv.LoadFromData(string(data)); err == nil { + if len(wdgt) == 0 { + var screen *gdk.Screen + if screen, err = gdk.ScreenGetDefault(); err == nil { + gtk.AddProviderForScreen(screen, cssProv, gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) + } + } else { + var styleContext *gtk.StyleContext + if styleContext, err = wdgt[0].GetStyleContext(); err == nil { + styleContext.AddProvider(cssProv, gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) + } + } + } + } + return +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/dnd.go b/vendor/github.com/hfmrow/gtk3Import/misc/dnd.go new file mode 100644 index 0000000..aec2eee --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/dnd.go @@ -0,0 +1,191 @@ +// dnd.go + +// Source file auto-generated on Tue, 23 Jul 2019 04:14:20 using Gotk3ObjHandler v1.3.6 ©2019 H.F.M + +/* + Drag & drop handling . + + This program comes with absolutely no warranty. See the The MIT License (MIT) for details: + https://opensource.org/licenses/mit-license.php +*/ + +package gtk3Import + +import ( + "bytes" + "log" + "net/url" + "strings" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" +) + +type DragNDropStruct struct { + // gtkObject that receive DND + Object interface{} + // Contain the files list received + FilesList *[]string + // Callback called after data was received. + callBackRecieveDone func() + // Callback called during data reception. If false is returned, the loop ends + callBackOnRecieve func(item interface{}, context *gdk.DragContext) bool + // To build dnd context + targets []gtk.TargetEntry +} + +// DragNDropNew: configure controls to receive dndcontent. "filesList" can be "nil" +func DragNDropNew(objects interface{}, filesList *[]string, + callBackRecieveDone func(), + callBackOnRecieve ...func(item interface{}, context *gdk.DragContext) bool) *DragNDropStruct { + + ds := new(DragNDropStruct) + ds.Object = objects + + ds.callBackOnRecieve = nil + if len(callBackOnRecieve) > 0 { + ds.callBackOnRecieve = callBackOnRecieve[0] + } + ds.callBackRecieveDone = callBackRecieveDone + + switch filesList { + case nil: + ds.FilesList = new([]string) + default: + ds.FilesList = filesList + } + ds.init() + return ds +} + +// Dispatching reciever object type (TreeView, Button ...) +func (ds *DragNDropStruct) init() { + + // Build DnD context + targetTypes := []string{ + "x-special/mate-icon-list", + "text/uri-list", + "UTF8_STRING", + "COMPOUND_TEXT", + "TEXT", + "STRING", + "text/plain;charset=utf-8", + "text/plain"} + + for _, tType := range targetTypes { + te, err := gtk.TargetEntryNew(tType, gtk.TARGET_OTHER_APP, 0) + if err != nil { + log.Fatal(err) + } + ds.targets = append(ds.targets, *te) + } + + switch ds.Object.(type) { + + case *gtk.Window: + ds.Object.(*gtk.Window).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.Window).Connect("drag-data-received", ds.dndFilesReceived) + + case *gtk.Entry: + ds.Object.(*gtk.Entry).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.Entry).Connect("drag-data-received", ds.dndFilesReceived) + + case *gtk.EventBox: + ds.Object.(*gtk.EventBox).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.EventBox).Connect("drag-data-received", ds.dndFilesReceived) + + case *gtk.TreeView: + ds.Object.(*gtk.TreeView).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.TreeView).Connect("drag-data-received", ds.dndFilesReceived) + + case *gtk.TextView: + ds.Object.(*gtk.TextView).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.TextView).Connect("drag-data-received", ds.dndFilesReceived) + + case *gtk.Button: + ds.Object.(*gtk.Button).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.Button).Connect("drag-data-received", ds.dndFilesReceived) + + case *gtk.Image: + ds.Object.(*gtk.Image).DragDestSet( + gtk.DEST_DEFAULT_ALL, + ds.targets, + gdk.ACTION_COPY) + ds.Object.(*gtk.Image).Connect("drag-data-received", ds.dndFilesReceived) + + // Already handled natively !!! + // case *gtk.FileChooserButton: + // ds.Object.(*gtk.FileChooserButton).DragDestSet( + // gtk.DEST_DEFAULT_ALL, + // ds.targets, + // gdk.ACTION_COPY) + // ds.Object.(*gtk.FileChooserButton).Connect("drag-data-received", ds.dndFilesReceived) + } +} + +// ButtonInFilesReceived: Store in files list +func (ds *DragNDropStruct) dndFilesReceived(object interface{}, context *gdk.DragContext, x, y int, selData *gtk.SelectionData, info, time uint) { + + *ds.FilesList = (*ds.FilesList)[:0] + data := selData.GetData() + list := strings.Split(string(data), getTextEOL(data)) + + for _, item := range list { + if len(item) != 0 { + + if ds.callBackOnRecieve != nil { + // For other type than string, callback permit to handle anything + if !ds.callBackOnRecieve(item, context) { + break + } + } else { + // Default handling as a string + if u, err := url.PathUnescape(item); err == nil { + + *ds.FilesList = append(*ds.FilesList, strings.TrimPrefix(u, "file://")) + } + } + } + } + if ds.callBackRecieveDone != nil { + ds.callBackRecieveDone() + } +} + +// GetTextEOL: Get EOL from text bytes (CR, LF, CRLF) +func getTextEOL(inTextBytes []byte) (outString string) { + + var ( + bCR = []byte{0x0D} + bLF = []byte{0x0A} + bCRLF = []byte{0x0D, 0x0A} + ) + + switch { + case bytes.Contains(inTextBytes, bCRLF): + outString = string(bCRLF) + case bytes.Contains(inTextBytes, bCR): + outString = string(bCR) + default: + outString = string(bLF) + } + return +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/notify.go b/vendor/github.com/hfmrow/gtk3Import/misc/notify.go new file mode 100644 index 0000000..1cf9a0f --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/notify.go @@ -0,0 +1,29 @@ +// notify.go + +/* +* ©2018 H.F.M. MIT license +* Handle gtk3 Dialogs. +* +* Message, Question/Response dialogs, file/dir dialogs, Notifications. + */ + +package gtk3Import + +import ( + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gtk" +) + +// Notify: Display a notify message at the top right of screen. +func Notify(title, text string) { + const appID = "h.f.m" + app, _ := gtk.ApplicationNew(appID, glib.APPLICATION_FLAGS_NONE) + //Shows an application as soon as the app starts + app.Connect("activate", func() { + notif := glib.NotificationNew(title) + notif.SetBody(text) + app.SendNotification(appID, notif) + }) + app.Run(nil) + app.Quit() +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/popupMenu.go b/vendor/github.com/hfmrow/gtk3Import/misc/popupMenu.go new file mode 100644 index 0000000..deebfad --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/popupMenu.go @@ -0,0 +1,899 @@ +// popupMenu.go + +/* + ©2019-21 H.F.M. MIT license + + A simple builder for popup menu that can handle icons or not. +*/ + +package gtk3Import + +import ( + "fmt" + "log" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" + + gipf "github.com/hfmrow/gtk3Import/pixbuff" +) + +var ( // Lib mapping + HexToBytes = gipf.HexToBytes + GetPixBuf = gipf.GetPixBuf +) + +type ItemOptionsType int + +const ( + // Like GtkMenuItem + ITEM_OPT_NORMAL ItemOptionsType = 1 << 0 + // Like GtkCheckMenuItem + ITEM_OPT_CHECK ItemOptionsType = 1 << 1 + // Like GtkRadioMenuItem + ITEM_OPT_RADIO ItemOptionsType = 1 << 2 + // Like GtkSeparatorMenuItem + ITEM_OPT_SEPARATOR ItemOptionsType = 1 << 3 + // Add icon before GtkMenuItem + ITEM_OPT_ICON ItemOptionsType = 1 << 4 + // Disable the use of mnemonic + ITEM_OPT_NO_MNEMONIC ItemOptionsType = 1 << 5 + // Start a new group for GtkRadioButton(s) + ITEM_OPT_RADIO_NEW_GRP ItemOptionsType = 1 << 6 + // align label to other (adding blank icon) + ITEM_OPT_ALGN_LBL ItemOptionsType = 1 << 7 + // Box container alignement centered + ITEM_OPT_ALGN_BOX_CNTR ItemOptionsType = 1 << 8 +) + +// PopupMenuStruct: means that only standard widgets will be used +// If you want to add icons, prefere using next structure 'PopupMenuIconStruct' +type PopupMenuStruct struct { + Menu *gtk.Menu + // Indicate what type of function the window has. + WindowTypeHint gdk.WindowTypeHint // default (WINDOW_TYPE_HINT_POPUP_MENU) + // left mouse button instead of right + LMB, + // Reserving space to toggle (gtkCheckMenuItem/GtkRadioMenuItem) + ReserveToggleSize bool + // space separator for box (used when image is present) + BoxSpacing, + // Contain the index of last GtkMenuItem created + nextMenuItemIdx int + // Used to link radio button within a group + lastRadioMenuItmGroup *gtk.RadioMenuItem + // Where menuitems are stored + items []combObj + // Options that can be used with designed function + OPT_NORMAL, + OPT_CHECK, + OPT_RADIO, + OPT_SEPARATOR, + OPT_NO_MNEMONIC, + OPT_RADIO_NEW_GRP ItemOptionsType +} + +type combObj struct { + widget interface{} + tType ItemOptionsType + combined bool + xMenuItem *gtk.MenuItem + hasCallback bool +} + +func combObjNew() combObj { + c := new(combObj) + return *c +} + +/* + * Classic version + */ +// Retrieve current underlayed Gtk MenuItem +func (c *combObj) getMenuItem() *gtk.MenuItem { + obj := c.widget + menuItem, ok := obj.(*gtk.MenuItem) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.MenuItem)", obj) + } + // } + return menuItem +} + +// Retrieve current underlayed GtkCheckMenuItem +func (c *combObj) getCheckMenuItem() *gtk.CheckMenuItem { + obj := c.widget + menuItem, ok := obj.(*gtk.CheckMenuItem) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.CheckMenuItem)", obj) + } + return menuItem +} + +// Retrieve current underlayed GtkRadioMenuItem +func (c *combObj) getRadioMenuItem() *gtk.RadioMenuItem { + obj := c.widget + menuItem, ok := obj.(*gtk.RadioMenuItem) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.RadioMenuItem)", obj) + } + return menuItem +} + +// Retrieve current underlayed GtkSeparatorMenuItem +func (c *combObj) getSeparatorMenuItem() *gtk.SeparatorMenuItem { + obj := c.widget + menuItem, ok := obj.(*gtk.SeparatorMenuItem) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.SeparatorMenuItem)", obj) + } + return menuItem +} + +// Retrieve current underlayed GtkMenuItem combined version (Icon) +func (c *combObj) getCombMenuItem() *gtk.MenuItem { + return c.xMenuItem +} + +/* + * Icon version + */ +// Retrieve current underlayed GtkLabel +func (c *combObj) getLabel() *gtk.Label { + obj := c.widget + menuItem, ok := obj.(*gtk.Label) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.Label)", obj) + } + return menuItem +} + +// Retrieve current underlayed GtkCheckButton +func (c *combObj) getCheckButton() *gtk.CheckButton { + obj := c.widget + menuItem, ok := obj.(*gtk.CheckButton) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.CheckButton)", obj) + } + return menuItem +} + +// Retrieve current underlayed GtkRadioButton +func (c *combObj) getRadioButton() *gtk.RadioButton { + obj := c.widget + menuItem, ok := obj.(*gtk.RadioButton) + if !ok { + log.Printf("[Warning!]: Unable to convert %T to (*gtk.RadioButton)", obj) + } + return menuItem +} + +// PopupMenuNew: return a new PopupMenuStruct structure +func PopupMenuStructNew() (pop *PopupMenuStruct) { + pop = new(PopupMenuStruct) + + pop.lastRadioMenuItmGroup = nil + pop.ReserveToggleSize = false + pop.WindowTypeHint = gdk.WINDOW_TYPE_HINT_POPUP_MENU + + pop.OPT_NORMAL = ITEM_OPT_NORMAL + pop.OPT_CHECK = ITEM_OPT_CHECK + pop.OPT_RADIO = ITEM_OPT_RADIO + pop.OPT_SEPARATOR = ITEM_OPT_SEPARATOR + pop.OPT_NO_MNEMONIC = ITEM_OPT_NO_MNEMONIC + pop.OPT_RADIO_NEW_GRP = ITEM_OPT_RADIO_NEW_GRP + return +} + +// Retrieve current GtkMenuItem +func (pop *PopupMenuStruct) GetMenuItemCurrent() *gtk.MenuItem { + return pop.items[pop.nextMenuItemIdx-1].getMenuItem() +} + +// Retrieve current GtkCheckMenuItem +func (pop *PopupMenuStruct) GetCheckMenuItemCurrent() *gtk.CheckMenuItem { + return pop.items[pop.nextMenuItemIdx-1].getCheckMenuItem() +} + +// Retrieve current GtkRadioMenuItem +func (pop *PopupMenuStruct) GetRadioMenuItemCurrent() *gtk.RadioMenuItem { + return pop.items[pop.nextMenuItemIdx-1].getRadioMenuItem() +} + +// Retrieve current GtkSeparatorMenuItem +func (pop *PopupMenuStruct) GetSeparatorMenuItemCurrent() *gtk.SeparatorMenuItem { + return pop.items[pop.nextMenuItemIdx-1].getSeparatorMenuItem() +} + +// Retrieve the IMenuItem at 'idx' require type assertion +func (pop *PopupMenuStruct) GetIMenuItemIdx(idx int) gtk.IMenuItem { + return pop.items[idx].widget.(gtk.IMenuItem) +} + +func (pop *PopupMenuStruct) buildXMenuItem(lbl string, ico, activateFunction interface{}, opt ItemOptionsType) (*combObj, error) { + var ( + cmbo combObj + err error + menuItem *gtk.MenuItem + checkMenuItem *gtk.CheckMenuItem + radioMenuItem *gtk.RadioMenuItem + separatorMenuItem *gtk.SeparatorMenuItem + ) + switch { + case opt&ITEM_OPT_SEPARATOR != 0: + separatorMenuItem, err = gtk.SeparatorMenuItemNew() + if err == nil { + if len(lbl) > 0 { + separatorMenuItem.SetLabel(lbl) + } + cmbo = combObj{widget: separatorMenuItem, tType: ITEM_OPT_SEPARATOR, combined: false} + return &cmbo, nil + } + case opt&ITEM_OPT_CHECK != 0: + if opt&ITEM_OPT_NO_MNEMONIC != 0 { + checkMenuItem, err = gtk.CheckMenuItemNewWithLabel(lbl) + } else { + checkMenuItem, err = gtk.CheckMenuItemNewWithMnemonic(lbl) + } + if err == nil { + switch f := activateFunction.(type) { + case func(c *gtk.CheckMenuItem): + checkMenuItem.Connect("activate", f) + default: + return nil, fmt.Errorf( + "AddItem: callback for %T require 'func(c *gtk.CheckMenuItem)' type!", + checkMenuItem) + } + cmbo = combObj{widget: checkMenuItem, tType: ITEM_OPT_CHECK, combined: false} + return &cmbo, nil + } + return nil, err + + case opt&ITEM_OPT_RADIO != 0, opt&ITEM_OPT_RADIO_NEW_GRP != 0: + if opt&ITEM_OPT_NO_MNEMONIC != 0 { + radioMenuItem, err = gtk.RadioMenuItemNewWithLabel(nil, lbl) + } else { + radioMenuItem, err = gtk.RadioMenuItemNewWithMnemonic(nil, lbl) + } + if err == nil { + switch f := activateFunction.(type) { + case func(r *gtk.RadioMenuItem): + radioMenuItem.Connect("activate", f) + default: + return nil, fmt.Errorf( + "AddItem: callback for %T require 'func(r *gtk.RadioMenuItem)' type!", + radioMenuItem) + } + + cmbo = combObj{widget: radioMenuItem, tType: ITEM_OPT_RADIO, combined: false} + return &cmbo, nil + } + case opt&ITEM_OPT_NORMAL != 0: + if opt&ITEM_OPT_NO_MNEMONIC != 0 { + menuItem, err = gtk.MenuItemNewWithLabel(lbl) + } else { + menuItem, err = gtk.MenuItemNewWithMnemonic(lbl) + } + if err == nil { + if activateFunction != nil { + switch f := activateFunction.(type) { + case func(): + menuItem.Connect("activate", f) + } + } + cmbo = combObj{widget: menuItem, tType: ITEM_OPT_NORMAL, combined: false} + return &cmbo, nil + } + default: + return nil, fmt.Errorf("AddItemWithOptions: Unable to define choosen option(s)") + } + + return nil, err +} + +// AddItem: Add item to menu. This version handle +// checkbutton/radiobutton with groups and classic labels +func (pop *PopupMenuStruct) AddItem( + lbl string, activateFunction interface{}, options ...interface{}) (widgetIdx int, err error) { + + var ( + opt ItemOptionsType = ITEM_OPT_NORMAL // Default Option + icon interface{} + ) + switch len(options) { + case 1: + opt = opt | options[0].(ItemOptionsType) + icon = nil + } + + cmbo, err := pop.buildXMenuItem(lbl, icon, activateFunction, opt) + if err != nil { + return -1, err + } + pop.items = append(pop.items, *cmbo) + + // Handling RadioMenuItem groups + if opt&ITEM_OPT_RADIO != 0 || opt&ITEM_OPT_RADIO_NEW_GRP != 0 { + if opt&ITEM_OPT_RADIO_NEW_GRP != 0 { + pop.lastRadioMenuItmGroup = cmbo.getRadioMenuItem() + } + if pop.lastRadioMenuItmGroup == nil { + pop.lastRadioMenuItmGroup = cmbo.getRadioMenuItem() + } + cmbo.getRadioMenuItem().JoinGroup(pop.lastRadioMenuItmGroup) + } + + pop.nextMenuItemIdx++ + return pop.nextMenuItemIdx - 1, err +} + +// MenuBuild: Build popupmenu. +func (pop *PopupMenuStruct) MenuBuild() *gtk.Menu { + var err error + if pop.Menu, err = gtk.MenuNew(); err == nil { + pop.Menu = appendToExistingMenu(pop.items, pop.Menu) + } else { + log.Println("Popup menu creation error !") + return nil + } + pop.Menu.SetProperty("reserve_toggle_size", pop.ReserveToggleSize) + pop.Menu.SetProperty("menu_type_hint", pop.WindowTypeHint) + return pop.Menu +} + +// CheckRMB: Check whether an event comes from the right button of the +// mouse and display the popup if it is the case at the mouse position. +func (pop *PopupMenuStruct) CheckRMB(obj interface{}, event *gdk.Event) bool { + return checkRMB(pop.LMB, pop.Menu, event) +} + +// CheckRMBFromTreeView: May be directly used as callback function for +// TreeView' "button-press-event" signal, considere to initialize the +// popup menu before setting this function as callback. Otherwise, the +// call will generate error "nil pointer ..." +func (pop *PopupMenuStruct) CheckRMBFromTreeView(tv *gtk.TreeView, event *gdk.Event) bool { + return checkRMBFromTreeView(pop.LMB, pop.Menu, tv, event) +} + +// AppendToExistingMenu: append "MenuItems" to an existing "*gtk.Menu" +// Useful when you want to just add some entries to the context menu that +// already exist in a gtk.TextView or gtk.Entry by using "populate-popup" +// signal. Notice: GtkWidget > GtkMenu: +// menu := >k.Menu{gtk.MenuShell{gtk.Container{*w}}} +// Each connection to signal need to re-create the entire menu. +func (pop *PopupMenuStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu { + return appendToExistingMenu(pop.items, menu) +} + +func appendToExistingMenu(menuItems []combObj, menu *gtk.Menu) *gtk.Menu { + for _, menuItem := range menuItems { + switch menuItem.tType { + case ITEM_OPT_SEPARATOR: + menu.Append(menuItem.getSeparatorMenuItem()) + default: + if menuItem.combined { + menu.Append(menuItem.xMenuItem) + } else { + switch menuItem.tType { + case ITEM_OPT_NORMAL: + menu.Append(menuItem.getMenuItem()) + case ITEM_OPT_CHECK: + menu.Append(menuItem.getCheckMenuItem()) + case ITEM_OPT_RADIO: + menu.Append(menuItem.getRadioMenuItem()) + } + } + } + } + menu.ShowAll() + return menu +} + +/* + * Icon version, this structure hold a home-made version of GtkMenu with Icon + * handling. Since Gtk3 does not include icon possibility anymore, i've made + * this implementation to continue using icons in my menu. + * - GtkMenuItem is replaced by a GtkBox which embeds a GtkLabel, everything will be embedded in a GtkMenuItem. + * - GtkCheckMenuItem is replaced by a GtkBox which embeds a GtkCheckButton, everything will be embedded in a GtkMenuItem. + * - GtkRadioMenuItem is replaced by a GtkBox which embeds a GtkRadioButton, everything will be embedded in a GtkMenuItem. + * - GtkSeparatorMenuItem still untouched. + * Note: for Icon, each GtkBox may embed/or not a GtkImage at first. + * The "signal" emitted by the objects is processed transparently. + * All objects are accessible using they own method just after +* creation or later, using they indexes and respective methods. +*/ +// PopupMenuIconStruct: Structure that hold popup menu options and methods. +// A simple builder for popup menu that may handle icons. +// Instead of classics GtkMenuItem, this structure use: +// - GtkLabel as GtkMenuItem, it will be embedded in a GtkMenuItem +// - GtkCheckButton as GtkCheckMenuItem, it will be embedded in a GtkMenuItem +// - GtkRadioButton as GtkRadioMenuItem, it will be embedded in a GtkMenuItem +// To get the active widget, you can use 'GetXXXCurrent' or 'GetXXXIdx' method +// Note: the "toggled" signal is handled as transparent as possible. +type PopupMenuIconStruct struct { + Menu *gtk.Menu + // Indicate what type of function the window has. + WindowTypeHint gdk.WindowTypeHint // default (WINDOW_TYPE_HINT_POPUP_MENU) + // left mouse button instead of right + LMB, + // Reserving space to toggle (gtkCheckMenuItem/GtkRadioMenuItem) + ReserveToggleSize bool + // Define icons size + IconsSize, + // space separator for box (used for image) + BoxSpacing, + // Contain the last GtkMenuItme created + nextMenuItemIdx, + // Used to link radio button within a group + lastRadioButtonGroupIdx int + // Used to link radio button within a group + lastRadioButtonGroup *gtk.RadioButton + // Where menuitems are stored + items []combObj + // Options that can be used with designed function + OPT_NORMAL, + OPT_CHECK, + OPT_RADIO, + OPT_SEPARATOR, + OPT_ICON, + OPT_NO_MNEMONIC, + OPT_RADIO_NEW_GRP, + OPT_ALGN_LBL, + OPT_ALGN_BOX_CNTR ItemOptionsType +} + +// PopupMenuNew: return a new PopupMenuIconStruct structure +func PopupMenuIconStructNew() (pop *PopupMenuIconStruct) { + pop = new(PopupMenuIconStruct) + pop.IconsSize = 18 + pop.BoxSpacing = 4 + + pop.lastRadioButtonGroup = nil + pop.ReserveToggleSize = false + pop.WindowTypeHint = gdk.WINDOW_TYPE_HINT_POPUP_MENU + + pop.OPT_NORMAL = ITEM_OPT_NORMAL + pop.OPT_CHECK = ITEM_OPT_CHECK + pop.OPT_RADIO = ITEM_OPT_RADIO + pop.OPT_SEPARATOR = ITEM_OPT_SEPARATOR + pop.OPT_ICON = ITEM_OPT_ICON + pop.OPT_NO_MNEMONIC = ITEM_OPT_NO_MNEMONIC + pop.OPT_RADIO_NEW_GRP = ITEM_OPT_RADIO_NEW_GRP + pop.OPT_ALGN_LBL = ITEM_OPT_ALGN_LBL + pop.OPT_ALGN_BOX_CNTR = ITEM_OPT_ALGN_BOX_CNTR + return +} + +// Retrieve current GtkMenuItem +func (pop *PopupMenuIconStruct) GetMenuItemCurrent() *gtk.MenuItem { + return pop.items[pop.nextMenuItemIdx-1].getCombMenuItem() +} + +// Retrieve current undferlayed GtkLabel +func (pop *PopupMenuIconStruct) GetLabelCurrent() *gtk.Label { + return pop.items[pop.nextMenuItemIdx-1].getLabel() +} + +// Retrieve current undferlayed GtkCheckButton +func (pop *PopupMenuIconStruct) GetCheckButtonCurrent() *gtk.CheckButton { + return pop.items[pop.nextMenuItemIdx-1].getCheckButton() +} + +// Retrieve current undferlayed GtkRadioButton +func (pop *PopupMenuIconStruct) GetRadioButtonCurrent() *gtk.RadioButton { + return pop.items[pop.nextMenuItemIdx-1].getRadioButton() +} + +// Retrieve current GtkSeparatorMenuItem +func (pop *PopupMenuIconStruct) GetSeparatorMenuItemCurrent() *gtk.SeparatorMenuItem { + return pop.items[pop.nextMenuItemIdx-1].getSeparatorMenuItem() +} + +// Get the MenuItem at 'idx', which contains underlying widgets +func (pop *PopupMenuIconStruct) GetMenuItemIdx(idx int) *gtk.MenuItem { + return pop.items[idx].xMenuItem +} + +// Retrieve the underlayed IWidget at 'idx' +func (pop *PopupMenuIconStruct) GetIWidgetIdx(idx int) gtk.IWidget { + return pop.items[idx].widget.(gtk.IWidget) +} + +// AddItemWithOptions: Add items to menu. This version handle +// checkbutton/radiobutton with groups and classic labels with +// or without icon and more options ... +func (pop *PopupMenuIconStruct) buildXMenuItem(lbl string, ico, activateFunction interface{}, opt ItemOptionsType) (*combObj, error) { + var ( + cmbo combObj + err error + menuItem *gtk.MenuItem + pixbuf *gdk.Pixbuf + image *gtk.Image + label *gtk.Label + checkbutton *gtk.CheckButton + radiobutton *gtk.RadioButton + box *gtk.Box + + addImage = func(ico interface{}) error { + // The function below is a part of personal gotk3 library that + // allow to load image with some facilities. May handle a full + // filename or an embedded binary data (hex/zip compressed). + if pixbuf, err = GetPixBuf(ico, pop.IconsSize); err == nil { + if image, err = gtk.ImageNewFromPixbuf(pixbuf); err == nil { + box.PackStart(image, false, false, 0) + return nil + } + } + return err + } + ) + if box, err = gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, pop.BoxSpacing); err == nil { + if opt&ITEM_OPT_ALGN_BOX_CNTR == 0 { + box.SetHAlign(gtk.ALIGN_START) + } + if menuItem, err = gtk.MenuItemNew(); err == nil { + menuItem.Container.Add(box) + + if opt&ITEM_OPT_ICON != 0 { + if ico == nil { + return nil, fmt.Errorf("AddItemWithOptions: Icon requested but not provided") + } + err = addImage(ico) + } else if opt&ITEM_OPT_ALGN_LBL != 0 { + err = addImage(blankIcon) + image.SetOpacity(0) + } + if err != nil { + return nil, err + } + + switch { + case opt&ITEM_OPT_SEPARATOR != 0: + separatorItem, err := gtk.SeparatorMenuItemNew() + if err != nil { + return nil, err + } + // If empty, do not cast SetLabel, permit to draw a 1 pixel line + // instead of a plain (full height) mark as separator. + if len(lbl) > 0 { + separatorItem.SetLabel(lbl) + } + cmbo = combObj{widget: separatorItem, tType: ITEM_OPT_SEPARATOR, combined: false} + + case opt&ITEM_OPT_CHECK != 0: + if opt&ITEM_OPT_NO_MNEMONIC != 0 { + checkbutton, err = gtk.CheckButtonNewWithLabel(lbl) + } else { + checkbutton, err = gtk.CheckButtonNewWithMnemonic(lbl) + } + if err != nil { + return nil, err + } + box.PackEnd(checkbutton, true, true, 0) + switch f := activateFunction.(type) { + case func(chk *gtk.CheckButton): + menuItem.Connect("activate", func() { + checkbutton.SetActive(!checkbutton.GetActive()) + f(checkbutton) + }) + default: + return nil, fmt.Errorf("AddItemWithOptions: callback type 'func(chk *gtk.CheckButton)' required!") + } + cmbo = combObj{widget: checkbutton, tType: ITEM_OPT_CHECK, combined: true, xMenuItem: menuItem} + + case opt&ITEM_OPT_RADIO != 0, opt&ITEM_OPT_RADIO_NEW_GRP != 0: + if opt&ITEM_OPT_NO_MNEMONIC != 0 { + radiobutton, err = gtk.RadioButtonNewWithLabel(nil, lbl) + } else { + radiobutton, err = gtk.RadioButtonNewWithMnemonic(nil, lbl) + } + if err != nil { + return nil, err + } + box.PackEnd(radiobutton, true, true, 0) + switch f := activateFunction.(type) { + case func(chk *gtk.RadioButton): + menuItem.Connect("activate", func() { + radiobutton.SetActive(!radiobutton.GetActive()) + f(radiobutton) + }) + default: + return nil, fmt.Errorf("AddItemWithOptions: callback type 'func(rbn *gtk.RadioButton)' required!") + } + cmbo = combObj{widget: radiobutton, tType: ITEM_OPT_RADIO, combined: true, xMenuItem: menuItem} + + case opt&ITEM_OPT_NORMAL != 0: + if opt&ITEM_OPT_NO_MNEMONIC != 0 { + label, err = gtk.LabelNew(lbl) + } else { + label, err = gtk.LabelNewWithMnemonic(lbl) + } + if err != nil { + return nil, err + } + box.PackEnd(label, true, true, 0) + switch f := activateFunction.(type) { + case func(): + menuItem.Connect("activate", f) + } + cmbo = combObj{widget: label, tType: ITEM_OPT_NORMAL, combined: true, xMenuItem: menuItem} + + default: + return nil, fmt.Errorf("AddItemWithOptions: Unable to define choosen option(s)") + } + menuItem.ShowAll() + return &cmbo, nil + } + } + + return nil, err +} + +// AddItem: Add item to menu. This version handle +// checkbutton/radiobutton with groups and classic labels with +// or without icon and more options ... +func (pop *PopupMenuIconStruct) AddItem( + lbl string, activateFunction interface{}, options ...interface{}) (widgetIdx int, err error) { + + var ( + opt ItemOptionsType = ITEM_OPT_NORMAL // Default Option + icon interface{} = nil + ) + switch len(options) { + case 1: + opt = opt | options[0].(ItemOptionsType) + case 2: + opt = opt | options[0].(ItemOptionsType) + icon = options[1] + } + + cmbo, err := pop.buildXMenuItem(lbl, icon, activateFunction, opt) + if err != nil { + return -1, err + } + pop.items = append(pop.items, *cmbo) + + // Handling RadioMenuItem groups + if opt&ITEM_OPT_RADIO != 0 || opt&ITEM_OPT_RADIO_NEW_GRP != 0 { + if opt&ITEM_OPT_RADIO_NEW_GRP != 0 { + pop.lastRadioButtonGroup = cmbo.getRadioButton() + } + if pop.lastRadioButtonGroup == nil { + pop.lastRadioButtonGroup = cmbo.getRadioButton() + } + cmbo.getRadioButton().JoinGroup(pop.lastRadioButtonGroup) + } + + pop.nextMenuItemIdx++ + return pop.nextMenuItemIdx - 1, err +} + +// MenuBuild: Build popupmenu. +func (pop *PopupMenuIconStruct) MenuBuild() *gtk.Menu { + var err error + if pop.Menu, err = gtk.MenuNew(); err == nil { + pop.Menu = appendToExistingMenu(pop.items, pop.Menu) + } else { + log.Println("Popup menu creation error !") + return nil + } + pop.Menu.SetProperty("reserve_toggle_size", pop.ReserveToggleSize) + pop.Menu.SetProperty("menu_type_hint", pop.WindowTypeHint) + return pop.Menu +} + +// CheckRMB: Check whether an event comes from the right button of the +// mouse and display the popup if it is the case at the mouse position. +func (pop *PopupMenuIconStruct) CheckRMB(obj interface{}, event *gdk.Event) bool { + return checkRMB(pop.LMB, pop.Menu, event) +} + +// CheckRMBFromTreeView: May be directly used as callback function for +// TreeView' "button-press-event" signal, considere to initialize the +// popup menu before setting this function as callback. Otherwise, the +// call will generate error "nil pointer ..." +func (pop *PopupMenuIconStruct) CheckRMBFromTreeView(tv *gtk.TreeView, event *gdk.Event) bool { + return checkRMBFromTreeView(pop.LMB, pop.Menu, tv, event) +} + +func (pop *PopupMenuIconStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu { + return appendToExistingMenu(pop.items, menu) +} + +func checkRMB(popLMB bool, menu *gtk.Menu, event *gdk.Event) bool { + eventButton := gdk.EventButtonNewFromEvent(event) + if uint(eventButton.Button()) == mouseBtn(popLMB) { + menu.PopupAtPointer(event) + return true /* we handled this */ + } + return false /* we did not handle this */ +} + +func checkRMBFromTreeView(popLMB bool, menu *gtk.Menu, tv *gtk.TreeView, event *gdk.Event) bool { + if selection, err := tv.GetSelection(); err == nil { + + eventButton := gdk.EventButtonNewFromEvent(event) + if uint(eventButton.Button()) == mouseBtn(popLMB) { + // If right click is not over a selected row then + // unselect all and select the row under the cursor + eventMotion := gdk.EventMotionNewFromEvent(event) + x, y := eventMotion.MotionVal() + if path, _, _, _, ok := tv.GetPathAtPos(int(x), int(y)); ok { + if !selection.PathIsSelected(path) { + selection.UnselectAll() + selection.SelectPath(path) + } + } + if selection.CountSelectedRows() > 0 { + // Display popup menu + menu.PopupAtPointer(event) + return true /* we handled this */ + } + } + } + return false /* we did not handle this */ +} + +// mouseBtn: get uint value of specified button to match +func mouseBtn(popLMB bool) uint { + if popLMB { + return 1 // LMB + } + return 3 // RMB +} + +// Icon used as transparent to fill space before underlayed widget when +// ITEM_OPT_ALGN_LBL is used. +var blankIcon = HexToBytes("blank", []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff\x00\x3a\x02\xc5\xfd\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\x00\x00\x01\x84\x69\x43\x43\x50\x49\x43\x43\x20\x70\x72\x6f\x66\x69\x6c\x65\x00\x00\x28\x91\x7d\x91\x3d\x48\xc3\x40\x1c\xc5\x5f\x53\xa5\x22\x15\x41\x0b\x8a\x38\x64\xa8\x4e\x16\x44\x45\x74\xd3\x2a\x14\xa1\x42\xa8\x15\x5a\x75\x30\xb9\xf4\x43\x68\xd2\x90\xa4\xb8\x38\x0a\xae\x05\x07\x3f\x16\xab\x0e\x2e\xce\xba\x3a\xb8\x0a\x82\xe0\x07\x88\x9b\x9b\x93\xa2\x8b\x94\xf8\xbf\xa4\xd0\x22\xc6\x83\xe3\x7e\xbc\xbb\xf7\xb8\x7b\x07\x08\xb5\x12\xd3\xac\xb6\x51\x40\xd3\x6d\x33\x95\x88\x8b\x99\xec\x8a\x18\x7a\x85\x80\x1e\xf4\x61\x1a\x82\xcc\x2c\x63\x56\x92\x92\xf0\x1d\x5f\xf7\x08\xf0\xf5\x2e\xc6\xb3\xfc\xcf\xfd\x39\xba\xd4\x9c\xc5\x80\x80\x48\x3c\xc3\x0c\xd3\x26\x5e\x27\x9e\xdc\xb4\x0d\xce\xfb\xc4\x11\x56\x94\x55\xe2\x73\xe2\x11\x93\x2e\x48\xfc\xc8\x75\xc5\xe3\x37\xce\x05\x97\x05\x9e\x19\x31\xd3\xa9\x39\xe2\x08\xb1\x58\x68\x61\xa5\x85\x59\xd1\xd4\x88\x27\x88\xa3\xaa\xa6\x53\xbe\x90\xf1\x58\xe5\xbc\xc5\x59\x2b\x55\x58\xe3\x9e\xfc\x85\xe1\x9c\xbe\xbc\xc4\x75\x9a\x83\x48\x60\x01\x8b\x90\x20\x42\x41\x05\x1b\x28\xc1\x46\x8c\x56\x9d\x14\x0b\x29\xda\x8f\xfb\xf8\x07\x5c\xbf\x44\x2e\x85\x5c\x1b\x60\xe4\x98\x47\x19\x1a\x64\xd7\x0f\xfe\x07\xbf\xbb\xb5\xf2\xe3\x63\x5e\x52\x38\x0e\xb4\xbf\x38\xce\xc7\x10\x10\xda\x05\xea\x55\xc7\xf9\x3e\x76\x9c\xfa\x09\x10\x7c\x06\xae\xf4\xa6\xbf\x5c\x03\xa6\x3e\x49\xaf\x36\xb5\xe8\x11\xd0\xbd\x0d\x5c\x5c\x37\x35\x65\x0f\xb8\xdc\x01\xfa\x9f\x0c\xd9\x94\x5d\x29\x48\x53\xc8\xe7\x81\xf7\x33\xfa\xa6\x2c\xd0\x7b\x0b\x74\xae\x7a\xbd\x35\xf6\x71\xfa\x00\xa4\xa9\xab\xe4\x0d\x70\x70\x08\x0c\x17\x28\x7b\xcd\xe7\xdd\x1d\xad\xbd\xfd\x7b\xa6\xd1\xdf\x0f\x6b\xbe\x72\xa4\xea\xad\xb2\x9e\x00\x00\x00\x06\x62\x4b\x47\x44\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x2e\x23\x00\x00\x2e\x23\x01\x78\xa5\x3f\x76\x00\x00\x00\x07\x74\x49\x4d\x45\x07\xe5\x02\x12\x17\x3b\x0b\xb8\x84\x6f\xa0\x00\x00\x00\x19\x74\x45\x58\x74\x43\x6f\x6d\x6d\x65\x6e\x74\x00\x43\x72\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x47\x49\x4d\x50\x57\x81\x0e\x17\x00\x00\x00\x12\x49\x44\x41\x54\x38\xcb\x63\x60\x18\x05\xa3\x60\x14\x8c\x02\x08\x00\x00\x04\x10\x00\x01\x85\x3f\xaa\x72\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\x01\x00\x00\xff\xff\x1a\x3e\x56\xc7\x3a\x02\x00\x00")) + +/******************** OUTDATED START ********************** + * Methods below MUST NOT be used anymore to display icons + * Otherwise, without icon they still available + */ +// AddItem: Add items to menu. +// func (pop *PopupMenuIconStruct) AddItem(lbl string, activateFunction interface{}, +// icon ...interface{}) (err error) { + +// fmt.Printf("Warning!: POPUP/MENU implementation must be changed using new version\n") + +// var menuItem *gtk.MenuItem +// var pixbuf *gdk.Pixbuf + +// if len(icon) != 0 { +// // The function below is a part of personal gotk3 library +// // allow to load image with some facilities. May handle +// // filename or embedded binary data (hex/zip compressed). +// // pixbuf, err = gdk.PixbufNewFromFile(filename) +// pixbuf, err = GetPixBuf(icon[0], pop.IconsSize) +// } + +// if pop.WithIcons { +// menuItem, err = pop.menuItemNewWithImage(lbl, pixbuf) +// } else { +// menuItem, err = gtk.MenuItemNewWithMnemonic(lbl) +// } + +// // Handle the "activate" signal from the related item. +// if err == nil { +// menuItem.SetUseUnderline(true) +// if activateFunction != nil { +// menuItem.Connect("activate", activateFunction.(func())) +// } +// pop.Items = append(pop.Items, menuItem) +// // pop.separators = append(pop.separators, nil) +// pop.nextMenuItemIdx++ +// } +// return err +// } + +// // AddCheckMenuItem: Add items to menu. +// func (pop *PopupMenuIconStruct) AddCheckMenuItem(lbl string, activateFunction interface{}) (err error) { + +// fmt.Printf("Warning!: POPUP/MENU implementation must be changed using new version\n") + +// var menuItem *gtk.CheckMenuItem +// menuItem, err = gtk.CheckMenuItemNewWithMnemonic(lbl) + +// // Handle the "activate" signal from the related item. +// if err == nil { +// menuItem.SetUseUnderline(true) +// if activateFunction != nil { +// menuItem.Connect("activate", activateFunction.(func())) +// } +// pop.Items = append(pop.Items, menuItem) +// // pop.separators = append(pop.separators, nil) +// pop.nextMenuItemIdx++ +// } +// return err +// } + +// // menuItemNewWithImage: Build an item containing an image. +// func (pop *PopupMenuIconStruct) menuItemNewWithImage(label string, +// pixbuf *gdk.Pixbuf) (menuItem *gtk.MenuItem, err error) { + +// fmt.Printf("Warning!: POPUP/MENU implementation must be changed using new version\n") + +// var image *gtk.Image +// box, err := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, pop.BoxSpacing) +// if err == nil { +// if image, err = gtk.ImageNewFromPixbuf(pixbuf); err == nil { +// label, err := gtk.LabelNewWithMnemonic(label) +// if err == nil { +// menuItem, err = gtk.MenuItemNew() +// if err == nil { +// label.SetHAlign(gtk.ALIGN_START) +// box.Add(image) +// box.PackEnd(label, true, true, 0) +// box.SetHAlign(gtk.ALIGN_START) +// menuItem.Container.Add(box) +// menuItem.ShowAll() +// } +// } +// } +// } +// return menuItem, err +// } + +// AddSeparator: Add separator to menu. +// func (pop *PopupMenuIconStruct) AddSeparator(label ...string) (err error) { + +// if separatorItem, err := gtk.SeparatorMenuItemNew(); err == nil { +// if len(label) > 0 { +// separatorItem.SetLabel(label[0]) +// } +// pop.Items = append(pop.Items, separatorItem) +// pop.nextMenuItemIdx++ +// } +// return err +// } + +// MenuBuild: Build popupmenu. +// func (pop *PopupMenuIconStruct) MenuBuild() *gtk.Menu { +// var err error +// if pop.Menu, err = gtk.MenuNew(); err == nil { +// for _, menuItem := range pop.Items { +// switch m := menuItem.(type) { +// case *gtk.SeparatorMenuItem: +// pop.Menu.Append(m) +// case *gtk.MenuItem: +// pop.Menu.Append(m) +// case *gtk.CheckMenuItem: +// pop.Menu.Append(m) +// case *gtk.RadioMenuItem: +// pop.Menu.Append(m) +// } +// } +// pop.Menu.ShowAll() +// } else { +// log.Println("Popup menu creation error !") +// return nil +// } + +// pop.Menu.SetReserveToggleSize(pop.SetReserveToggleSize) +// return pop.Menu +// } + +// AppendToExistingMenu: append "MenuItems" to an existing "*gtk.Menu" +// Useful when you want to just add some entries to the context menu that +// already exist in a gtk.TextView or gtk.Entry by using "populate-popup" +// signal. Notice: GtkWidget > GtkMenu: +// menu := >k.Menu{gtk.MenuShell{gtk.Container{*w}}} +// Each connection to signal need to re-create the entire menu. +// func (pop *PopupMenuIconStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu { +// for _, menuItem := range pop.Items { +// switch m := menuItem.(type) { +// case *gtk.SeparatorMenuItem: +// pop.Menu.Append(m) +// case *gtk.MenuItem: +// pop.Menu.Append(m) +// case *gtk.CheckMenuItem: +// pop.Menu.Append(m) +// case *gtk.RadioMenuItem: +// pop.Menu.Append(m) +// } +// } +// menu.ShowAll() +// return menu +// } + +/******************** OUTDATED END **********************/ diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/progress.go b/vendor/github.com/hfmrow/gtk3Import/misc/progress.go new file mode 100755 index 0000000..1e56e61 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/progress.go @@ -0,0 +1,142 @@ +// progress.go + +/* + Source file auto-generated on Thu, 17 Oct 2019 02:33:04 using Gotk3ObjHandler v1.3.9 ©2018-19 H.F.M + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + This structure implement a progressbar. +*/ + +package gtk3Import + +import ( + "sync" + "time" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gtk" +) + +type ProgressBarStruct struct { + RefreshMs uint + GifImageName string + + gifImage *gtk.Image + box *gtk.Box + boxPosition int + fMain, fEnd func() (err error) + progressBar *gtk.ProgressBar + TimeOutContinue bool + ticker *time.Ticker +} + +func ProgressBarNew(progressBar *gtk.ProgressBar, fMain, fEnd func() (err error)) (pbs *ProgressBarStruct) { + pbs = new(ProgressBarStruct) + pbs.Init(progressBar, fMain, fEnd) + return +} + +func ProgressGifNew(gifImage *gtk.Image, box *gtk.Box, position int, fMain, fEnd func() (err error)) (pbs *ProgressBarStruct) { + pbs = new(ProgressBarStruct) + pbs.Init(nil, fMain, fEnd) + pbs.box = box + pbs.boxPosition = position + pbs.gifImage = gifImage + pbs.box.Add(pbs.gifImage) + pbs.gifImage.SetHAlign(gtk.ALIGN_FILL) + pbs.gifImage.SetHExpand(true) + pbs.box.ReorderChild(pbs.gifImage, position) + // pbs.gifImage.Show() + return +} + +func (pbs *ProgressBarStruct) Init(progressBar *gtk.ProgressBar, fMain, fEnd func() (err error)) { + pbs.RefreshMs = 100 + pbs.progressBar = progressBar + pbs.fMain, pbs.fEnd = fMain, fEnd +} + +func (pbs *ProgressBarStruct) StartGif() (err error) { + pbs.gifImage.Show() + waitGroup := new(sync.WaitGroup) + waitGroup.Add(1) + go func() { + defer waitGroup.Done() + err = pbs.fMain() + }() + + waitGroup.Wait() + if err != nil { + return + } + glib.IdleAdd(func() { + pbs.removeGifFromTopBox() + err = pbs.fEnd() + }) + return +} + +func (pbs *ProgressBarStruct) removeGifFromTopBox() { + pbs.box.Remove(pbs.gifImage) +} + +func (pbs *ProgressBarStruct) StartTicker() (err error) { + + pbs.ticker = time.NewTicker(time.Millisecond * time.Duration(pbs.RefreshMs)) + go func() { + for _ = range pbs.ticker.C { + glib.IdleAdd(func() { + pbs.progressBar.Pulse() + }) + } + }() + + waitGroup := new(sync.WaitGroup) + waitGroup.Add(1) + go func() { + defer waitGroup.Done() + err = pbs.fMain() + }() + + waitGroup.Wait() + if err != nil { + return + } + glib.IdleAdd(func() { + pbs.progressBar.SetFraction(0) + err = pbs.fEnd() + pbs.ticker.Stop() + }) + + return +} + +func (pbs *ProgressBarStruct) StartTimeOut() { + + pbs.TimeOutContinue = true + glib.TimeoutAdd(pbs.RefreshMs, func() bool { + glib.IdleAdd(func() { + pbs.progressBar.Pulse() + }) + if pbs.TimeOutContinue { + return true + } else { + glib.IdleAdd(func() { + pbs.progressBar.SetFraction(0) + pbs.fEnd() + }) + return false + } + }) + + waitGroup := new(sync.WaitGroup) + waitGroup.Add(1) + go func() { + defer waitGroup.Done() + pbs.fMain() + }() + waitGroup.Wait() + pbs.TimeOutContinue = false + return +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/statusBar.go b/vendor/github.com/hfmrow/gtk3Import/misc/statusBar.go new file mode 100644 index 0000000..fab17d4 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/statusBar.go @@ -0,0 +1,166 @@ +// statusBar.go + +/* + This library use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019 H.F.M - Handle Statusbar messages & Window Title + This program comes with absolutely no warranty. See the The MIT License (MIT) for details: + https://opensource.org/licenses/mit-license.php +*/ + +package gtk3Import + +import ( + "log" + "strconv" + "strings" + + "github.com/gotk3/gotk3/gtk" +) + +/*************/ +/* Titlebar */ +/***********/ + +type TitleBar struct { + MainTitle string + Separator string + + appendTitle string + prependTitle string + window *gtk.Window + titleNew string +} + +func TitleBarStructureNew(window *gtk.Window, title ...string) *TitleBar { + tb := new(TitleBar) + tb.Init(window, title...) + return tb +} + +// * Alternative use of TitleBarNew() * in the case where we need +// to import the structure rather than using it via the imported library. +func (tb *TitleBar) Init(window *gtk.Window, title ...string) { + var err error + tb.window = window + tb.Separator = " - " + + if len(title) > 0 { + tb.MainTitle = strings.Join(title, " ") + } else { + if tb.MainTitle, err = tb.window.GetTitle(); err != nil { + log.Fatalf("Unable to acquire window title: %s\n", err.Error()) + } + } +} + +func (tb *TitleBar) Reset() string { + tb.window.SetTitle(tb.MainTitle) + return tb.MainTitle +} + +func (tb *TitleBar) Update(toAdd []string, appendTo ...bool) string { + var appendToTitle bool + if len(appendTo) > 0 { + appendToTitle = appendTo[0] + } + if len(toAdd) > 0 { + if appendToTitle && len(toAdd) != 0 { + tb.titleNew = tb.MainTitle + tb.Separator + strings.Join(toAdd, tb.Separator) + + } else if len(toAdd) != 0 { + tb.titleNew = strings.Join(toAdd, tb.Separator) + tb.Separator + tb.MainTitle + } + } else { + tb.titleNew = tb.MainTitle + } + tb.window.SetTitle(tb.titleNew) + return tb.titleNew +} + +/**************/ +/* Statusbar */ +/************/ + +type StatusBar struct { + Messages []string /* Each row contain associated strings refere to contextId number */ + Separator string + statusbar *gtk.Statusbar + contextId uint + Prefix []string +} + +/* Init: Initialise structure to handle elements to be displayed. */ +func StatusBarStructureNew(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) (bar *StatusBar) { + bar = new(StatusBar) + bar.Init(originStatusbar, prefix, stackId...) + return +} + +// Show: display / hide statusbar +func (bar *StatusBar) Show(state bool) { + bar.statusbar.SetVisible(state) +} + +/* Init: Initialise structure to handle elements to be displayed. */ +func (bar *StatusBar) Init(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) { + var stack int + if len(stackId) == 0 { + stack = 0 + } else { + stack = stackId[0] + } + bar.Separator = " | " + bar.statusbar = originStatusbar + bar.contextId = bar.statusbar.GetContextId(strconv.Itoa(stack)) /* get contextId of stack */ + bar.Messages = make([]string, len(prefix)) + bar.Prefix = prefix +} + +/* Add: add new element and return his own position. */ +func (bar *StatusBar) Add(prefix, inString string) (position int) { + bar.Prefix = append(bar.Prefix, prefix) + bar.Messages = append(bar.Messages, prefix+" "+inString) + bar.Disp() + return len(bar.Messages) - 1 +} + +/* Add: set element at desired position. */ +func (bar *StatusBar) Set(inString string, pos int) { + if pos > len(bar.Messages)-1 || pos < 0 { + inString = "Statusbar error: Invalid range to setting this message -> " + inString + pos = len(bar.Messages) - 1 + } + bar.Messages[pos] = inString + bar.Disp() +} + +/* Del: remove element at defined position and get the new length of elements. */ +func (bar *StatusBar) Del(pos int) (newLength int) { + copy(bar.Messages[pos:], bar.Messages[pos+1:]) + bar.Messages = bar.Messages[:cap(bar.Messages)-2] + copy(bar.Prefix[pos:], bar.Prefix[pos+1:]) + bar.Prefix = bar.Prefix[:cap(bar.Prefix)-2] + bar.Disp() + return len(bar.Messages) +} + +/* CleanAll: remove all elements (set to empty string) from the messages list. */ +func (bar *StatusBar) CleanAll() { + for idx, _ := range bar.Messages { + bar.Messages[idx] = "" + } + bar.Disp() +} + +/* Disp: display content of stored elements into statusbar */ +func (bar *StatusBar) Disp() { + var dispMessages []string + for idxMessage, message := range bar.Messages { + if len(message) != 0 { + dispMessages = append(dispMessages, bar.Prefix[idxMessage]+" "+message) + } + } + bar.statusbar.Push(bar.contextId, strings.Join(dispMessages, bar.Separator)) +} diff --git a/vendor/github.com/hfmrow/gtk3Import/misc/timeOut.go b/vendor/github.com/hfmrow/gtk3Import/misc/timeOut.go new file mode 100644 index 0000000..5985821 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/misc/timeOut.go @@ -0,0 +1,85 @@ +// +build ignore + +package main + +import ( + "fmt" + "log" + + "github.com/gotk3/gotk3/glib" + "github.com/gotk3/gotk3/gtk" +) + +var timeoutContinue = true +var tos glib.SourceHandle + +// Create and initialize the window +func setupWindow(title string) *gtk.Window { + win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL) + if err != nil { + log.Fatal("Unable to create window:", err) + } + + win.SetTitle(title) + win.Connect("destroy", func() { + gtk.MainQuit() + }) + win.SetPosition(gtk.WIN_POS_CENTER) + width, height := 600, 300 + win.SetDefaultSize(width, height) + + box, _ := gtk.BoxNew(gtk.ORIENTATION_VERTICAL, 0) + btn, _ := gtk.ButtonNew() + btn.Connect("clicked", ButtonClicked) + btn.SetLabel("Stop timeout") + + box.Add(btn) + win.Add(box) + + return win +} + +func main() { + gtk.Init(nil) + + win := setupWindow("Go Example Testreport") + + win.ShowAll() + + // Init timeout: + tos, _ = glib.TimeoutAdd(uint(1000), func() bool { + fmt.Println("timed out") + + return timeoutContinue + }) + + gtk.Main() +} + +func ButtonClicked() { + var methode int + + // Three methods to stop timeout: + // 1- Destroying + // 2- Removing + // 3- Returning false by called function + + // Choose one of them: + methode = 3 + + switch methode { + case 1: // 1- Destroying + mcd := glib.MainContextDefault() + src := mcd.FindSourceById(tos) + src.Destroy() + fmt.Printf("Timeout stopped & IsDestroyed: %v\n", src.IsDestroyed()) + + case 2: // 2- Removing + glib.SourceRemove(tos) + fmt.Printf("Timeout stopped but still referenced\n") + + case 3: // 3- Returning false by called function + timeoutContinue = !timeoutContinue + fmt.Printf("Timeout stopped but still in memory and referenced\n") + } +} diff --git a/vendor/github.com/hfmrow/gtk3Import/pango/pangoSimple/pangoSimple.go b/vendor/github.com/hfmrow/gtk3Import/pango/pangoSimple/pangoSimple.go new file mode 100644 index 0000000..a312c99 --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/pango/pangoSimple/pangoSimple.go @@ -0,0 +1,151 @@ +// PangoMarkupBinder.go + +/* +* ©2019 H.F.M. MIT license +* Handle Pango markup functions. + +* This is a pango markup binder to gotk3 pango library ... +* I have made it to make more simple markup handling when i'm working on gtk objects. +* It can be used in treeview, dialog, label, ... Each object where you can set "markup" content + + */ + +package gtk3Import + +import ( + "fmt" + "regexp" + "strings" +) + +type PangoSimple struct { + pangoEscapeChar [][]string +} + +func PangoSimpleNew() (ps *PangoSimple) { + ps = new(PangoSimple) + ps.Init() + return +} + +// Init: Init [PangoSimple] structure +func (pm *PangoSimple) Init() { + // pm.pangoEscapeChar = [][]string{{"<", "<", string([]byte{0x15})}, {"&", "&", string([]byte{0x16})}} + pm.pangoEscapeChar = [][]string{{"<", "<", "lOwErThAnTmPrEpLaCeMeNt"}, {"&", "&", "aMpErSaNdTmPrEpLaCeMeNt"}} +} + +// MarkupHttpClickable: Search for http adresses in the input text and make http adress as clickable links +func (pm *PangoSimple) MarkupHttpClickable(inString string, keepFromEnd ...int) (outString string) { + var adrToDisp string + outString = pm.Prepare(inString) // In case nothing is found, returned value is same as entered value + reg := regexp.MustCompile(`(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?`) + indexes := reg.FindAllIndex([]byte(outString), -1) + + removePrefix := regexp.MustCompile(`(http|https|ftp|ftps)\:\/\/`) + + for idx := len(indexes) - 1; idx >= 0; idx-- { + inLeft := outString[:indexes[idx][0]] + inRight := outString[indexes[idx][1]:] + url := outString[indexes[idx][0]:indexes[idx][1]] + + adrToDisp = removePrefix.ReplaceAllString(url, "") + if len(keepFromEnd) > 0 { + tmpUrl := strings.Split(url, "/") + adrToDisp = strings.Join(tmpUrl[len(tmpUrl)-keepFromEnd[0]:], "/") + } + + outString = inLeft + `` + adrToDisp + `` + inRight + } + return pm.Finalize(outString) +} + +// ApplyMarkup: This method add automatically the closer at end. +// ie: ApplyMarkup(``, "hello") +func (pm *PangoSimple) ApplyMarkup(markup ...string) string { + return pm.Finalize(markup[0] + pm.Prepare(markup[1]) + pm.getClose(markup[0])) +} + +func (pm *PangoSimple) ApplyMarkupAgain(markup ...string) string { + return markup[0] + markup[1] + pm.getClose(markup[0]) +} + +// getClose: return the last argument derived from the first to close the pango string +func (pm *PangoSimple) getClose(in string) string { + if strings.HasPrefix(in, `` + } + if strings.HasPrefix(in, `` + } + return fmt.Sprintf("", strings.Split(in, `>`)[0][1:]) +} + +// prepare: sanitize input string to safely use with pango +func (pm *PangoSimple) Prepare(inString string) string { + inString = strings.ReplaceAll(inString, pm.pangoEscapeChar[1][0], pm.pangoEscapeChar[1][2]) + return strings.ReplaceAll(inString, pm.pangoEscapeChar[0][0], pm.pangoEscapeChar[0][2]) +} + +// finalize: restore originals characters using markup replacement +func (pm *PangoSimple) Finalize(inString string) string { + inString = strings.ReplaceAll(inString, pm.pangoEscapeChar[1][2], pm.pangoEscapeChar[1][1]) + return strings.ReplaceAll(inString, pm.pangoEscapeChar[0][2], pm.pangoEscapeChar[0][1]) +} + +type PangoColor struct { + Black string + Brown string + White string + Red string + Green string + Blue string + Cyan string + Magenta string + Purple string + Turquoise string + Violet string + + Darkred string + Darkgreen string + Darkblue string + Darkgray string + Darkcyan string + + Lightblue string + Lightgray string + Lightgreen string + Lightturquoise string + Lightred string + Lightyellow string +} + +func PangoColorNew() (pc *PangoColor) { + pc = new(PangoColor) + pc.Init() + return +} +func (pc *PangoColor) Init() { + // Colors initialisation + pc.Black = "#000000" + pc.Brown = "#7C2020" + pc.White = "#FFFFFF" + pc.Red = "#FF2222" + pc.Green = "#22BB22" + pc.Blue = "#0044FF" + pc.Cyan = "#14FFFA" + pc.Magenta = "#D72D6C" + pc.Purple = "#8B0037" + pc.Turquoise = "#009187" + pc.Violet = "#7F00FF" + pc.Darkred = "#300000" + pc.Darkgreen = "#003000" + pc.Darkblue = "#000030" + pc.Darkcyan = "#003333" + pc.Darkgray = "#303030" + pc.Lightturquoise = "#80FFE7" + pc.Lightblue = "#ADD8E6" + pc.Lightgray = "#E4DDDD" + pc.Lightgreen = "#87FF87" + pc.Lightred = "#FF6666" + pc.Lightyellow = "#FFFF6F" +} diff --git a/vendor/github.com/hfmrow/gtk3Import/pixbuff/pixbufByte.go b/vendor/github.com/hfmrow/gtk3Import/pixbuff/pixbufByte.go new file mode 100644 index 0000000..052235a --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/pixbuff/pixbufByte.go @@ -0,0 +1,652 @@ +// pixbuffByte.go + +/* + Source file auto-generated on Sun, 20 Oct 2019 13:50:31 using Gotk3ObjHandler v1.3.9 ©2018-19 H.F.M + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + ©2019 H.F.M + + This program comes with absolutely no warranty. See the The MIT License (MIT) for details: + https://opensource.org/licenses/mit-license.php +*/ + +package gtk3Import + +import ( + "bytes" + "compress/gzip" + "fmt" + "io" + "io/ioutil" + "os" + "reflect" + + "github.com/gotk3/gotk3/gdk" + "github.com/gotk3/gotk3/gtk" +) + +/*************************************************/ +/* Images functions, used to initialize objects */ +/* You can use it to load your own embedded */ +/* images, icons ... */ +/*********************************************/ + +// TryStockIcon: Convenience function to combine a stock-icons-theme +// and an asset/filename icon to send to "GetPixBuf()" function. +func TryStockIcon(iconLookupFlag gtk.IconLookupFlags, stockName, assetName interface{}) (names []interface{}) { + names = append(names, stockName) + names = append(names, iconLookupFlag) + names = append(names, assetName) + return +} + +// OptPict: hold options for SetPict(), you can use OptPictStructNew() +// to set defaults values. +type OptPict struct { + Size int + // 0 = limit height, 1 = limit width, 2 = percents, + // 3 = limit height or width depending on MaxSize value. + ResizeMethode int + // Rotate image / icon + Rotate gdk.PixbufRotation + // SpinButton / Entry ... icon positions + Position gtk.EntryIconPosition + // Opacity [0.01 to 1.0] work with: Box, ToggleButton, ToolButton, MenuButton, Button + // a value of 0 means 1.0; 0.01 means 0 + Opacity float64 + // Ask for a GdkPixbufAnimation image + Animated bool + // Max size accepted relative to "ResizeMethode" = 3 + MaxSize int +} + +// OptPictStructNew: 'values' options can be nil, ther is no obligation +// to use this function to create the structure because functions are +// designed to handle defaults options automatically, this is a convenient use. +// The options (each values can be nil) order (if used) must be: +// Size, ResizeMethode, Rotate, Position, Opacity, Animated, MaxSize. +func OptPictStructNew(values ...interface{}) OptPict { + + // Set default options + opt := OptPict{ + Size: 0, + ResizeMethode: 0, + Rotate: gdk.PIXBUF_ROTATE_NONE, + Position: gtk.ENTRY_ICON_PRIMARY, + Opacity: 1.0, + Animated: false, + MaxSize: 256, + } + + var fillOptInt = func(i, index int) { + switch index { + + case 0: + opt.Size = i + case 1: + opt.ResizeMethode = i + case 6: + opt.MaxSize = i + } + } + // Fill opt with given values + if values != nil { + for idx, val := range values { + switch val.(type) { + + case nil: + continue + case gdk.PixbufRotation: + opt.Rotate = val.(gdk.PixbufRotation) + case gtk.EntryIconPosition: + opt.Position = val.(gtk.EntryIconPosition) + case float64: + opt.Opacity = val.(float64) + case bool: + opt.Animated = val.(bool) + case int: + fillOptInt(val.(int), idx) + } + } + } + return opt +} + +// getOptPict: Handling OptPict for many usages +func _getOptPict(options ...interface{}) OptPict { + + opt := OptPictStructNew() + + if len(options) > 0 { + switch options[0].(type) { + case int: + opt.Size = options[0].(int) + case interface{}: + opt = options[0].(OptPict) + } + } + return opt +} + +// SetPic: Assign image to an Object depending on type, accept stock-icons-theme, +// filename or []byte. Use OptPict{} struct to set options, size can be applied +// directly as int or be nil. +// The options are described below: +// - Load a gif animated image and specify using animation (true), resizing not +// allowed with animations. +// SetPict(GtkImage, "linearProgressHorzBlue.gif", OptPict{Animated: true}) +// - Resize to 32 pixels height, keep porportions & assign image to GtkButton. +// SetPict(GtkButton, "stillImage.png", 32) or +// SetPict(GtkButton, "stillImage.png", OptPict{Size: 32}) +// - With default size, resizing not allowed for GtkSpinButton position at right-end. +// SetPict(GtkSpinButton, "stillImage.png", OptPict{Position: gtk.ENTRY_ICON_SECONDARY}) +// - Load a stock-icons-theme or an asset/filename icon to a GtkMenuButton where stock not available. +// SetPict(gtk.MenuButton, TryStockIcon("open-menu-symbolic", "stillImage.png"), 18) or +// SetPict(gtk.MenuButton, TryStockIcon("open-menu-symbolic", "stillImage.png"), OptPict{Size: 18}) +// - Rotate upsidedown, resize 14px: +// SetPict(gtk.MenuButton, TryStockIcon("open-menu-symbolic", "stillImage.png"), OptPict{Size: 14, Rotate: gdk.PIXBUF_ROTATE_UPSIDEDOWN}) +func SetPict(iObject, varPath interface{}, options ...interface{}) (err error) { + var inPixbuf *gdk.Pixbuf + var inPixbufAnimation *gdk.PixbufAnimation + var image *gtk.Image + + opt := _getOptPict(options...) + + // Since the default initialization value is set to 0, + // we need to change it to show a visible image ... + if opt.Opacity == 0 { + opt.Opacity = 1 + } + + // Get pixbuff type (normal or animation for GtkImage) + if opt.Animated { + if inPixbufAnimation, err = GetPixBufAnimation(varPath); err == nil { + image, err = gtk.ImageNewFromAnimation(inPixbufAnimation) + } + } else { + if inPixbuf, err = GetPixBuf(varPath, opt); err == nil { + image, err = gtk.ImageNewFromPixbuf(inPixbuf) + } + } + + // Handling the error if there is + if err != nil { + var filename string + // Look for a stock icon or a filename or an ambedded asset + switch path := varPath.(type) { + case []interface{}: + filename = path[2].(string) + default: + filename = path.(string) + } + if _, err = os.Stat(filename); len(filename) > 0 /*os.IsNotExist(err)*/ { + err = fmt.Errorf("SetPict: [%v] %v", varPath, err) + fmt.Println(err.Error()) // double output + } + return + } + + // Objects parsing + if image != nil { + + image.SetOpacity(opt.Opacity) + + switch object := iObject.(type) { + + case *gtk.Button: // Set Image to GtkButton + object.SetImage(image) + object.SetAlwaysShowImage(true) + + case *gtk.MenuButton: // Set Image to GtkMenuButton + object.SetImage(image) + object.SetAlwaysShowImage(true) + + case *gtk.ToggleButton: // Set Image to GtkToggleButton + object.SetImage(image) + object.SetAlwaysShowImage(true) + + case *gtk.ToolButton: // Set Image to GtkToolButton + object.SetIconWidget(image) + + case *gtk.Box: // Add Image to GtkBox + object.Add(image) + + case *gtk.SpinButton: // Set Icon to GtkSpinButton, No resize, No Animate. + object.SetIconFromPixbuf(opt.Position, inPixbuf) + + case *gtk.ApplicationWindow: // Set Icon to GtkApplicationWindow, No Animate. + object.SetIcon(inPixbuf) + + case *gtk.Window: // Set Icon to GtkWindow, No Animate. + object.SetIcon(inPixbuf) + + case *gtk.Image: // Set Image to GtkImage + if opt.Animated { + object.SetFromAnimation(inPixbufAnimation) + } else { + object.SetFromPixbuf(inPixbuf) + } + } + } else { + err = fmt.Errorf("Image error: %v", err) + } + return +} + +// GetPixBuf: Get gdk.PixBuf from stock, filename or []byte, depending +// on type. For an explanation of the options, see above, OptPict{}. +// note: If stock-icons-theme does not exist, the asset/filename icon is used. +func GetPixBuf(varPath interface{}, options ...interface{}) (outPixbuf *gdk.Pixbuf, err error) { + var pixbufLoader *gdk.PixbufLoader + + opt := _getOptPict(options...) + + // Look for a stock icon and a filename or ambedded asset + switch varPath.(type) { + case []interface{}: + var iconTheme *gtk.IconTheme + if iconTheme, err = gtk.IconThemeGetDefault(); err == nil { + stock := varPath.([]interface{})[0].(string) + iconLookupFlags := varPath.([]interface{})[1].(gtk.IconLookupFlags) + outPixbuf, err = iconTheme.LoadIcon(stock, opt.Size, iconLookupFlags) + } + if err != nil { + varPath = varPath.([]interface{})[2] + fmt.Println(err.Error() + ". try to load the secondary choice.") + } + } + + if outPixbuf == nil { // in this case, no stock icon was found or was not requested + switch varPath.(type) { + case string: // Its a filename + outPixbuf, err = gdk.PixbufNewFromFile(varPath.(string)) + case []uint8: // Its a binary data (embedded asset) + if pixbufLoader, err = gdk.PixbufLoaderNew(); err == nil { + outPixbuf, err = pixbufLoader.WriteAndReturnPixbuf(varPath.([]byte)) + } + } + + if err == nil && opt.Size != 0 { + newWidth, newHeight := NormalizeSize(outPixbuf.GetWidth(), outPixbuf.GetHeight(), opt) + if outPixbuf, err = outPixbuf.ScaleSimple(newWidth, newHeight, gdk.INTERP_HYPER); err == nil { + outPixbuf, err = outPixbuf.RotateSimple(opt.Rotate) + } + } + } + return +} + +// GetPixBufAnimation: Get gdk.PixBufAnimation from filename or []byte, depending on type +func GetPixBufAnimation(varPath interface{}) (outPixbufAnimation *gdk.PixbufAnimation, err error) { + var pixbufLoader *gdk.PixbufLoader + switch varPath.(type) { + case string: + outPixbufAnimation, err = gdk.PixbufAnimationNewFromFile(varPath.(string)) + case []uint8: + if pixbufLoader, err = gdk.PixbufLoaderNew(); err == nil { + outPixbufAnimation, err = pixbufLoader.WriteAndReturnPixbufAnimation(varPath.([]byte)) + } + } + return +} + +// NormalizeSize: compute new size with kept proportions based on defined format. +// formats: 0 = limit height, 1 = limit width, 2 = percents, +// 3 = limit height or width depending on MaxSize value. +func NormalizeSize(oldWidth, oldHeight int, options ...interface{}) (outWidth, outHeight int) { + + opt := _getOptPict(options...) + + switch opt.ResizeMethode { + case 0: // limit Height + outWidth = int(float64(oldWidth) * (float64(opt.Size) / float64(oldHeight))) + outHeight = opt.Size + case 1: // limit Width + outWidth = opt.Size + outHeight = int(float64(oldHeight) * (float64(opt.Size) / float64(oldWidth))) + case 2: // percent + outWidth = int((float64(oldWidth) * float64(opt.Size)) / 100) + outHeight = int((float64(oldHeight) * float64(opt.Size)) / 100) + case 3: // limit Height or Width + switch { + case oldWidth >= opt.MaxSize: + opt.Size = opt.MaxSize + opt.ResizeMethode = 1 + return NormalizeSize(oldWidth, oldHeight, opt) + case oldHeight >= opt.MaxSize: + opt.Size = opt.MaxSize + opt.ResizeMethode = 0 + return NormalizeSize(oldWidth, oldHeight, opt) + } + opt.ResizeMethode = 0 + return NormalizeSize(oldWidth, oldHeight, opt) + } + return +} + +/***************************************/ +/* Embedded data conversion functions */ +/* Used to make variable content */ +/* available in go-source */ +/***********************************/ +// GetBytesFromVarAsset: Get []byte representation from file or asset, depending on type +func GetBytesFromVarAsset(varPath interface{}) (outBytes []byte, err error) { + switch reflect.TypeOf(varPath).String() { + case "string": + return ioutil.ReadFile(varPath.(string)) + case "[]uint8": + return varPath.([]byte), err + } + return +} + +// HexToBytes: Convert Gzip Hex to []byte used for embedded binary in source code +func HexToBytes(varPath string, gzipData []byte) (outByte []byte) { + r, err := gzip.NewReader(bytes.NewBuffer(gzipData)) + if err == nil { + var bBuffer bytes.Buffer + if _, err = io.Copy(&bBuffer, r); err == nil { + if err = r.Close(); err == nil { + return bBuffer.Bytes() + } + } + } + if err != nil { + fmt.Printf("An error occurred while reading: %s\n%v\n", varPath, err.Error()) + } + return +} + +/* +* Previous VERSION + */ + +// /*************************************************/ +// /* Images functions, used to initialize objects */ +// /* You can use it to load your own embedded */ +// /* images, icons ... */ +// /*********************************************/ + +// // SetPic: Assign image to an Object depending on type, accept filename or []byte. +// // options: 1- size (int), 2- enable animation (bool) +// // ie: +// // - Load a gif animated image and specify using animation (true), resizing not allowed with animations. +// // SetPict(GtkImage, "linearProgressHorzBlue.gif", 0, true) +// // - Resize to 32 pixels height, keep porportions & assign image to GtkButton. +// // SetPict(GtkButton, "stillImage.png", 32) +// // - With default size, resizing not allowed for GtkSpinButton. +// // SetPict(GtkSpinButton, "stillImage.png") +// func SetPict(iObject, varPath interface{}, options ...interface{}) { +// var err error +// var sze int +// var inPixbuf *gdk.Pixbuf +// var inPixbufAnimation *gdk.PixbufAnimation +// var image *gtk.Image +// var isAnim bool +// pos := gtk.ENTRY_ICON_PRIMARY +// // Options parsing +// var getSizeOrPos = func() { +// switch s := options[0].(type) { +// case int: +// sze = s +// case string: +// if s == "right" { +// pos = gtk.ENTRY_ICON_SECONDARY +// } +// } +// } +// switch len(options) { +// case 1: +// getSizeOrPos() +// case 2: // +// getSizeOrPos() +// isAnim = options[1].(bool) +// } +// if isAnim { // PixbufAnimation case +// if inPixbufAnimation, err = GetPixBufAnimation(varPath); err == nil { +// image, err = gtk.ImageNewFromAnimation(inPixbufAnimation) +// } +// } else { // Pixbuf case +// if inPixbuf, err = GetPixBuf(varPath, sze); err == nil { +// image, err = gtk.ImageNewFromPixbuf(inPixbuf) +// } +// } +// if err != nil { +// if _, err = os.Stat(varPath.(string)); !os.IsNotExist(err) { +// log.Fatalf("SetPict: %v\n%s\n", varPath, err.Error()) +// return +// } +// } +// // Objects parsing +// if image != nil { +// switch object := iObject.(type) { +// case *gtk.Image: // Set Image to GtkImage +// if isAnim { +// object.SetFromAnimation(inPixbufAnimation) +// } else { +// object.SetFromPixbuf(inPixbuf) +// } +// case *gtk.Window: // Set Icon to GtkWindow, No Animate. +// object.SetIcon(inPixbuf) +// case *gtk.Button: // Set Image to GtkButton +// object.SetImage(image) +// object.SetAlwaysShowImage(true) +// case *gtk.ToolButton: // Set Image to GtkToolButton +// object.SetIconWidget(image) +// case *gtk.ToggleButton: // Set Image to GtkToggleButton +// object.SetImage(image) +// object.SetAlwaysShowImage(true) +// case *gtk.SpinButton: // Set Icon to GtkSpinButton. options[0] = "left" or "right", No resize, No Animate. +// object.SetIconFromPixbuf(pos, inPixbuf) +// case *gtk.Box: // Add Image to GtkBox +// object.Add(image) +// } +// } +// return +// } + +// // GetPixBuf: Get gdk.PixBuf from filename or []byte, depending on type +// // size: resize height keeping porportions. 0 = no change +// func GetPixBuf(varPath interface{}, size ...int) (outPixbuf *gdk.Pixbuf, err error) { +// var pixbufLoader *gdk.PixbufLoader +// sze := 0 +// if len(size) != 0 { +// sze = size[0] +// } +// switch varPath.(type) { +// case string: +// outPixbuf, err = gdk.PixbufNewFromFile(varPath.(string)) +// case []uint8: +// if pixbufLoader, err = gdk.PixbufLoaderNew(); err == nil { +// outPixbuf, err = pixbufLoader.WriteAndReturnPixbuf(varPath.([]byte)) +// } +// } +// if err == nil && sze != 0 { +// newWidth, newHeight := NormalizeSize(outPixbuf.GetWidth(), outPixbuf.GetHeight(), sze, 2) +// outPixbuf, err = outPixbuf.ScaleSimple(newWidth, newHeight, gdk.INTERP_BILINEAR) +// } +// return +// } + +// // GetPixBufAnimation: Get gdk.PixBufAnimation from filename or []byte, depending on type +// func GetPixBufAnimation(varPath interface{}) (outPixbufAnimation *gdk.PixbufAnimation, err error) { +// var pixbufLoader *gdk.PixbufLoader +// switch varPath.(type) { +// case string: +// outPixbufAnimation, err = gdk.PixbufAnimationNewFromFile(varPath.(string)) +// case []uint8: +// if pixbufLoader, err = gdk.PixbufLoaderNew(); err == nil { +// outPixbufAnimation, err = pixbufLoader.WriteAndReturnPixbufAnimation(varPath.([]byte)) +// } +// } +// return +// } + +// // NormalizeSize: compute new size with kept proportions based on defined format. +// // format: 0 percent, 1 reducing width, 2 reducing height +// func NormalizeSize(oldWidth, oldHeight, newValue, format int) (outWidth, outHeight int) { +// switch format { +// case 0: // percent +// outWidth = int((float64(oldWidth) * float64(newValue)) / 100) +// outHeight = int((float64(oldHeight) * float64(newValue)) / 100) +// case 1: // Width +// outWidth = newValue +// outHeight = int(float64(oldHeight) * (float64(newValue) / float64(oldWidth))) +// case 2: // Height +// outWidth = int(float64(oldWidth) * (float64(newValue) / float64(oldHeight))) +// outHeight = newValue +// } +// return +// } + +// // ResizeImage: Get Resized gtk.Pixbuff image representation from file or []byte, depending on type +// // interp: 0 GDK_INTERP_NEAREST, 1 GDK_INTERP_TILES, 2 GDK_INTERP_BILINEAR (default), 3 GDK_INTERP_HYPER. +// func ResizeImage(varPath interface{}, width, height int, interp ...int) (outPixbuf *gdk.Pixbuf, err error) { +// interpolation := gdk.INTERP_BILINEAR +// if len(interp) != 0 { +// switch interp[0] { +// case 0: +// interpolation = gdk.INTERP_NEAREST +// case 1: +// interpolation = gdk.INTERP_TILES +// case 3: +// interpolation = gdk.INTERP_HYPER +// } +// } +// if outPixbuf, err = GetPixBuf(varPath); err == nil { +// if width != outPixbuf.GetWidth() || height != outPixbuf.GetHeight() { +// outPixbuf, err = outPixbuf.ScaleSimple(width, height, interpolation) +// } +// } +// return +// } + +// // RotateImage: Rotate by 90,180,270 degres and get gdk.PixBuf image representation from file or []byte, depending on type +// func RotateImage(varPath interface{}, angle gdk.PixbufRotation) (outPixbuf *gdk.Pixbuf, err error) { +// if outPixbuf, err = GetPixBuf(varPath); err == nil { +// switch angle { +// case 90: +// outPixbuf, err = outPixbuf.RotateSimple(gdk.PIXBUF_ROTATE_COUNTERCLOCKWISE) +// case 180: +// outPixbuf, err = outPixbuf.RotateSimple(gdk.PIXBUF_ROTATE_UPSIDEDOWN) +// case 270: +// outPixbuf, err = outPixbuf.RotateSimple(gdk.PIXBUF_ROTATE_CLOCKWISE) +// default: +// return nil, errors.New("Rotation not allowed: " + fmt.Sprintf("%d", angle)) +// } +// } +// return +// } + +// // FlipImage: Get Flipped gdk.PixBuf image representation from file or []byte, depending on type +// func FlipImage(varPath interface{}, horizontal bool) (outPixbuf *gdk.Pixbuf, err error) { +// if outPixbuf, err = GetPixBuf(varPath); err == nil { +// outPixbuf, err = outPixbuf.Flip(horizontal) +// } +// return +// } + +// /* +// Old functions, not used in new programs written and +// will be deleted after updating all other programs +// */ +// // setImage: Set Image to GtkImage objects +// func SetImage(object *gtk.Image, varPath interface{}, size ...int) { +// if inPixbuf, err := GetPixBuf(varPath, size...); err == nil { +// object.SetFromPixbuf(inPixbuf) +// return +// } else if len(varPath.(string)) != 0 { +// fmt.Printf("SetImage: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } + +// // setWinIcon: Set Icon to GtkWindow objects +// func SetWinIcon(object *gtk.Window, varPath interface{}, size ...int) { +// if inPixbuf, err := GetPixBuf(varPath, size...); err == nil { +// object.SetIcon(inPixbuf) +// } else if len(varPath.(string)) != 0 { +// fmt.Printf("SetWinIcon: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } + +// // setButtonImage: Set Icon to GtkButton objects +// func SetButtonImage(object *gtk.Button, varPath interface{}, size ...int) { +// var image *gtk.Image +// inPixbuf, err := GetPixBuf(varPath, size...) +// if err == nil { +// if image, err = gtk.ImageNewFromPixbuf(inPixbuf); err == nil { +// object.SetImage(image) +// object.SetAlwaysShowImage(true) +// return +// } +// } +// if err != nil && len(varPath.(string)) != 0 { +// fmt.Printf("SetButtonImage: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } + +// // setToolButtonImage: Set Icon to GtkToolButton objects +// func SetToolButtonImage(object *gtk.ToolButton, varPath interface{}, size ...int) { +// var image *gtk.Image +// inPixbuf, err := GetPixBuf(varPath, size...) +// if err == nil { +// if image, err = gtk.ImageNewFromPixbuf(inPixbuf); err == nil { +// object.SetIconWidget(image) +// return +// } +// } +// if err != nil && len(varPath.(string)) != 0 { +// fmt.Printf("setToolButtonImage: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } + +// // setToggleButtonImage: Set Icon to GtkToggleButton objects +// func SetToggleButtonImage(object *gtk.ToggleButton, varPath interface{}, size ...int) { +// var image *gtk.Image +// inPixbuf, err := GetPixBuf(varPath, size...) +// if err == nil { +// if image, err = gtk.ImageNewFromPixbuf(inPixbuf); err == nil { +// object.SetImage(image) +// object.SetAlwaysShowImage(true) +// return +// } +// } +// if err != nil && len(varPath.(string)) != 0 { +// fmt.Printf("SetToggleButtonImage: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } + +// // SetSpinButtonImage: Set Icon to GtkSpinButton objects. Position = "left" or "right" +// func SetSpinButtonImage(object *gtk.SpinButton, varPath interface{}, position ...string) { +// var inPixbuf *gdk.Pixbuf +// var err error +// pos := gtk.ENTRY_ICON_PRIMARY +// if len(position) > 0 { +// if position[0] == "right" { +// pos = gtk.ENTRY_ICON_SECONDARY +// } +// } +// if inPixbuf, err = GetPixBuf(varPath); err == nil { +// object.SetIconFromPixbuf(pos, inPixbuf) +// return +// } else if len(varPath.(string)) != 0 { +// fmt.Printf("SetSpinButtonImage: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } + +// // setBoxImage: Set Image to GtkBox objects +// func SetBoxImage(object *gtk.Box, varPath interface{}, size ...int) { +// var image *gtk.Image +// inPixbuf, err := GetPixBuf(varPath, size...) +// if err == nil { +// if image, err = gtk.ImageNewFromPixbuf(inPixbuf); err == nil { +// image.Show() +// object.Add(image) +// return +// } +// } +// if err != nil && len(varPath.(string)) != 0 { +// fmt.Printf("setBoxImage: An error occurred on image: %v\n%s\n", varPath, err.Error()) +// } +// } diff --git a/vendor/github.com/hfmrow/gtk3Import/tools/widgets/widgets.go b/vendor/github.com/hfmrow/gtk3Import/tools/widgets/widgets.go new file mode 100644 index 0000000..1275b1f --- /dev/null +++ b/vendor/github.com/hfmrow/gtk3Import/tools/widgets/widgets.go @@ -0,0 +1,90 @@ +// widgets.go + +/* + Source file auto-generated on Sat, 19 Oct 2019 22:06:16 using Gotk3ObjHandler v1.3.9 ©2018-19 H.F.M + This software use gotk3 that is licensed under the ISC License: + https://github.com/gotk3/gotk3/blob/master/LICENSE + + Copyright ©2019 H.F.M (github.com/hfmrow) + This program comes with absolutely no warranty. See the The MIT License (MIT) for details: + https://opensource.org/licenses/mit-license.php +*/ + +package gtk3Import + +import ( + "reflect" + + "github.com/gotk3/gotk3/gtk" +) + +// WidgetProperties: A convenient structure that implements +// methods to add multiple properties to an object at a time, +// considering a property restriction list that contains +// unauthorized properties for certain types of objects. +type WidgetProperties struct { + properties []widgetProperty + propRestrictions [][]interface{} // List of Property by object that not usable + initialized bool +} +type widgetProperty struct { + Name string + Value interface{} +} + +// PropsToWidget: Apply the properties to the object after filtering +// unauthorized ones. Can be used for independent objects, such as those +// built into an independant box that will be added as a container, to +// the Dialog's list of the main objects. +func (wp *WidgetProperties) PropsToWidget(wdg gtk.IWidget) { + wp.init() + for _, prop := range wp.properties { + for _, obj := range wp.propRestrictions { + if reflect.TypeOf(wdg) == reflect.TypeOf(obj[0]) { + for _, avoidProp := range obj[1:] { + if prop.Name == avoidProp.(string) { + return + } + } + } + } + wdg.Set(prop.Name, prop.Value) + } +} + +// AddPropertyUnallowed: add new unallowed property to the list +// i.e: []interface{}{new(gtk.Image), "justify", "wrap", "pattern", "relief"} +// means that the gtk.Image object cannot handle: +// "justify", "wrap", "pattern", "relief" properties. +func (wp *WidgetProperties) AddPropertyUnallowed(value []interface{}) { + wp.init() + // Add new property for an object to the list that will be applied during control' creation. + wp.propRestrictions = append(wp.propRestrictions, value) +} + +// AddProperty: add new property to the list, will be applied to all parent objects +func (wp *WidgetProperties) AddProperty(name string, value interface{}) { + wp.init() + // Add new property for an object to the list that will be applied during control' creation. + wp.properties = append(wp.properties, widgetProperty{Name: name, Value: value}) +} + +// Reset: user defined lists +func (wp *WidgetProperties) Reset(wdg gtk.IWidget) { + wp.properties = wp.properties[:0] + wp.propRestrictions = wp.propRestrictions[:0] + wp.initialized = false + wp.init() +} + +// init: default unallowed properties for objects +func (wp *WidgetProperties) init() { + if !wp.initialized { + wp.propRestrictions = [][]interface{}{ + {new(gtk.Image), "justify", "wrap", "pattern", "relief"}, + {new(gtk.Separator), "halign", "justify", "wrap", "pattern", "relief"}, + {new(gtk.Calendar), "wrap", "pattern", "relief"}, + {new(gtk.Box), "wrap", "pattern", "relief"}} + wp.initialized = true + } +}