Skip to content

Commit

Permalink
remove unused declarations from header file, require ffi extension in…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
morawskim committed Apr 29, 2024
1 parent db1ed85 commit c9330a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 67 deletions.
66 changes: 0 additions & 66 deletions src/Notifier/FFI/ffi-libnotify.h
Original file line number Diff line number Diff line change
@@ -1,79 +1,13 @@
#define FFI_LIB "libnotify.so.4"

typedef signed short gint16;
typedef int gint;
typedef bool gboolean;
typedef void* gpointer;
typedef unsigned int gsize;
typedef unsigned int guint;
typedef unsigned long gulong;
typedef gulong GType;

typedef struct _GTypeClass GTypeClass;
typedef struct _GSList GSList;
typedef struct _GTypeInstance GTypeInstance;
typedef struct _GObject GObject;
typedef struct _GObjectClass GObjectClass;
typedef struct _GObject GInitiallyUnowned;
typedef struct _GObjectClass GInitiallyUnownedClass;
typedef struct _GObjectConstructParam GObjectConstructParam;

typedef struct _NotifyNotification NotifyNotification;
typedef struct _NotifyNotificationClass NotifyNotificationClass;
typedef struct _NotifyNotificationPrivate NotifyNotificationPrivate;

typedef struct _GTypeInstanceError GError;

struct _GSList
{
gpointer data;
GSList *next;
};

struct _GTypeClass {
GType g_type;
};

struct _GObjectClass
{
GTypeClass g_type_class;
GSList *construct_properties;
gsize flags;
gpointer pdummy[6];
};

struct _GTypeInstance {
GTypeClass *g_class;
};

struct _GObject
{
GTypeInstance g_type_instance;
guint ref_count;
// GData *qdata;
};

struct _NotifyNotification
{
/*< private >*/
GObject parent_object;

NotifyNotificationPrivate *priv;
};

struct _NotifyNotificationClass
{
GObjectClass parent_class;

/* Signals */
void (*closed) (NotifyNotification *notification);
};


gboolean notify_init(const char *app_name);
gboolean notify_is_initted (void);
void notify_uninit (void);
const char* notify_get_app_name ( void );
NotifyNotification *notify_notification_new(const char *summary, const char *body, const char *icon);
gboolean notify_notification_show (NotifyNotification *notification, GError **error);
void g_object_unref (gpointer object);
5 changes: 4 additions & 1 deletion tests/Notifier/LibNotifyNotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testSendWithEmptyBody()
}

/**
* @requires ffi
* @requires extension ffi
*/
public function testInitialize()
{
Expand Down Expand Up @@ -77,6 +77,9 @@ public function testSendThrowsExceptionWhenNotificationHasAnEmptyBody()
}
}

/**
* @requires extension ffi
*/
public function testSendNotificationWithAllOptions()
{
$notifier = $this->getNotifier();
Expand Down

0 comments on commit c9330a7

Please sign in to comment.