summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-03-22 16:55:36 +0000
committerVincent Sanders <vince@netsurf-browser.org>2012-03-22 16:55:36 +0000
commit51d8264eb1e8f705635cd0af2c0e9dddaf855711 (patch)
tree25bdda51e22072965b65545fabea1cf957f6d303 /include
parent4875d9f650071c8cd6d2976ea6f88f18bc8cc10b (diff)
downloadlibnsfb-51d8264eb1e8f705635cd0af2c0e9dddaf855711.tar.gz
libnsfb-51d8264eb1e8f705635cd0af2c0e9dddaf855711.tar.bz2
basic fixes for linux framebuffer surface
svn path=/trunk/libnsfb/; revision=13550
Diffstat (limited to 'include')
-rw-r--r--include/libnsfb.h15
-rw-r--r--include/nsfb.h6
-rw-r--r--include/surface.h36
3 files changed, 35 insertions, 22 deletions
diff --git a/include/libnsfb.h b/include/libnsfb.h
index 330c476..739617e 100644
--- a/include/libnsfb.h
+++ b/include/libnsfb.h
@@ -118,15 +118,26 @@ int nsfb_update(nsfb_t *nsfb, nsfb_bbox_t *box);
*/
int nsfb_get_geometry(nsfb_t *nsfb, int *width, int *height, enum nsfb_format_e *format);
-/** Alter the geometry of a framebuffer context
+/** Alter the geometry of a surface
*
* @param nsfb The context to alter.
* @param width The new display width.
* @param height The new display height.
- * @param bpp The new display depth.
+ * @param format The desired surface format.
*/
int nsfb_set_geometry(nsfb_t *nsfb, int width, int height, enum nsfb_format_e format);
+/** Set parameters a surface
+ *
+ * Some surface types can take additional parameters for
+ * attributes. For example the linux surface uses this to allow the
+ * setting of a different output device
+ *
+ * @param nsfb The surface to alter.
+ * @param parameters The parameters for the surface.
+ */
+int nsfb_set_parameters(nsfb_t *nsfb, const char *parameters);
+
/** Obtain the buffer memory base and stride.
*
* @param nsfb The context to read.
diff --git a/include/nsfb.h b/include/nsfb.h
index 9b1619c..5caff9b 100644
--- a/include/nsfb.h
+++ b/include/nsfb.h
@@ -20,12 +20,10 @@ struct nsfb_s {
int width; /**< Visible width. */
int height; /**< Visible height. */
- int bpp;
+ char *parameters;
enum nsfb_format_e format; /**< Framebuffer format */
-
- int refresh; /**< Desired refresh rate for physical displays. */
- char *output_dev; /**> Path to output device for surfaces that require it. */
+ int bpp; /**< Bits per pixel - distinct from format */
uint8_t *ptr; /**< Base of video memory. */
int linelen; /**< length of a video line. */
diff --git a/include/surface.h b/include/surface.h
index d0c6c5a..efb84fb 100644
--- a/include/surface.h
+++ b/include/surface.h
@@ -5,38 +5,42 @@
#include "nsfb.h"
/* surface default options */
-typedef int (nsfb_fendfn_defaults_t)(nsfb_t *nsfb);
+typedef int (nsfb_surfacefn_defaults_t)(nsfb_t *nsfb);
/* surface init */
-typedef int (nsfb_fendfn_init_t)(nsfb_t *nsfb);
+typedef int (nsfb_surfacefn_init_t)(nsfb_t *nsfb);
/* surface finalise */
-typedef int (nsfb_fendfn_fini_t)(nsfb_t *nsfb);
+typedef int (nsfb_surfacefn_fini_t)(nsfb_t *nsfb);
/* surface set geometry */
-typedef int (nsfb_fendfn_geometry_t)(nsfb_t *nsfb, int width, int height, enum nsfb_format_e format);
+typedef int (nsfb_surfacefn_geometry_t)(nsfb_t *nsfb, int width, int height, enum nsfb_format_e format);
+
+/* surface set parameters */
+typedef int (nsfb_surfacefn_parameters_t)(nsfb_t *nsfb, const char *parameters);
/* surface input */
-typedef bool (nsfb_fendfn_input_t)(nsfb_t *nsfb, nsfb_event_t *event, int timeout);
+typedef bool (nsfb_surfacefn_input_t)(nsfb_t *nsfb, nsfb_event_t *event, int timeout);
/* surface area claim */
-typedef int (nsfb_fendfn_claim_t)(nsfb_t *nsfb, nsfb_bbox_t *box);
+typedef int (nsfb_surfacefn_claim_t)(nsfb_t *nsfb, nsfb_bbox_t *box);
/* surface area update */
-typedef int (nsfb_fendfn_update_t)(nsfb_t *nsfb, nsfb_bbox_t *box);
+typedef int (nsfb_surfacefn_update_t)(nsfb_t *nsfb, nsfb_bbox_t *box);
/* surface cursor display */
-typedef int (nsfb_fendfn_cursor_t)(nsfb_t *nsfb, struct nsfb_cursor_s *cursor);
+typedef int (nsfb_surfacefn_cursor_t)(nsfb_t *nsfb, struct nsfb_cursor_s *cursor);
typedef struct nsfb_surface_rtns_s {
- nsfb_fendfn_defaults_t *defaults;
- nsfb_fendfn_init_t *initialise;
- nsfb_fendfn_fini_t *finalise;
- nsfb_fendfn_geometry_t *geometry;
- nsfb_fendfn_input_t *input;
- nsfb_fendfn_claim_t *claim;
- nsfb_fendfn_update_t *update;
- nsfb_fendfn_cursor_t *cursor;
+ nsfb_surfacefn_defaults_t *defaults;
+ nsfb_surfacefn_init_t *initialise;
+ nsfb_surfacefn_fini_t *finalise;
+ nsfb_surfacefn_geometry_t *geometry;
+ nsfb_surfacefn_parameters_t *parameters;
+ nsfb_surfacefn_input_t *input;
+ nsfb_surfacefn_claim_t *claim;
+ nsfb_surfacefn_update_t *update;
+ nsfb_surfacefn_cursor_t *cursor;
} nsfb_surface_rtns_t;
void _nsfb_register_surface(const enum nsfb_type_e type, const nsfb_surface_rtns_t *rtns, const char *name);