{"id":1241,"date":"2014-04-22T22:13:10","date_gmt":"2014-04-22T21:13:10","guid":{"rendered":"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1241"},"modified":"2014-04-26T12:52:30","modified_gmt":"2014-04-26T11:52:30","slug":"tulip-ui-buttons-pas","status":"publish","type":"page","link":"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1241","title":{"rendered":"Tulip.UI.Buttons.pas"},"content":{"rendered":"<div style=\"background-color: #FFFFFF; width: 700px\">\n<header class=\"entry-meta\" style=\"text-align: Right;\"><a title=\"Source Files\" href=\"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1091\">Source Files<\/a><span> | Tulip.UI.Buttons.pas<\/span><\/header>\n<p><code><\/p>\n<pre>\r\n{******************************************************************************}\r\n{                                                                              }\r\n{                        Tulip - User Interface Library                        }\r\n{                                                                              }\r\n{             Copyright(c) 2012 Marcos Gomes. All rights Reserved.             }\r\n{                                                                              }\r\n{  --------------------------------------------------------------------------  }\r\n{                                                                              }\r\n{  This product is based on Asphyre Sphinx (c) 2000 - 2012  Yuriy Kotsarenko.  }\r\n{       All rights reserved. Official web site: http:\/\/www.afterwarp.net       }\r\n{                                                                              }\r\n{******************************************************************************}\r\n{                                                                              }\r\n{  Important Notice:                                                           }\r\n{                                                                              }\r\n{  If you modify\/use this code or one of its parts either in original or       }\r\n{  modified form, you must comply with Mozilla Public License Version 2.0,     }\r\n{  including section 3, \"Responsibilities\". Failure to do so will result in    }\r\n{  the license breach, which will be resolved in the court. Remember that      }\r\n{  violating author's rights either accidentally or intentionally is           }\r\n{  considered a serious crime in many countries. Thank you!                    }\r\n{                                                                              }\r\n{  !! Please *read* Mozilla Public License 2.0 document located at:            }\r\n{  http:\/\/www.mozilla.org\/MPL\/                                                 }\r\n{                                                                              }\r\n{  --------------------------------------------------------------------------  }\r\n{                                                                              }\r\n{  The contents of this file are subject to the Mozilla Public License         }\r\n{  Version 2.0 (the \"License\"); you may not use this file except in            }\r\n{  compliance with the License. You may obtain a copy of the License at        }\r\n{  http:\/\/www.mozilla.org\/MPL\/                                                 }\r\n{                                                                              }\r\n{  Software distributed under the License is distributed on an \"AS IS\"         }\r\n{  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the     }\r\n{  License for the specific language governing rights and limitations          }\r\n{  under the License.                                                          }\r\n{                                                                              }\r\n{  The Original Code is Tulip.UI.Buttons.pas.                                  }\r\n{                                                                              }\r\n{  The Initial Developer of the Original Code is Marcos Gomes.                 }\r\n{  Portions created by Marcos Gomes are Copyright (C) 2012, Marcos Gomes.      }\r\n{  All Rights Reserved.                                                        }\r\n{                                                                              }\r\n{******************************************************************************}\r\n{                                                                              }\r\n{  Tulip.UI.Buttons.pas                                 Modified: 05-Out-2012  }\r\n{  --------------------------------------------------------------------------  }\r\n{                                                                              }\r\n{                   Base Implementations for Button Controls                   }\r\n{                                                                              }\r\n{                                Version 1.02                                  }\r\n{                                                                              }\r\n{******************************************************************************}\r\n\r\nunit Tulip.UI.Buttons;\r\n\r\ninterface\r\n\r\nuses\r\n  System.SysUtils, System.Types, System.Classes,\r\n  \/\/ Asphyre Units\r\n  AbstractCanvas, AsphyreFonts, AsphyreImages, AsphyreTypes, Vectors2,\r\n  \/\/ Tulip UI Units\r\n  Tulip.UI.Types, Tulip.UI.Classes, Tulip.UI.Controls, Tulip.UI.Helpers,\r\n  Tulip.UI.Utils;\r\n\r\ntype\r\n{$REGION 'TCustomAButton'}\r\n  TCustomAButton = class(TWControl)\r\n  private\r\n    FAntialiased: Boolean;\r\n    FBorder: TActiveBorder;\r\n    FCaption: String;\r\n    FColor: TFillColor;\r\n    FColorHover: TFillColor;\r\n    FColorPressed: TFillColor;\r\n    FFocusRect: TFocusRect;\r\n    FFont: TActiveFormatedFont;\r\n    FImage: TImage;\r\n    FImageHover: TImage;\r\n    FImagePressed: TImage;\r\n    FMargin: Word;\r\n    FShadow: Boolean;\r\n    FTransparent: Boolean;\r\n\r\n    procedure SetAntialiased(Value: Boolean);\r\n    procedure SetBorder(Value: TActiveBorder);\r\n    procedure SetCaption(Value: String);\r\n    procedure SetColor(Color: TFillColor);\r\n    procedure SetColorHover(Color: TFillColor);\r\n    procedure SetColorPressed(Color: TFillColor);\r\n    procedure SetFocusRect(Value: TFocusRect);\r\n    procedure SetFont(Value: TActiveFormatedFont);\r\n    procedure SetImage(Value: TImage);\r\n    procedure SetImageHover(Value: TImage);\r\n    procedure SetImagePressed(Value: TImage);\r\n    procedure SetMargin(Value: Word);\r\n    procedure SetShadow(Value: Boolean);\r\n    procedure SetTransparent(Value: Boolean);\r\n  protected\r\n    procedure AssignTo(Dest: TPersistent); override;\r\n    procedure Paint; override;\r\n  public\r\n    constructor Create(AOwner: TComponent); override;\r\n    destructor Destroy; override;\r\n\r\n    procedure KeyDown(var Key: Word; Shift: TShiftState); override;\r\n    procedure KeyUp(var Key: Word; Shift: TShiftState); override;\r\n    procedure MouseEnter; override;\r\n    procedure MouseLeave; override;\r\n    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;\r\n      X, Y: Integer); override;\r\n    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;\r\n    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;\r\n      X, Y: Integer); override;\r\n\r\n    property Antialiased: Boolean read FAntialiased write SetAntialiased;\r\n    property Border: TActiveBorder read FBorder write SetBorder;\r\n    property Caption: String read FCaption write SetCaption;\r\n    property Color: TFillColor read FColor write SetColor;\r\n    property ColorHover: TFillColor read FColorHover write SetColorHover;\r\n    property ColorPressed: TFillColor read FColorPressed write SetColorPressed;\r\n    property FocusRect: TFocusRect read FFocusRect write SetFocusRect;\r\n    property Font: TActiveFormatedFont read FFont write SetFont;\r\n    property Image: TImage read FImage write SetImage;\r\n    property ImageHover: TImage read FImageHover write SetImageHover;\r\n    property ImagePressed: TImage read FImagePressed write SetImagePressed;\r\n    property Margin: Word read FMargin write SetMargin;\r\n    property Shadow: Boolean read FShadow write SetShadow;\r\n    property Transparent: Boolean read FTransparent write SetTransparent;\r\n  end;\r\n{$ENDREGION}\r\n\r\nimplementation\r\n\r\n{$REGION 'TCustomAButton'}\r\n{ TCustomAButton }\r\n\r\nprocedure TCustomAButton.AssignTo(Dest: TPersistent);\r\nbegin\r\n  ControlState := ControlState + [csReadingState];\r\n\r\n  inherited AssignTo(Dest);\r\n\r\n  if Dest is TCustomAButton then\r\n    with TCustomAButton(Dest) do\r\n    begin\r\n      Antialiased := Self.Antialiased;\r\n      Border := Self.Border;\r\n      Caption := Self.Caption;\r\n      Color := Self.Color;\r\n      ColorHover := Self.ColorHover;\r\n      ColorPressed := Self.ColorPressed;\r\n      FocusRect := Self.FocusRect;\r\n      Font := Self.Font;\r\n      Image := Self.Image;\r\n      ImageHover := Self.ImageHover;\r\n      ImagePressed := Self.ImagePressed;\r\n      Margin := Self.Margin;\r\n      Shadow := Self.Shadow;\r\n      Transparent := Self.Transparent;\r\n    end;\r\n\r\n  ControlState := ControlState - [csReadingState];\r\nend;\r\n\r\nconstructor TCustomAButton.Create(AOwner: TComponent);\r\nvar\r\n  Num: Integer;\r\nbegin\r\n  ControlState := ControlState + [csCreating];\r\n\r\n  inherited Create(AOwner);\r\n\r\n  if (AOwner &lt;&gt; nil) and (AOwner &lt;&gt; Self) and (AOwner is TWControl) then\r\n  begin\r\n    \/\/ Auto generate name\r\n    Num := 1;\r\n    begin\r\n      while (TWControl(AOwner).Handle.FindChildControl('Button' + IntToStr(Num),\r\n        True) &lt;&gt; nil) do\r\n        Inc(Num);\r\n      Name := 'Button' + IntToStr(Num);\r\n    end;\r\n  end;\r\n\r\n  \/\/ Fields\r\n  FAntialiased := True;\r\n  FBorder := TActiveBorder.Create;\r\n  FBorder.Color := $B0FFFFFF;\r\n  FBorder.ColorHover := $C0FFFFFF;\r\n  FBorder.ColorPressed := $C0FFFFFF;\r\n  FBorder.Size := 1;\r\n  FCaption := Name;\r\n  FColor := TFillColor.Create($FFA6CAF0, $FFA6CAF0, $FF4090F0, $FF4090F0);\r\n  FColorHover := TFillColor.Create($FFB6DAF0, $FFB6DAF0, $FF409AF0, $FF409AF0);\r\n  FColorPressed := TFillColor.Create($FF4090F0, $FF4090F0, $FFA6CAF0,\r\n    $FFA6CAF0);\r\n  FFocusRect := fDark;\r\n  FFont := TActiveFormatedFont.Create;\r\n  FFont.Name := 'tahoma10';\r\n  FFont.ColorPressed.SetColor($FFFFD040, $FFFFFFFF);\r\n  FImage := TImage.Create;\r\n  FImageHover := TImage.Create;\r\n  FImagePressed := TImage.Create;\r\n  FMargin := 2;\r\n  FShadow := True;\r\n  FTransparent := False;\r\n\r\n  \/\/ Properties\r\n  Left := 0;\r\n  Top := 0;\r\n  Width := 72;\r\n  Height := 24;\r\n  Visible := True;\r\n  TabStop := True;\r\n\r\n  ControlState := ControlState - [csCreating];\r\nend;\r\n\r\ndestructor TCustomAButton.Destroy;\r\nbegin\r\n  FBorder.Free;\r\n  FColor.Free;\r\n  FColorHover.Free;\r\n  FColorPressed.Free;\r\n  FFont.Free;\r\n  FImage.Free;\r\n  FImageHover.Free;\r\n  FImagePressed.Free;\r\n\r\n  inherited;\r\nend;\r\n\r\nprocedure TCustomAButton.KeyDown(var Key: Word; Shift: TShiftState);\r\nbegin\r\n  if (Key = 13) or (Key = $20) then\r\n  begin\r\n    ControlState := ControlState + [csClicked];\r\n  end;\r\n\r\n  inherited KeyDown(Key, Shift);\r\nend;\r\n\r\nprocedure TCustomAButton.KeyUp(var Key: Word; Shift: TShiftState);\r\nbegin\r\n  if (Key = 13) or (Key = $20) then\r\n  begin\r\n    ControlState := ControlState - [csClicked];\r\n    VirtualPoint := Point(Self.ClientLeft, Self.ClientTop);\r\n    Self.Click;\r\n  end;\r\n\r\n  inherited KeyUp(Key, Shift);\r\nend;\r\n\r\nprocedure TCustomAButton.MouseDown(Button: TMouseButton; Shift: TShiftState;\r\n  X, Y: Integer);\r\nbegin\r\n  Self.SetFocus;\r\n\r\n  ControlState := ControlState + [csClicked];\r\n\r\n  inherited MouseDown(Button, Shift, X, Y);\r\nend;\r\n\r\nprocedure TCustomAButton.MouseEnter;\r\nbegin\r\n  ControlState := ControlState + [csMouseHover];\r\n  inherited MouseEnter;\r\nend;\r\n\r\nprocedure TCustomAButton.MouseLeave;\r\nbegin\r\n  ControlState := ControlState - [csMouseHover];\r\n  inherited MouseLeave;\r\nend;\r\n\r\nprocedure TCustomAButton.MouseMove(Shift: TShiftState; X, Y: Integer);\r\nbegin\r\n  inherited MouseMove(Shift, X, Y);\r\nend;\r\n\r\nprocedure TCustomAButton.MouseUp(Button: TMouseButton; Shift: TShiftState;\r\n  X, Y: Integer);\r\nbegin\r\n  ControlState := ControlState - [csClicked];\r\n\r\n  inherited MouseUp(Button, Shift, X, Y);\r\nend;\r\n\r\nprocedure TCustomAButton.Paint;\r\nvar\r\n  X, Y: Integer;\r\n  AFont: TAsphyreFont;\r\n  AImage: TAsphyreImage;\r\n  AColor: TFillColor;\r\n  ABorderColor: TAColor;\r\n  AFontColor: TTextColor;\r\n  bTop, bBottom: TConstraintSize;\r\nbegin\r\n  \/\/ Set initial values\r\n  X := ClientLeft;\r\n  Y := ClientTop;\r\n\r\n  ControlManager.Canvas.Antialias := FAntialiased;\r\n\r\n  \/\/ Draw Background\r\n  if not FTransparent then\r\n  begin\r\n    \/\/ Select Image and Color\r\n    if csClicked in ControlState then\r\n    begin\r\n      AImage := ControlManager.Images.Image[FImagePressed.Image];\r\n      AColor := FColorPressed;\r\n    end\r\n    else if csMouseHover in ControlState then\r\n    begin\r\n      AImage := ControlManager.Images.Image[FImageHover.Image];\r\n      AColor := FColorHover;\r\n    end\r\n    else\r\n    begin\r\n      AImage := ControlManager.Images.Image[FImage.Image];\r\n      AColor := FColor;\r\n    end;\r\n\r\n    if AImage &lt;&gt; nil then\r\n    begin\r\n      if csClicked in ControlState then\r\n      begin\r\n        ControlManager.Canvas.UseImagePx(AImage, pRect4(FImagePressed.Rect));\r\n        ControlManager.Canvas.TexMap(pRect4(Rect(X, Y, X + Width, Y + Height)),\r\n          cAlpha4(AColor), beNormal);\r\n      end\r\n      else if csMouseHover in ControlState then\r\n      begin\r\n        ControlManager.Canvas.UseImagePx(AImage, pRect4(FImageHover.Rect));\r\n        ControlManager.Canvas.TexMap(pRect4(Rect(X, Y, X + Width, Y + Height)),\r\n          cAlpha4(AColor), beNormal);\r\n      end\r\n      else\r\n      begin\r\n        ControlManager.Canvas.UseImagePx(AImage, pRect4(FImage.Rect));\r\n        ControlManager.Canvas.TexMap(pRect4(Rect(X, Y, X + Width, Y + Height)),\r\n          cAlpha4(AColor), beNormal);\r\n      end;\r\n\r\n    end\r\n    else\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(X, Y, X + Width, Y + Height),\r\n        cColor4(AColor), beNormal);\r\n    end;\r\n  end;\r\n\r\n  \/\/ Draw Border\r\n  if Border.Size &gt; 0 then\r\n  begin\r\n    bTop := 0;\r\n    bBottom := 0;\r\n\r\n    \/\/ Select Border Color\r\n    if csClicked in ControlState then\r\n    begin\r\n      ABorderColor := FBorder.ColorPressed;\r\n    end\r\n    else if csMouseHover in ControlState then\r\n    begin\r\n      ABorderColor := FBorder.ColorHover;\r\n    end\r\n    else\r\n    begin\r\n      ABorderColor := FBorder.Color;\r\n    end;\r\n\r\n    if eTop in Border.Edges then\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(X, Y, X + Width, Y + Border.Size),\r\n        ABorderColor, beNormal);\r\n      bTop := Border.Size;\r\n    end;\r\n\r\n    if eBottom in Border.Edges then\r\n    begin\r\n      ControlManager.Canvas.FillRect(Rect(X, Y + Height - Border.Size,\r\n        X + Width, Y + Height), ABorderColor, beNormal);\r\n      bBottom := Border.Size;\r\n    end;\r\n\r\n    if eLeft in Border.Edges then\r\n      ControlManager.Canvas.FillRect(Rect(X, Y + bTop, X + Border.Size,\r\n        Y + Height - bBottom), ABorderColor, beNormal);\r\n\r\n    if eRight in Border.Edges then\r\n      ControlManager.Canvas.FillRect(Rect(X + Width - Border.Size, Y + bTop,\r\n        X + Width, Y + Height - bBottom), ABorderColor, beNormal);\r\n  end;\r\n\r\n  \/\/ Draw DisplayText\r\n  AFont := ControlManager.Fonts.Font[FFont.Name];\r\n  if (AFont &lt;&gt; nil) and (FCaption &lt;&gt; '') then\r\n  begin\r\n    \/\/ Select Font Color\r\n    if csClicked in ControlState then\r\n    begin\r\n      AFontColor := FFont.ColorPressed;\r\n    end\r\n    else if csMouseHover in ControlState then\r\n    begin\r\n      AFontColor := FFont.ColorHover;\r\n    end\r\n    else\r\n    begin\r\n      AFontColor := FFont.Color;\r\n    end;\r\n\r\n    AFont.TextRectEx(Point2(X + Border.Size + Margin, Y + Border.Size + Margin +\r\n      1), Point2(Width - (Border.Size * 2) - (Margin * 2),\r\n      Height - (Border.Size * 2) - (Margin * 2)), FCaption, cColor2(AFontColor),\r\n      1.0, FFont.HorizontalAlign, FFont.VerticalAlign, FFont.ParagraphLine);\r\n  end;\r\n\r\n  \/\/ Draw Shadow\r\n  if (Shadow = True) then\r\n  begin\r\n    ControlManager.Canvas.FillRect(Rect(X + Width, Y + 1, X + Width + 1,\r\n      Y + Height), cColor4($40000000), beShadow);\r\n    ControlManager.Canvas.FillRect(Rect(X + 1, Y + Height, X + Width + 1,\r\n      Y + Height + 1), cColor4($40000000), beShadow);\r\n  end;\r\n\r\n  \/\/ Draw Focus rect\r\n  if (ControlManager.ActiveControl = Self) and (Self.FocusRect = fLight) then\r\n  begin\r\n    ControlManager.Canvas.FrameRect(Rect(X - 1, Y - 1, X + Width + 1,\r\n      Y + Height + 1), cColor4($40FFFFFF), beNormal);\r\n  end;\r\n  if (ControlManager.ActiveControl = Self) and (Self.FocusRect = fDark) then\r\n  begin\r\n    ControlManager.Canvas.FrameRect(Rect(X - 1, Y - 1, X + Width + 1,\r\n      Y + Height + 1), cColor4($30000000), beNormal);\r\n  end;\r\n\r\nend;\r\n\r\nprocedure TCustomAButton.SetAntialiased(Value: Boolean);\r\nbegin\r\n  FAntialiased := Value;\r\nend;\r\n\r\nprocedure TCustomAButton.SetBorder(Value: TActiveBorder);\r\nbegin\r\n  if Value &lt;&gt; nil then\r\n    FBorder.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomAButton.SetCaption(Value: String);\r\nbegin\r\n  FCaption := Value;\r\nend;\r\n\r\nprocedure TCustomAButton.SetColor(Color: TFillColor);\r\nbegin\r\n  if Color &lt;&gt; nil then\r\n    FColor.Assign(Color);\r\nend;\r\n\r\nprocedure TCustomAButton.SetColorHover(Color: TFillColor);\r\nbegin\r\n  if Color &lt;&gt; nil then\r\n    FColorHover.Assign(Color);\r\nend;\r\n\r\nprocedure TCustomAButton.SetColorPressed(Color: TFillColor);\r\nbegin\r\n  if Color &lt;&gt; nil then\r\n    FColorPressed.Assign(Color);\r\nend;\r\n\r\nprocedure TCustomAButton.SetImage(Value: TImage);\r\nbegin\r\n  if Value &lt;&gt; nil then\r\n    FImage.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomAButton.SetImageHover(Value: TImage);\r\nbegin\r\n  if Value &lt;&gt; nil then\r\n    FImageHover.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomAButton.SetImagePressed(Value: TImage);\r\nbegin\r\n  if Value &lt;&gt; nil then\r\n    FImagePressed.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomAButton.SetMargin(Value: Word);\r\nbegin\r\n  FMargin := Value;\r\nend;\r\n\r\nprocedure TCustomAButton.SetShadow(Value: Boolean);\r\nbegin\r\n  FShadow := Value;\r\nend;\r\n\r\nprocedure TCustomAButton.SetFocusRect(Value: TFocusRect);\r\nbegin\r\n  FFocusRect := Value;\r\nend;\r\n\r\nprocedure TCustomAButton.SetFont(Value: TActiveFormatedFont);\r\nbegin\r\n  if Value &lt;&gt; nil then\r\n    FFont.Assign(Value);\r\nend;\r\n\r\nprocedure TCustomAButton.SetTransparent(Value: Boolean);\r\nbegin\r\n  FTransparent := Value;\r\nend;\r\n{$ENDREGION}\r\n\r\nend.\r\n<\/pre>\n<p><\/code><\/p>\n<footer class=\"entry-meta\" style=\"text-align: Right;\"><a title=\"Source Files\" href=\"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1091\">Source Files<\/a><span> | Tulip.UI.Buttons.pas<\/span><\/footer>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Source Files | Tulip.UI.Buttons.pas {******************************************************************************} { } { Tulip &#8211; User Interface Library } { } { Copyright(c) 2012 Marcos Gomes. All rights Reserved. } { } { &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; } <a class=\"more-link\" href=\"http:\/\/tulip-ui.azurewebsites.net\/?page_id=1241\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1091,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1241"}],"collection":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1241"}],"version-history":[{"count":32,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1241\/revisions"}],"predecessor-version":[{"id":2891,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1241\/revisions\/2891"}],"up":[{"embeddable":true,"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/pages\/1091"}],"wp:attachment":[{"href":"http:\/\/tulip-ui.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}