Gitweb links:
...log
http://git.netsurf-browser.org/libnsfb.git/shortlog/9672c46b1a3ecf2a0c32445f1c1d17f15fd20bb5
...commit
http://git.netsurf-browser.org/libnsfb.git/commit/9672c46b1a3ecf2a0c32445f1c1d17f15fd20bb5
...tree
http://git.netsurf-browser.org/libnsfb.git/tree/9672c46b1a3ecf2a0c32445f1c1d17f15fd20bb5
The branch, master has been updated
via 9672c46b1a3ecf2a0c32445f1c1d17f15fd20bb5 (commit)
via 1440a3a8cb8b44c4d762758c20b1fc31653ff187 (commit)
from 84fb99890ff127c763efc5014633b8e3a4c762b4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnsfb.git/commit/?id=9672c46b1a3ecf2a0c32445f1c1d17f15fd20bb5
commit 9672c46b1a3ecf2a0c32445f1c1d17f15fd20bb5
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
surface: Reorder surface types by usefulness
In order to allow client applications to decide which surface
to default to, order the types by usefulness to a typical user.
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/include/libnsfb.h b/include/libnsfb.h
index d52d821..674df65 100644
--- a/include/libnsfb.h
+++ b/include/libnsfb.h
@@ -35,13 +35,14 @@ typedef struct nsfb_bbox_s {
/** The type of framebuffer surface. */
enum nsfb_type_e {
NSFB_SURFACE_NONE = 0, /**< No surface */
- NSFB_SURFACE_RAM, /**< RAM surface */
NSFB_SURFACE_SDL, /**< SDL surface */
- NSFB_SURFACE_LINUX, /**< Linux framebuffer surface */
+ NSFB_SURFACE_X, /**< X windows surface */
+ NSFB_SURFACE_WL, /**< Wayland surface */
NSFB_SURFACE_VNC, /**< VNC surface */
+ NSFB_SURFACE_LINUX, /**< Linux framebuffer surface */
NSFB_SURFACE_ABLE, /**< ABLE framebuffer surface */
- NSFB_SURFACE_X, /**< X windows surface */
- NSFB_SURFACE_WL /**< Wayland surface */
+ NSFB_SURFACE_RAM, /**< RAM surface */
+ NSFB_SURFACE_COUNT, /**< The number of surface kinds */
};
enum nsfb_format_e {
commitdiff
http://git.netsurf-browser.org/libnsfb.git/commit/?id=1440a3a8cb8b44c4d762758c20b1fc31653ff187
commit 1440a3a8cb8b44c4d762758c20b1fc31653ff187
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>
surface: Add basic surface enumerator
Signed-off-by: Daniel Silverstone <[email protected]>
diff --git a/include/libnsfb.h b/include/libnsfb.h
index dfb720c..d52d821 100644
--- a/include/libnsfb.h
+++ b/include/libnsfb.h
@@ -58,6 +58,21 @@ enum nsfb_format_e {
NSFB_FMT_I1, /* black and white */
};
+/** Callback for surface enumeration
+ *
+ * @param The context you gave for the enumeration
+ * @param The name of a surface registered with libnsfb
+ * @param The type of that surface for use with ::nsfb_new
+ */
+typedef void (*surface_enumeration_cb)(void *, const char *, enum nsfb_type_e);
+
+/** Enumerate surface types registered with libnsfb
+ *
+ * @param cb The callback to call with each surface
+ * @param context The context to pass to the enumeration callback
+ */
+void nsfb_enumerate_surface_types(surface_enumeration_cb cb, void *context);
+
/** Select frontend type from a name.
*
* @param name The name to select a frontend.
diff --git a/src/surface/surface.c b/src/surface/surface.c
index f3127bd..426efa9 100644
--- a/src/surface/surface.c
+++ b/src/surface/surface.c
@@ -151,6 +151,17 @@ nsfb_type_from_name(const char *name)
return NSFB_SURFACE_NONE;
}
+/* exported interface defined in libnsfb.h */
+void
+nsfb_enumerate_surface_types(surface_enumeration_cb cb, void *context)
+{
+ int fend_loop;
+
+ for (fend_loop = 0; fend_loop < surface_count; fend_loop++) {
+ cb(context, surfaces[fend_loop].name, surfaces[fend_loop].type);
+ }
+}
+
/*
* Local variables:
* c-basic-offset: 4
-----------------------------------------------------------------------
Summary of changes:
include/libnsfb.h | 24 ++++++++++++++++++++----
src/surface/surface.c | 11 +++++++++++
2 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/include/libnsfb.h b/include/libnsfb.h
index dfb720c..674df65 100644
--- a/include/libnsfb.h
+++ b/include/libnsfb.h
@@ -35,13 +35,14 @@ typedef struct nsfb_bbox_s {
/** The type of framebuffer surface. */
enum nsfb_type_e {
NSFB_SURFACE_NONE = 0, /**< No surface */
- NSFB_SURFACE_RAM, /**< RAM surface */
NSFB_SURFACE_SDL, /**< SDL surface */
- NSFB_SURFACE_LINUX, /**< Linux framebuffer surface */
+ NSFB_SURFACE_X, /**< X windows surface */
+ NSFB_SURFACE_WL, /**< Wayland surface */
NSFB_SURFACE_VNC, /**< VNC surface */
+ NSFB_SURFACE_LINUX, /**< Linux framebuffer surface */
NSFB_SURFACE_ABLE, /**< ABLE framebuffer surface */
- NSFB_SURFACE_X, /**< X windows surface */
- NSFB_SURFACE_WL /**< Wayland surface */
+ NSFB_SURFACE_RAM, /**< RAM surface */
+ NSFB_SURFACE_COUNT, /**< The number of surface kinds */
};
enum nsfb_format_e {
@@ -58,6 +59,21 @@ enum nsfb_format_e {
NSFB_FMT_I1, /* black and white */
};
+/** Callback for surface enumeration
+ *
+ * @param The context you gave for the enumeration
+ * @param The name of a surface registered with libnsfb
+ * @param The type of that surface for use with ::nsfb_new
+ */
+typedef void (*surface_enumeration_cb)(void *, const char *, enum nsfb_type_e);
+
+/** Enumerate surface types registered with libnsfb
+ *
+ * @param cb The callback to call with each surface
+ * @param context The context to pass to the enumeration callback
+ */
+void nsfb_enumerate_surface_types(surface_enumeration_cb cb, void *context);
+
/** Select frontend type from a name.
*
* @param name The name to select a frontend.
diff --git a/src/surface/surface.c b/src/surface/surface.c
index f3127bd..426efa9 100644
--- a/src/surface/surface.c
+++ b/src/surface/surface.c
@@ -151,6 +151,17 @@ nsfb_type_from_name(const char *name)
return NSFB_SURFACE_NONE;
}
+/* exported interface defined in libnsfb.h */
+void
+nsfb_enumerate_surface_types(surface_enumeration_cb cb, void *context)
+{
+ int fend_loop;
+
+ for (fend_loop = 0; fend_loop < surface_count; fend_loop++) {
+ cb(context, surfaces[fend_loop].name, surfaces[fend_loop].type);
+ }
+}
+
/*
* Local variables:
* c-basic-offset: 4
--
NetSurf Framebuffer library
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org