Skip to content

Commit

Permalink
Bind 2 high visibility PrintCore APIs (#4933)
Browse files Browse the repository at this point in the history
  • Loading branch information
chamons authored Oct 11, 2018
1 parent ffd85c9 commit 7c1d23d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 20 additions & 0 deletions src/PrintCore/PrintCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,26 @@ public bool IsRemote {
}
}

[DllImport (Constants.PrintCoreLibrary)]
extern static IntPtr PMPrinterGetID (IntPtr printer);

public string Id {
get {
return CFString.FetchString (PMPrinterGetID (handle));
}
}

[DllImport (Constants.PrintCoreLibrary)]
extern static PMStatusCode PMPrinterCopyHostName (IntPtr printer, out IntPtr hostName);

public string HostName {
get {
PMStatusCode code = PMPrinterCopyHostName (handle, out IntPtr hostName);
if (code != PMStatusCode.Ok)
return null;
return CFString.FetchString (hostName, true);
}
}
}

public class PMServer : PMPrintCoreBase {
Expand Down
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-PrintCore.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
!missing-pinvoke! PMPresetCreatePrintSettings is not bound
!missing-pinvoke! PMPresetGetAttributes is not bound
!missing-pinvoke! PMPrinterCopyDescriptionURL is not bound
!missing-pinvoke! PMPrinterCopyHostName is not bound
!missing-pinvoke! PMPrinterCopyPresets is not bound
!missing-pinvoke! PMPrinterCopyState is not bound
!missing-pinvoke! PMPrinterGetCommInfo is not bound
!missing-pinvoke! PMPrinterGetDriverCreator is not bound
!missing-pinvoke! PMPrinterGetDriverReleaseInfo is not bound
!missing-pinvoke! PMPrinterGetID is not bound
!missing-pinvoke! PMPrinterGetIndexedPrinterResolution is not bound
!missing-pinvoke! PMPrinterGetLanguageInfo is not bound
!missing-pinvoke! PMPrinterGetLocation is not bound
Expand Down

1 comment on commit 7c1d23d

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Build' 🔥 : hudson.AbortException: script returned exit code 2

🔥 Build failed 🔥

Please sign in to comment.