gotk3adapter-master/0000755000000000000000000000000013103122331013422 5ustar rootrootgotk3adapter-master/gtka/0000755000000000000000000000000013103122331014350 5ustar rootrootgotk3adapter-master/gtka/grid.go0000644000000000000000000000110413103122331015620 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gtki" ) type grid struct { *container internal *gtk.Grid } func wrapGridSimple(v *gtk.Grid) *grid { if v == nil { return nil } return &grid{wrapContainerSimple(&v.Container), v} } func wrapGrid(v *gtk.Grid, e error) (*grid, error) { return wrapGridSimple(v), e } func unwrapGrid(v gtki.Grid) *gtk.Grid { if v == nil { return nil } return v.(*grid).internal } func (v *grid) Attach(v1 gtki.Widget, v2, v3, v4, v5 int) { v.internal.Attach(unwrapWidget(v1), v2, v3, v4, v5) } gotk3adapter-master/gtka/text_mark.go0000644000000000000000000000072013103122331016674 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gtki" ) type textMark struct { *gtk.TextMark } func wrapTextMarkSimple(v *gtk.TextMark) *textMark { if v == nil { return nil } return &textMark{v} } func wrapTextMark(v *gtk.TextMark, e error) (*textMark, error) { return wrapTextMarkSimple(v), e } func unwrapTextMark(v gtki.TextMark) *gtk.TextMark { if v == nil { return nil } return v.(*textMark).TextMark } gotk3adapter-master/gtka/real_gtk.go0000644000000000000000000001102713103122331016470 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/glib" "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gdka" "github.com/twstrike/gotk3adapter/gdki" "github.com/twstrike/gotk3adapter/glibi" "github.com/twstrike/gotk3adapter/gtki" ) type RealGtk struct{} var Real = &RealGtk{} func (*RealGtk) AboutDialogNew() (gtki.AboutDialog, error) { return wrapAboutDialog(gtk.AboutDialogNew()) } func (*RealGtk) AccelGroupNew() (gtki.AccelGroup, error) { return wrapAccelGroup(gtk.AccelGroupNew()) } func (*RealGtk) AcceleratorParse(acc string) (uint, gdki.ModifierType) { res, res2 := gtk.AcceleratorParse(acc) return res, gdki.ModifierType(res2) } func (*RealGtk) AddProviderForScreen(s gdki.Screen, provider gtki.StyleProvider, prio uint) { gtk.AddProviderForScreen(gdka.UnwrapScreen(s), unwrapStyleProvider(provider), prio) } func (*RealGtk) ApplicationNew(appId string, flags glibi.ApplicationFlags) (gtki.Application, error) { return wrapApplication(gtk.ApplicationNew(appId, glib.ApplicationFlags(flags))) } func (*RealGtk) AssistantNew() (gtki.Assistant, error) { return wrapAssistant(gtk.AssistantNew()) } func (*RealGtk) BuilderNew() (gtki.Builder, error) { return wrapBuilder(gtk.BuilderNew()) } func (*RealGtk) BuilderNewFromResource(s string) (gtki.Builder, error) { return wrapBuilder(gtk.BuilderNewFromResource(s)) } func (*RealGtk) CellRendererTextNew() (gtki.CellRendererText, error) { return wrapCellRendererText(gtk.CellRendererTextNew()) } func (*RealGtk) CheckButtonNewWithMnemonic(label string) (gtki.CheckButton, error) { return wrapCheckButton(gtk.CheckButtonNewWithMnemonic(label)) } func (*RealGtk) CheckMenuItemNewWithMnemonic(label string) (gtki.CheckMenuItem, error) { return wrapCheckMenuItem(gtk.CheckMenuItemNewWithMnemonic(label)) } func (*RealGtk) CssProviderNew() (gtki.CssProvider, error) { return wrapCssProvider(gtk.CssProviderNew()) } func (*RealGtk) CssProviderGetDefault() (gtki.CssProvider, error) { return wrapCssProvider(gtk.CssProviderGetDefault()) } func (*RealGtk) CssProviderGetNamed(name, variant string) (gtki.CssProvider, error) { return wrapCssProvider(gtk.CssProviderGetNamed(name, variant)) } func (*RealGtk) EntryNew() (gtki.Entry, error) { return wrapEntry(gtk.EntryNew()) } func (*RealGtk) FileChooserDialogNewWith2Buttons(title string, parent gtki.Window, action gtki.FileChooserAction, first_button_text string, first_button_id gtki.ResponseType, second_button_text string, second_button_id gtki.ResponseType) (gtki.FileChooserDialog, error) { return wrapFileChooserDialog(gtk.FileChooserDialogNewWith2Buttons(title, unwrapWindow(parent), gtk.FileChooserAction(action), first_button_text, gtk.ResponseType(first_button_id), second_button_text, gtk.ResponseType(second_button_id))) } func (*RealGtk) Init(args *[]string) { gtk.Init(args) } func (*RealGtk) LabelNew(str string) (gtki.Label, error) { return wrapLabel(gtk.LabelNew(str)) } func unwrapTypes(ts []glibi.Type) []glib.Type { result := make([]glib.Type, len(ts)) for ix, rr := range ts { result[ix] = glib.Type(rr) } return result } func (*RealGtk) ListStoreNew(types ...glibi.Type) (gtki.ListStore, error) { return wrapListStore(gtk.ListStoreNew(unwrapTypes(types)...)) } func (*RealGtk) MenuItemNew() (gtki.MenuItem, error) { return wrapMenuItem(gtk.MenuItemNew()) } func (*RealGtk) MenuItemNewWithMnemonic(label string) (gtki.MenuItem, error) { return wrapMenuItem(gtk.MenuItemNewWithMnemonic(label)) } func (*RealGtk) MenuItemNewWithLabel(label string) (gtki.MenuItem, error) { return wrapMenuItem(gtk.MenuItemNewWithLabel(label)) } func (*RealGtk) MenuNew() (gtki.Menu, error) { return wrapMenu(gtk.MenuNew()) } func (*RealGtk) SeparatorMenuItemNew() (gtki.SeparatorMenuItem, error) { return wrapSeparatorMenuItem(gtk.SeparatorMenuItemNew()) } func (*RealGtk) TextBufferNew(table gtki.TextTagTable) (gtki.TextBuffer, error) { return wrapTextBuffer(gtk.TextBufferNew(unwrapTextTagTable(table))) } func (*RealGtk) TextTagNew(name string) (gtki.TextTag, error) { return wrapTextTag(gtk.TextTagNew(name)) } func (*RealGtk) TextTagTableNew() (gtki.TextTagTable, error) { return wrapTextTagTable(gtk.TextTagTableNew()) } func (*RealGtk) TextViewNew() (gtki.TextView, error) { return wrapTextView(gtk.TextViewNew()) } func (*RealGtk) TreePathNew() gtki.TreePath { var tp gtk.TreePath return wrapTreePathSimple(&tp) } func (*RealGtk) WindowSetDefaultIcon(icon gdki.Pixbuf) { gtk.WindowSetDefaultIcon(gdka.UnwrapPixbuf(icon)) } func (*RealGtk) SettingsGetDefault() (gtki.Settings, error) { return wrapSettings(gtk.SettingsGetDefault()) } gotk3adapter-master/gtka/menu_bar.go0000644000000000000000000000077213103122331016475 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gtki" ) type menuBar struct { *menuShell internal *gtk.MenuBar } func wrapMenuBarSimple(v *gtk.MenuBar) *menuBar { if v == nil { return nil } return &menuBar{wrapMenuShellSimple(&v.MenuShell), v} } func wrapMenuBar(v *gtk.MenuBar, e error) (*menuBar, error) { return wrapMenuBarSimple(v), e } func unwrapMenuBar(v gtki.MenuBar) *gtk.MenuBar { if v == nil { return nil } return v.(*menuBar).internal } gotk3adapter-master/gtka/window.go0000644000000000000000000000343013103122331016206 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gdka" "github.com/twstrike/gotk3adapter/gdki" "github.com/twstrike/gotk3adapter/gtki" ) type window struct { *bin internal *gtk.Window } type asWindow interface { toWindow() *window } func (v *window) toWindow() *window { return v } func wrapWindowSimple(v *gtk.Window) *window { if v == nil { return nil } return &window{wrapBinSimple(&v.Bin), v} } func wrapWindow(v *gtk.Window, e error) (*window, error) { return wrapWindowSimple(v), e } func unwrapWindow(v gtki.Window) *gtk.Window { if v == nil { return nil } return v.(asWindow).toWindow().internal } func (v *window) AddAccelGroup(v2 gtki.AccelGroup) { v.internal.AddAccelGroup(unwrapAccelGroup(v2)) } func (v *window) GetTitle() string { v1, e := v.internal.GetTitle() if e != nil { return "" } return v1 } func (v *window) IsActive() bool { return v.internal.IsActive() } func (v *window) Resize(v1, v2 int) { v.internal.Resize(v1, v2) } func (v *window) SetApplication(v2 gtki.Application) { v.internal.SetApplication(unwrapApplication(v2)) } func (v *window) SetIcon(v2 gdki.Pixbuf) { v.internal.SetIcon(gdka.UnwrapPixbuf(v2)) } func (v *window) SetTitle(v1 string) { v.internal.SetTitle(v1) } func (v *window) SetTitlebar(v2 gtki.Widget) { v.internal.SetTitlebar(unwrapWidget(v2)) } func (v *window) SetTransientFor(v2 gtki.Window) { v.internal.SetTransientFor(unwrapWindow(v2)) } func (v *window) Present() { v.internal.Present() } func (v *window) HasToplevelFocus() bool { return v.internal.HasToplevelFocus() } func (v *window) Fullscreen() { v.internal.Fullscreen() } func (v *window) Unfullscreen() { v.internal.Unfullscreen() } func (v *window) SetUrgencyHint(v1 bool) { v.internal.SetUrgencyHint(v1) } gotk3adapter-master/gtka/assistant.go0000644000000000000000000000251513103122331016713 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gtki" ) type assistant struct { *window internal *gtk.Assistant } func wrapAssistantSimple(v *gtk.Assistant) *assistant { if v == nil { return nil } return &assistant{wrapWindowSimple(&v.Window), v} } func wrapAssistant(v *gtk.Assistant, e error) (*assistant, error) { return wrapAssistantSimple(v), e } func unwrapAssistant(v gtki.Assistant) *gtk.Assistant { if v == nil { return nil } return v.(*assistant).internal } func (a *assistant) Commit() { a.internal.Commit() } func (a *assistant) NextPage() { a.internal.NextPage() } func (a *assistant) PreviousPage() { a.internal.PreviousPage() } func (a *assistant) AppendPage(page gtki.Widget) int { return a.internal.AppendPage(unwrapWidget(page)) } func (a *assistant) SetPageComplete(page gtki.Widget, complete bool) { a.internal.SetPageComplete(unwrapWidget(page), complete) } func (a *assistant) GetPageComplete(page gtki.Widget) bool { return a.internal.GetPageComplete(unwrapWidget(page)) } func (a *assistant) GetCurrentPage() int { return a.internal.GetCurrentPage() } func (a *assistant) SetCurrentPage(pageNum int) { a.internal.SetCurrentPage(pageNum) } func (a *assistant) GetNthPage(pageNum int) (gtki.Widget, error) { return wrapWidget(a.internal.GetNthPage(pageNum)) } gotk3adapter-master/gtka/tree_store.go0000644000000000000000000000333213103122331017053 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gliba" "github.com/twstrike/gotk3adapter/glibi" "github.com/twstrike/gotk3adapter/gtki" ) type treeStore struct { *gliba.Object internal *gtk.TreeStore } func wrapTreeStoreSimple(v *gtk.TreeStore) *treeStore { if v == nil { return nil } return &treeStore{gliba.WrapObjectSimple(v.Object), v} } func wrapTreeStore(v *gtk.TreeStore, e error) (*treeStore, error) { return wrapTreeStoreSimple(v), e } func unwrapTreeStore(v gtki.TreeStore) *gtk.TreeStore { if v == nil { return nil } return v.(*treeStore).internal } func (v *treeStore) GetIter(v1 gtki.TreePath) (gtki.TreeIter, error) { return wrapTreeIter(v.internal.GetIter(unwrapTreePath(v1))) } func (v *treeStore) GetIterFirst() (gtki.TreeIter, bool) { v1, v2 := v.internal.GetIterFirst() return wrapTreeIterSimple(v1), v2 } func (v *treeStore) GetIterFromString(v1 string) (gtki.TreeIter, error) { return wrapTreeIter(v.internal.GetIterFromString(v1)) } func (v *treeStore) GetPath(v1 gtki.TreeIter) (gtki.TreePath, error) { return wrapTreePath(v.internal.GetPath(unwrapTreeIter(v1))) } func (v *treeStore) GetValue(v1 gtki.TreeIter, v2 int) (glibi.Value, error) { return gliba.WrapValue(v.internal.GetValue(unwrapTreeIter(v1), v2)) } func (v *treeStore) IterNext(v1 gtki.TreeIter) bool { return v.internal.IterNext(unwrapTreeIter(v1)) } func (v *treeStore) Append(v1 gtki.TreeIter) gtki.TreeIter { return wrapTreeIterSimple(v.internal.Append(unwrapTreeIter(v1))) } func (v *treeStore) Clear() { v.internal.Clear() } func (v *treeStore) SetValue(v1 gtki.TreeIter, v2 int, v3 interface{}) error { return v.internal.SetValue(unwrapTreeIter(v1), v2, gliba.UnwrapAllGuard(v3)) } gotk3adapter-master/gtka/application_window.go0000644000000000000000000000117513103122331020575 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gtki" ) type applicationWindow struct { *window internal *gtk.ApplicationWindow } func wrapApplicationWindowSimple(v *gtk.ApplicationWindow) *applicationWindow { if v == nil { return nil } return &applicationWindow{wrapWindowSimple(&v.Window), v} } func wrapApplicationWindow(v *gtk.ApplicationWindow, e error) (*applicationWindow, error) { return wrapApplicationWindowSimple(v), e } func unwrapApplicationWindow(v gtki.ApplicationWindow) *gtk.ApplicationWindow { if v == nil { return nil } return v.(*applicationWindow).internal } gotk3adapter-master/gtka/box.go0000644000000000000000000000152313103122331015470 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gtki" ) type box struct { *container internal *gtk.Box } func wrapBoxSimple(v *gtk.Box) *box { if v == nil { return nil } return &box{wrapContainerSimple(&v.Container), v} } func wrapBox(v *gtk.Box, e error) (*box, error) { return wrapBoxSimple(v), e } func unwrapBox(v gtki.Box) *gtk.Box { if v == nil { return nil } return v.(*box).internal } func (v *box) PackEnd(v1 gtki.Widget, v2, v3 bool, v4 uint) { v.internal.PackEnd(unwrapWidget(v1), v2, v3, v4) } func (v *box) PackStart(v1 gtki.Widget, v2, v3 bool, v4 uint) { v.internal.PackStart(unwrapWidget(v1), v2, v3, v4) } func (v *box) SetChildPacking(v1 gtki.Widget, v2, v3 bool, v4 uint, v5 gtki.PackType) { v.internal.SetChildPacking(unwrapWidget(v1), v2, v3, v4, gtk.PackType(v5)) } gotk3adapter-master/gtka/builder.go0000644000000000000000000000216213103122331016326 0ustar rootrootpackage gtka import ( "github.com/gotk3/gotk3/gtk" "github.com/twstrike/gotk3adapter/gliba" "github.com/twstrike/gotk3adapter/glibi" "github.com/twstrike/gotk3adapter/gtki" ) type builder struct { *gliba.Object internal *gtk.Builder } func wrapBuilderSimple(v *gtk.Builder) *builder { if v == nil { return nil } return &builder{gliba.WrapObjectSimple(v.Object), v} } func wrapBuilder(v *gtk.Builder, e error) (*builder, error) { return wrapBuilderSimple(v), e } func unwrapBuilder(v gtki.Builder) *gtk.Builder { if v == nil { return nil } return v.(*builder).internal } func (v *builder) AddFromString(v1 string) error { return v.internal.AddFromString(v1) } func (v *builder) AddFromResource(v1 string) error { return v.internal.AddFromResource(v1) } func (v *builder) GetObject(v1 string) (glibi.Object, error) { vx1, vx2 := v.internal.GetObject(v1) return Wrap(vx1).(glibi.Object), vx2 } func (v *builder) ConnectSignals(v1 map[string]interface{}) { newSignals := make(map[string]interface{}) for k, vv := range v1 { newSignals[k] = gliba.FixupFunction(vv) } v.internal.ConnectSignals(newSignals) } gotk3adapter-master/gtka/gen.rb0000755000000000000000000000223013103122331015446 0ustar rootroot#!/usr/bin/env ruby types = %w[ AboutDialog AccelGroup Application ApplicationWindow Assistant Box Builder Button CellRendererText CellRendererToggle CheckButton CheckMenuItem ComboBox ComboBoxText CssProvider Dialog Entry FileChooserDialog Grid InfoBar Label ListStore Menu MenuBar MenuItem MessageDialog Notebook Revealer ScrolledWindow SeparatorMenuItem TextBuffer TextIter TextTag TextTagTable TextView TreeIter TreePath TreeStore TreeView Widget Window ] class String def underscore self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end end types.each do |tp| lower = tp[0].downcase + tp[1..-1] fname = "#{tp.underscore}.go" File.open(fname, "w") do |ff| ff.puts < true, "int" => true, "string" => true, "rune" => true, } def parse(s) name, args, rets = /^(.*?)\((.*?)\)(?: ?(.*?))$/.match(s).captures { name: name, args: args.split(", "), rets: rets } end def mapType(tt) if $PRIMITIVES[tt] tt else "gtki.#{tt}" end end def singleArgList(arg, ix) argName = "v#{ix+1}" argType = mapType(arg) "#{argName} #{argType}" end def unwrapType(type, name) "unwrap#{type}(#{name})" end def singleCallList(arg, ix) argName = "v#{ix+1}" if $PRIMITIVES[arg] "#{argName}" else unwrapType(arg, argName) end end def argList(args) args.map.with_index { |x, ix| singleArgList(x, ix) }.join(", ") end def returnList(rets) if rets == "" "" else " #{mapType(rets)}" end end def callList(args) args.map.with_index { |x, ix| singleCallList(x, ix) }.join(", ") end def potentialReturnStart(rets) if rets == "" "" else if $PRIMITIVES[rets] "return " else "return wrap#{rets}(" end end end def potentialReturnEnd(rets) if rets == "" "" else if $PRIMITIVES[rets] "" else ")" end end end all.each do |xx| res = parse(xx) puts < Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . gotk3adapter-master/.gitignore0000644000000000000000000000041213103122331015407 0ustar rootroot# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof gotk3adapter-master/glib_mock/0000755000000000000000000000000013103122331015350 5ustar rootrootgotk3adapter-master/glib_mock/mock.go0000644000000000000000000000276013103122331016635 0ustar rootrootpackage glib_mock import "github.com/twstrike/gotk3adapter/glibi" type Mock struct{} func (*Mock) IdleAdd(f interface{}, args ...interface{}) (glibi.SourceHandle, error) { return glibi.SourceHandle(0), nil } func (*Mock) InitI18n(domain string, dir string) { } func (*Mock) Local(vx string) string { return vx } func (*Mock) MainDepth() int { return 0 } func (*Mock) SignalNew(s string) (glibi.Signal, error) { return &MockSignal{}, nil } func (*Mock) SettingsNew(string) glibi.Settings { return nil } func (*Mock) SettingsNewWithPath(string, string) glibi.Settings { return nil } func (*Mock) SettingsNewWithBackend(string, glibi.SettingsBackend) glibi.Settings { return nil } func (*Mock) SettingsNewWithBackendAndPath(string, glibi.SettingsBackend, string) glibi.Settings { return nil } func (*Mock) SettingsNewFull(glibi.SettingsSchema, glibi.SettingsBackend, string) glibi.Settings { return nil } func (*Mock) SettingsSync() { } func (*Mock) SettingsBackendGetDefault() glibi.SettingsBackend { return nil } func (*Mock) KeyfileSettingsBackendNew(string, string, string) glibi.SettingsBackend { return nil } func (*Mock) MemorySettingsBackendNew() glibi.SettingsBackend { return nil } func (*Mock) NullSettingsBackendNew() glibi.SettingsBackend { return nil } func (*Mock) SettingsSchemaSourceGetDefault() glibi.SettingsSchemaSource { return nil } func (*Mock) SettingsSchemaSourceNewFromDirectory(string, glibi.SettingsSchemaSource, bool) glibi.SettingsSchemaSource { return nil } gotk3adapter-master/glib_mock/mock_application.go0000644000000000000000000000023213103122331021210 0ustar rootrootpackage glib_mock type MockApplication struct { MockObject } func (*MockApplication) Quit() {} func (*MockApplication) Run([]string) int { return 0 } gotk3adapter-master/glib_mock/mock_iface_testers.go0000644000000000000000000000072113103122331021530 0ustar rootrootpackage glib_mock import "github.com/twstrike/gotk3adapter/glibi" func init() { glibi.AssertGlib(&Mock{}) glibi.AssertApplication(&MockApplication{}) glibi.AssertObject(&MockObject{}) glibi.AssertSettings(&MockSettings{}) glibi.AssertSettingsBackend(&MockSettingsBackend{}) glibi.AssertSettingsSchema(&MockSettingsSchema{}) glibi.AssertSettingsSchemaSource(&MockSettingsSchemaSource{}) glibi.AssertSignal(&MockSignal{}) glibi.AssertValue(&MockValue{}) } gotk3adapter-master/glib_mock/mock_settings_schema_source.go0000644000000000000000000000051113103122331023445 0ustar rootrootpackage glib_mock import "github.com/twstrike/gotk3adapter/glibi" type MockSettingsSchemaSource struct { } func (*MockSettingsSchemaSource) Ref() glibi.SettingsSchemaSource { return nil } func (*MockSettingsSchemaSource) Unref() {} func (*MockSettingsSchemaSource) Lookup(string, bool) glibi.SettingsSchema { return nil } gotk3adapter-master/glib_mock/mock_settings_schema.go0000644000000000000000000000061513103122331022072 0ustar rootrootpackage glib_mock import "github.com/twstrike/gotk3adapter/glibi" type MockSettingsSchema struct { } func (*MockSettingsSchema) Ref() glibi.SettingsSchema { return nil } func (*MockSettingsSchema) Unref() {} func (*MockSettingsSchema) GetID() string { return "" } func (*MockSettingsSchema) GetPath() string { return "" } func (*MockSettingsSchema) HasKey(string) bool { return false } gotk3adapter-master/glib_mock/mock_settings_backend.go0000644000000000000000000000010313103122331022211 0ustar rootrootpackage glib_mock type MockSettingsBackend struct { MockObject } gotk3adapter-master/glib_mock/mock_settings.go0000644000000000000000000000257413103122331020560 0ustar rootrootpackage glib_mock import "github.com/twstrike/gotk3adapter/glibi" type MockSettings struct { MockObject } func (*MockSettings) IsWritable(string) bool { return false } func (*MockSettings) Delay() { } func (*MockSettings) Apply() { } func (*MockSettings) Revert() { } func (*MockSettings) GetHasUnapplied() bool { return false } func (*MockSettings) GetChild(string) glibi.Settings { return nil } func (*MockSettings) Reset(string) { } func (*MockSettings) ListChildren() []string { return nil } func (*MockSettings) GetBoolean(string) bool { return false } func (*MockSettings) SetBoolean(string, bool) bool { return false } func (*MockSettings) GetInt(string) int { return 0 } func (*MockSettings) SetInt(string, int) bool { return false } func (*MockSettings) GetUInt(string) uint { return 0 } func (*MockSettings) SetUInt(string, uint) bool { return false } func (*MockSettings) GetDouble(string) float64 { return 0 } func (*MockSettings) SetDouble(string, float64) bool { return false } func (*MockSettings) GetString(string) string { return "" } func (*MockSettings) SetString(string, string) bool { return false } func (*MockSettings) GetEnum(string) int { return 0 } func (*MockSettings) SetEnum(string, int) bool { return false } func (*MockSettings) GetFlags(string) uint { return 0 } func (*MockSettings) SetFlags(string, uint) bool { return false } gotk3adapter-master/glib_mock/mock_signal.go0000644000000000000000000000013713103122331020166 0ustar rootrootpackage glib_mock type MockSignal struct{} func (*MockSignal) String() string { return "" } gotk3adapter-master/glib_mock/mock_object.go0000644000000000000000000000120013103122331020147 0ustar rootrootpackage glib_mock import "github.com/twstrike/gotk3adapter/glibi" type MockObject struct{} func (*MockObject) Connect(v1 string, v2 interface{}, v3 ...interface{}) (glibi.SignalHandle, error) { return glibi.SignalHandle(0), nil } func (*MockObject) ConnectAfter(v1 string, v2 interface{}, v3 ...interface{}) (glibi.SignalHandle, error) { return glibi.SignalHandle(0), nil } func (*MockObject) Emit(v1 string, v2 ...interface{}) (interface{}, error) { return nil, nil } func (*MockObject) GetProperty(string) (interface{}, error) { return nil, nil } func (*MockObject) SetProperty(v1 string, v2 interface{}) error { return nil } gotk3adapter-master/glib_mock/mock_value.go0000644000000000000000000000026513103122331020027 0ustar rootrootpackage glib_mock type MockValue struct{} func (*MockValue) GetString() (string, error) { return "", nil } func (*MockValue) GoValue() (interface{}, error) { return nil, nil } gotk3adapter-master/Godeps/0000755000000000000000000000000013103122331014643 5ustar rootrootgotk3adapter-master/Godeps/Readme0000644000000000000000000000021013103122331015754 0ustar rootrootThis directory tree is generated automatically by godep. Please do not edit. See https://github.com/tools/godep for more information. gotk3adapter-master/Godeps/Godeps.json0000644000000000000000000000161013103122331016755 0ustar rootroot{ "ImportPath": "github.com/twstrike/gotk3adapter", "GoVersion": "go1.6", "GodepVersion": "v74", "Packages": [ "./..." ], "Deps": [ { "ImportPath": "github.com/gotk3/gotk3/cairo", "Comment": "GOTK3_0_2_0-517-g3732904", "Rev": "37329043822dea00ae853ce824c3360b0cdf9391" }, { "ImportPath": "github.com/gotk3/gotk3/gdk", "Comment": "GOTK3_0_2_0-517-g3732904", "Rev": "37329043822dea00ae853ce824c3360b0cdf9391" }, { "ImportPath": "github.com/gotk3/gotk3/glib", "Comment": "GOTK3_0_2_0-517-g3732904", "Rev": "37329043822dea00ae853ce824c3360b0cdf9391" }, { "ImportPath": "github.com/gotk3/gotk3/gtk", "Comment": "GOTK3_0_2_0-517-g3732904", "Rev": "37329043822dea00ae853ce824c3360b0cdf9391" }, { "ImportPath": "github.com/gotk3/gotk3/pango", "Comment": "GOTK3_0_2_0-517-g3732904", "Rev": "37329043822dea00ae853ce824c3360b0cdf9391" } ] } gotk3adapter-master/glibi/0000755000000000000000000000000013103122331014510 5ustar rootrootgotk3adapter-master/glibi/value.go0000644000000000000000000000020313103122331016146 0ustar rootrootpackage glibi type Value interface { GetString() (string, error) GoValue() (interface{}, error) } func AssertValue(_ Value) {} gotk3adapter-master/glibi/signal.go0000644000000000000000000000015313103122331016313 0ustar rootrootpackage glibi type Signal interface { String() string } // end of Signal func AssertSignal(_ Signal) {} gotk3adapter-master/glibi/settings_schema_source.go0000644000000000000000000000027513103122331021603 0ustar rootrootpackage glibi type SettingsSchemaSource interface { Ref() SettingsSchemaSource Unref() Lookup(string, bool) SettingsSchema } func AssertSettingsSchemaSource(_ SettingsSchemaSource) {} gotk3adapter-master/glibi/glib.go0000644000000000000000000000156413103122331015762 0ustar rootrootpackage glibi type Glib interface { IdleAdd(interface{}, ...interface{}) (SourceHandle, error) InitI18n(string, string) Local(string) string MainDepth() int SettingsNew(string) Settings SettingsNewWithPath(string, string) Settings SettingsNewWithBackend(string, SettingsBackend) Settings SettingsNewWithBackendAndPath(string, SettingsBackend, string) Settings SettingsNewFull(SettingsSchema, SettingsBackend, string) Settings SettingsSync() SettingsBackendGetDefault() SettingsBackend KeyfileSettingsBackendNew(string, string, string) SettingsBackend MemorySettingsBackendNew() SettingsBackend NullSettingsBackendNew() SettingsBackend SettingsSchemaSourceGetDefault() SettingsSchemaSource SettingsSchemaSourceNewFromDirectory(string, SettingsSchemaSource, bool) SettingsSchemaSource SignalNew(string) (Signal, error) } // end of Glib func AssertGlib(_ Glib) {} gotk3adapter-master/glibi/settings_backend.go0000644000000000000000000000015413103122331020346 0ustar rootrootpackage glibi type SettingsBackend interface { Object } func AssertSettingsBackend(_ SettingsBackend) {} gotk3adapter-master/glibi/settings.go0000644000000000000000000000113213103122331016674 0ustar rootrootpackage glibi type Settings interface { Object IsWritable(string) bool Delay() Apply() Revert() GetHasUnapplied() bool GetChild(string) Settings Reset(string) ListChildren() []string GetBoolean(string) bool SetBoolean(string, bool) bool GetInt(string) int SetInt(string, int) bool GetUInt(string) uint SetUInt(string, uint) bool GetDouble(string) float64 SetDouble(string, float64) bool GetString(string) string SetString(string, string) bool GetEnum(string) int SetEnum(string, int) bool GetFlags(string) uint SetFlags(string, uint) bool } func AssertSettings(_ Settings) {} gotk3adapter-master/glibi/data.go0000644000000000000000000000157313103122331015756 0ustar rootrootpackage glibi type ApplicationFlags int type SignalHandle uint type SourceHandle uint type Type uint var ( APPLICATION_FLAGS_NONE ApplicationFlags APPLICATION_IS_SERVICE ApplicationFlags APPLICATION_HANDLES_OPEN ApplicationFlags APPLICATION_HANDLES_COMMAND_LINE ApplicationFlags APPLICATION_SEND_ENVIRONMENT ApplicationFlags APPLICATION_NON_UNIQUE ApplicationFlags ) var ( TYPE_INVALID Type TYPE_NONE Type TYPE_INTERFACE Type TYPE_CHAR Type TYPE_UCHAR Type TYPE_BOOLEAN Type TYPE_INT Type TYPE_UINT Type TYPE_LONG Type TYPE_ULONG Type TYPE_INT64 Type TYPE_UINT64 Type TYPE_ENUM Type TYPE_FLAGS Type TYPE_FLOAT Type TYPE_DOUBLE Type TYPE_STRING Type TYPE_POINTER Type TYPE_BOXED Type TYPE_PARAM Type TYPE_OBJECT Type TYPE_VARIANT Type ) gotk3adapter-master/glibi/settings_schema.go0000644000000000000000000000026713103122331020224 0ustar rootrootpackage glibi type SettingsSchema interface { Ref() SettingsSchema Unref() GetID() string GetPath() string HasKey(string) bool } func AssertSettingsSchema(_ SettingsSchema) {} gotk3adapter-master/glibi/object.go0000644000000000000000000000053313103122331016306 0ustar rootrootpackage glibi type Object interface { Connect(string, interface{}, ...interface{}) (SignalHandle, error) ConnectAfter(string, interface{}, ...interface{}) (SignalHandle, error) Emit(string, ...interface{}) (interface{}, error) GetProperty(string) (interface{}, error) SetProperty(string, interface{}) error } func AssertObject(_ Object) {} gotk3adapter-master/glibi/application.go0000644000000000000000000000017413103122331017344 0ustar rootrootpackage glibi type Application interface { Object Quit() Run([]string) int } func AssertApplication(_ Application) {} gotk3adapter-master/pangoi/0000755000000000000000000000000013103122331014677 5ustar rootrootgotk3adapter-master/pangoi/pango.go0000644000000000000000000000016713103122331016336 0ustar rootrootpackage pangoi type Pango interface { AsFontDescription(interface{}) FontDescription } func AssertPango(_ Pango) {} gotk3adapter-master/pangoi/font_description.go0000644000000000000000000000016413103122331020600 0ustar rootrootpackage pangoi type FontDescription interface { GetSize() int } func AssertFontDescription(_ FontDescription) {} gotk3adapter-master/pangoi/data.go0000644000000000000000000000024013103122331016133 0ustar rootrootpackage pangoi var ( PANGO_SCALE int ) var ( UNDERLINE_NONE int UNDERLINE_SINGLE int UNDERLINE_DOUBLE int UNDERLINE_LOW int UNDERLINE_ERROR int ) gotk3adapter-master/gtki/0000755000000000000000000000000013103122331014360 5ustar rootrootgotk3adapter-master/gtki/grid.go0000644000000000000000000000016213103122331015633 0ustar rootrootpackage gtki type Grid interface { Container Attach(Widget, int, int, int, int) } func AssertGrid(_ Grid) {} gotk3adapter-master/gtki/text_mark.go0000644000000000000000000000011413103122331016701 0ustar rootrootpackage gtki type TextMark interface{} func AssertTextMark(_ TextMark) {} gotk3adapter-master/gtki/menu_bar.go0000644000000000000000000000012613103122331016476 0ustar rootrootpackage gtki type MenuBar interface { MenuShell } func AssertMenuBar(_ MenuBar) {} gotk3adapter-master/gtki/window.go0000644000000000000000000000065013103122331016217 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/gdki" type Window interface { Bin AddAccelGroup(AccelGroup) GetTitle() string HasToplevelFocus() bool IsActive() bool Fullscreen() Unfullscreen() Present() Resize(int, int) SetApplication(Application) SetIcon(gdki.Pixbuf) SetTitle(string) SetTitlebar(Widget) // Since 3.10 SetTransientFor(Window) SetUrgencyHint(bool) } func AssertWindow(_ Window) {} gotk3adapter-master/gtki/assistant.go0000644000000000000000000000134513103122331016723 0ustar rootrootpackage gtki type Assistant interface { Window GetCurrentPage() int SetCurrentPage(pageNum int) // GetNPages() int GetNthPage(pageNum int) (Widget, error) // PrependPage(page Widget) int AppendPage(page Widget) int // InsertPage(page Widget, position int) int // RemovePage(pageNum int) // SetPageType(page Widget, ptype gtk.AssistantPageType) // GetPageType(page Widget) gtk.AssistantPageType // SetPageTitle(page Widget, title string) // GetPageTitle(page Widget) string SetPageComplete(page Widget, complete bool) GetPageComplete(page Widget) bool // AddActionWidget(child Widget) // RemoveActionWidget(child Widget) // UpdateButtonsState() Commit() NextPage() PreviousPage() } func AssertAssistant(_ Assistant) {} gotk3adapter-master/gtki/tree_store.go0000644000000000000000000000035413103122331017064 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TreeStore interface { glibi.Object TreeModel Append(TreeIter) TreeIter Clear() SetValue(TreeIter, int, interface{}) error } func AssertTreeStore(_ TreeStore) {} gotk3adapter-master/gtki/file_chooser.go0000644000000000000000000000020513103122331017345 0ustar rootrootpackage gtki type FileChooser interface { GetFilename() string SetCurrentName(string) } func AssertFileChooser(_ FileChooser) {} gotk3adapter-master/gtki/application_window.go0000644000000000000000000000016113103122331020577 0ustar rootrootpackage gtki type ApplicationWindow interface { Window } func AssertApplicationWindow(_ ApplicationWindow) {} gotk3adapter-master/gtki/box.go0000644000000000000000000000031013103122331015471 0ustar rootrootpackage gtki type Box interface { Container PackEnd(Widget, bool, bool, uint) PackStart(Widget, bool, bool, uint) SetChildPacking(Widget, bool, bool, uint, PackType) } func AssertBox(_ Box) {} gotk3adapter-master/gtki/builder.go0000644000000000000000000000043013103122331016332 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type Builder interface { glibi.Object AddFromResource(string) error AddFromString(string) error ConnectSignals(map[string]interface{}) GetObject(string) (glibi.Object, error) } func AssertBuilder(_ Builder) {} gotk3adapter-master/gtki/text_tag_table.go0000644000000000000000000000025013103122331017672 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TextTagTable interface { glibi.Object Add(TextTag) } func AssertTextTagTable(_ TextTagTable) {} gotk3adapter-master/gtki/style_provider.go0000644000000000000000000000013313103122331017756 0ustar rootrootpackage gtki type StyleProvider interface{} func AssertStyleProvider(_ StyleProvider) {} gotk3adapter-master/gtki/revealer.go0000644000000000000000000000011413103122331016510 0ustar rootrootpackage gtki type Revealer interface{} func AssertRevealer(_ Revealer) {} gotk3adapter-master/gtki/tree_view.go0000644000000000000000000000042513103122331016701 0ustar rootrootpackage gtki type TreeView interface { Container CollapseRow(TreePath) bool ExpandAll() GetCursor() (TreePath, TreeViewColumn) GetPathAtPos(int, int, TreePath, TreeViewColumn, *int, *int) bool GetSelection() (TreeSelection, error) } func AssertTreeView(_ TreeView) {} gotk3adapter-master/gtki/bin.go0000644000000000000000000000010413103122331015452 0ustar rootrootpackage gtki type Bin interface { Container GetChild() Widget } gotk3adapter-master/gtki/label.go0000644000000000000000000000023113103122331015762 0ustar rootrootpackage gtki type Label interface { Widget GetLabel() string SetLabel(string) SetSelectable(bool) SetText(string) } func AssertLabel(_ Label) {} gotk3adapter-master/gtki/file_chooser_dialog.go0000644000000000000000000000017613103122331020673 0ustar rootrootpackage gtki type FileChooserDialog interface { Dialog FileChooser } func AssertFileChooserDialog(_ FileChooserDialog) {} gotk3adapter-master/gtki/about_dialog.go0000644000000000000000000000031413103122331017336 0ustar rootrootpackage gtki type AboutDialog interface { Dialog SetAuthors([]string) SetProgramName(string) SetVersion(string) SetLicense(string) SetWrapLicense(bool) } func AssertAboutDialog(_ AboutDialog) {} gotk3adapter-master/gtki/accel_group.go0000644000000000000000000000037613103122331017200 0ustar rootrootpackage gtki import ( "github.com/twstrike/gotk3adapter/gdki" "github.com/twstrike/gotk3adapter/glibi" ) type AccelGroup interface { glibi.Object Connect2(uint, gdki.ModifierType, AccelFlags, interface{}) } func AssertAccelGroup(_ AccelGroup) {} gotk3adapter-master/gtki/style_context.go0000644000000000000000000000040513103122331017612 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type StyleContext interface { glibi.Object AddClass(string) AddProvider(StyleProvider, uint) GetProperty2(string, StateFlags) (interface{}, error) } func AssertStyleContext(_ StyleContext) {} gotk3adapter-master/gtki/menu_item.go0000644000000000000000000000021513103122331016667 0ustar rootrootpackage gtki type MenuItem interface { Bin GetLabel() string SetLabel(string) SetSubmenu(Widget) } func AssertMenuItem(_ MenuItem) {} gotk3adapter-master/gtki/tree_path.go0000644000000000000000000000011413103122331016656 0ustar rootrootpackage gtki type TreePath interface{} func AssertTreePath(_ TreePath) {} gotk3adapter-master/gtki/separator_menu_item.go0000644000000000000000000000016313103122331020751 0ustar rootrootpackage gtki type SeparatorMenuItem interface { MenuItem } func AssertSeparatorMenuItem(_ SeparatorMenuItem) {} gotk3adapter-master/gtki/list_store.go0000644000000000000000000000044713103122331017103 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type ListStore interface { glibi.Object TreeModel Append() TreeIter Clear() Remove(TreeIter) bool Set2(TreeIter, []int, []interface{}) error SetValue(TreeIter, int, interface{}) error } func AssertListStore(_ ListStore) {} gotk3adapter-master/gtki/check_menu_item.go0000644000000000000000000000021313103122331020022 0ustar rootrootpackage gtki type CheckMenuItem interface { MenuItem GetActive() bool SetActive(bool) } func AssertCheckMenuItem(_ CheckMenuItem) {} gotk3adapter-master/gtki/settings.go0000644000000000000000000000021513103122331016545 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type Settings interface { glibi.Object } func AssertSettings(_ Settings) {} gotk3adapter-master/gtki/spin_button.go0000644000000000000000000000036113103122331017253 0ustar rootrootpackage gtki type SpinButton interface { Entry GetValueAsInt() int SetValue(float64) GetValue() float64 GetAdjustment() Adjustment SetRange(float64, float64) SetIncrements(float64, float64) } func AssertSpinButton(_ SpinButton) {} gotk3adapter-master/gtki/notebook.go0000644000000000000000000000044313103122331016530 0ustar rootrootpackage gtki type Notebook interface { Container AppendPage(Widget, Widget) int GetCurrentPage() int GetNPages() int GetNthPage(int) (Widget, error) NextPage() PrevPage() SetCurrentPage(int) SetShowTabs(bool) SetTabLabelText(Widget, string) } func AssertNotebook(_ Notebook) {} gotk3adapter-master/gtki/gtk.go0000644000000000000000000000304013103122331015471 0ustar rootrootpackage gtki import ( "github.com/twstrike/gotk3adapter/gdki" "github.com/twstrike/gotk3adapter/glibi" ) type Gtk interface { AboutDialogNew() (AboutDialog, error) AccelGroupNew() (AccelGroup, error) AcceleratorParse(string) (uint, gdki.ModifierType) AddProviderForScreen(gdki.Screen, StyleProvider, uint) ApplicationNew(string, glibi.ApplicationFlags) (Application, error) AssistantNew() (Assistant, error) BuilderNew() (Builder, error) BuilderNewFromResource(string) (Builder, error) CellRendererTextNew() (CellRendererText, error) CheckButtonNewWithMnemonic(string) (CheckButton, error) CheckMenuItemNewWithMnemonic(string) (CheckMenuItem, error) CssProviderNew() (CssProvider, error) CssProviderGetDefault() (CssProvider, error) CssProviderGetNamed(string, string) (CssProvider, error) EntryNew() (Entry, error) FileChooserDialogNewWith2Buttons(string, Window, FileChooserAction, string, ResponseType, string, ResponseType) (FileChooserDialog, error) Init(*[]string) LabelNew(string) (Label, error) ListStoreNew(...glibi.Type) (ListStore, error) MenuItemNew() (MenuItem, error) MenuItemNewWithLabel(string) (MenuItem, error) MenuItemNewWithMnemonic(string) (MenuItem, error) MenuNew() (Menu, error) SeparatorMenuItemNew() (SeparatorMenuItem, error) TextBufferNew(TextTagTable) (TextBuffer, error) TextTagNew(string) (TextTag, error) TextTagTableNew() (TextTagTable, error) TextViewNew() (TextView, error) TreePathNew() TreePath WindowSetDefaultIcon(gdki.Pixbuf) SettingsGetDefault() (Settings, error) } func AssertGtk(_ Gtk) {} gotk3adapter-master/gtki/button.go0000644000000000000000000000011513103122331016217 0ustar rootrootpackage gtki type Button interface { Bin } func AssertButton(_ Button) {} gotk3adapter-master/gtki/editable.go0000644000000000000000000000014113103122331016454 0ustar rootrootpackage gtki type Editable interface { SetEditable(bool) } func AssertEditable(_ Editable) {} gotk3adapter-master/gtki/combo_box_text.go0000644000000000000000000000022113103122331017715 0ustar rootrootpackage gtki type ComboBoxText interface { ComboBox AppendText(string) GetActiveText() string } func AssertComboBoxText(_ ComboBoxText) {} gotk3adapter-master/gtki/dialog.go0000644000000000000000000000017613103122331016152 0ustar rootrootpackage gtki type Dialog interface { Window Run() int SetDefaultResponse(ResponseType) } func AssertDialog(_ Dialog) {} gotk3adapter-master/gtki/entry.go0000644000000000000000000000025413103122331016051 0ustar rootrootpackage gtki type Entry interface { Widget Editable GetText() (string, error) SetHasFrame(bool) SetText(string) SetVisibility(bool) } func AssertEntry(_ Entry) {} gotk3adapter-master/gtki/text_buffer.go0000644000000000000000000000077613103122331017236 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TextBuffer interface { glibi.Object ApplyTagByName(string, TextIter, TextIter) CreateMark(string, TextIter, bool) TextMark Delete(TextIter, TextIter) GetCharCount() int GetEndIter() TextIter GetIterAtMark(TextMark) TextIter GetIterAtOffset(int) TextIter GetLineCount() int GetStartIter() TextIter GetText(TextIter, TextIter, bool) string Insert(TextIter, string) InsertAtCursor(string) } func AssertTextBuffer(_ TextBuffer) {} gotk3adapter-master/gtki/text_iter.go0000644000000000000000000000345213103122331016722 0ustar rootrootpackage gtki type TextIter interface { BackwardChar() bool BackwardChars(int) bool BackwardCursorPosition() bool BackwardCursorPositions(int) bool BackwardLine() bool BackwardLines(int) bool BackwardToTagToggle(TextTag) bool BackwardVisibleCursorPosition() bool BackwardVisibleCursorPositions(int) bool BackwardVisibleLine() bool BackwardVisibleLines(int) bool BeginsTag(TextTag) bool CanInsert(bool) bool Compare(TextIter) int Editable(bool) bool EndsLine() bool EndsSentence() bool EndsTag(TextTag) bool EndsWord() bool Equal(TextIter) bool ForwardChar() bool ForwardChars(int) bool ForwardCursorPosition() bool ForwardCursorPositions(int) bool ForwardLine() bool ForwardLines(int) bool ForwardSentenceEnd() bool ForwardSentenceEnds(int) bool ForwardToEnd() ForwardToLineEnd() bool ForwardToTagToggle(TextTag) bool ForwardVisibleCursorPosition() bool ForwardVisibleCursorPositions(int) bool ForwardVisibleLine() bool ForwardVisibleLines(int) bool ForwardVisibleWordEnd() bool ForwardVisibleWordEnds(v1 int) bool ForwardWordEnd() bool ForwardWordEnds(int) bool GetBuffer() TextBuffer GetBytesInLine() int GetChar() rune GetCharsInLine() int GetLine() int GetLineIndex() int GetLineOffset() int GetOffset() int GetSlice(TextIter) string GetText(TextIter) string GetVisibleLineIndex() int GetVisibleLineOffset() int GetVisibleSlice(TextIter) string GetVisibleText(TextIter) string HasTag(TextTag) bool InRange(TextIter, TextIter) bool InsideSentence() bool InsideWord() bool IsCursorPosition() bool IsEnd() bool IsStart() bool SetLine(int) SetLineIndex(int) SetLineOffset(int) SetOffset(int) SetVisibleLineIndex(int) SetVisibleLineOffset(int) StartsLine() bool StartsSentence() bool StartsWord() bool TogglesTag(TextTag) bool } func AssertTextIter(_ TextIter) {} gotk3adapter-master/gtki/tree_view_column.go0000644000000000000000000000023713103122331020257 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TreeViewColumn interface { glibi.Object } func AssertTreeViewColumn(_ TreeViewColumn) {} gotk3adapter-master/gtki/cell_renderer.go0000644000000000000000000000023113103122331017510 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type CellRenderer interface { glibi.Object } func AssertCellRenderer(_ CellRenderer) {} gotk3adapter-master/gtki/menu.go0000644000000000000000000000031313103122331015650 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/gdki" type Menu interface { MenuShell PopupAtMouseCursor(Menu, MenuItem, int, uint32) PopupAtPointer(gdki.Event) } func AssertMenu(_ Menu) {} gotk3adapter-master/gtki/header_bar.go0000644000000000000000000000016213103122331016762 0ustar rootrootpackage gtki type HeaderBar interface { Container SetSubtitle(string) } func AssertHeaderBar(_ HeaderBar) {} gotk3adapter-master/gtki/message_dialog.go0000644000000000000000000000014513103122331017652 0ustar rootrootpackage gtki type MessageDialog interface { Dialog } func AssertMessageDialog(_ MessageDialog) {} gotk3adapter-master/gtki/data.go0000644000000000000000000000401213103122331015615 0ustar rootrootpackage gtki // AccelFlags is a representation of GTK's GtkAccelFlags type AccelFlags int var ( ACCEL_VISIBLE AccelFlags ACCEL_LOCKED AccelFlags ACCEL_MASK AccelFlags ) // Align is a representation of GTK's GtkAlign. type Align int var ( ALIGN_FILL Align ALIGN_START Align ALIGN_END Align ALIGN_CENTER Align ) // FileChooserAction is a representation of GTK's GtkFileChooserAction. type FileChooserAction int var ( FILE_CHOOSER_ACTION_OPEN FileChooserAction FILE_CHOOSER_ACTION_SAVE FileChooserAction FILE_CHOOSER_ACTION_SELECT_FOLDER FileChooserAction FILE_CHOOSER_ACTION_CREATE_FOLDER FileChooserAction ) // PackType is a representation of GTK's GtkPackType. type PackType int var ( PACK_START PackType PACK_END PackType ) // ResponseType is a representation of GTK's GtkResponseType. type ResponseType int var ( RESPONSE_NONE ResponseType RESPONSE_REJECT ResponseType RESPONSE_ACCEPT ResponseType RESPONSE_DELETE_EVENT ResponseType RESPONSE_OK ResponseType RESPONSE_CANCEL ResponseType RESPONSE_CLOSE ResponseType RESPONSE_YES ResponseType RESPONSE_NO ResponseType RESPONSE_APPLY ResponseType RESPONSE_HELP ResponseType ) // StateFlags is a representation of GTK's GtkStateFlags. type StateFlags int var ( STATE_FLAG_NORMAL StateFlags STATE_FLAG_ACTIVE StateFlags STATE_FLAG_PRELIGHT StateFlags STATE_FLAG_SELECTED StateFlags STATE_FLAG_INSENSITIVE StateFlags STATE_FLAG_INCONSISTENT StateFlags STATE_FLAG_FOCUSED StateFlags STATE_FLAG_BACKDROP StateFlags ) // StyleProviderPriority is a representation of GTK's GtkStyleProviderPriority. type StyleProviderPriority int var ( STYLE_PROVIDER_PRIORITY_FALLBACK StyleProviderPriority STYLE_PROVIDER_PRIORITY_THEME StyleProviderPriority STYLE_PROVIDER_PRIORITY_SETTINGS StyleProviderPriority STYLE_PROVIDER_PRIORITY_APPLICATION StyleProviderPriority STYLE_PROVIDER_PRIORITY_USER StyleProviderPriority ) gotk3adapter-master/gtki/menu_shell.go0000644000000000000000000000015713103122331017045 0ustar rootrootpackage gtki type MenuShell interface { Container Append(MenuItem) } func AssertMenuShell(_ MenuShell) {} gotk3adapter-master/gtki/tree_iter.go0000644000000000000000000000011413103122331016665 0ustar rootrootpackage gtki type TreeIter interface{} func AssertTreeIter(_ TreeIter) {} gotk3adapter-master/gtki/tree_model.go0000644000000000000000000000054113103122331017026 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TreeModel interface { GetIter(TreePath) (TreeIter, error) GetIterFirst() (TreeIter, bool) GetIterFromString(string) (TreeIter, error) GetPath(TreeIter) (TreePath, error) GetValue(TreeIter, int) (glibi.Value, error) IterNext(TreeIter) bool } func AssertTreeModel(_ TreeModel) {} gotk3adapter-master/gtki/widget.go0000644000000000000000000000106613103122331016175 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/gdki" import "github.com/twstrike/gotk3adapter/glibi" type Widget interface { glibi.Object Destroy() GetWindow() (gdki.Window, error) GrabFocus() GetAllocatedHeight() int GetAllocatedWidth() int GetStyleContext() (StyleContext, error) GrabDefault() HasFocus() bool Hide() HideOnDelete() SetHAlign(Align) SetHExpand(bool) SetMarginBottom(int) SetMarginTop(int) SetName(string) SetSensitive(bool) SetSizeRequest(int, int) SetVisible(bool) Show() ShowAll() } func AssertWidget(_ Widget) {} gotk3adapter-master/gtki/scrolled_window.go0000644000000000000000000000020313103122331020100 0ustar rootrootpackage gtki type ScrolledWindow interface { Bin GetVAdjustment() Adjustment } func AssertScrolledWindow(_ ScrolledWindow) {} gotk3adapter-master/gtki/adjustment.go0000644000000000000000000000037313103122331017070 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type Adjustment interface { glibi.Object GetLower() float64 GetPageSize() float64 GetUpper() float64 SetValue(float64) } // end of Adjustment func AssertAdjustment(_ Adjustment) {} gotk3adapter-master/gtki/toggle_button.go0000644000000000000000000000020613103122331017561 0ustar rootrootpackage gtki type ToggleButton interface { Button GetActive() bool SetActive(bool) } func AssertToggleButton(_ ToggleButton) {} gotk3adapter-master/gtki/text_view.go0000644000000000000000000000062713103122331016732 0ustar rootrootpackage gtki type TextView interface { Container BackwardDisplayLine(TextIter) bool BackwardDisplayLineStart(TextIter) bool ForwardDisplayLine(TextIter) bool ForwardDisplayLineEnd(TextIter) bool GetBuffer() (TextBuffer, error) MoveVisually(TextIter, int) bool SetBuffer(TextBuffer) SetCursorVisible(bool) SetEditable(bool) StartsDisplayLine(TextIter) bool } func AssertTextView(_ TextView) {} gotk3adapter-master/gtki/css_provider.go0000644000000000000000000000026313103122331017412 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type CssProvider interface { glibi.Object LoadFromData(string) error } func AssertCssProvider(_ CssProvider) {} gotk3adapter-master/gtki/combo_box.go0000644000000000000000000000031713103122331016657 0ustar rootrootpackage gtki type ComboBox interface { Bin CellLayout GetActive() int GetActiveIter() (TreeIter, error) GetActiveID() string SetActive(int) SetModel(TreeModel) } func AssertComboBox(_ ComboBox) {} gotk3adapter-master/gtki/check_button.go0000644000000000000000000000014513103122331017357 0ustar rootrootpackage gtki type CheckButton interface { ToggleButton } func AssertCheckButton(_ CheckButton) {} gotk3adapter-master/gtki/cell_renderer_toggle.go0000644000000000000000000000017213103122331021055 0ustar rootrootpackage gtki type CellRendererToggle interface { CellRenderer } func AssertCellRendererToggle(_ CellRendererToggle) {} gotk3adapter-master/gtki/info_bar.go0000644000000000000000000000012013103122331016457 0ustar rootrootpackage gtki type InfoBar interface { Box } func AssertInfoBar(_ InfoBar) {} gotk3adapter-master/gtki/cell_layout.go0000644000000000000000000000023413103122331017222 0ustar rootrootpackage gtki type CellLayout interface { AddAttribute(CellRenderer, string, int) PackStart(CellRenderer, bool) } func AssertCellLayout(_ CellLayout) {} gotk3adapter-master/gtki/cell_renderer_text.go0000644000000000000000000000016413103122331020561 0ustar rootrootpackage gtki type CellRendererText interface { CellRenderer } func AssertCellRendererText(_ CellRendererText) {} gotk3adapter-master/gtki/tree_selection.go0000644000000000000000000000036613103122331017720 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TreeSelection interface { glibi.Object GetSelected() (TreeModel, TreeIter, bool) SelectIter(TreeIter) UnselectPath(TreePath) } func AssertTreeSelection(_ TreeSelection) {} gotk3adapter-master/gtki/container.go0000644000000000000000000000012113103122331016663 0ustar rootrootpackage gtki type Container interface { Widget Add(Widget) Remove(Widget) } gotk3adapter-master/gtki/application.go0000644000000000000000000000026613103122331017216 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type Application interface { glibi.Application GetActiveWindow() Window } func AssertApplication(_ Application) {} gotk3adapter-master/gtki/text_tag.go0000644000000000000000000000021213103122331016521 0ustar rootrootpackage gtki import "github.com/twstrike/gotk3adapter/glibi" type TextTag interface { glibi.Object } func AssertTextTag(_ TextTag) {} gotk3adapter-master/README.md0000644000000000000000000000013513103122331014700 0ustar rootroot# gotk3adapter Contains adapters and interfaces for gotk3 in order to make testing possible. gotk3adapter-master/gliba/0000755000000000000000000000000013103122331014500 5ustar rootrootgotk3adapter-master/gliba/value.go0000644000000000000000000000065313103122331016147 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type value struct { *glib.Value } func wrapValueSimple(v *glib.Value) *value { if v == nil { return nil } return &value{v} } func WrapValue(v *glib.Value, e error) (*value, error) { return wrapValueSimple(v), e } func unwrapValue(v glibi.Value) *glib.Value { if v == nil { return nil } return v.(*value).Value } gotk3adapter-master/gliba/signal.go0000644000000000000000000000067413103122331016313 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type signal struct { *glib.Signal } func wrapSignalSimple(s *glib.Signal) *signal { if s == nil { return nil } return &signal{s} } func wrapSignal(s *glib.Signal, e error) (*signal, error) { return wrapSignalSimple(s), nil } func unwrapSignal(v glibi.Signal) *glib.Signal { if v == nil { return nil } return v.(*signal).Signal } gotk3adapter-master/gliba/settings_schema_source.go0000644000000000000000000000155013103122331021570 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type settingsSchemaSource struct { *glib.SettingsSchemaSource } func wrapSettingsSchemaSourceSimple(v *glib.SettingsSchemaSource) *settingsSchemaSource { if v == nil { return nil } return &settingsSchemaSource{v} } func unwrapSettingsSchemaSource(v glibi.SettingsSchemaSource) *glib.SettingsSchemaSource { if v == nil { return nil } return v.(*settingsSchemaSource).SettingsSchemaSource } func (v *settingsSchemaSource) Ref() glibi.SettingsSchemaSource { return wrapSettingsSchemaSourceSimple(v.SettingsSchemaSource.Ref()) } func (v *settingsSchemaSource) Unref() { v.SettingsSchemaSource.Unref() } func (v *settingsSchemaSource) Lookup(v1 string, v2 bool) glibi.SettingsSchema { return wrapSettingsSchemaSimple(v.SettingsSchemaSource.Lookup(v1, v2)) } gotk3adapter-master/gliba/settings_backend.go0000644000000000000000000000074413103122331020343 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type settingsBackend struct { *Object *glib.SettingsBackend } func wrapSettingsBackendSimple(v *glib.SettingsBackend) *settingsBackend { if v == nil { return nil } return &settingsBackend{WrapObjectSimple(v.Object), v} } func unwrapSettingsBackend(v glibi.SettingsBackend) *glib.SettingsBackend { if v == nil { return nil } return v.(*settingsBackend).SettingsBackend } gotk3adapter-master/gliba/settings.go0000644000000000000000000000425513103122331016675 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type settings struct { *Object *glib.Settings } func wrapSettingsSimple(v *glib.Settings) *settings { if v == nil { return nil } return &settings{WrapObjectSimple(v.Object), v} } func unwrapSettings(v glibi.Settings) *glib.Settings { if v == nil { return nil } return v.(*settings).Settings } func (v *settings) IsWritable(v1 string) bool { return v.Settings.IsWritable(v1) } func (v *settings) Delay() { v.Settings.Delay() } func (v *settings) Apply() { v.Settings.Apply() } func (v *settings) Revert() { v.Settings.Revert() } func (v *settings) GetHasUnapplied() bool { return v.Settings.GetHasUnapplied() } func (v *settings) GetChild(v1 string) glibi.Settings { return wrapSettingsSimple(v.Settings.GetChild(v1)) } func (v *settings) Reset(v1 string) { v.Settings.Reset(v1) } func (v *settings) ListChildren() []string { return v.Settings.ListChildren() } func (v *settings) GetBoolean(v1 string) bool { return v.Settings.GetBoolean(v1) } func (v *settings) SetBoolean(v1 string, v2 bool) bool { return v.Settings.SetBoolean(v1, v2) } func (v *settings) GetInt(v1 string) int { return v.Settings.GetInt(v1) } func (v *settings) SetInt(v1 string, v2 int) bool { return v.Settings.SetInt(v1, v2) } func (v *settings) GetUInt(v1 string) uint { return v.Settings.GetUInt(v1) } func (v *settings) SetUInt(v1 string, v2 uint) bool { return v.Settings.SetUInt(v1, v2) } func (v *settings) GetDouble(v1 string) float64 { return v.Settings.GetDouble(v1) } func (v *settings) SetDouble(v1 string, v2 float64) bool { return v.Settings.SetDouble(v1, v2) } func (v *settings) GetString(v1 string) string { return v.Settings.GetString(v1) } func (v *settings) SetString(v1 string, v2 string) bool { return v.Settings.SetString(v1, v2) } func (v *settings) GetEnum(v1 string) int { return v.Settings.GetEnum(v1) } func (v *settings) SetEnum(v1 string, v2 int) bool { return v.Settings.SetEnum(v1, v2) } func (v *settings) GetFlags(v1 string) uint { return v.Settings.GetFlags(v1) } func (v *settings) SetFlags(v1 string, v2 uint) bool { return v.Settings.SetFlags(v1, v2) } gotk3adapter-master/gliba/wrapping.go0000644000000000000000000000571313103122331016664 0ustar rootrootpackage gliba import ( "fmt" "github.com/gotk3/gotk3/glib" ) type Wrapper func(interface{}) (interface{}, bool) type Unwrapper func(interface{}) (interface{}, bool) var wrappers []Wrapper var unwrappers []Unwrapper func AddWrapper(f Wrapper) { wrappers = append(wrappers, f) } func AddUnwrapper(f Unwrapper) { unwrappers = append(unwrappers, f) } func WrapAllGuard(v interface{}) interface{} { vv, ok := WrapAll(v) if !ok { panic(fmt.Sprintf("Unrecognized type of object: %#v", v)) } return vv } func UnwrapAllGuard(v interface{}) interface{} { vv, ok := UnwrapAll(v) if !ok { panic(fmt.Sprintf("Unrecognized type of object: %#v", v)) } return vv } func WrapAll(v interface{}) (interface{}, bool) { for _, w := range wrappers { v1, ok := w(v) if ok { return v1, ok } } return nil, false } func UnwrapAll(v interface{}) (interface{}, bool) { for _, u := range unwrappers { v1, ok := u(v) if ok { return v1, ok } } return nil, false } func init() { AddWrapper(WrapPrimitive) AddWrapper(WrapLocal) AddUnwrapper(UnwrapPrimitive) AddUnwrapper(UnwrapLocal) } func UnwrapPrimitive(v interface{}) (interface{}, bool) { if v == nil { return nil, true } switch e := v.(type) { case bool: return e, true case int8: return e, true case int64: return e, true case int: return e, true case uint8: return e, true case uint64: return e, true case uint: return e, true case float32: return e, true case float64: return e, true case string: return e, true } return nil, false } func WrapPrimitive(v interface{}) (interface{}, bool) { return UnwrapPrimitive(v) } func Wrap(o interface{}) interface{} { v1, ok := WrapLocal(o) if !ok { panic(fmt.Sprintf("Unrecognized type of object: %#v", o)) } return v1 } func Unwrap(o interface{}) interface{} { v1, ok := UnwrapLocal(o) if !ok { panic(fmt.Sprintf("Unrecognized type of object: %#v", o)) } return v1 } func WrapLocal(o interface{}) (interface{}, bool) { switch oo := o.(type) { case *glib.Application: val := WrapApplicationSimple(oo) if val == nil { return nil, true } return val, true case *glib.Object: val := WrapObjectSimple(oo) if val == nil { return nil, true } return val, true case *glib.Signal: val := wrapSignalSimple(oo) if val == nil { return nil, true } return val, true case *glib.Value: val := wrapValueSimple(oo) if val == nil { return nil, true } return val, true } return nil, false } func UnwrapLocal(o interface{}) (interface{}, bool) { switch oo := o.(type) { case *Application: val := unwrapApplication(oo) if val == nil { return nil, true } return val, true case *Object: val := unwrapObject(oo) if val == nil { return nil, true } return val, true case *signal: val := unwrapSignal(oo) if val == nil { return nil, true } return val, true case *value: val := unwrapValue(oo) if val == nil { return nil, true } return val, true } return nil, false } gotk3adapter-master/gliba/glib_iface_testers.go0000644000000000000000000000066113103122331020647 0ustar rootrootpackage gliba import "github.com/twstrike/gotk3adapter/glibi" func init() { glibi.AssertGlib(&RealGlib{}) glibi.AssertApplication(&Application{}) glibi.AssertObject(&Object{}) glibi.AssertSettings(&settings{}) glibi.AssertSettingsBackend(&settingsBackend{}) glibi.AssertSettingsSchema(&settingsSchema{}) glibi.AssertSettingsSchemaSource(&settingsSchemaSource{}) glibi.AssertSignal(&signal{}) glibi.AssertValue(&value{}) } gotk3adapter-master/gliba/data_init.go0000644000000000000000000000330313103122331016762 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) func init() { glibi.APPLICATION_FLAGS_NONE = glibi.ApplicationFlags(glib.APPLICATION_FLAGS_NONE) glibi.APPLICATION_IS_SERVICE = glibi.ApplicationFlags(glib.APPLICATION_IS_SERVICE) glibi.APPLICATION_HANDLES_OPEN = glibi.ApplicationFlags(glib.APPLICATION_HANDLES_OPEN) glibi.APPLICATION_HANDLES_COMMAND_LINE = glibi.ApplicationFlags(glib.APPLICATION_HANDLES_COMMAND_LINE) glibi.APPLICATION_SEND_ENVIRONMENT = glibi.ApplicationFlags(glib.APPLICATION_SEND_ENVIRONMENT) glibi.APPLICATION_NON_UNIQUE = glibi.ApplicationFlags(glib.APPLICATION_NON_UNIQUE) glibi.TYPE_INVALID = glibi.Type(glib.TYPE_INVALID) glibi.TYPE_NONE = glibi.Type(glib.TYPE_NONE) glibi.TYPE_INTERFACE = glibi.Type(glib.TYPE_INTERFACE) glibi.TYPE_CHAR = glibi.Type(glib.TYPE_CHAR) glibi.TYPE_UCHAR = glibi.Type(glib.TYPE_UCHAR) glibi.TYPE_BOOLEAN = glibi.Type(glib.TYPE_BOOLEAN) glibi.TYPE_INT = glibi.Type(glib.TYPE_INT) glibi.TYPE_UINT = glibi.Type(glib.TYPE_UINT) glibi.TYPE_LONG = glibi.Type(glib.TYPE_LONG) glibi.TYPE_ULONG = glibi.Type(glib.TYPE_ULONG) glibi.TYPE_INT64 = glibi.Type(glib.TYPE_INT64) glibi.TYPE_UINT64 = glibi.Type(glib.TYPE_UINT64) glibi.TYPE_ENUM = glibi.Type(glib.TYPE_ENUM) glibi.TYPE_FLAGS = glibi.Type(glib.TYPE_FLAGS) glibi.TYPE_FLOAT = glibi.Type(glib.TYPE_FLOAT) glibi.TYPE_DOUBLE = glibi.Type(glib.TYPE_DOUBLE) glibi.TYPE_STRING = glibi.Type(glib.TYPE_STRING) glibi.TYPE_POINTER = glibi.Type(glib.TYPE_POINTER) glibi.TYPE_BOXED = glibi.Type(glib.TYPE_BOXED) glibi.TYPE_PARAM = glibi.Type(glib.TYPE_PARAM) glibi.TYPE_OBJECT = glibi.Type(glib.TYPE_OBJECT) glibi.TYPE_VARIANT = glibi.Type(glib.TYPE_VARIANT) } gotk3adapter-master/gliba/settings_schema.go0000644000000000000000000000153713103122331020215 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type settingsSchema struct { *glib.SettingsSchema } func wrapSettingsSchemaSimple(v *glib.SettingsSchema) *settingsSchema { if v == nil { return nil } return &settingsSchema{v} } func unwrapSettingsSchema(v glibi.SettingsSchema) *glib.SettingsSchema { if v == nil { return nil } return v.(*settingsSchema).SettingsSchema } func (v *settingsSchema) Ref() glibi.SettingsSchema { return wrapSettingsSchemaSimple(v.SettingsSchema.Ref()) } func (v *settingsSchema) Unref() { v.SettingsSchema.Unref() } func (v *settingsSchema) GetID() string { return v.SettingsSchema.GetID() } func (v *settingsSchema) GetPath() string { return v.SettingsSchema.GetPath() } func (v *settingsSchema) HasKey(v1 string) bool { return v.SettingsSchema.HasKey(v1) } gotk3adapter-master/gliba/object.go0000644000000000000000000000735613103122331016310 0ustar rootrootpackage gliba import ( "reflect" "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type Object struct { *glib.Object } func WrapObjectSimple(v *glib.Object) *Object { if v == nil { return nil } return &Object{v} } func unwrapObject(v glibi.Object) *glib.Object { if v == nil { return nil } return v.(*Object).Object } func FixupArray(v []interface{}) []interface{} { nv := make([]interface{}, len(v)) for ix, vv := range v { nv[ix] = UnwrapAllGuard(vv) } return nv } func fixupReturnValue(v []reflect.Value) interface{} { return UnwrapAllGuard(v[0].Interface()) } func fixupArg(tv reflect.Type, v interface{}) reflect.Value { vvt := reflect.TypeOf(v) switch vvt.Kind() { case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128: if vvt != tv { return reflect.ValueOf(v).Convert(tv) } else { return reflect.ValueOf(v) } default: return reflect.ValueOf(WrapAllGuard(v)) } } func fixupArgs(t reflect.Type, v ...interface{}) []reflect.Value { res := make([]reflect.Value, len(v)) for ix, vv := range v { res[ix] = fixupArg(t.In(ix), vv) } return res } func FixupFunction(v interface{}) interface{} { rf := reflect.ValueOf(v) if rf.Type().Kind() != reflect.Func { panic("We can't fix up something that is not a function") } ni := rf.Type().NumIn() no := rf.Type().NumOut() if ni > 4 { panic("We can't handle more than 4 arguments to a closure") } if no > 1 { panic("We can't handle more than 1 output arguments for a closure") } switch ni { case 0: if no == 0 { return v } else { return func() interface{} { return fixupReturnValue(rf.Call([]reflect.Value{})) } } case 1: if no == 0 { return func(v1 interface{}) { rf.Call(fixupArgs(rf.Type(), v1)) } } else { return func(v1 interface{}) interface{} { return fixupReturnValue(rf.Call(fixupArgs(rf.Type(), v1))) } } case 2: if no == 0 { return func(v1, v2 interface{}) { rf.Call(fixupArgs(rf.Type(), v1, v2)) } } else { return func(v1, v2 interface{}) interface{} { return fixupReturnValue(rf.Call(fixupArgs(rf.Type(), v1, v2))) } } case 3: if no == 0 { return func(v1, v2, v3 interface{}) { rf.Call(fixupArgs(rf.Type(), v1, v2, v3)) } } else { return func(v1, v2, v3 interface{}) interface{} { return fixupReturnValue(rf.Call(fixupArgs(rf.Type(), v1, v2, v3))) } } case 4: if no == 0 { return func(v1, v2, v3, v4 interface{}) { rf.Call(fixupArgs(rf.Type(), v1, v2, v3, v4)) } } else { return func(v1, v2, v3, v4 interface{}) interface{} { return fixupReturnValue(rf.Call(fixupArgs(rf.Type(), v1, v2, v3, v4))) } } } panic("Shouldn't happen") } func (v *Object) Connect(v1 string, v2 interface{}, v3 ...interface{}) (glibi.SignalHandle, error) { nv2 := FixupFunction(v2) vx1, vx2 := v.Object.Connect(v1, nv2, FixupArray(v3)...) return glibi.SignalHandle(vx1), vx2 } func (v *Object) ConnectAfter(v1 string, v2 interface{}, v3 ...interface{}) (glibi.SignalHandle, error) { nv2 := FixupFunction(v2) vx1, vx2 := v.Object.ConnectAfter(v1, nv2, FixupArray(v3)...) return glibi.SignalHandle(vx1), vx2 } func (v *Object) Emit(v1 string, v2 ...interface{}) (interface{}, error) { vx1, vx2 := v.Object.Emit(v1, FixupArray(v2)...) return WrapAllGuard(vx1), vx2 } func (v *Object) GetProperty(v1 string) (interface{}, error) { vx1, vx2 := v.Object.GetProperty(v1) return WrapAllGuard(vx1), vx2 } func (v *Object) SetProperty(v1 string, v2 interface{}) error { return v.Object.SetProperty(v1, WrapAllGuard(v2)) } gotk3adapter-master/gliba/application.go0000644000000000000000000000067013103122331017335 0ustar rootrootpackage gliba import ( "github.com/gotk3/gotk3/glib" "github.com/twstrike/gotk3adapter/glibi" ) type Application struct { *Object *glib.Application } func WrapApplicationSimple(v *glib.Application) *Application { if v == nil { return nil } return &Application{WrapObjectSimple(v.Object), v} } func unwrapApplication(v glibi.Application) *glib.Application { if v == nil { return nil } return v.(*Application).Application } gotk3adapter-master/gliba/real_glib.go0000644000000000000000000000501713103122331016752 0ustar rootrootpackage gliba import "github.com/gotk3/gotk3/glib" import "github.com/twstrike/gotk3adapter/glibi" type RealGlib struct{} var Real = &RealGlib{} func (*RealGlib) IdleAdd(f interface{}, args ...interface{}) (glibi.SourceHandle, error) { res, err := glib.IdleAdd(f, args...) return glibi.SourceHandle(res), err } func (*RealGlib) InitI18n(domain string, dir string) { glib.InitI18n(domain, dir) } func (*RealGlib) Local(v1 string) string { return glib.Local(v1) } func (*RealGlib) MainDepth() int { return glib.MainDepth() } func (*RealGlib) SignalNew(s string) (glibi.Signal, error) { return wrapSignal(glib.SignalNew(s)) } func (*RealGlib) SettingsNew(v1 string) glibi.Settings { return wrapSettingsSimple(glib.SettingsNew(v1)) } func (*RealGlib) SettingsNewWithPath(v1 string, v2 string) glibi.Settings { return wrapSettingsSimple(glib.SettingsNewWithPath(v1, v2)) } func (*RealGlib) SettingsNewWithBackend(v1 string, v2 glibi.SettingsBackend) glibi.Settings { return wrapSettingsSimple(glib.SettingsNewWithBackend(v1, unwrapSettingsBackend(v2))) } func (*RealGlib) SettingsNewWithBackendAndPath(v1 string, v2 glibi.SettingsBackend, v3 string) glibi.Settings { return wrapSettingsSimple(glib.SettingsNewWithBackendAndPath(v1, unwrapSettingsBackend(v2), v3)) } func (*RealGlib) SettingsNewFull(v1 glibi.SettingsSchema, v2 glibi.SettingsBackend, v3 string) glibi.Settings { return wrapSettingsSimple(glib.SettingsNewFull(unwrapSettingsSchema(v1), unwrapSettingsBackend(v2), v3)) } func (*RealGlib) SettingsSync() { glib.SettingsSync() } func (*RealGlib) SettingsBackendGetDefault() glibi.SettingsBackend { return wrapSettingsBackendSimple(glib.SettingsBackendGetDefault()) } func (*RealGlib) KeyfileSettingsBackendNew(v1 string, v2 string, v3 string) glibi.SettingsBackend { return wrapSettingsBackendSimple(glib.KeyfileSettingsBackendNew(v1, v2, v3)) } func (*RealGlib) MemorySettingsBackendNew() glibi.SettingsBackend { return wrapSettingsBackendSimple(glib.MemorySettingsBackendNew()) } func (*RealGlib) NullSettingsBackendNew() glibi.SettingsBackend { return wrapSettingsBackendSimple(glib.NullSettingsBackendNew()) } func (*RealGlib) SettingsSchemaSourceGetDefault() glibi.SettingsSchemaSource { return wrapSettingsSchemaSourceSimple(glib.SettingsSchemaSourceGetDefault()) } func (*RealGlib) SettingsSchemaSourceNewFromDirectory(v1 string, v2 glibi.SettingsSchemaSource, v3 bool) glibi.SettingsSchemaSource { return wrapSettingsSchemaSourceSimple(glib.SettingsSchemaSourceNewFromDirectory(v1, unwrapSettingsSchemaSource(v2), v3)) } gotk3adapter-master/gdki/0000755000000000000000000000000013103122331014340 5ustar rootrootgotk3adapter-master/gdki/window.go0000644000000000000000000000026413103122331016200 0ustar rootrootpackage gdki import "github.com/twstrike/gotk3adapter/glibi" type Window interface { glibi.Object GetDesktop() uint32 MoveToDesktop(uint32) } func AssertWindow(_ Window) {} gotk3adapter-master/gdki/event_button.go0000644000000000000000000000022713103122331017404 0ustar rootrootpackage gdki type EventButton interface { Event Button() uint Time() uint32 X() float64 Y() float64 } func AssertEventButton(_ EventButton) {} gotk3adapter-master/gdki/gdk.go0000644000000000000000000000036013103122331015433 0ustar rootrootpackage gdki type Gdk interface { EventButtonFrom(Event) EventButton EventKeyFrom(Event) EventKey PixbufLoaderNew() (PixbufLoader, error) ScreenGetDefault() (Screen, error) WorkspaceControlSupported() bool } func AssertGdk(_ Gdk) {} gotk3adapter-master/gdki/pixbuf.go0000644000000000000000000000014413103122331016163 0ustar rootrootpackage gdki type Pixbuf interface { SavePNG(string, int) error } func AssertPixbuf(_ Pixbuf) {} gotk3adapter-master/gdki/event_key.go0000644000000000000000000000016313103122331016660 0ustar rootrootpackage gdki type EventKey interface { Event KeyVal() uint State() uint } func AssertEventKey(_ EventKey) {} gotk3adapter-master/gdki/pixbuf_loader.go0000644000000000000000000000036513103122331017516 0ustar rootrootpackage gdki import "github.com/twstrike/gotk3adapter/glibi" type PixbufLoader interface { glibi.Object Close() error GetPixbuf() (Pixbuf, error) SetSize(int, int) Write([]byte) (int, error) } func AssertPixbufLoader(_ PixbufLoader) {} gotk3adapter-master/gdki/event.go0000644000000000000000000000010313103122331016002 0ustar rootrootpackage gdki type Event interface{} func AssertEvent(_ Event) {} gotk3adapter-master/gdki/screen.go0000644000000000000000000000010613103122331016143 0ustar rootrootpackage gdki type Screen interface{} func AssertScreen(_ Screen) {} gotk3adapter-master/gdki/data.go0000644000000000000000000005570513103122331015614 0ustar rootrootpackage gdki // ModifierType is a representation of GDK's GdkModifierType. type ModifierType uint var ( GDK_SHIFT_MASK ModifierType GDK_LOCK_MASK ModifierType GDK_CONTROL_MASK ModifierType GDK_MOD1_MASK ModifierType GDK_MOD2_MASK ModifierType GDK_MOD3_MASK ModifierType GDK_MOD4_MASK ModifierType GDK_MOD5_MASK ModifierType GDK_BUTTON1_MASK ModifierType GDK_BUTTON2_MASK ModifierType GDK_BUTTON3_MASK ModifierType GDK_BUTTON4_MASK ModifierType GDK_BUTTON5_MASK ModifierType GDK_SUPER_MASK ModifierType GDK_HYPER_MASK ModifierType GDK_META_MASK ModifierType GDK_RELEASE_MASK ModifierType GDK_MODIFIER_MASK ModifierType ) var ( KEY_VoidSymbol uint KEY_BackSpace uint KEY_Tab uint KEY_Linefeed uint KEY_Clear uint KEY_Return uint KEY_Pause uint KEY_Scroll_Lock uint KEY_Sys_Req uint KEY_Escape uint KEY_Delete uint KEY_Multi_key uint KEY_Codeinput uint KEY_SingleCandidate uint KEY_MultipleCandidate uint KEY_PreviousCandidate uint KEY_Kanji uint KEY_Muhenkan uint KEY_Henkan_Mode uint KEY_Henkan uint KEY_Romaji uint KEY_Hiragana uint KEY_Katakana uint KEY_Hiragana_Katakana uint KEY_Zenkaku uint KEY_Hankaku uint KEY_Zenkaku_Hankaku uint KEY_Touroku uint KEY_Massyo uint KEY_Kana_Lock uint KEY_Kana_Shift uint KEY_Eisu_Shift uint KEY_Eisu_toggle uint KEY_Kanji_Bangou uint KEY_Zen_Koho uint KEY_Mae_Koho uint KEY_Home uint KEY_Left uint KEY_Up uint KEY_Right uint KEY_Down uint KEY_Prior uint KEY_Page_Up uint KEY_Next uint KEY_Page_Down uint KEY_End uint KEY_Begin uint KEY_Select uint KEY_Print uint KEY_Execute uint KEY_Insert uint KEY_Undo uint KEY_Redo uint KEY_Menu uint KEY_Find uint KEY_Cancel uint KEY_Help uint KEY_Break uint KEY_Mode_switch uint KEY_script_switch uint KEY_Num_Lock uint KEY_KP_Space uint KEY_KP_Tab uint KEY_KP_Enter uint KEY_KP_F1 uint KEY_KP_F2 uint KEY_KP_F3 uint KEY_KP_F4 uint KEY_KP_Home uint KEY_KP_Left uint KEY_KP_Up uint KEY_KP_Right uint KEY_KP_Down uint KEY_KP_Prior uint KEY_KP_Page_Up uint KEY_KP_Next uint KEY_KP_Page_Down uint KEY_KP_End uint KEY_KP_Begin uint KEY_KP_Insert uint KEY_KP_Delete uint KEY_KP_Equal uint KEY_KP_Multiply uint KEY_KP_Add uint KEY_KP_Separator uint KEY_KP_Subtract uint KEY_KP_Decimal uint KEY_KP_Divide uint KEY_KP_0 uint KEY_KP_1 uint KEY_KP_2 uint KEY_KP_3 uint KEY_KP_4 uint KEY_KP_5 uint KEY_KP_6 uint KEY_KP_7 uint KEY_KP_8 uint KEY_KP_9 uint KEY_F1 uint KEY_F2 uint KEY_F3 uint KEY_F4 uint KEY_F5 uint KEY_F6 uint KEY_F7 uint KEY_F8 uint KEY_F9 uint KEY_F10 uint KEY_F11 uint KEY_L1 uint KEY_F12 uint KEY_L2 uint KEY_F13 uint KEY_L3 uint KEY_F14 uint KEY_L4 uint KEY_F15 uint KEY_L5 uint KEY_F16 uint KEY_L6 uint KEY_F17 uint KEY_L7 uint KEY_F18 uint KEY_L8 uint KEY_F19 uint KEY_L9 uint KEY_F20 uint KEY_L10 uint KEY_F21 uint KEY_R1 uint KEY_F22 uint KEY_R2 uint KEY_F23 uint KEY_R3 uint KEY_F24 uint KEY_R4 uint KEY_F25 uint KEY_R5 uint KEY_F26 uint KEY_R6 uint KEY_F27 uint KEY_R7 uint KEY_F28 uint KEY_R8 uint KEY_F29 uint KEY_R9 uint KEY_F30 uint KEY_R10 uint KEY_F31 uint KEY_R11 uint KEY_F32 uint KEY_R12 uint KEY_F33 uint KEY_R13 uint KEY_F34 uint KEY_R14 uint KEY_F35 uint KEY_R15 uint KEY_Shift_L uint KEY_Shift_R uint KEY_Control_L uint KEY_Control_R uint KEY_Caps_Lock uint KEY_Shift_Lock uint KEY_Meta_L uint KEY_Meta_R uint KEY_Alt_L uint KEY_Alt_R uint KEY_Super_L uint KEY_Super_R uint KEY_Hyper_L uint KEY_Hyper_R uint KEY_ISO_Lock uint KEY_ISO_Level2_Latch uint KEY_ISO_Level3_Shift uint KEY_ISO_Level3_Latch uint KEY_ISO_Level3_Lock uint KEY_ISO_Level5_Shift uint KEY_ISO_Level5_Latch uint KEY_ISO_Level5_Lock uint KEY_ISO_Group_Shift uint KEY_ISO_Group_Latch uint KEY_ISO_Group_Lock uint KEY_ISO_Next_Group uint KEY_ISO_Next_Group_Lock uint KEY_ISO_Prev_Group uint KEY_ISO_Prev_Group_Lock uint KEY_ISO_First_Group uint KEY_ISO_First_Group_Lock uint KEY_ISO_Last_Group uint KEY_ISO_Last_Group_Lock uint KEY_ISO_Left_Tab uint KEY_ISO_Move_Line_Up uint KEY_ISO_Move_Line_Down uint KEY_ISO_Partial_Line_Up uint KEY_ISO_Partial_Line_Down uint KEY_ISO_Partial_Space_Left uint KEY_ISO_Partial_Space_Right uint KEY_ISO_Set_Margin_Left uint KEY_ISO_Set_Margin_Right uint KEY_ISO_Release_Margin_Left uint KEY_ISO_Release_Margin_Right uint KEY_ISO_Release_Both_Margins uint KEY_ISO_Fast_Cursor_Left uint KEY_ISO_Fast_Cursor_Right uint KEY_ISO_Fast_Cursor_Up uint KEY_ISO_Fast_Cursor_Down uint KEY_ISO_Continuous_Underline uint KEY_ISO_Discontinuous_Underline uint KEY_ISO_Emphasize uint KEY_ISO_Center_Object uint KEY_ISO_Enter uint KEY_First_Virtual_Screen uint KEY_Prev_Virtual_Screen uint KEY_Next_Virtual_Screen uint KEY_Last_Virtual_Screen uint KEY_Terminate_Server uint KEY_AccessX_Enable uint KEY_AccessX_Feedback_Enable uint KEY_RepeatKeys_Enable uint KEY_SlowKeys_Enable uint KEY_BounceKeys_Enable uint KEY_StickyKeys_Enable uint KEY_MouseKeys_Enable uint KEY_MouseKeys_Accel_Enable uint KEY_Overlay1_Enable uint KEY_Overlay2_Enable uint KEY_AudibleBell_Enable uint KEY_Pointer_Left uint KEY_Pointer_Right uint KEY_Pointer_Up uint KEY_Pointer_Down uint KEY_Pointer_UpLeft uint KEY_Pointer_UpRight uint KEY_Pointer_DownLeft uint KEY_Pointer_DownRight uint KEY_Pointer_Button_Dflt uint KEY_Pointer_Button1 uint KEY_Pointer_Button2 uint KEY_Pointer_Button3 uint KEY_Pointer_Button4 uint KEY_Pointer_Button5 uint KEY_Pointer_DblClick_Dflt uint KEY_Pointer_DblClick1 uint KEY_Pointer_DblClick2 uint KEY_Pointer_DblClick3 uint KEY_Pointer_DblClick4 uint KEY_Pointer_DblClick5 uint KEY_Pointer_Drag_Dflt uint KEY_Pointer_Drag1 uint KEY_Pointer_Drag2 uint KEY_Pointer_Drag3 uint KEY_Pointer_Drag4 uint KEY_Pointer_Drag5 uint KEY_Pointer_EnableKeys uint KEY_Pointer_Accelerate uint KEY_Pointer_DfltBtnNext uint KEY_Pointer_DfltBtnPrev uint KEY_space uint KEY_exclam uint KEY_quotedbl uint KEY_numbersign uint KEY_dollar uint KEY_percent uint KEY_ampersand uint KEY_apostrophe uint KEY_quoteright uint KEY_parenleft uint KEY_parenright uint KEY_asterisk uint KEY_plus uint KEY_comma uint KEY_minus uint KEY_period uint KEY_slash uint KEY_0 uint KEY_1 uint KEY_2 uint KEY_3 uint KEY_4 uint KEY_5 uint KEY_6 uint KEY_7 uint KEY_8 uint KEY_9 uint KEY_colon uint KEY_semicolon uint KEY_less uint KEY_equal uint KEY_greater uint KEY_question uint KEY_at uint KEY_A uint KEY_B uint KEY_C uint KEY_D uint KEY_E uint KEY_F uint KEY_G uint KEY_H uint KEY_I uint KEY_J uint KEY_K uint KEY_L uint KEY_M uint KEY_N uint KEY_O uint KEY_P uint KEY_Q uint KEY_R uint KEY_S uint KEY_T uint KEY_U uint KEY_V uint KEY_W uint KEY_X uint KEY_Y uint KEY_Z uint KEY_bracketleft uint KEY_backslash uint KEY_bracketright uint KEY_asciicircum uint KEY_underscore uint KEY_grave uint KEY_quoteleft uint KEY_a uint KEY_b uint KEY_c uint KEY_d uint KEY_e uint KEY_f uint KEY_g uint KEY_h uint KEY_i uint KEY_j uint KEY_k uint KEY_l uint KEY_m uint KEY_n uint KEY_o uint KEY_p uint KEY_q uint KEY_r uint KEY_s uint KEY_t uint KEY_u uint KEY_v uint KEY_w uint KEY_x uint KEY_y uint KEY_z uint KEY_braceleft uint KEY_bar uint KEY_braceright uint KEY_asciitilde uint KEY_nobreakspace uint KEY_exclamdown uint KEY_cent uint KEY_sterling uint KEY_currency uint KEY_yen uint KEY_brokenbar uint KEY_section uint KEY_diaeresis uint KEY_copyright uint KEY_ordfeminine uint KEY_guillemotleft uint KEY_notsign uint KEY_hyphen uint KEY_registered uint KEY_macron uint KEY_degree uint KEY_plusminus uint KEY_twosuperior uint KEY_threesuperior uint KEY_acute uint KEY_mu uint KEY_paragraph uint KEY_periodcentered uint KEY_cedilla uint KEY_onesuperior uint KEY_masculine uint KEY_guillemotright uint KEY_onequarter uint KEY_onehalf uint KEY_threequarters uint KEY_questiondown uint KEY_Agrave uint KEY_Aacute uint KEY_Acircumflex uint KEY_Atilde uint KEY_Adiaeresis uint KEY_Aring uint KEY_AE uint KEY_Ccedilla uint KEY_Egrave uint KEY_Eacute uint KEY_Ecircumflex uint KEY_Ediaeresis uint KEY_Igrave uint KEY_Iacute uint KEY_Icircumflex uint KEY_Idiaeresis uint KEY_ETH uint KEY_Eth uint KEY_Ntilde uint KEY_Ograve uint KEY_Oacute uint KEY_Ocircumflex uint KEY_Otilde uint KEY_Odiaeresis uint KEY_multiply uint KEY_Oslash uint KEY_Ooblique uint KEY_Ugrave uint KEY_Uacute uint KEY_Ucircumflex uint KEY_Udiaeresis uint KEY_Yacute uint KEY_THORN uint KEY_Thorn uint KEY_ssharp uint KEY_agrave uint KEY_aacute uint KEY_acircumflex uint KEY_atilde uint KEY_adiaeresis uint KEY_aring uint KEY_ae uint KEY_ccedilla uint KEY_egrave uint KEY_eacute uint KEY_ecircumflex uint KEY_ediaeresis uint KEY_igrave uint KEY_iacute uint KEY_icircumflex uint KEY_idiaeresis uint KEY_eth uint KEY_ntilde uint KEY_ograve uint KEY_oacute uint KEY_ocircumflex uint KEY_otilde uint KEY_odiaeresis uint KEY_division uint KEY_oslash uint KEY_ooblique uint KEY_ugrave uint KEY_uacute uint KEY_ucircumflex uint KEY_udiaeresis uint KEY_yacute uint KEY_thorn uint KEY_ydiaeresis uint KEY_Aogonek uint KEY_breve uint KEY_Lstroke uint KEY_Lcaron uint KEY_Sacute uint KEY_Scaron uint KEY_Scedilla uint KEY_Tcaron uint KEY_Zacute uint KEY_Zcaron uint KEY_Zabovedot uint KEY_aogonek uint KEY_ogonek uint KEY_lstroke uint KEY_lcaron uint KEY_sacute uint KEY_caron uint KEY_scaron uint KEY_scedilla uint KEY_tcaron uint KEY_zacute uint KEY_doubleacute uint KEY_zcaron uint KEY_zabovedot uint KEY_Racute uint KEY_Abreve uint KEY_Lacute uint KEY_Cacute uint KEY_Ccaron uint KEY_Eogonek uint KEY_Ecaron uint KEY_Dcaron uint KEY_Dstroke uint KEY_Nacute uint KEY_Ncaron uint KEY_Odoubleacute uint KEY_Rcaron uint KEY_Uring uint KEY_Udoubleacute uint KEY_Tcedilla uint KEY_racute uint KEY_abreve uint KEY_lacute uint KEY_cacute uint KEY_ccaron uint KEY_eogonek uint KEY_ecaron uint KEY_dcaron uint KEY_dstroke uint KEY_nacute uint KEY_ncaron uint KEY_odoubleacute uint KEY_rcaron uint KEY_uring uint KEY_udoubleacute uint KEY_tcedilla uint KEY_abovedot uint KEY_Hstroke uint KEY_Hcircumflex uint KEY_Iabovedot uint KEY_Gbreve uint KEY_Jcircumflex uint KEY_hstroke uint KEY_hcircumflex uint KEY_idotless uint KEY_gbreve uint KEY_jcircumflex uint KEY_Cabovedot uint KEY_Ccircumflex uint KEY_Gabovedot uint KEY_Gcircumflex uint KEY_Ubreve uint KEY_Scircumflex uint KEY_cabovedot uint KEY_ccircumflex uint KEY_gabovedot uint KEY_gcircumflex uint KEY_ubreve uint KEY_scircumflex uint KEY_kra uint KEY_kappa uint KEY_Rcedilla uint KEY_Itilde uint KEY_Lcedilla uint KEY_Emacron uint KEY_Gcedilla uint KEY_Tslash uint KEY_rcedilla uint KEY_itilde uint KEY_lcedilla uint KEY_emacron uint KEY_gcedilla uint KEY_tslash uint KEY_ENG uint KEY_eng uint KEY_Amacron uint KEY_Iogonek uint KEY_Eabovedot uint KEY_Imacron uint KEY_Ncedilla uint KEY_Omacron uint KEY_Kcedilla uint KEY_Uogonek uint KEY_Utilde uint KEY_Umacron uint KEY_amacron uint KEY_iogonek uint KEY_eabovedot uint KEY_imacron uint KEY_ncedilla uint KEY_omacron uint KEY_kcedilla uint KEY_uogonek uint KEY_utilde uint KEY_umacron uint KEY_Wcircumflex uint KEY_wcircumflex uint KEY_Ycircumflex uint KEY_ycircumflex uint KEY_Babovedot uint KEY_babovedot uint KEY_Dabovedot uint KEY_dabovedot uint KEY_Fabovedot uint KEY_fabovedot uint KEY_Mabovedot uint KEY_mabovedot uint KEY_Pabovedot uint KEY_pabovedot uint KEY_Sabovedot uint KEY_sabovedot uint KEY_Tabovedot uint KEY_tabovedot uint KEY_Wgrave uint KEY_wgrave uint KEY_Wacute uint KEY_wacute uint KEY_Wdiaeresis uint KEY_wdiaeresis uint KEY_Ygrave uint KEY_ygrave uint KEY_OE uint KEY_oe uint KEY_Ydiaeresis uint KEY_overline uint ) gotk3adapter-master/gdka/0000755000000000000000000000000013103122331014330 5ustar rootrootgotk3adapter-master/gdka/gdk_iface_testers.go0000644000000000000000000000052413103122331020325 0ustar rootrootpackage gdka import "github.com/twstrike/gotk3adapter/gdki" func init() { gdki.AssertGdk(&RealGdk{}) gdki.AssertEvent(&event{}) gdki.AssertEventButton(&eventButton{}) gdki.AssertEventKey(&eventKey{}) gdki.AssertPixbuf(&pixbuf{}) gdki.AssertPixbufLoader(&pixbufLoader{}) gdki.AssertScreen(&screen{}) gdki.AssertWindow(&window{}) } gotk3adapter-master/gdka/window.go0000644000000000000000000000125713103122331016173 0ustar rootrootpackage gdka import ( "github.com/gotk3/gotk3/gdk" "github.com/twstrike/gotk3adapter/gdki" "github.com/twstrike/gotk3adapter/gliba" ) type window struct { *gliba.Object internal *gdk.Window } func WrapWindowSimple(v *gdk.Window) *window { if v == nil { return nil } return &window{gliba.WrapObjectSimple(v.Object), v} } func WrapWindow(v *gdk.Window, e error) (*window, error) { return WrapWindowSimple(v), e } func UnwrapWindow(v gdki.Window) *gdk.Window { if v == nil { return nil } return v.(*window).internal } func (v *window) GetDesktop() uint32 { return v.internal.GetDesktop() } func (v *window) MoveToDesktop(v1 uint32) { v.internal.MoveToDesktop(v1) } gotk3adapter-master/gdka/event_button.go0000644000000000000000000000077513103122331017404 0ustar rootrootpackage gdka import ( "github.com/gotk3/gotk3/gdk" "github.com/twstrike/gotk3adapter/gdki" ) type eventButton struct { *gdk.EventButton } func wrapEventButtonSimple(v *gdk.EventButton) *eventButton { if v == nil { return nil } return &eventButton{v} } func wrapEventButton(v *gdk.EventButton, e error) (*eventButton, error) { return wrapEventButtonSimple(v), e } func unwrapEventButton(v gdki.EventButton) *gdk.EventButton { if v == nil { return nil } return v.(*eventButton).EventButton } gotk3adapter-master/gdka/event_extra.go0000644000000000000000000000023013103122331017176 0ustar rootrootpackage gdka import "github.com/twstrike/gotk3adapter/gdki" func eventCast(e gdki.Event) *event { if e == nil { return nil } return e.(*event) } gotk3adapter-master/gdka/gen.rb0000755000000000000000000000211313103122331015426 0ustar rootroot#!/usr/bin/env ruby types = %w[ Event EventButton Pixbuf PixbufLoader Screen ] exportedWrap = {} exportedUnwrap = { "Screen" => true, "Pixbuf" => true } class String def underscore self.gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end end types.each do |tp| lower = tp[0].downcase + tp[1..-1] fname = "#{tp.underscore}.go" prefix1 = if exportedWrap[tp] "W" else "w" end prefix2 = if exportedUnwrap[tp] "U" else "u" end File.open(fname, "w") do |ff| ff.puts < "false", "int" => "0", "string" => "\"\"", "rune" => "0", } def parse(s) name, args, rets = /^(.*?)\((.*?)\)(?: ?(.*?))$/.match(s).captures { name: name, args: args.split(", "), rets: rets } end def mapType(tt) if $PRIMITIVES[tt] tt else "gtki.#{tt}" end end def argList(args) args.map{ |x| "#{mapType(x)}" }.join(", ") end def returnList(rets) if rets == "" "" else " #{mapType(rets)}" end end def potentialReturn(rets) if rets == "" "" else if $PRIMITIVES[rets] "return #{$PRIMITIVES[rets]}" else "return nil" end end end all.each do |xx| res = parse(xx) puts <