/packages/fpgtk/src/fpgtk.pp

https://github.com/slibre/freepascal · Puppet · 12085 lines · 10076 code · 2009 blank · 0 comment · 182 complexity · b337937eb034893336e893d80f99a453 MD5 · raw file

Large files are truncated click here to view the full file

  1. {$mode objfpc}{$h+} {$ifdef win32}{$define gtkwin}{$endif}
  2. UNIT FPgtk;
  3. // Generated with GtkWrite by Luk Vandelaer (version 1.08)
  4. INTERFACE
  5. USES classes, sysutils, gtk, gdk, glib, FPglib;
  6. TYPE
  7. TFPgtkObject = class;
  8. TFPgtkData = class;
  9. TFPgtkAdjustment = class;
  10. TFPgtkToolTips = class;
  11. TFPgtkWidget = class;
  12. TFPgtkGroup = class;
  13. TFPgtkWidgetGroup = class;
  14. TFPgtkMisc = class;
  15. TFPgtkLabel = class;
  16. TFPgtkAccelLabel = class;
  17. TFPgtkTipsQuery = class;
  18. TFPgtkArrow = class;
  19. TFPgtkImage = class;
  20. TFPgtkPixmap = class;
  21. TFPgtkContainer = class;
  22. TFPgtkBin = class;
  23. TFPgtkAlignment = class;
  24. TFPgtkFrame = class;
  25. TFPgtkAspectFrame = class;
  26. TFPgtkButton = class;
  27. TFPgtkToggleButton = class;
  28. TFPgtkCheckButton = class;
  29. TFPgtkRadioButton = class;
  30. TFPgtkRadioButtonGroup = class;
  31. TFPgtkOptionMenu = class;
  32. TFPgtkItem = class;
  33. TFPgtkItemGroup = class;
  34. TFPgtkMenuItem = class;
  35. TFPgtkCheckMenuItem = class;
  36. TFPgtkRadioMenuItem = class;
  37. TFPgtkRadioMenuGroup = class;
  38. TFPgtkTearOffMenuItem = class;
  39. TFPgtkListItem = class;
  40. TFPgtkListItemGroup = class;
  41. TFPgtkTreeItem = class;
  42. TFPgtkWindow = class;
  43. TFPgtkColorSelectionDialog = class;
  44. TFPgtkDialog = class;
  45. TFPgtkInputDialog = class;
  46. TFPgtkFileSelection = class;
  47. TFPgtkFontSelectionDialog = class;
  48. TFPgtkEventBox = class;
  49. TFPgtkHandleBox = class;
  50. TFPgtkScrolledWindow = class;
  51. TFPgtkViewport = class;
  52. TFPgtkBox = class;
  53. TFPgtkButtonBox = class;
  54. TFPgtkHButtonBox = class;
  55. TFPgtkVButtonBox = class;
  56. TFPgtkVBox = class;
  57. TFPgtkColorSelection = class;
  58. TFPgtkGammaCurve = class;
  59. TFPgtkHBox = class;
  60. TFPgtkCombo = class;
  61. TFPgtkStatusbar = class;
  62. TFPgtkCList = class;
  63. TFPgtkCTree = class;
  64. TFPgtkFixed = class;
  65. TFPgtkNotebook = class;
  66. TFPgtkFontSelection = class;
  67. TFPgtkPaned = class;
  68. TFPgtkHPaned = class;
  69. TFPgtkVPaned = class;
  70. TFPgtkLayout = class;
  71. TFPgtkList = class;
  72. TFPgtkMenuShell = class;
  73. TFPgtkMenuBar = class;
  74. TFPgtkMenu = class;
  75. TFPgtkPacker = class;
  76. TFPgtkTable = class;
  77. TFPgtkToolbar = class;
  78. TFPgtkTree = class;
  79. TFPgtkCalendar = class;
  80. TFPgtkDrawingArea = class;
  81. TFPgtkCurve = class;
  82. TFPgtkEditable = class;
  83. TFPgtkEntry = class;
  84. TFPgtkSpinButton = class;
  85. TFPgtkText = class;
  86. TFPgtkRuler = class;
  87. TFPgtkHRuler = class;
  88. TFPgtkVRuler = class;
  89. TFPgtkRange = class;
  90. TFPgtkScale = class;
  91. TFPgtkHScale = class;
  92. TFPgtkVScale = class;
  93. TFPgtkScrollbar = class;
  94. TFPgtkHScrollbar = class;
  95. TFPgtkVScrollbar = class;
  96. TFPgtkSeparator = class;
  97. TFPgtkHSeparator = class;
  98. TFPgtkVSeparator = class;
  99. TFPgtkPreview = class;
  100. TFPgtkProgress = class;
  101. TFPgtkProgressBar = class;
  102. TFPgtkItemFactory = class;
  103. TFPgtkSignalFunction = procedure (Sender:TFPgtkObject; Data:pointer) of Object;
  104. TFPgtkBooleanSignalFunction = procedure (Sender:TFPgtkObject; Bool:boolean; data:pointer) of Object;
  105. FPgtkException = class (Exception) end;
  106. PPascalClassData = ^TPascalClassData;
  107. TPascalClassData = record
  108. TheInstance : TFPgtkObject;
  109. end;
  110. PSignalData = ^TSignalData;
  111. TSignalData = record
  112. TheData : pointer;
  113. TheWidget : TFPgtkObject;
  114. TheSignalProc : TFPgtkSignalFunction;
  115. end;
  116. TDestroyState = (dsAlive, dsWaiting, dsDestroying);
  117. TFPgtkObjectClass = Class of TFPgtkObject;
  118. PFPgtkObject = ^TFPgtkObject;
  119. TFPgtkObject = class
  120. Private
  121. FDestroying : TDestroyState;
  122. PascalInstance:TPascalClassData;
  123. ConvertDatas:TStringList;
  124. SignalDatas:TList;
  125. NotifyList:TList;
  126. function ConvertSignalData (proc:TFPgtkSignalFunction; data:pointer; FreeIt:boolean) : PSignalData;
  127. procedure FreeClass (Sender:TFPgtkObject; Data:pointer);
  128. procedure CheckConvertDatas;
  129. procedure CheckNotifyList;
  130. procedure InitCreate;
  131. procedure FinalCreate;
  132. function GetUserData : pointer;
  133. procedure SetUserData (TheValue : pointer);
  134. Protected
  135. FGtkObject:PGtkObject;
  136. procedure CreateGtkObject; Virtual; Abstract;
  137. procedure NotifyDestroy (AnObject:TFPgtkObject); Virtual;
  138. Public
  139. function TheGtkObject : PGtkObject;
  140. function SignalConnect (Signal:string; Proc:TFPgtkSignalFunction; data:pointer) : guint;
  141. function SignalConnectAfter (Signal:string; Proc:TFPgtkSignalFunction; data:pointer) : guint;
  142. function BooleanSignalConnect (Signal:string; Proc:TFPgtkBooleanSignalFunction; data:pointer) : guint;
  143. function BooleanSignalConnectAfter (Signal:string; Proc:TFPgtkBooleanSignalFunction; data:pointer) : guint;
  144. constructor Create;
  145. constructor CreateFromObject (GtkObject:PGtkObject);
  146. property Destroying : TDestroyState read FDestroying;
  147. procedure AskNotification (AnObject:TFPgtkObject);
  148. destructor Destroy; Override;
  149. function ConnectDestroy (proc:TFPgtkSignalFunction; data:pointer) : guint;
  150. function ConnectAfterDestroy (proc:TFPgtkSignalFunction; data:pointer) : guint;
  151. procedure SignalDisconnect (SignalHandler:guint);
  152. procedure SignalBlockHandler (SignalHandler:guint);
  153. procedure SignalUnblockHandler (SignalHandler:guint);
  154. procedure SignalEmit (aName:string; Args:array of const);
  155. function SignalNEmissions (aName:string) : guint;
  156. procedure SignalEmitStop (aName:string);
  157. procedure SetData (Key:string; Data:pointer);
  158. property UserData : pointer read GetUserData write SetUserData;
  159. procedure SetDataFull (Key:string; Data:pointer; Destroyer:TFPgtkSignalFunction);
  160. procedure RemoveData (Key:string);
  161. function GetData (Key:string) : pointer;
  162. function GtkDestroyed : boolean;
  163. procedure Constructed;
  164. procedure ConstructedDefault;
  165. procedure Sink;
  166. procedure Ref;
  167. procedure Unref;
  168. procedure WeakRef (Notify:TFPgtkSignalFunction; data:pointer);
  169. procedure WeakUnref (notify:TFPgtkSignalFunction; data:pointer);
  170. end;
  171. TFPgtkData = class (TFPgtkObject)
  172. Public
  173. function TheGtkObject : PGtkData;
  174. function ConnectDisconnect (proc:TFPgtkSignalFunction; data:pointer) : guint;
  175. function ConnectAfterDisconnect (proc:TFPgtkSignalFunction; data:pointer) : guint;
  176. end;
  177. TFPgtkAdjustment = class (TFPgtkData)
  178. Private
  179. function GetValue : gfloat;
  180. procedure SetValue (TheValue : gfloat);
  181. function GetLower : gfloat;
  182. procedure SetLower (TheValue : gfloat);
  183. function GetUpper : gfloat;
  184. procedure SetUpper (TheValue : gfloat);
  185. function GetStepIncrement : gfloat;
  186. procedure SetStepIncrement (TheValue : gfloat);
  187. function GetPageIncrement : gfloat;
  188. procedure SetPageIncrement (TheValue : gfloat);
  189. function GetPageSize : gfloat;
  190. procedure SetPageSize (TheValue : gfloat);
  191. Protected
  192. procedure CreateGtkObject; override;
  193. Public
  194. function TheGtkObject : PGtkAdjustment;
  195. procedure Configure (aLower:gfloat; anUpper:gfloat; aValue:gfloat; aStepInc:gfloat; aPageInc:gfloat; aPageSize:gfloat);
  196. function ConnectValueChanged (proc:TFPgtkSignalFunction; data:pointer) : guint;
  197. function ConnectAfterValueChanged (proc:TFPgtkSignalFunction; data:pointer) : guint;
  198. function ConnectChanged (proc:TFPgtkSignalFunction; data:pointer) : guint;
  199. function ConnectAfterChanged (proc:TFPgtkSignalFunction; data:pointer) : guint;
  200. procedure ValueChanged;
  201. procedure Changed;
  202. procedure ClampPage (aLower:gfloat; aUpper:gfloat);
  203. property Value : gfloat read GetValue write SetValue;
  204. property Lower : gfloat read GetLower write SetLower;
  205. property Upper : gfloat read GetUpper write SetUpper;
  206. property StepIncrement : gfloat read GetStepIncrement write SetStepIncrement;
  207. property PageIncrement : gfloat read GetPageIncrement write SetPageIncrement;
  208. property PageSize : gfloat read GetPageSize write SetPageSize;
  209. end;
  210. TFPgtkToolTips = class (TFPgtkData)
  211. Private
  212. function GetEnabled : boolean;
  213. procedure SetEnabled (TheValue : boolean);
  214. function GetDelay : integer;
  215. procedure SetDelay (TheValue : integer);
  216. function GetColorForeground : PGdkColor;
  217. procedure SetColorForeground (TheValue : PGdkColor);
  218. function GetColorBackground : PGdkColor;
  219. procedure SetColorBackground (TheValue : PGdkColor);
  220. Protected
  221. procedure CreateGtkObject; override;
  222. Public
  223. function TheGtkObject : PGtkToolTips;
  224. procedure SetColors (Fore:PGdkColor; Back:PGdkColor);
  225. procedure SetTip (Widget:TFPgtkWidget; TipText:string; TipPrivate:string);
  226. property Enabled : boolean read GetEnabled write SetEnabled;
  227. property Delay : integer read GetDelay write SetDelay;
  228. property ColorForeground : PGdkColor read GetColorForeground write SetColorForeground;
  229. property ColorBackground : PGdkColor read GetColorBackground write SetColorBackground;
  230. procedure ForceWindow;
  231. end;
  232. TFPgtkWidgetSignalFunction = procedure (Sender:TFPgtkObject; Widget:TFPgtkWidget; Data:pointer) of Object;
  233. TFPgtkEventFunction = function (Sender:TFPgtkWidget; Event:PGdkEvent; data:pointer): boolean of Object;
  234. TFPgtkEventButtonFunction = function (Sender:TFPgtkWidget; Event:PGdkEventButton; data:pointer): boolean of Object;
  235. TFPgtkEventMotionFunction = function (Sender:TFPgtkWidget; Event:PGdkEventMotion; data:pointer): boolean of Object;
  236. TFPgtkEventExposeFunction = function (Sender:TFPgtkWidget; Event:PGdkEventExpose; data:pointer): boolean of Object;
  237. TFPgtkEventKeyFunction = function (Sender:TFPgtkWidget; Event:PGdkEventKey; data:pointer): boolean of Object;
  238. TFPgtkEventCrossingFunction = function (Sender:TFPgtkWidget; Event:PGdkEventCrossing; data:pointer): boolean of Object;
  239. TFPgtkEventConfigureFunction = function (Sender:TFPgtkWidget; Event:PGdkEventConfigure; data:pointer): boolean of Object;
  240. TFPgtkEventFocusFunction = function (Sender:TFPgtkWidget; Event:PGdkEventFocus; data:pointer): boolean of Object;
  241. TFPgtkEventPropertyFunction = function (Sender:TFPgtkWidget; Event:PGdkEventProperty; data:pointer): boolean of Object;
  242. TFPgtkEventSelectionFunction = function (Sender:TFPgtkWidget; Event:PGdkEventSelection; data:pointer): boolean of Object;
  243. TFPgtkEventProximityFunction = function (Sender:TFPgtkWidget; Event:PGdkEventProximity; data:pointer): boolean of Object;
  244. TFPgtkEventClientFunction = function (Sender:TFPgtkWidget; Event:PGdkEventClient; data:pointer): boolean of Object;
  245. TFPgtkEventNoExposeFunction = function (Sender:TFPgtkWidget; Event:PGdkEventNoExpose; data:pointer): boolean of Object;
  246. TFPgtkWidget = class (TFPgtkObject)
  247. Private
  248. function GetTheGtkWidget : PGtkWidget;
  249. procedure SetTheGtkWidget (TheValue : PGtkWidget);
  250. function GetAllocation : TGtkAllocation;
  251. function GetName : string;
  252. procedure SetName (TheValue : string);
  253. function GetPropFlags : longint;
  254. procedure SetPropFlags (TheValue : longint);
  255. function GetState : longint;
  256. function GetSavedState : longint;
  257. function GetParent : TFPgtkWidget;
  258. procedure SetParent (TheValue : TFPgtkWidget);
  259. function GetParentWindow : PGdkWindow;
  260. procedure SetParentWindow (TheValue : PGdkWindow);
  261. procedure Reparent (NewParent:TFPgtkWidget);
  262. function GetVisible : boolean;
  263. procedure SetVisible (TheValue : boolean);
  264. function GetNoWindow : boolean;
  265. procedure SetNoWindow (TheValue : boolean);
  266. function GetRealized : boolean;
  267. procedure SetRealized (TheValue : boolean);
  268. function GetMapped : boolean;
  269. procedure SetMapped (TheValue : boolean);
  270. function GetDrawable : boolean;
  271. function GetIsSensitive : boolean;
  272. function GetSensitive : boolean;
  273. procedure SetSensitive (TheValue : boolean);
  274. function GetParentSensitive : boolean;
  275. procedure SetParentSensitive (TheValue : boolean);
  276. function GetAppPaintable : boolean;
  277. function GetCanFocus : boolean;
  278. procedure SetCanFocus (TheValue : boolean);
  279. function GetHasFocus : boolean;
  280. function GetCanDefault : boolean;
  281. procedure SetCanDefault (TheValue : boolean);
  282. function GetHasDefault : boolean;
  283. function GetReceivesDefault : boolean;
  284. function GetCompositeChild : boolean;
  285. function GetTooltip : string;
  286. procedure SetTooltip (TheValue : string);
  287. function GetColormap : PGdkColormap;
  288. procedure SetColormap (TheValue : PGdkColormap);
  289. Protected
  290. procedure SetFlags (NewFlags:longint);
  291. procedure UnsetFlags (NewUnsetFlags:longint);
  292. procedure Map;
  293. procedure Unmap;
  294. procedure QueueDraw;
  295. procedure QueueResize;
  296. procedure DrawFocus;
  297. procedure DrawDefault;
  298. Public
  299. function TheGtkObject : PGtkWidget;
  300. property TheGtkWidget : PGtkWidget read GetTheGtkWidget write SetTheGtkWidget;
  301. function WidgetSignalConnect (Signal:string; Proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  302. function WidgetSignalConnectAfter (Signal:string; Proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  303. procedure Draw (Rectangle:PGdkRectangle); Overload;
  304. procedure Show;
  305. procedure Hide;
  306. procedure Realize;
  307. procedure Unrealize;
  308. procedure ShowNow;
  309. procedure ShowAll;
  310. procedure HideAll;
  311. procedure SetAllocation (AnAllocation:TGtkAllocation); Overload;
  312. procedure SetAllocation (x:integer; y:integer; width:integer; height:integer); Overload;
  313. property Allocation : TGtkAllocation read GetAllocation write SetAllocation;
  314. procedure SetUPosition (x:integer; y:integer);
  315. procedure SetUsize (width:integer; height:integer);
  316. property Name : string read GetName write SetName;
  317. property Flags : longint read GetPropFlags write SetPropFlags;
  318. property State : longint read GetState;
  319. property SavedState : longint read GetSavedState;
  320. property Parent : TFPgtkWidget read GetParent write SetParent;
  321. property ParentWindow : PGdkWindow read GetParentWindow write SetParentWindow;
  322. procedure Unparent;
  323. property Visible : boolean read GetVisible write SetVisible;
  324. property NoWindow : boolean read GetNoWindow write SetNoWindow;
  325. property Realized : boolean read GetRealized write SetRealized;
  326. property Mapped : boolean read GetMapped write SetMapped;
  327. property Drawable : boolean read GetDrawable;
  328. property IsSensitive : boolean read GetIsSensitive;
  329. property Sensitive : boolean read GetSensitive write SetSensitive;
  330. property ParentSensitive : boolean read GetParentSensitive write SetParentSensitive;
  331. property AppPaintable : boolean read GetAppPaintable;
  332. property CanFocus : boolean read GetCanFocus write SetCanFocus;
  333. procedure GrabFocus;
  334. property HasFocus : boolean read GetHasFocus;
  335. property CanDefault : boolean read GetCanDefault write SetCanDefault;
  336. procedure GrabDefault;
  337. property HasDefault : boolean read GetHasDefault;
  338. property ReceivesDefault : boolean read GetReceivesDefault;
  339. property CompositeChild : boolean read GetCompositeChild;
  340. property Tooltip : string read GetTooltip write SetTooltip;
  341. procedure HideOnDelete;
  342. property Colormap : PGdkColormap read GetColormap write SetColormap;
  343. function ConnectShow (proc:TFPgtkSignalFunction; data:pointer) : guint;
  344. function ConnectAfterShow (proc:TFPgtkSignalFunction; data:pointer) : guint;
  345. function Connecthide (proc:TFPgtkSignalFunction; data:pointer) : guint;
  346. function ConnectAfterhide (proc:TFPgtkSignalFunction; data:pointer) : guint;
  347. function Connectmap (proc:TFPgtkSignalFunction; data:pointer) : guint;
  348. function ConnectAftermap (proc:TFPgtkSignalFunction; data:pointer) : guint;
  349. function Connectunmap (proc:TFPgtkSignalFunction; data:pointer) : guint;
  350. function ConnectAfterunmap (proc:TFPgtkSignalFunction; data:pointer) : guint;
  351. function Connectrealize (proc:TFPgtkSignalFunction; data:pointer) : guint;
  352. function ConnectAfterrealize (proc:TFPgtkSignalFunction; data:pointer) : guint;
  353. function Connectunrealize (proc:TFPgtkSignalFunction; data:pointer) : guint;
  354. function ConnectAfterunrealize (proc:TFPgtkSignalFunction; data:pointer) : guint;
  355. function ConnectDrawFocus (proc:TFPgtkSignalFunction; data:pointer) : guint;
  356. function ConnectAfterDrawFocus (proc:TFPgtkSignalFunction; data:pointer) : guint;
  357. function ConnectDrawDefault (proc:TFPgtkSignalFunction; data:pointer) : guint;
  358. function ConnectAfterDrawDefault (proc:TFPgtkSignalFunction; data:pointer) : guint;
  359. function ConnectParentSet (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  360. function ConnectAfterParentSet (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  361. function ConnectGrabFocus (proc:TFPgtkSignalFunction; data:pointer) : guint;
  362. function ConnectAfterGrabFocus (proc:TFPgtkSignalFunction; data:pointer) : guint;
  363. function EventConnect (Signal:string; Proc:TFPgtkEventFunction; data:pointer) : guint;
  364. function EventConnectAfter (Signal:string; Proc:TFPgtkEventFunction; data:pointer) : guint;
  365. function ConnectEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  366. function ConnectAfterEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  367. function EventButtonConnect (Signal:string; Proc:TFPgtkEventButtonFunction; data:pointer) : guint;
  368. function EventButtonConnectAfter (Signal:string; Proc:TFPgtkEventButtonFunction; data:pointer) : guint;
  369. function ConnectButtonPressEvent (proc:TFPgtkEventButtonFunction; data:pointer) : guint;
  370. function ConnectAfterButtonPressEvent (proc:TFPgtkEventButtonFunction; data:pointer) : guint;
  371. function ConnectButtonReleaseEvent (proc:TFPgtkEventButtonFunction; data:pointer) : guint;
  372. function ConnectAfterButtonReleaseEvent (proc:TFPgtkEventButtonFunction; data:pointer) : guint;
  373. function EventMotionConnect (Signal:string; Proc:TFPgtkEventMotionFunction; data:pointer) : guint;
  374. function EventMotionConnectAfter (Signal:string; Proc:TFPgtkEventMotionFunction; data:pointer) : guint;
  375. function ConnectMotionNotifyEvent (proc:TFPgtkEventMotionFunction; data:pointer) : guint;
  376. function ConnectAfterMotionNotifyEvent (proc:TFPgtkEventMotionFunction; data:pointer) : guint;
  377. function ConnectDeleteEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  378. function ConnectAfterDeleteEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  379. function ConnectDestroyEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  380. function ConnectAfterDestroyEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  381. function EventExposeConnect (Signal:string; Proc:TFPgtkEventExposeFunction; data:pointer) : guint;
  382. function EventExposeConnectAfter (Signal:string; Proc:TFPgtkEventExposeFunction; data:pointer) : guint;
  383. function ConnectExposeEvent (proc:TFPgtkEventExposeFunction; data:pointer) : guint;
  384. function ConnectAfterExposeEvent (proc:TFPgtkEventExposeFunction; data:pointer) : guint;
  385. function EventKeyConnect (Signal:string; Proc:TFPgtkEventKeyFunction; data:pointer) : guint;
  386. function EventKeyConnectAfter (Signal:string; Proc:TFPgtkEventKeyFunction; data:pointer) : guint;
  387. function ConnectKeyPressEvent (proc:TFPgtkEventKeyFunction; data:pointer) : guint;
  388. function ConnectAfterKeyPressEvent (proc:TFPgtkEventKeyFunction; data:pointer) : guint;
  389. function ConnectKeyReleaseEvent (proc:TFPgtkEventKeyFunction; data:pointer) : guint;
  390. function ConnectAfterKeyReleaseEvent (proc:TFPgtkEventKeyFunction; data:pointer) : guint;
  391. function EventCrossingConnect (Signal:string; Proc:TFPgtkEventCrossingFunction; data:pointer) : guint;
  392. function EventCrossingConnectAfter (Signal:string; Proc:TFPgtkEventCrossingFunction; data:pointer) : guint;
  393. function ConnectEnterNotifyEvent (proc:TFPgtkEventCrossingFunction; data:pointer) : guint;
  394. function ConnectAfterEnterNotifyEvent (proc:TFPgtkEventCrossingFunction; data:pointer) : guint;
  395. function ConnectLeaveNotifyEvent (proc:TFPgtkEventCrossingFunction; data:pointer) : guint;
  396. function ConnectAfterLeaveNotifyEvent (proc:TFPgtkEventCrossingFunction; data:pointer) : guint;
  397. function EventConfigureConnect (Signal:string; Proc:TFPgtkEventConfigureFunction; data:pointer) : guint;
  398. function EventConfigureConnectAfter (Signal:string; Proc:TFPgtkEventConfigureFunction; data:pointer) : guint;
  399. function ConnectConfigureEvent (proc:TFPgtkEventConfigureFunction; data:pointer) : guint;
  400. function ConnectAfterConfigureEvent (proc:TFPgtkEventConfigureFunction; data:pointer) : guint;
  401. function EventFocusConnect (Signal:string; Proc:TFPgtkEventFocusFunction; data:pointer) : guint;
  402. function EventFocusConnectAfter (Signal:string; Proc:TFPgtkEventFocusFunction; data:pointer) : guint;
  403. function ConnectFocusInEvent (proc:TFPgtkEventFocusFunction; data:pointer) : guint;
  404. function ConnectAfterFocusInEvent (proc:TFPgtkEventFocusFunction; data:pointer) : guint;
  405. function ConnectFocusOutEvent (proc:TFPgtkEventFocusFunction; data:pointer) : guint;
  406. function ConnectAfterFocusOutEvent (proc:TFPgtkEventFocusFunction; data:pointer) : guint;
  407. function ConnectMapEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  408. function ConnectAfterMapEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  409. function ConnectUnmapEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  410. function ConnectAfterUnmapEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  411. function EventPropertyConnect (Signal:string; Proc:TFPgtkEventPropertyFunction; data:pointer) : guint;
  412. function EventPropertyConnectAfter (Signal:string; Proc:TFPgtkEventPropertyFunction; data:pointer) : guint;
  413. function ConnectPropertyNotifyEvent (proc:TFPgtkEventPropertyFunction; data:pointer) : guint;
  414. function ConnectAfterPropertyNotifyEvent (proc:TFPgtkEventPropertyFunction; data:pointer) : guint;
  415. function EventSelectionConnect (Signal:string; Proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  416. function EventSelectionConnectAfter (Signal:string; Proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  417. function ConnectSelectionClearEvent (proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  418. function ConnectAfterSelectionClearEvent (proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  419. function ConnectSelectionRequestEvent (proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  420. function ConnectAfterSelectionRequestEvent (proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  421. function ConnectSelectionNotifyEvent (proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  422. function ConnectAfterSelectionNotifyEvent (proc:TFPgtkEventSelectionFunction; data:pointer) : guint;
  423. function EventProximityConnect (Signal:string; Proc:TFPgtkEventProximityFunction; data:pointer) : guint;
  424. function EventProximityConnectAfter (Signal:string; Proc:TFPgtkEventProximityFunction; data:pointer) : guint;
  425. function ConnectProximityInEvent (proc:TFPgtkEventProximityFunction; data:pointer) : guint;
  426. function ConnectAfterProximityInEvent (proc:TFPgtkEventProximityFunction; data:pointer) : guint;
  427. function ConnectProximityOutEvent (proc:TFPgtkEventProximityFunction; data:pointer) : guint;
  428. function ConnectAfterProximityOutEvent (proc:TFPgtkEventProximityFunction; data:pointer) : guint;
  429. function EventClientConnect (Signal:string; Proc:TFPgtkEventClientFunction; data:pointer) : guint;
  430. function EventClientConnectAfter (Signal:string; Proc:TFPgtkEventClientFunction; data:pointer) : guint;
  431. function ConnectClientEvent (proc:TFPgtkEventClientFunction; data:pointer) : guint;
  432. function ConnectAfterClientEvent (proc:TFPgtkEventClientFunction; data:pointer) : guint;
  433. function EventNoExposeConnect (Signal:string; Proc:TFPgtkEventNoExposeFunction; data:pointer) : guint;
  434. function EventNoExposeConnectAfter (Signal:string; Proc:TFPgtkEventNoExposeFunction; data:pointer) : guint;
  435. function ConnectNoExposeEvent (proc:TFPgtkEventNoExposeFunction; data:pointer) : guint;
  436. function ConnectAfterNoExposeEvent (proc:TFPgtkEventNoExposeFunction; data:pointer) : guint;
  437. function ConnectVisibilityNotifyEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  438. function ConnectAfterVisibilityNotifyEvent (proc:TFPgtkEventFunction; data:pointer) : guint;
  439. procedure LockAccelerators;
  440. procedure UnlockAccelerators;
  441. procedure RemoveAccelerators (aSignal:string; OnlyVisible:boolean);
  442. procedure ActivateAccelGroups (Key:guint; Mods:TGdkModifierType);
  443. procedure AcceleratorAdd (AG:PGtkAccelGroup; aSignal:string; Key:guint; Mods:TGdkModifierType; acFlags:TGtkAccelFlags); Overload;
  444. end;
  445. TFPgtkForEachProcedure = procedure (item : pointer; data : pointer) of object;
  446. TFPgtkGroup = class (TList)
  447. Private
  448. FManageLists : boolean;
  449. FListChanged:boolean;
  450. FSListChanged:boolean;
  451. FClassesChanged:boolean;
  452. FNotUpdating:boolean;
  453. FGList:PGList;
  454. FGSList:PGSList;
  455. procedure FreeList;
  456. procedure FreeSList;
  457. function CreateGList : PGList;
  458. function CreateGSList : PGSList;
  459. function GetGtkListProp : PGList;
  460. procedure SetGtkListProp (TheValue : PGList);
  461. function GetGtkSListProp : PGSList;
  462. procedure SetGtkSListProp (TheValue : PGSList);
  463. Protected
  464. procedure BuildFromGtkList;
  465. procedure BuildFromGtkSList;
  466. procedure Notify (ptr:pointer; Action:TListNotification); Override;
  467. function GetData (index:integer) : pointer; Dynamic;
  468. function UngetData (data:pointer) : pointer; Dynamic;
  469. Public
  470. property ManageLists : boolean read FManageLists write FManageLists;
  471. constructor Create;
  472. destructor Destroy; Override;
  473. function GetGtkList (buffered:boolean) : PGList;
  474. function GetGtkSList (buffered:boolean) : PGSList;
  475. procedure BeginUpdate;
  476. procedure EndUpdate;
  477. procedure ForEach (Proc:TFPgtkForEachProcedure; data:pointer);
  478. property GtkList : PGList read GetGtkListProp write SetGtkListProp;
  479. property GtkSList : PGSList read GetGtkSListProp write SetGtkSListProp;
  480. end;
  481. TFPgtkWidgetGroup = class (TFPgtkGroup)
  482. Private
  483. function GetItem(Index:integer) : TFPgtkWidget;
  484. procedure SetItem (Index:integer; TheValue : TFPgtkWidget);
  485. function GetTooltips(index:integer) : string;
  486. procedure SetTooltips (index:integer; TheValue : string);
  487. Public
  488. function GetData (index:integer) : pointer; Override;
  489. function UnGetData (data:pointer) : pointer; Override;
  490. procedure AddToContainer (Container:TFPgtkContainer);
  491. procedure PackInBox (box:TFPgtkBox; AtStart:boolean; Expanding:boolean; Fill:boolean; Padding:integer);
  492. property Items [Index:integer] : TFPgtkWidget read GetItem write SetItem;
  493. property Tooltips [index:integer] : string read GetTooltips write SetTooltips;
  494. end;
  495. TFPgtkMisc = class (TFPgtkWidget)
  496. Private
  497. function GetXAlign : gfloat;
  498. procedure SetXAlign (TheValue : gfloat);
  499. function GetYAlign : gfloat;
  500. procedure SetYAlign (TheValue : gfloat);
  501. function GetXPad : word;
  502. procedure SetXPad (TheValue : word);
  503. function GetYPad : word;
  504. procedure SetYPad (TheValue : word);
  505. Public
  506. function TheGtkObject : PGtkMisc;
  507. procedure SetAlignment (x:gfloat; y:gfloat);
  508. procedure SetPadding (x:word; y:word);
  509. property XAlign : gfloat read GetXAlign write SetXAlign;
  510. property YAlign : gfloat read GetYAlign write SetYAlign;
  511. property XPad : word read GetXPad write SetXPad;
  512. property YPad : word read GetYPad write SetYPad;
  513. end;
  514. TFPgtkLabelClass = class of TFPgtkLabel;
  515. TFPgtkLabel = class (TFPgtkMisc)
  516. Private
  517. function GetText : string;
  518. procedure SetText (TheValue : string);
  519. function GetPattern : string;
  520. procedure SetPattern (TheValue : string);
  521. function GetJustify : TGtkJustification;
  522. procedure SetJustify (TheValue : TGtkJustification);
  523. function GetLineWrap : boolean;
  524. procedure SetLineWrap (TheValue : boolean);
  525. Protected
  526. procedure CreateGtkObject; override;
  527. Public
  528. function TheGtkObject : PGtkLabel;
  529. constructor Create (aText:string);
  530. property Text : string read GetText write SetText;
  531. property Pattern : string read GetPattern write SetPattern;
  532. property Justify : TGtkJustification read GetJustify write SetJustify;
  533. property LineWrap : boolean read GetLineWrap write SetLineWrap;
  534. function ParseUline (aText:string) : guint;
  535. end;
  536. TFPgtkAccelLabel = class (TFPgtkLabel)
  537. Private
  538. function GetAccelWidget : TFPgtkWidget;
  539. procedure SetAccelWidget (TheValue : TFPgtkWidget);
  540. Protected
  541. procedure CreateGtkObject; override;
  542. Public
  543. function TheGtkObject : PGtkAccelLabel;
  544. property AccelWidget : TFPgtkWidget read GetAccelWidget write SetAccelWidget;
  545. function AccelText : string;
  546. procedure Refetch;
  547. end;
  548. TFPgtkTipsQuery = class (TFPgtkLabel)
  549. Protected
  550. procedure CreateGtkObject; override;
  551. Public
  552. function TheGtkObject : PGtkTipsQuery;
  553. end;
  554. TFPgtkArrow = class (TFPgtkMisc)
  555. Private
  556. function GetArrowType : TGtkArrowType;
  557. procedure SetArrowType (TheValue : TGtkArrowType);
  558. function GetShadowType : TGtkShadowType;
  559. procedure SetShadowType (TheValue : TGtkShadowType);
  560. Protected
  561. procedure CreateGtkObject; override;
  562. Public
  563. function TheGtkObject : PGtkArrow;
  564. property ArrowType : TGtkArrowType read GetArrowType write SetArrowType;
  565. property ShadowType : TGtkShadowType read GetShadowType write SetShadowType;
  566. procedure SetTypes (AnArrowType:TGtkArrowType; AShadowtype:TGtkShadowType);
  567. constructor Create (AnArrowType:TGtkArrowType; AShadowType:TGtkShadowType);
  568. end;
  569. TFPgtkImage = class (TFPgtkMisc)
  570. Private
  571. function GetImageProp : PGdkImage;
  572. procedure SetImageProp (TheValue : PGdkImage);
  573. function GetMask : PGdkBitMap;
  574. procedure SetMask (TheValue : PGdkBitMap);
  575. Protected
  576. procedure CreateGtkObject; override;
  577. Public
  578. FMask:PGdkBitMap;
  579. FImage:PGdkImage;
  580. function TheGtkObject : PGtkImage;
  581. property Image : PGdkImage read GetImageProp write SetImageProp;
  582. property Mask : PGdkBitMap read GetMask write SetMask;
  583. procedure SetImage (anImage:PGdkImage; aMask:PGdkBitmap);
  584. constructor Create (anImage:PGdkImage; aMask:PGdkBitmap);
  585. end;
  586. TStringArray = array[0..32000] of pgchar;
  587. PStringArray = ^TStringArray;
  588. TFPgtkPixmap = class (TFPgtkMisc)
  589. Private
  590. function GetBuildInsensitive : longbool;
  591. procedure SetBuildInsensitive (TheValue : longbool);
  592. function GetPixmapProp : PGdkPixMap;
  593. procedure SetPixmapProp (TheValue : PGdkPixMap);
  594. function GetMask : PGdkBitMap;
  595. procedure SetMask (TheValue : PGdkBitMap);
  596. Protected
  597. procedure CreateGtkObject; override;
  598. Public
  599. FMask:PGdkBitMap;
  600. FPixMap:PGdkPixmap;
  601. function TheGtkObject : PGtkPixmap;
  602. property BuildInsensitive : longbool read GetBuildInsensitive write SetBuildInsensitive;
  603. constructor Create;
  604. constructor CreateFromFile (Filename:string; Window:TFPgtkWidget);
  605. constructor CreateFromStrings (Data:TStrings; Window:TFPgtkWidget);
  606. constructor CreateFromText (Data:string; Window:TFPgtkWidget);
  607. property PixMap : PGdkPixMap read GetPixmapProp write SetPixmapProp;
  608. property Mask : PGdkBitMap read GetMask write SetMask;
  609. procedure SetPixmap (aPixmap:PGdkPixMap; aMask:PGdkBitmap);
  610. procedure GetPixmap (var aPixmap:PGdkPixmap; var aMask:PGdkBitmap);
  611. procedure LoadFromFile (Filename:string);
  612. procedure LoadFromStrings (data:TStrings);
  613. procedure LoadFromText (data:string);
  614. procedure LoadFromArray (data:array of string);
  615. end;
  616. TFPgtkDirectionFunctionSignalFunction = function (Sender:TFPgtkObject; Direction:TGtkDirectionType; data:pointer): TGtkDirectionType of Object;
  617. TFPgtkContainer = class (TFPgtkWidget)
  618. Private
  619. function GetBorder : integer;
  620. procedure SetBorder (TheValue : integer);
  621. function GetChildren : TFPgtkWidgetGroup;
  622. Public
  623. FChildren:TFPgtkWidgetGroup;
  624. function TheGtkObject : PGtkContainer;
  625. property Border : integer read GetBorder write SetBorder;
  626. procedure Add (AWidget:TFPgtkWidget; IsVisible:boolean); Overload;
  627. procedure Add (AWidget:TFPgtkWidget); Overload;
  628. procedure Remove (AWidget:TFPgtkWidget);
  629. constructor Create;
  630. destructor Destroy; Override;
  631. property Children : TFPgtkWidgetGroup read GetChildren;
  632. procedure Focus (Direction:TGtkDirectionType);
  633. procedure FocusChild (Child:TFPgtkWidget);
  634. procedure RegisterToplevel;
  635. procedure UnregisterToplevel;
  636. procedure ResizeChildren;
  637. function DirectionFunctionSignalConnect (Signal:string; Proc:TFPgtkDirectionFunctionSignalFunction; data:pointer) : guint;
  638. function DirectionFunctionSignalConnectAfter (Signal:string; Proc:TFPgtkDirectionFunctionSignalFunction; data:pointer) : guint;
  639. function ConnectAdd (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  640. function ConnectAfterAdd (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  641. function ConnectRemove (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  642. function ConnectAfterRemove (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  643. function ConnectCheckResize (proc:TFPgtkSignalFunction; data:pointer) : guint;
  644. function ConnectAfterCheckResize (proc:TFPgtkSignalFunction; data:pointer) : guint;
  645. function ConnectFocus (proc:TFPgtkDirectionFunctionSignalFunction; data:pointer) : guint;
  646. function ConnectAfterFocus (proc:TFPgtkDirectionFunctionSignalFunction; data:pointer) : guint;
  647. function ConnectSetFocusChild (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  648. function ConnectAfterSetFocusChild (proc:TFPgtkWidgetSignalFunction; data:pointer) : guint;
  649. end;
  650. TFPgtkBin = class (TFPgtkContainer)
  651. Private
  652. function GetChild : TFPgtkWidget;
  653. procedure SetChild (TheValue : TFPgtkWidget);
  654. Protected
  655. property Child : TFPgtkWidget read GetChild write SetChild;
  656. Public
  657. function TheGtkObject : PGtkBin;
  658. end;
  659. TFPgtkAlignment = class (TFPgtkBin)
  660. Public
  661. function TheGtkObject : PGtkAlignment;
  662. procedure Configure (anXAlign:gfloat; anYAlign:gfloat; anXScale:gfloat; anYScale:gfloat);
  663. end;
  664. TFPgtkFrame = class (TFPgtkBin)
  665. Private
  666. function GetText : string;
  667. procedure SetText (TheValue : string);
  668. function GetAlignment : gfloat;
  669. procedure SetAlignment (TheValue : gfloat);
  670. function GetShadowType : TgtkShadowType;
  671. procedure SetShadowType (TheValue : TgtkShadowType);
  672. Protected
  673. procedure CreateGtkObject; override;
  674. Public
  675. function TheGtkObject : PGtkFrame;
  676. property Text : string read GetText write SetText;
  677. property Alignment : gfloat read GetAlignment write SetAlignment;
  678. property ShadowType : TgtkShadowType read GetShadowType write SetShadowType;
  679. end;
  680. TFPgtkAspectFrame = class (TFPgtkFrame)
  681. Protected
  682. procedure CreateGtkObject; override;
  683. Public
  684. function TheGtkObject : PGtkAspectFrame;
  685. procedure Configure (anXAlign:gfloat; anYAlign:gfloat; Ratio:gfloat; ObeyChild:longbool);
  686. end;
  687. TFPgtkButton = class (TFPgtkBin)
  688. Private
  689. FAccelKey : guint;
  690. FAddContainer : TFPgtkContainer;
  691. FLabel : TFPgtkLabel;
  692. procedure CreateLabel (aText:string);
  693. function GetText : string;
  694. procedure SetText (TheValue : string);
  695. function GetReliefStyle : TGtkReliefStyle;
  696. procedure SetReliefStyle (TheValue : TGtkReliefStyle);
  697. Protected
  698. procedure CreateGtkObject; override;
  699. function LabelClass : TFPgtkLabelClass; Virtual;
  700. procedure NotifyDestroy (AnObject:TFPgtkObject); Override;
  701. procedure LabelCreated; Virtual;
  702. Public
  703. function TheGtkObject : PGtkButton;
  704. function ConnectClicked (proc:TFPgtkSignalFunction; data:pointer) : guint;
  705. function ConnectAfterClicked (proc:TFPgtkSignalFunction; data:pointer) : guint;
  706. function ConnectPressed (proc:TFPgtkSignalFunction; data:pointer) : guint;
  707. function ConnectAfterPressed (proc:TFPgtkSignalFunction; data:pointer) : guint;
  708. function ConnectReleased (proc:TFPgtkSignalFunction; data:pointer) : guint;
  709. function ConnectAfterReleased (proc:TFPgtkSignalFunction; data:pointer) : guint;
  710. function ConnectEnter (proc:TFPgtkSignalFunction; data:pointer) : guint;
  711. function ConnectAfterEnter (proc:TFPgtkSignalFunction; data:pointer) : guint;
  712. function ConnectLeave (proc:TFPgtkSignalFunction; data:pointer) : guint;
  713. function ConnectAfterLeave (proc:TFPgtkSignalFunction; data:pointer) : guint;
  714. procedure Clicked;
  715. procedure Pressed;
  716. procedure Released;
  717. procedure Enter;
  718. procedure Leave;
  719. constructor Create;
  720. constructor CreateWithLabel (aText:string); Overload;
  721. constructor CreateWithLabel (aText:string; AccelGroup:PGtkAccelGroup); Overload;
  722. property TheLabel : TFPgtkLabel read FLabel;
  723. property Text : string read GetText write SetText;
  724. property ReliefStyle : TGtkReliefStyle read GetReliefStyle write SetReliefStyle;
  725. property AddContainer : TFPgtkContainer read FAddContainer write FAddContainer;
  726. property AccelKey : guint read FAccelKey;
  727. end;
  728. TFPgtkToggleButton = class (TFPgtkButton)
  729. Private
  730. function GetActive : boolean;
  731. procedure SetActive (TheValue : boolean);
  732. function GetDrawIndicator : boolean;
  733. procedure SetDrawIndicator (TheValue : boolean);
  734. Protected
  735. procedure CreateGtkObject; override;
  736. Public
  737. function TheGtkObject : PGtkToggleButton;
  738. function ConnectToggled (proc:TFPgtkSignalFunction; data:pointer) : guint;
  739. function ConnectAfterToggled (proc:TFPgtkSignalFunction; data:pointer) : guint;
  740. procedure Toggled;
  741. property Active : boolean read GetActive write SetActive;
  742. property DrawIndicator : boolean read GetDrawIndicator write SetDrawIndicator;
  743. end;
  744. TFPgtkCheckButton = class (TFPgtkToggleButton)
  745. Protected
  746. procedure CreateGtkObject; override;
  747. Public
  748. function TheGtkObject : PGtkCheckButton;
  749. end;
  750. TFPgtkRadioButton = class (TFPgtkCheckButton)
  751. Protected
  752. procedure CreateGtkObject; Override;
  753. Public
  754. FGroup:TFPgtkRadioButtonGroup;
  755. function TheGtkObject : PGtkRadioButton;
  756. constructor Create (AGroup:TFPgtkRadioButtonGroup);
  757. constructor CreateWithLabel (AGroup:TFPgtkRadioButtonGroup; aText:string);
  758. end;
  759. TFPgtkRadioButtonGroup = class (TFPgtkWidgetGroup)
  760. Private
  761. function GetItem(index:integer) : TFPgtkRadioButton;
  762. procedure SetItem (index:integer; TheValue : TFPgtkRadioButton);
  763. Public
  764. property Items [index:integer] : TFPgtkRadioButton read GetItem write SetItem;
  765. function ActiveButtonText : string;
  766. function ActiveButtonIndex : integer;
  767. function ActiveButton : TFPgtkRadioButton;
  768. end;
  769. TFPgtkOptionMenu = class (TFPgtkButton)
  770. Private
  771. function GetMenu : TFPgtkMenu;
  772. procedure setmenu (TheValue : TFPgtkMenu);
  773. Protected
  774. procedure CreateGtkObject; override;
  775. Public
  776. function TheGtkObject : PGtkOptionMenu;
  777. property Menu : TFPgtkMenu read GetMenu write setmenu;
  778. procedure RemoveMenu;
  779. procedure SetHistory (index:integer);
  780. procedure Clear;
  781. end;
  782. TFPgtkItemClass = class of TFPgtkItem;
  783. TFPgtkItem = class (TFPgtkBin)
  784. Private
  785. FAccelKey : guint;
  786. FAddContainer : TFPgtkContainer;
  787. FLabel : TFPgtkLabel;
  788. procedure CreateLabel (aText:string);
  789. function GetText : string;
  790. procedure SetText (TheValue : string);
  791. Protected
  792. function LabelClass : TFPgtkLabelClass; Virtual;
  793. procedure NotifyDestroy (AnObject:TFPgtkObject); Override;
  794. procedure LabelCreated; Virtual;
  795. Public
  796. function TheGtkObject : PGtkItem;
  797. function ConnectSelect (proc:TFPgtkSignalFunction; data:pointer) : guint;
  798. function ConnectAfterSelect (proc:TFPgtkSignalFunction; data:pointer) : guint;
  799. function ConnectDeselect (proc:TFPgtkSignalFunction; data:pointer) : guint;
  800. function ConnectAfterDeselect (proc:TFPgtkSignalFunction; data:pointer) : guint;
  801. function ConnectToggle (proc:TFPgtkSignalFunction; data:pointer) : guint;
  802. function ConnectAfterToggle (proc:TFPgtkSignalFunction; data:pointer) : guint;
  803. procedure Select;
  804. procedure Deselect;
  805. procedure Toggle;
  806. constructor Create;
  807. constructor CreateWithLabel (aText:string);
  808. property TheLabel : TFPgtkLabel read FLabel;
  809. property Text : string read GetText write SetText;
  810. property AddContainer : TFPgtkContainer read FAddContainer write FAddContainer;
  811. property AccelKey : guint read FAccelKey;
  812. end;
  813. TFPgtkItemGroup = class (TFPgtkWidgetGroup)
  814. Private
  815. FItemClass : TFPgtkItemClass;
  816. function GetItem(index:integer) : TFPgtkItem;
  817. procedure SetItem (index:integer; TheValue : TFPgtkItem);
  818. Public
  819. property Items [index:integer] : TFPgtkItem read GetItem write SetItem;
  820. procedure FillFromList (aList:TStrings);
  821. procedure FillFromCommaText (aList:string);
  822. procedure FillFromArray (aList:array of string);
  823. property ItemClass : TFPgtkItemClass read FItemClass write FItemClass;
  824. procedure SignalConnect (Signal:string; proc:TFPgtkSignalFunction; data:pointer);
  825. constructor create (AnItemClass:TFPgtkItemClass);
  826. function AddTextItem (aText:string) : TFPgtkItem;
  827. end;
  828. TFPgtkMenuItem = class (TFPgtkItem)
  829. Private
  830. function GetPlacement : TGtkSubmenuPlacement;
  831. procedure SetPlacement (TheValue : TGtkSubmenuPlacement);
  832. function GetToggleIndicator : boolean;
  833. procedure SetToggleIndicator (TheValue : boolean);
  834. function GetSubMenuIndicator : boolean;
  835. procedure SetSubMenuIndicator (TheValue : boolean);
  836. function GetJustifyRight : boolean;
  837. procedure SetJustifyRight (TheValue : boolean);
  838. function GetSubMenu : TFPgtkMenuShell;
  839. procedure SetPropSubMenu (TheValue : TFPgtkMenuShell);
  840. Protected
  841. procedure CreateGtkObject; override;
  842. function LabelClass : TFPgtkLabelClass; Override;
  843. procedure LabelCreated; Override;
  844. Public
  845. function TheGtkObject : PGtkMenuItem;
  846. function ConnectActivate (proc:TFPgtksignalFunction; data:pointer) : guint;
  847. function ConnectAfterActivate (proc:TFPgtksignalFunction; data:pointer) : guint;
  848. function ConnectActivateItem (proc:TFPgtksignalFunction; data:pointer) : guint;
  849. function ConnectAfterActivateItem (proc:TFPgtksignalFunction; data:pointer) : guint;
  850. procedure Activate;
  851. procedure SetSubMenu (aSubMenu:TFPgtkWidget);
  852. procedure RemoveSubMenu;
  853. procedure Configure (ShowToggleIndicator:boolean; ShowSubmenuIndicator:boolean);
  854. procedure RightJustify;
  855. property Placement : TGtkSubmenuPlacement read GetPlacement write SetPlacement;
  856. property ToggleIndicator : boolean read GetToggleIndicator write SetToggleIndicator;
  857. property SubMenuIndicator : boolean read GetSubMenuIndicator write SetSubMenuIndicator;
  858. property JustifyRight : boolean read GetJustifyRight write SetJustifyRight;
  859. property SubMenu : TFPgtkMenuShell read GetSubMenu write SetPropSubMenu;
  860. end;
  861. TFPgtkCheckMenuItem = class (TFPgtkMenuItem)
  862. Private
  863. function GetActive : boolean;
  864. procedure SetActive (TheValue : boolean);
  865. function GetShowToggle : boolean;
  866. procedure SetShowToggle (TheValue : boolean);
  867. Protected
  868. procedure CreateGtkObject; override;
  869. Public
  870. function TheGtkObject : PGtkCheckMenuItem;
  871. function ConnectToggled (proc:TFPgtksignalFunction; data:pointer) : guint;
  872. function ConnectAfterToggled (proc:TFPgtksignalFunction; data:pointer) : guint;
  873. procedure Toggled;
  874. property Active : boolean read GetActive write SetActive;
  875. property ShowToggle : boolean read GetShowToggle write SetShowToggle;
  876. end;
  877. TFPgtkRadioMenuItem = class (TFPgtkCheckMenuItem)
  878. Private
  879. FGroup : TFPgtkRadioMenuGroup;
  880. Protected
  881. procedure CreateGtkObject; Override;
  882. Public
  883. function TheGtkObject : PGtkRadioMenuItem;
  884. constructor Create (AGroup:TFPgtkRadioMenuGroup);
  885. constructor CreateWithLabel (Agroup:TFPgtkRadioMenuGroup; aText:string);
  886. property Group : TFPgtkRadioMenuGroup read FGroup;
  887. end;
  888. TFPgtkRadioMenuGroup = class (TFPgtkItemGroup)
  889. Private
  890. function GetItem(index:integer) : TFPgtkRadioMenuItem;
  891. procedure SetItem (index:integer; TheValue : TFPgtkRadioMenuItem);
  892. Public
  893. property Items [index:integer] : TFPgtkRadioMenuItem read GetItem write SetItem;
  894. function ActiveMenuText : string;
  895. function ActiveMenuIndex : integer;
  896. function ActiveMenu : TFPgtkRadioMenuItem;
  897. constructor create;
  898. end;
  899. TFPgtkTearOffMenuItem = class (TFPgtkMenuItem)
  900. Protected
  901. procedure CreateGtkObject; override;
  902. Public
  903. function TheGtkObject : PGtkTearOffMenuItem;
  904. end;
  905. TFPgtkScrollSignalFunction = procedure (Sender:TFPgtkObject; ScrollType:TgtkScrollType; position:gfloat; data:pointer) of Object;
  906. TFPgtkScrollBooleanSignalFunction = procedure (Sender:TFPgtkObject; ScrolType:TgtkScrollType; Position:gfloat; AutoStartSelection:boolean; data:pointer) of Object;
  907. TFPgtkListItem = class (TFPgtkItem)
  908. Protected
  909. procedure CreateGtkObject; override;
  910. Public
  911. function TheGtkObject : PGtkListItem;
  912. function ScrollSignalConnect (Signal:string; Proc:TFPgtkScrollSignalFunction; data:pointer) : guint;
  913. function ScrollSignalConnectAfter (Signal:string; Proc:TFPgtkScrollSignalFunction; data:pointer) : guint;
  914. function ScrollBooleanSignalConnect (Signal:string; Proc:TFPgtkScrollBooleanSignalFunction; data:pointer) : guint;
  915. function ScrollBooleanSignalConnectAfter (Signal:string; Proc:TFPgtkScrollBooleanSignalFunction; data:pointer) : guint;
  916. function ConnectToggleFocusRow (proc:TFPgtkSignalFunction; data:pointer) : guint;
  917. function ConnectAfterToggleFocusRow (proc:TFPgtkSignalFunction; data:pointer) : guint;
  918. function ConnectSelectAll (proc:TFPgtkSignalFunction; data:pointer) : guint;
  919. function ConnectAfterSelectAll (proc:TFPgtkSignalFunction; data:pointer) : guint;
  920. function ConnectUnselectAll (proc:TFPgtkSignalFunction; data:pointer) : guint;
  921. function ConnectAfterUnselectAll (proc:TFPgtkSignalFunction; data:pointer) : guint;
  922. function ConnectUndoSelection (proc:TFPgtkSignalFunction; data:pointer) : guint;
  923. function ConnectAfterUndoSelection (proc:TFPgtkSignalFunction; data:pointer) : guint;
  924. function ConnectStartSelection (proc:TFPgtkSignalFunction; data:pointer) : guint;
  925. function ConnectAfterStartSelection (proc:TFPgtkSignalFunction; data:pointer) : guint;
  926. function ConnectEndSelection (proc:TFPgtkSignalFunction; data:pointer) : guint;
  927. function ConnectAfterEndSelection (proc:TFPgtkSignalFunction; data:pointer) : guint;
  928. function ConnectToggleAddMode (proc:TFPgtkSignalFunction; data:pointer) : guint;
  929. function ConnectAfterToggleAddMode (proc:TFPgtkSignalFunction; data:pointer) : guint;
  930. function ConnectExtendSelection (proc:TFPgtkScrollBooleanSignalFunction; data:pointer) : guint;
  931. function ConnectAfterExtendSelection (proc:TFPgtkScrollBooleanSignalFunction; data:pointer) : guint;
  932. function ConnectScrollVertical (proc:TFPgtkScrollSignalFunction; data:pointer) : guint;
  933. function ConnectAfterScrollVertical (proc:TFPgtkScrollSignalFunction; data:pointer) : guint;
  934. function ConnectScrollHorizontal (proc:TFPgtkScrollSignalFunction; data:pointer) : guint;
  935. function ConnectAfterScrollHorizontal (proc:TFPgtkScrollSignalFunction; data:pointer) : guint;
  936. procedure Select;
  937. procedure Deselect;
  938. end;
  939. TFPgtkListItemGroup = class (TFPgtkItemGroup)
  940. Public
  941. constructor create;
  942. end;
  943. TFPgtkTreeItem = class (TFPgtkItem)
  944. Private
  945. function GetSubTree : TFPgtkWidget;
  946. procedure SetSubTree (TheValue : TFPgtkWidget);
  947. function GetPixPlus : TFPgtkWidget;
  948. function GetPixMinus : TFPgtkWidget;
  949. function GetExpanded : boolean;
  950. procedure SetExpanded (TheValue : boolean);
  951. Protected
  952. procedure CreateGtkObject; override;
  953. Public
  954. function TheGtkObject : PGtkTreeItem;
  955. property SubTree : TFPgtkWidget read GetSubTree write SetSubTree;
  956. property PixPlus : TFPgtkWidget read GetPixPlus;
  957. property PixMinus : TFPgtkWidget read GetPixMinus;
  958. property Expanded : boolean read GetExpanded write SetExpanded;
  959. procedure Select;
  960. procedure Deselect;
  961. procedure Expand;
  962. procedure Collapse;
  963. function ConnectCollapse (proc:TFPgtkSignalFunction; data:pointer) : guint;
  964. function ConnectAfterCollapse (proc:TFPgtkSignalFunction; data:pointer) : guint;
  965. function ConnectExpand (proc:TFPgtkSignalFunction; data:pointer) : guint;
  966. function ConnectAfterExpand (proc:TFPgtkSignalFunction; data:pointer) : guint;
  967. end;
  968. DialogResultCallback = procedure (Sender:TFPgtkWindow; DialogResult:pointer;
  969. Action:integer; initiator:TFPgtkObject) of object;
  970. DialogInitCallback = procedure (Sender : TFPgtkWindow; InitData : pointer) of object;
  971. TFPgtkWindowClass = class of TFPgtkWindow;
  972. TFPgtkWindow = class (TFPgtkBin)
  973. Private
  974. FAccelGroups:TList;
  975. FMainLevel : guint;
  976. FModalAction : integer;
  977. FOnDialogInit : DialogInitCallback;
  978. FOnDialogResult : DialogResultCallback;
  979. FDialogResult : pointer;
  980. TheWindowType:TGtkWindowType;
  981. function GetWindowType : TGtkWindowType;
  982. procedure SetWindowType (TheValue : TGtkWindowType);
  983. function GetTitle : string;
  984. procedure SetTitle (TheValue : string);
  985. function GetModal : boolean;
  986. procedure SetModal (TheValue : boolean);
  987. procedure SetModalAction (TheValue : integer);
  988. procedure ExecuteEnds (Sender:TFPgtkObject; data:pointer);
  989. function GetUserSizable : boolean;
  990. procedure SetUserSizable (TheValue : boolean);
  991. function GetPosition : TGtkWindowPosition;
  992. procedure SetPosition (TheValue : TGtkWindowPosition);
  993. function GetAccelGroups(ID:integer) : PGtkAccelGroup;
  994. Protected
  995. procedure CreateGtkObject; override;
  996. property DialogResult : pointer read FDialogResult write FDialogResult;
  997. procedure DoDialogResult (Action:integer; Sender:TFPgtkObject); Virtual;
  998. procedure DoDialogInit (InitData:pointer); Virtual;
  999. Public
  1000. function TheGtkObject : PGtkWindow;
  1001. constructor Create (AType:TGtkWindowType);
  1002. destructor Destroy; Override;
  1003. property WindowType : TGtkWindowType read GetWindowType write SetWindowType;
  1004. property Title : string read GetTitle write SetTitle;
  1005. property Modal : boolean read GetModal write SetModal;
  1006. property OnDialogResult : DialogResultCallback read FOnDialogResult write FOnDialogResult;
  1007. property OnDialogInit : DialogInitCa