1"""This package contains data which must be edited by hand when adding new
2   bindings.
3"""
4
5from adaformat import *
6
7# General packages that don't depend on others and must be processed first
8
9enums = ("GtkEnums",
10         "PangoEnums",
11         )
12
13# List of interfaces to bind. These are processed before the widgets themselves
14# These are GIR names
15
16interfaces = (
17    "Actionable",
18    "Activatable",
19    # "AppChooser",
20    "--Atk.ImplementorIface",
21    "Buildable",
22    "CellEditable",
23    "CellLayout",
24    "ColorChooser",
25    "Editable",
26    "FileChooser",
27    "FontChooser",
28    "Icon",
29    "Orientable",
30    "PrintOperationPreview",
31    "RecentChooser",
32    "Scrollable",
33    "StyleProvider",
34    "ToolShell",
35    "TreeDragDest",
36    "TreeDragSource",
37    "TreeSortable",
38    "TreeModel",
39
40    "Action",
41    "ActionGroup",
42    "ActionMap",
43    "--AppInfo",  # Not tested yet, from Gio
44    "--AsyncInitable",  # Not tested yet, from Gio
45    "--AsyncResult",  # Not tested yet, from Gio
46    "--Converter",  # Not tested yet, from Gio
47    "--DBusInterface",  # Not tested yet, from Gio
48    "--DBusObject",  # Not tested yet, from Gio
49    "--DBusObjectManager",  # Not tested yet, from Gio
50    "--DesktopAppInfoLookup",  # Not tested yet, from Gio
51    "--Drive",  # Not tested yet, from Gio
52    "--File",  # Not tested yet, from Gio
53    "--FileDescriptorBased",  # Not tested yet, from Gio
54    "--Initable",  # Not tested yet, from Gio
55    "--LoadableIcon",  # Not tested yet, from Gio
56    "--Mount",  # Not tested yet, from Gio
57    "--NetworkMonitor",  # Not tested yet, from Gio
58    "--PollableInputStream",  # Not tested yet, from Gio
59    "--PollableOutputStream",  # Not tested yet, from Gio
60    "--Proxy",  # Not tested yet, from Gio
61    "--ProxyResolver",  # Not tested yet, from Gio
62    "--RemoteActionGroup",  # Not tested yet, from Gio
63    "--Seekable",  # Not tested yet, from Gio
64    "--SocketConnectable",  # Not tested yet, from Gio
65    "--TlsBackend",  # Not tested yet, from Gio
66    "--TlsClientConnection",  # Not tested yet, from Gio
67    "--TlsFileDatabase",  # Not tested yet, from Gio
68    "--TlsServerConnection",  # Not tested yet, from Gio
69    "--Volume",  # Not tested yet, from Gio
70)
71
72# List of widgets to bind.
73# Contains C type names.
74# Start the name with -- for objects we do not want to bind
75
76binding = ("--GdkAtom",   # No binding necessary, too low-level
77           "GdkCursor",
78           "GdkDevice",
79           "GdkDeviceManager",
80           "GdkDisplay",
81           "GdkDragContext",
82           "GdkEvent",
83           "GdkFrameClock",
84           "GdkFrameTimings",
85           "GdkRGBA",
86           "GdkScreen",
87           "GdkWindow",
88
89           "GApplication",
90           "GApplicationCommandLine",
91           "--GBytes",   # Function returning arrays
92           "--GBufferedInputStream",  # Not tested yet, from Gio
93           "--GBufferedOutputStream",  # Not tested yet, from Gio
94           "GCancellable",
95           "--GCharsetConverter",  # Not tested yet, from Gio
96           "--GConverterInputStream",  # Not tested yet, from Gio
97           "--GConverterOutputStream",  # Not tested yet, from Gio
98           "--GCredentials",  # Not tested yet, from Giov
99           "--GDBusActionGroup",  # Not tested yet, from Gio
100           "--GDBusAnnotationInfo",  # Not tested yet, from Gio
101           "--GDBusArgInfo",  # Not tested yet, from Gio
102           "--GDBusAuthObserver",  # Not tested yet, from Gio
103           "--GDBusConnection",  # Not tested yet, from Gio
104           "--GDBusInterfaceInfo",  # Not tested yet, from Gio
105           "--GDBusInterfaceSkeleton",  # Not tested yet, from Gio
106           "--GDBusMenuModel",  # Not tested yet, from Gio
107           "--GDBusMessage",  # Not tested yet, from Gio
108           "--GDBusMethodInfo",  # Not tested yet, from Gio
109           "--GDBusMethodInvocation",  # Not tested yet, from Gio
110           "--GDBusNodeInfo",  # Not tested yet, from Gio
111           "--GDBusObjectManagerClient",  # Not tested yet, from Gio
112           "--GDBusObjectManagerServer",  # Not tested yet, from Gio
113           "--GDBusObjectProxy",  # Not tested yet, from Gio
114           "--GDBusObjectSkeleton",  # Not tested yet, from Gio
115           "--GDBusPropertyInfo",  # Not tested yet, from Gio
116           "--GDBusProxy",  # Not tested yet, from Gio
117           "--GDBusServer",  # Not tested yet, from Gio
118           "--GDBusSignalInfo",  # Not tested yet, from Gio
119           "--GDataInputStream",  # Not tested yet, from Gio
120           "--GDataOutputStream",  # Not tested yet, from Gio
121           "--GDesktopAppInfo",  # Not tested yet, from Gio
122           "--GEmblem",  # Not tested yet, from Gio
123           "--GEmblemedIcon",  # Not tested yet, from Gio
124           "--GFileAttributeInfoList",  # Not tested yet, from Gio
125           "--GFileAttributeMatcher",  # Not tested yet, from Gio
126           "--GFileEnumerator",  # Not tested yet, from Gio
127           "--GFileIOStream",  # Not tested yet, from Gio
128           "--GFileIcon",  # Not tested yet, from Gio
129           "--GFileInfo",  # Not tested yet, from Gio
130           "--GFileInputStream",  # Not tested yet, from Gio
131           "--GFileMonitor",  # Not tested yet, from Gio
132           "--GFileOutputStream",  # Not tested yet, from Gio
133           "--GFilenameCompleter",  # Not tested yet, from Gio
134           "--GFilterInputStream",  # Not tested yet, from Gio
135           "--GFilterOutputStream",  # Not tested yet, from Gio
136           "--GIOExtension",  # Not tested yet, from Gio
137           "--GIOExtensionPoint",  # Not tested yet, from Gio
138           "--GIOModule",  # Not tested yet, from Gio
139           "--GIOModuleScope",  # Not tested yet, from Gio
140           "--GIOSchedulerJob",  # Not tested yet, from Gio
141           "--GIOStream",  # Not tested yet, from Gio
142           "--GInetAddress",  # Not tested yet, from Gio
143           "--GInetAddressMask",  # Not tested yet, from Gio
144           "--GInetSocketAddress",  # Not tested yet, from Gio
145           "--GInputStream",  # Not tested yet, from Gio
146           "--GMemoryInputStream",  # Not tested yet, from Gio
147           "--GMemoryOutputStream",  # Not tested yet, from Gio
148           "GMenuModel",  # Not tested yet, from Gio
149           "GMenu",  # Not tested yet, from Gio
150           "GMenuAttributeIter",  # Not tested yet, from Gio
151           "GMenuItem",  # Not tested yet, from Gio
152           "GMenuLinkIter",  # Not tested yet, from Gio
153           "--GMountOperation",  # Not tested yet, from Gio
154           "--GNativeVolumeMonitor",  # Not tested yet, from Gio
155           "--GNetworkAddress",  # Not tested yet, from Gio
156           "--GNetworkService",  # Not tested yet, from Gio
157           "GNotification",
158           "--GOutputStream",  # Not tested yet, from Gio
159           "GOptionContext",
160
161           "--GParamSpec",   # Bound manually
162           "--GParamSpecBoolean",   # Bound manually
163           "--GParamSpecBoxed",   # Bound manually
164           "--GParamSpecChar",   # Bound manually
165           "--GParamSpecDouble",   # Bound manually
166           "--GParamSpecEnum",   # Bound manually
167           "--GParamSpecFlags",   # Bound manually
168           "--GParamSpecFloat",   # Bound manually
169           "--GParamSpecGType",   # Bound manually
170           "--GParamSpecInt",   # Bound manually
171           "--GParamSpecInt64",   # Bound manually
172           "--GParamSpecLong",   # Bound manually
173           "--GParamSpecObject",   # Bound manually
174           "--GParamSpecOverride",   # Bound manually
175           "--GParamSpecParam",   # Bound manually
176           "--GParamSpecPointer",   # Bound manually
177           "--GParamSpecPool",   # Bound manually
178           "--GParamSpecString",   # Bound manually
179           "--GParamSpecUChar",   # Bound manually
180           "--GParamSpecUInt",   # Bound manually
181           "--GParamSpecUInt64",   # Bound manually
182           "--GParamSpecULong",   # Bound manually
183           "--GParamSpecUnichar",   # Bound manually
184           "--GParamSpecValueArray",   # Bound manually
185           "--GParamSpecVariant",   # Bound manually
186
187           "--GPermission",  # Not tested yet, from Gio
188           "--GProxyAddress",  # Not tested yet, from Gio
189           "--GProxyAddressEnumerator",  # Not tested yet, from Gio
190           "--GResolver",  # Not tested yet, from Gio
191           "--GResource",  # Not tested yet, from Gio
192           "--GSettings",  # Not tested yet, from Gio
193           "--GSettingsSchema",  # Not tested yet, from Gio
194           "--GSettingsSchemaSource",  # Not tested yet, from Gio
195           "GSimpleAction",
196           "GSimpleActionGroup",
197           "--GSimpleAsyncResult",  # Not tested yet, from Gio
198           "--GSimplePermission",  # Not tested yet, from Gio
199           "--GSocket",  # Not tested yet, from Gio
200           "--GSocketAddress",  # Not tested yet, from Gio
201           "--GSocketAddressEnumerator",  # Not tested yet, from Gio
202           "--GSocketClient",  # Not tested yet, from Gio
203           "--GSocketConnection",  # Not tested yet, from Gio
204           "--GSocketControlMessage",  # Not tested yet, from Gio
205           "--GSocketListener",  # Not tested yet, from Gio
206           "--GSocketService",  # Not tested yet, from Gio
207           "--GSource",   # Manually bound in Glib.Main
208           "--GSrvTarget",  # Not tested yet, from Gio
209           "--GStaticResource",  # Not tested yet, from Gio
210           "GString",
211           "--GTcpConnection",  # Not tested yet, from Gio
212           "--GTcpWrapperConnection",  # Not tested yet, from Gio
213           "--GThemedIcon",  # Not tested yet, from Gio
214           "--GThreadedSocketService",  # Not tested yet, from Gio
215           "--GTlsCertificate",  # Not tested yet, from Gio
216           "--GTlsConnection",  # Not tested yet, from Gio
217           "--GTlsDatabase",  # Not tested yet, from Gio
218           "--GTlsInteraction",  # Not tested yet, from Gio
219           "--GTlsPassword",  # Not tested yet, from Gio
220           "--GUnixConnection",  # Not tested yet, from Gio
221           "--GUnixCredentialsMessage",  # Not tested yet, from Gio
222           "--GUnixFDList",  # Not tested yet, from Gio
223           "--GUnixFDMessage",  # Not tested yet, from Gio
224           "--GUnixInputStream",  # Not tested yet, from Gio
225           "--GUnixMountMonitor",  # Not tested yet, from Gio
226           "--GUnixMountPoint",  # Not tested yet, from Gio
227           "--GUnixOutputStream",  # Not tested yet, from Gio
228           "--GUnixSocketAddress",  # Not tested yet, from Gio
229           "GVariant",
230           "GVariantIter",
231           "GVariantType",
232           "--GVfs",  # Not tested yet, from Gio
233           "--GVolumeMonitor",  # Not tested yet, from Gio
234           "--GZlibCompressor",  # Not tested yet, from Gio
235           "--GZlibDecompressor",  # Not tested yet, from Gio
236
237           "--PangoAttrIterator",
238           "PangoAttrList",
239           "PangoAttribute",
240           "--PangoColor",
241           "PangoContext",
242           "PangoCoverage",
243           "PangoFont",
244           "PangoFontDescription",
245           "PangoFontFace",
246           "PangoFontFamily",
247           "PangoFontMap",
248           "PangoFontMetrics",
249           "PangoFontset",
250           "--PangoGlyphItem",
251           "--PangoGlyphItemIter",
252           "--PangoGlyphString",
253           "--PangoItem",
254           "--PangoRenderer",
255           "--PangoScriptIter",
256           "PangoLanguage",
257           "PangoLayout",
258           "PangoLayoutIter",
259           "PangoLayoutLine",
260           "PangoMatrix",
261           "PangoTabArray",
262
263           "GtkAboutDialog",
264           "GtkAccelGroup",
265           "GtkAccelLabel",
266           "GtkAccelMap",
267           "--GtkAccessible",  # Needs ATK
268           "GtkAction",
269           "GtkActionGroup",
270           "GtkActionBar",
271           "GtkAdjustment",
272           "GtkAlignment",
273           "--GtkAppChooserButton",  # Needs GFile
274           "--GtkAppChooserDialog",  # Needs GFile
275           "--GtkAppChooserWidget",  # Needs GFile
276           "GtkApplication",
277           "GtkApplicationWindow",
278           "GtkArrow",
279           "--GtkArrowAccessible",  # We do not support atk
280           "GtkAspectFrame",
281           "GtkAssistant",
282           "GtkBin",
283           "GtkBindingEntry",
284           "GtkBindingSet",
285           "GtkBorder",
286           "GtkBox",
287           "--GtkBooleanCellAccessible",  # We do not support atk
288           "GtkBuilder",
289           "GtkButton",
290           "--GtkButtonAccessible",  # We do not support atk
291           "GtkButtonBox",
292           "GtkCalendar",
293           "--GtkCellAccessible",  # We do not support atk
294           "GtkCellArea",
295           "GtkCellAreaBox",
296           "--GtkCellAreaClass",
297           "GtkCellAreaContext",
298           "GtkCellRenderer",
299           "GtkCellRendererAccel",
300           "--GtkCellRendererClass",  # Useless in Ada
301           "GtkCellRendererCombo",
302           "GtkCellRendererPixbuf",
303           "GtkCellRendererProgress",
304           "GtkCellRendererSpin",
305           "GtkCellRendererSpinner",
306           "GtkCellRendererText",
307           "GtkCellRendererToggle",
308           "GtkCellView",
309           "GtkCheckButton",
310           "GtkCheckMenuItem",
311           "--GtkCheckMenuItemAccessible",  # We do not support atk
312           "GtkClipboard",
313           "GtkColorButton",
314           "GtkColorChooserDialog",
315           "GtkColorChooserWidget",
316           "GtkColorSelection",
317           "GtkColorSelectionDialog",
318           "GtkComboBox",
319           "--GtkComboBoxAccessible",  # We do not support atk
320           "GtkComboBoxText",
321           "GtkContainer",
322           "--GtkContainerAccessible",  # We do not support atk
323           "--GtkContainerCellAccessible",  # We do not support atk
324           "--GtkContainerClass",
325           "GtkCssProvider",
326           "GtkCssSection",
327           "GtkDialog",
328           "GtkDrawingArea",
329           "GtkEntry",
330           "--GtkEntryAccessible",  # We do not support atk
331           "GtkEntryBuffer",
332           "GtkEntryCompletion",
333           "--GtkEntryIconAccessible",  # We do not support atk
334           "GtkEventBox",
335           "GtkEventController",
336           "GtkExpander",
337           "--GtkExpanderAccessible",  # We do not support atk
338           "GtkFileChooserButton",
339           "GtkFileChooserDialog",
340           "GtkFileChooserWidget",
341           "GtkFileFilter",
342           "GtkFixed",
343           "GtkFlowBox",
344           "--GtkFlowBoxAccessible",  # We do not support atk
345           "GtkFlowBoxChild",
346           "--GtkFlowBoxChildAccessible",  # We do not support atk
347           "GtkFontButton",
348           "GtkFontChooserDialog",
349           "GtkFontChooserWidget",
350           "GtkFontSelection",
351           "GtkFontSelectionDialog",
352           "GtkFrame",
353           "--GtkFrameAccessible",  # We do not support atk
354           "GtkGesture",
355           "GtkGestureDrag",
356           "GtkGestureLongPress",
357           "GtkGestureMultiPress",
358           "GtkGesturePan",
359           "GtkGestureRotate",
360           "GtkGestureSingle",
361           "GtkGestureSwipe",
362           "GtkGestureZoom",
363           "GtkGradient",
364           "GtkGrid",
365           "GtkHandleBox",
366           "GtkHBox",
367           "GtkHButtonBox",
368           "GtkHeaderBar",
369           "GtkHPaned",
370           "GtkHScale",
371           "GtkHScrollbar",
372           "GtkHSeparator",
373           "GtkHSV",
374           "GtkIconFactory",
375           "GtkIconInfo",
376           "GtkIconSet",
377           "GtkIconSource",
378           "GtkIconTheme",
379           "GtkIconView",
380           "--GtkIconViewAccessible",  # We do not support atk
381           "GtkIMContext",
382           "GtkIMContextSimple",
383           "GtkIMMulticontext",
384           "GtkImage",
385           "--GtkImageAccessible",  # We do not support atk
386           "--GtkImageCellAccessible",  # We do not support atk
387           "GtkImageMenuItem",
388           "GtkInfoBar",
389           "GtkInvisible",
390           "GtkLabel",
391           "--GtkLabelAccessible",  # We do not support atk
392           "GtkLayout",
393           "GtkLevelBar",
394           "--GtkLevelBarAccessible",  # We do not support atk
395           "GtkLinkButton",
396           "--GtkLinkButtonAccessible",  # We do not support atk
397           "GtkListBox",
398           "--GtkListBoxAccessible",  # We do not support atk
399           "GtkListBoxRow",
400           "--GtkListBoxRowAccessible",  # We do not support atk
401           "GtkListStore",
402           "--GtkLockButton",  # requires GPermission
403           "--GtkLockButtonAccessible",  # We do not support atk
404           "GtkMain",
405           "GtkMisc",
406           "GtkMenu",
407           "--GtkMenuAccessible",  # We do not support atk
408           "GtkMenuBar",
409           "GtkMenuButton",
410           "--GtkMenuButtonAccessible",  # We do not support atk
411           "GtkMenuItem",
412           "--GtkMenuItemAccessible",  # We do not support atk
413           "GtkMenuShell",
414           "--GtkMenuShellAccessible",  # We do not support atk
415           "GtkMenuToolButton",
416           "GtkMessageDialog",
417           "--GtkMountOperation",  # Requires a lot of GIO
418           "GtkNotebook",
419           "--GtkNotebookAccessible",  # We do not support atk
420           "--GtkNotebookPageAccessible",  # We do not support atk
421           "--GtkNumerableIcon",   # Requires a lot of GIO
422           "GtkOffscreenWindow",
423           "GtkOverlay",
424           "GtkPaned",
425           "--GtkPanedAccessible",  # We do not support atk
426           "GtkPageSetup",
427           "GtkPaperSize",
428           "--GtkPlacesSidebar",  # Requires GFile
429           "GtkPopover",
430           "--GtkPopoverAccessible",  # We do not support atk
431           "GtkPrintContext",
432           "GtkPrintOperation",
433           "GtkPrintSettings",
434           "--GtkPlug",  # X11-specific, no binding
435           "GtkProgressBar",
436           "--GtkProgressBarAccessible",  # We do not support atk
437           "GtkRadioAction",
438           "GtkRadioButton",
439           "--GtkRadioButtonAccessible",  # We do not support atk
440           "GtkRadioMenuItem",
441           "--GtkRadioMenuItemAccessible",  # We do not support atk
442           "GtkRadioToolButton",
443           "GtkRange",
444           "--GtkRangeAccessible",  # We do not support atk
445           "--GtkRcStyle",  # manual binding for these deprecated routines
446           "GtkRecentAction",
447           "GtkRecentChooserDialog",
448           "GtkRecentChooserMenu",
449           "GtkRecentChooserWidget",
450           "GtkRecentFilter",
451           "GtkRecentInfo",
452           "GtkRecentManager",
453           "--GtkRendererCellAccessible",  # We do not support atk
454           "GtkRevealer",
455           "GtkScale",
456           "--GtkScaleAccessible",  # We do not support atk
457           "GtkScaleButton",
458           "--GtkScaleButtonAccessible",  # We do not support atk
459           "GtkSearchBar",
460           "GtkSearchEntry",
461           "GtkSelectionData",
462           "GtkSeparator",
463           "GtkSeparatorMenuItem",
464           "GtkSeparatorToolItem",
465           "GtkSizeGroup",
466           "GtkScrollbar",
467           "GtkScrolledWindow",
468           "--GtkScrolledWindowAccessible",  # We do not support atk
469           "GtkSettings",
470           "--GtkSocket",  # X11-specific, no binding
471           "GtkSpinner",
472           "--GtkSpinnerAccessible",  # We do not support atk
473           "GtkSpinButton",
474           "--GtkSpinButtonAccessible",  # We do not support atk
475           "GtkStack",
476           "GtkStackSwitcher",
477           "GtkStatusbar",
478           "--GtkStatusbarAccessible",  # We do not support atk
479           "GtkStatusIcon",
480           "GtkStockItem",
481           "GtkStyle",
482           "GtkStyleContext",
483           "GtkStyleProperties",
484           "GtkSwitch",
485           "--GtkSwitchAccessible",  # We do not support atk
486           "GtkSymbolicColor",
487           "GtkTable",
488           "GtkTargetEntry",
489           "GtkTargetList",
490           "GtkTearoffMenuItem",
491           "GtkTextAttributes",
492           "GtkTextBuffer",
493           "--GtkTextCellAccessible",  # We do not support atk
494           "GtkTextChildAnchor",
495           "GtkTextIter",
496           "GtkTextMark",
497           "GtkTextTag",
498           "GtkTextTagTable",
499           "GtkTextView",
500           "--GtkTextViewAccessible",  # We do not support atk
501           "GtkThemingEngine",
502           "GtkTreeIter",
503           "GtkTreeModelFilter",
504           "GtkTreeModelSort",
505           "GtkTreePath",
506           "GtkTreeRowReference",
507           "GtkTreeSelection",
508           "GtkTreeStore",
509           "GtkTreeView",
510           "--GtkTreeViewAccessible",  # We do not support atk
511           "GtkTreeViewColumn",
512           "GtkToggleAction",
513           "GtkToggleButton",
514           "--GtkToggleButtonAccessible",  # We do not support atk
515           "GtkToggleToolButton",
516           "GtkToolButton",
517           "GtkToolbar",
518           "GtkToolItem",
519           "GtkToolItemGroup",
520           "GtkTooltip",
521           "GtkToolPalette",
522           "--GtkToplevelAccessible",  # We do not support atk
523           "GtkUIManager",
524           "GtkVBox",
525           "GtkVButtonBox",
526           "GtkVPaned",
527           "GtkVScale",
528           "GtkVScrollbar",
529           "GtkVSeparator",
530           "GtkViewport",
531           "GtkVolumeButton",
532           "GtkWidget",
533           "--GtkWidgetAccessible",  # We do not support atk
534           "GtkWidgetClass",
535           "GtkWindow",
536           "--GtkWindowAccessible",  # We do not support atk
537           "GtkWindowGroup",
538           )
539
540# Handling of functions with user data. The names below are the likely names
541# for callback functions that accept user_data. The GIR file doesn't point to
542# these specific parameters.
543
544user_data_params = ["Data", "Func_Data", "User_Data", "D", "Search_Data"]
545destroy_data_params = ["destroy", "func_notify"]
546
547# Maps c methods to Ada subprograms or enumeration (for docs).
548# All methods that are generated automatically will be added
549# as they are processed.
550
551naming.cname_to_adaname = {
552    "gtk_show_uri":                 "gtk_show_uri()",
553    "gtk_icon_factory_add_default": "Gtk.Icon_Factory.Add_Default",
554    "gtk_icon_factory_add":         "Gtk.Icon_Factory.Add",
555    "gdk_pixbuf_new_from_data":     "Gdk.Pixbuf.Gdk_New_From_Data",
556    "gdk_pixbuf_new_from_file":     "Gdk.Pixbuf.Gdk_New_From_File",
557    "gdk_pixbuf_new_from_xpm_data": "Gdk.Pixbuf.Gdk_New_From_Xpm_Data",
558    "gdk_pixbuf_animation_new_from_file":
559                                    "Gdk.Pixbuf.Gdk_New_From_File",
560    "gdk_pixbuf_new":               "Gdk.Pixbuf.Gdk_New",
561    "gdk_pixbuf_new_subpixbuf":     "Gdk.Pixbuf.Gdk_New_Subpixbuf",
562    "gtk_drag_finish":              "Gtk.Dnd.Finish",
563
564    "TRUE": "True",
565    "FALSE": "False",
566    "NULL": "null",
567
568    "GDK_2BUTTON_PRESS": "Gdk_2button_Press",
569    "GDK_3BUTTON_PRESS": "Gdk_3button_Press",
570    "GDK_EVENT_LAST": None,
571
572    # ??? Doesn't exist
573    "gtk_activatable_get_action": "Gtk.Activatable.Get_Action",
574}
575
576# Maps GIR's "name" to a "c:type". This isn't needed for the classes
577# themselves, since this is automatically read from the GIR file.
578# Mostly used for properties. The values must correspond to entries in
579# self.type_exceptions.
580
581naming.girname_to_ctype = {
582    "GdkPixbuf.Pixbuf":    "GdkPixbuf",
583    "Pango.EllipsizeMode": "PangoEllipsizeMode",
584    "Pango.FontDescription": "PangoFontDescription*",
585    "Pango.AttrList":      "PangoAttrList",
586    "Gio.Action":          "Action",
587    "Gio.ActionGroup":     "ActionGroup",
588    "Gio.ActionMap":       "ActionMap",
589    "Gio.Application":     "GApplication",
590    "Gio.ApplicationCommandLine": "GApplicationCommandLine",
591    "ApplicationCommandLine": "GApplicationCommandLine",
592    "Gio.Icon":            "GIcon*",
593    "GLib.Variant":        "GVariant",
594    "Gdk.Event":           "GdkEvent*",
595    "Gdk.EventButton":     "GdkEventButton*",
596    "Gdk.EventMotion":     "GdkEventMotion*",
597    "Gdk.EventProximity":  "GdkEventProximity*",
598    "Gdk.EventAny":        "GdkEventAny*",
599    "Gdk.EventConfigure":  "GdkEventConfigure*",
600    "Gdk.EventExpose":     "GdkEventExpose*",
601    "Gdk.EventKey":        "GdkEventKey*",
602    "Gdk.EventCrossing":   "GdkEventCrossing*",
603    "Gdk.EventScroll":     "GdkEventScroll*",
604    "Gdk.EventSequence":   "GdkEventSequence*",
605    "Gdk.EventWindowState": "GdkEventWindowState*",
606    "Gdk.EventVisibility":  "GdkEventVisibility*",
607    "Gdk.EventSelection":   "GdkEventSelection*",
608    "Gdk.EventFocus":       "GdkEventFocus*",
609    "Gdk.EventProperty":    "GdkEventProperty*",
610    "Gdk.EventGrabBroken":  "GdkEventGrabBroken*",
611    "Gdk.EventOwnerChange": "GdkEventOwnerChange*",
612    "Gdk.Pixmap":          "GdkPixmap*",
613    "Gdk.Image":           "GdkImage*",
614    "Gdk.DragContext":     "GdkDragContext",
615    "GdkPixbuf.PixbufAnimation": "GdkPixbufAnimation*",
616    "Gdk.Bitmap":          "GdkBitmap*",
617    "Gdk.Color":           "GdkColor*",
618    "Gdk.Screen":          "GdkScreen",
619    "Gdk.RGBA":            "GdkRGBA",
620    "GObject.Object":      "GObject*",
621    "GObject.Closure":     "GClosure*",
622    "cairo.Surface":       "cairo_surface_t*",
623    "cairo.Context":       "cairo_t*",
624    "cairo.RectangleInt":  "cairo_rectangle_int_t*",
625    "ModifierType":        "GdkModifierType",
626    "PropertyState":       "GdkPropertyState",
627    "TreePath":            "GtkTreePath*",
628    "TreeModel":           "GtkTreeModel*",
629    "GObject.InitiallyUnowned": "GObject*",  # An alias
630    "GObject.ParamSpec":   "GParamSpec",
631}
632
633# Naming exceptions. In particular maps Ada keywords.
634
635naming.exceptions = {
636    "Entry": "GEntry",
637    "Type":  "The_Type",
638    "Range": "GRange",
639    "Delay": "The_Delay",
640    "Select": "Gtk_Select",
641    "End":   "The_End",
642    "Return": "Do_Return",
643    "Function": "Func",
644    "Digits": "The_Digits",
645    "Reverse": "Gtk_Reverse",
646    "Raise": "Gdk_Raise",
647    "Use": "GUse",
648    "Uri": "URI",
649    "In": "Gtk_In",
650
651    "Gtk_Imcontext": "Gtk_IM_Context",
652    "Gtk_Imcontext_Simple": "Gtk_IM_Context_Simple",
653    "Gtk_Immulticontext": "Gtk_IM_Multi_Context",
654
655    "Gtk_Uimanager": "Gtk_UI_Manager",
656    "Gicon": "G_Icon",
657}
658
659# Maps C types to type descriptions.
660# All standard widgets will be added automatically. Only special
661# namings are needed here
662
663naming.type_exceptions = {
664    "gboolean":          Enum("Boolean",
665                              "Glib.Properties.Property_Boolean"),
666    "gdouble":  Proxy("Gdouble", "Glib.Properties.Property_Double"),
667    "double":   Proxy("Gdouble", "Glib.Properties.Property_Double"),
668    "gshort":   Proxy("Gshort",  "Glib.Properties.Property_Int"),
669    "int":      Proxy("Gint",    "Glib.Properties.Property_Int"),
670    "gint":     Proxy("Gint",    "Glib.Properties.Property_Int",
671                      default_record_field="0"),
672    "gint8":    Proxy("Gint8",   "Glib.Properties.Property_Int"),
673    "gint16":   Proxy("Gint16",  "Glib.Properties.Property_Int"),
674    "gint32":   Proxy("Gint32",  "Glib.Properties.Property_Int"),
675    "gint64":   Proxy("Gint64",  "Glib.Properties.Property_Int"),
676    "guint":    Proxy("Guint",   "Glib.Properties.Property_Uint"),
677    "guint8":   Proxy("Guint8",  "Glib.Properties.Property_Uint"),
678    "guint16":  Proxy("Guint16", "Glib.Properties.Property_Uint"),
679    "guint32":  Proxy("Guint32", "Glib.Properties.Property_Uint"),
680    "guint64":  Proxy("Guint64", "Glib.Properties.Property_Uint"),
681    "gfloat":   Proxy("Gfloat",  "Glib.Properties.Property_Float"),
682    "glong":    Proxy("Glong",   "Glib.Properties.Property_Long"),
683    "gulong":   Proxy("Gulong"),
684    "gsize":    Proxy("Gsize"),
685    "gssize":   Proxy("Gssize"),
686    "gunichar": Proxy("Gunichar"),
687    "gchar":    Proxy("Gchar"),
688    "guchar":   Proxy("Guchar"),
689    "GAppInfo": Proxy("Glib.GApp_Info"),
690
691    # These should not be necessary, but if we don't put them the gnerated
692    # binding is wrong (for instance we end up passing Gdk_Event_Record as
693    # parameters to functions, or Gdk_RGBA directly to C)
694    "GdkRGBA":  Record("Gdk.RGBA.Gdk_RGBA",  # impose casing
695                       "Gdk.RGBA.Property_RGBA"),
696    "GdkRGBA*":  Proxy("Gdk.RGBA.Gdk_RGBA", "Gdk.RGBA.Property_RGBA",
697                       "Gdk.RGBA.Gdk_RGBA_Or_Null"),
698    "GdkEvent*": Proxy("Gdk.Event.Gdk_Event", ""),
699
700    "cairo_t*":              Proxy("Cairo.Cairo_Context"),
701    "cairo_format_t":        Proxy("Cairo.Cairo_Format"),
702    "cairo_rectangle_int_t*": Proxy("Cairo.Region.Cairo_Rectangle_Int"),
703    "cairo_content_t":       Proxy("Cairo.Cairo_Content"),
704    "cairo_pattern_t*":      Proxy("Cairo.Cairo_Pattern"),
705    "cairo_surface_t*":      Proxy("Cairo.Cairo_Surface"),
706    "cairo_region_t*":       Proxy("Cairo.Region.Cairo_Region"),
707    "cairo_font_options_t":  Proxy("Cairo.Cairo_Font_Options"),
708
709    "GtkWidgetClass":    Proxy("Glib.Object.GObject_Class"),
710    "GtkWidgetClass*":   Proxy("Glib.Object.GObject_Class"),
711
712    # Force mapping to a Proxy. This is also hard-coded in GITClass.__init__
713    "PangoFontDescription": Proxy("Pango.Font.Pango_Font_Description",
714                                  "Pango.Font.Property_Font_Description"),
715    "PangoFontDescription*": Proxy("Pango.Font.Pango_Font_Description",
716                                   "Pango.Font.Property_Font_Description"),
717    "GtkTreeIter*":    Record("Gtk.Tree_Model.Gtk_Tree_Iter",
718                              val_or_null="Iter_Or_Null"),
719    "GtkTextIter*":    Record("Gtk.Text_Iter.Gtk_Text_Iter",
720                              val_or_null="Iter_Or_Null"),
721    "PangoAttribute": Proxy("Pango.Attributes.Pango_Attribute"),
722    "PangoAttribute*": Proxy("Pango.Attributes.Pango_Attribute"),
723
724    "GError*":           Proxy("Glib.Error.GError"),
725    "GObject*":          GObject("Glib.Object.GObject"),
726    "GClosure*":         Proxy("System.Address", ""),
727    "GInitiallyUnowned": GObject("Glib.Object.GInitiallyUnowned"),
728    "GIcon*":            Proxy("Glib.G_Icon.G_Icon"),
729    "GValue":            Proxy("Glib.Values.GValue", ""),
730    "GdkAtom":           Proxy("Gdk.Types.Gdk_Atom"),
731    "GVariantType":      Proxy("Glib.Variant.Gvariant_Type"),
732    "GVariantType*":     Proxy("Glib.Variant.Gvariant_Type"),
733    "GVariantIter":      Proxy("Glib.Variant.Gvariant_Iter"),
734
735    # Proper generation of lists
736    "GdkEventSequence":  Proxy("Gdk.Event.Gdk_Event_Sequence"),
737
738    # Specific to this binding generator (referenced from binding.xml)
739    "VisualList":  List("Gdk.Visual.Gdk_Visual_List.Glist"),
740    "ObjectList":  List("Glib.Object.Object_Simple_List.Glist"),
741    "ObjectSList": List("Glib.Object.Object_List.GSlist"),
742    "StringList":  List("Gtk.Enums.String_List.Glist"),
743    "StringSList": List("Gtk.Enums.String_SList.GSlist"),
744    "TreePathList": List("Gtk.Tree_Model.Gtk_Tree_Path_List.Glist"),
745    "TextTagList": List("Gtk.Text_Tag.Text_Tag_List.GSlist"),
746    "DeviceList": List("Gdk.Device.Device_List.Glist"),
747
748    "gpointer":       Proxy("System.Address", "",
749                            default_record_field="System.Null_Address"),
750    "GDestroyNotify": Proxy("Glib.G_Destroy_Notify_Address"),
751    "GQuark":        Proxy("Glib.GQuark"),
752    "GObject":       Proxy("Glib.Object.GObject"),
753    "GParamSpec":    Proxy("Glib.Param_Spec"),
754    "GClosure":      Proxy("GClosure"),
755    "GConnectFlags": Proxy("Glib.G_Connect_Flags"),
756    "GSource":       Proxy("Glib.Main.G_Source"),
757
758    "WidgetPath*":     Proxy("Gtk.Widget.Widget_Path"),
759
760    # ??? Shouldn't we use a naming exception instead ?
761    "GtkStatusbar":    GObject("Gtk.Status_Bar.Gtk_Status_Bar"),
762
763    "GtkRcStyle":      GObject("Gtk.Rc.Gtk_Rc_Style"),
764
765    "GtkTreeViewRowSeparatorFunc":
766        Callback("Gtk.Tree_View.Gtk_Tree_View_Row_Separator_Func"),
767
768    "GKeyFile*":           Proxy("Glib.Key_File.G_Key_File"),
769
770    "GdkColor*": Proxy("Gdk.Color.Gdk_Color",
771                       "Gdk.Color.Property_Gdk_Color",
772                       "Gdk.Color.Gdk_Color_Or_Null"),
773    "GdkDragContext":     GObject("Gdk.Drag_Contexts.Drag_Context"),
774    "GdkFont":            Proxy("Gdk.Font.Gdk_Font"),
775    "GdkVisual*":         Proxy("Gdk.Visual.Gdk_Visual"),
776    "GdkPixmap*":         Proxy("Gdk.Pixmap.Gdk_Pixmap"),
777    "GdkBitmap*":         Proxy("Gdk.Bitmap.Gdk_Bitmap"),
778    "GdkImage*":          Proxy("Gdk.Image.Gdk_Image"),
779    "GdkPixbuf":          GObject("Gdk.Pixbuf.Gdk_Pixbuf"),
780    "GdkPixbufAnimation*": Proxy("Gdk.Pixbuf.Gdk_Pixbuf_Animation"),
781
782    "GdkRectangle*":      Proxy("Gdk.Rectangle.Gdk_Rectangle"),
783
784    # in gdkevents.h
785    "GdkRectangle":      Proxy("Gdk.Rectangle.Gdk_Rectangle"),
786
787    # ??? The above should not be needed, we should infer it from the Gir.
788    # we need it to generate the "Stub" object in Gdk.Device.Get_Position
789    "Gdk.ModifierType":   Proxy("Gdk.Types.Gdk_Modifier_Type"),
790    "GdkModifierType":    Proxy("Gdk.Types.Gdk_Modifier_Type"),
791    "GdkKeyType":         Proxy("Gdk.Types.Gdk_Key_Type"),
792    "GdkWindowAttr*":     Proxy("Gdk.Gdk_Window_Attr"),
793
794    # Override type: we do not want to show they derive from GObject
795    "GdkCursor":         Proxy("Gdk.Gdk_Cursor"),
796    "GdkCursor*":        Proxy("Gdk.Gdk_Cursor"),
797    "GdkWindow":         Proxy("Gdk.Gdk_Window"),
798    "GdkWindow*":        Proxy("Gdk.Gdk_Window"),
799}
800