forked from chromelyapps/Chromely
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issues where Chromely does not work on some Linux distros - czt…
- Loading branch information
Showing
7 changed files
with
449 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Chromely.Native | ||
{ | ||
public class GListUtil | ||
{ | ||
private readonly IntPtr _list; | ||
public GListUtil(IntPtr list) | ||
{ | ||
_list = list; | ||
} | ||
|
||
public int Length | ||
{ | ||
get | ||
{ | ||
return g_list_length(_list); | ||
} | ||
} | ||
|
||
public void Free() | ||
{ | ||
if (_list != IntPtr.Zero) | ||
g_list_free(_list); | ||
} | ||
|
||
public IntPtr GetItem(int nth) | ||
{ | ||
if (_list != IntPtr.Zero) | ||
return g_list_nth_data(_list, (uint)nth); | ||
|
||
return IntPtr.Zero; | ||
} | ||
|
||
#region DLLIMPORTS GlibLib | ||
|
||
[DllImport(Library.GlibLib, CallingConvention = CallingConvention.Cdecl)] | ||
static extern int g_list_length(IntPtr l); | ||
|
||
[DllImport(Library.GlibLib, CallingConvention = CallingConvention.Cdecl)] | ||
static extern void g_list_free(IntPtr l); | ||
|
||
[DllImport(Library.GlibLib, CallingConvention = CallingConvention.Cdecl)] | ||
static extern IntPtr g_list_nth_data(IntPtr l, uint n); | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Chromely.Native | ||
{ | ||
public static class Library | ||
{ | ||
internal const string GtkLib = "libgtk-3.so.0"; | ||
internal const string GObjLib = "libgobject-2.0.so.0"; | ||
internal const string GdkLib = "libgdk-3.so.0"; | ||
internal const string GlibLib = "libglib-2.0.so.0"; | ||
internal const string GioLib = "libgio-2.0.so.0"; | ||
internal const string GdkPixBuf = "libgdk_pixbuf-2.0.so.0"; | ||
internal const string X11Lib = "libX11.so"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.