This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via cfc171705f4af25d48d768ed3b5e89e1ef668393 (commit)
from 33a4746b83e0cebb41776cc50b9d44a5c31a06fd (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 -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/cfc171705f4af25d48d768ed3b5e89e1ef66…
commit cfc171705f4af25d48d768ed3b5e89e1ef668393
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 13 16:14:02 2012 +0200
doc: Used spell checker to fix typos.
diff --git a/doc/backends.txt b/doc/backends.txt
index ced9548..2a614ff 100644
--- a/doc/backends.txt
+++ b/doc/backends.txt
@@ -3,14 +3,14 @@ Drawing Backends
Drawing backends provide means to draw into computer screen or into an window
inside of running operating system. Instead of having one unified
-initalization interface each backend has it's specific function and sematics
-but once backend is initalized the backend structure provides unified API for
-controling the drawing.
+initialization interface each backend has it's specific function and semantics
+but once backend is initialized the backend structure provides unified API for
+controlling the drawing.
-So far there are three backends implemented, linux mmaped framebuffer, libSDL
+So far there are three backends implemented, Linux mmaped frame-buffer, libSDL
and X11 backend.
-Initalization functions
+Initialization functions
~~~~~~~~~~~~~~~~~~~~~~~
[source,c]
@@ -18,12 +18,12 @@ Initalization functions
GP_Backend *GP_BackendLinuxFBInit(const char *path);
-------------------------------------------------------------------------------
-Initalizes mmaped framebuffer backend. The path is path to the framebuffer
-device ie. '/dev/fbX'. This backend is not buffered, everything you draw
-appears on the screen right away (an swich may be added for that purpose).
+Initializes mmaped frame-buffer backend. The path is path to the frame-buffer
+device i.e. '/dev/fbX'. This backend is not buffered, everything you draw
+appears on the screen right away (an switch may be added for that purpose).
-Also note that this backend doesn't initalize any input driver. You need to
-initalize input driver in order to get keystrokes and/or pointer events.
+Also note that this backend doesn't initialize any input driver. You need to
+initialize input driver in order to get keystrokes and/or pointer events.
[source,c]
@@ -38,15 +38,15 @@ GP_Backend *GP_BackendSDLInit(GP_Size w, GP_Size h,
const char *caption);
-------------------------------------------------------------------------------
-Initalize SDL as an backend driver. The backend is thread safe as all the
-operations are guarded by locks. You can't initalize more than one backend at a
-time, that is inherited SDL limiation. If you call the initalizaiton for a
-second time, you will get a pointer to allready running backend. This driver
+Initialize SDL as an backend driver. The backend is thread safe as all the
+operations are guarded by locks. You can't initialize more than one backend at a
+time, that is inherited SDL limitation. If you call the initialization for a
+second time, you will get a pointer to already running backend. This driver
feeds input events into global input event queue (see input docs for details).
If w, h and/or bpp are zero SDL tries to do a guess, most of the time wrong for
w and h though. The caption is window caption and may be ignored for some of
-the backends. And finally flags may change the SDL to go to fullscreen mode or
-make the window resizeable.
+the backends. And finally flags may change the SDL to go to full-screen mode or
+make the window resizable.
[source,c]
-------------------------------------------------------------------------------
@@ -65,7 +65,7 @@ windows at a time.
Overall init function
~~~~~~~~~~~~~~~~~~~~~
-Althoug there is no unified backend initalization, there is something close to
+Although there is no unified backend initialization, there is something close to
it.
[source,c]
@@ -76,23 +76,23 @@ GP_Backend *GP_BackendInit(const char *params, const char *caption, FILE *help);
-------------------------------------------------------------------------------
This function takes a params string as an parameter which is used for
-determining backend-dependend parametrs. The format is
+determining backend-dependent parameters. The format is
'backend_name:backend_parameters' where backend parameters may be window size
(either 'WxH' or 'FS' in case of SDL backend). The caption is window caption
(which is ignored in some of the cases) and the 'FILE' is file, where an error
is printed in case of failure, you should mostly use 'stderr' for that
purpose. If params is set to 'NULL' the the call only prints help into the
-passed help 'FILE'. If intitalizaton was succesfull pointer to allocated and
-initalized backend is returned otherwise 'NULL' is returned and some helpful
-infomation should be printed into the passed help 'FILE'.
+passed help 'FILE'. If initialization was successful pointer to allocated and
+initialized backend is returned otherwise 'NULL' is returned and some helpful
+information should be printed into the passed help 'FILE'.
Drawing Backend API
~~~~~~~~~~~~~~~~~~~
The drawing backend API consist of structure with callbacks. Every backend
-initalization yields pointer to this structure. Although is possible to call
-these pointers directly it's not recomended and everbody should rather use
+initialization yields pointer to this structure. Although is possible to call
+these pointers directly it's not recommended and everybody should rather use
backend inline functions instead.
The backend API consist of several functions:
@@ -109,7 +109,7 @@ Calls an backend exit callback.
GP_BackendFlip(GP_Backend *backend);
-------------------------------------------------------------------------------
-Flips a screen. Updates rect for a buffered backends.
+Flips a screen. Updates rectangle for a buffered backends.
[source,c]
-------------------------------------------------------------------------------
@@ -127,4 +127,4 @@ void GP_BackendPoll(GP_Backend *backend);
Polls for backend events. For backends that do not expose file descriptor
(namely SDL) this should be called repeatedly. For other backend it may be
-called either repeatedly or when data are ready on filedescriptor.
+called either repeatedly or when data are ready on file-descriptor.
diff --git a/doc/context.txt b/doc/context.txt
index 00c6c08..809f995 100644
--- a/doc/context.txt
+++ b/doc/context.txt
@@ -54,7 +54,7 @@ you could use variants with _Raw suffix (although this is not recommended).
There are various helper macros for transforming coordinates and sizes in
'core/GP_Transform.h'. And context helper functions to "rotate" the flags
clock wise and counter clock wise as well as functions to get the context size
-when taking into the accout the widht and height.
+when taking into the account the width and height.
[source,c]
-------------------------------------------------------------------------------
@@ -108,7 +108,7 @@ void GP_ContextInit(GP_Context *context, GP_Size w, GP_Size h,
GP_PixelType type, void *pixels);
-------------------------------------------------------------------------------
-Initalize given context accordingly to parameters, the rest of context
+Initialize given context accordingly to parameters, the rest of context
parameters are set to the default values (i.e. rotation flags are all set to
zero, 'free_pixels' flag is not set). Number of bits per pixel and
bytes per row are computed from the given pixel type and size.
@@ -125,7 +125,7 @@ will *not* try to allocate the pixel memory automatically).
GP_Context *GP_ContextAlloc(GP_Size w, GP_Size h, GP_PixelType type);
-------------------------------------------------------------------------------
-The 'GP_ContextAlloc()' allocates and initalizes a context.
+The 'GP_ContextAlloc()' allocates and initializes a context.
The orientation flags are all set to zero, the 'free_pixels' flag is set and the
rest of the metadata are calculated accordingly to width, height and
@@ -141,7 +141,7 @@ appropriate size; the initial contents of the bitmap are undefined.
GP_Context *GP_ContextCopy(const GP_Context *src, int flag);
-------------------------------------------------------------------------------
-The 'GP_ContextCopy()' allocates and initalizes a copy of the context passed
+The 'GP_ContextCopy()' allocates and initializes a copy of the context passed
as argument. If 'flag' is set, the bitmap contents ('src->pixels')
are also copied; otherwise the copy will have the same dimensions but
undefined contents.
diff --git a/doc/drawing_api.txt b/doc/drawing_api.txt
index d836680..a7f65c9 100644
--- a/doc/drawing_api.txt
+++ b/doc/drawing_api.txt
@@ -292,6 +292,6 @@ The Descent is the height in pixels from baseline to the bottom.
unsigned int GP_TextHeight(const GP_TextStyle *style);
--------------------------------------------------------------------------------
-The Height is size of the font from top to the bottom, eg. equals exactly to
+The Height is size of the font from top to the bottom, i.e. equals exactly to
the sum of ascent and descent.
diff --git a/doc/filters.txt b/doc/filters.txt
index 6750a70..a2647b7 100644
--- a/doc/filters.txt
+++ b/doc/filters.txt
@@ -25,7 +25,7 @@ type and the context size must be big enough to store the result.
For filters that work 'in-place' (which is explicitly said for each filter)
the source and the destination could be the same context. Note that this is
-not expected to work if you do several overlaping subcontexts and pass these
+not expected to work if you do several overlapping subcontexts and pass these
as arguments.
When 'NULL' is passed as destination new context for storing the result is
@@ -38,7 +38,7 @@ pixel_type, parameters, etc...
[source,c]
-------------------------------------------------------------------------------
/*
- * Filter common api.
+ * Filter common API.
*/
GP_Context *GP_FilterFoo(const GP_Context *src, GP_Context *dst,
foo params ...,
@@ -69,7 +69,7 @@ Point operation filters
Point operations are filters that works with pixels as with independent values
(the value of destination pixel depends only on the pixel on the same
-coodrdinates in source image). All of these filters works 'in-place' and the
+coordinates in source image). All of these filters works 'in-place' and the
result has always the same size as the source.
[source,c]
@@ -90,7 +90,7 @@ GP_Context *GP_FilterContrast(const GP_Context *src, GP_Context *dst,
float mul, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Constrast filter, multiplies all pixel channels by a fixed value.
+Contrast filter, multiplies all pixel channels by a fixed value.
[source,c]
-------------------------------------------------------------------------------
@@ -149,7 +149,7 @@ Rotate context by 90 degrees.
Doesn't work 'in-place' (yet).
The destination has to have the same pixel type and destination size must be
-big enough to fit rotated context (eg. W and H are swapped).
+big enough to fit rotated context (i.e. W and H are swapped).
[source,c]
-------------------------------------------------------------------------------
@@ -178,7 +178,7 @@ Rotate context by 270 degrees.
Doesn't work 'in-place' (yet).
-The destinatoin has to have the same pixel type and destination size must be
+The destination has to have the same pixel type and destination size must be
big enough to fit rotated context (eg. W and H are swapped).
[source,c]
@@ -253,14 +253,14 @@ Nearest Neighbour Interpolation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fast, but produces "pixelated" images. May however work better for images with
-sharp edges mostly consisting of big one colour regions (it doesn't blur the
+sharp edges mostly consisting of big one color regions (it doesn't blur the
result on upscaling).
Bicubic Interpolation
^^^^^^^^^^^^^^^^^^^^^
Works well as is on image upscaling. To get decent result on downscaling
-low-pass filter (gaussian blur) must be used on original image before actuall
+low-pass filter (Gaussian blur) must be used on original image before actual
downscaling. To do this reasonably fast we could cheat a little: first resize
big images a little without the low-pass filter, then apply low-pass filter and
finally downscale it to desired size.
diff --git a/doc/general.txt b/doc/general.txt
index 96310bb..d71ec1f 100644
--- a/doc/general.txt
+++ b/doc/general.txt
@@ -22,7 +22,7 @@ Graphics Rendering
** PutPixel/GetPixel
** Lines
** Circles
-** Elipses
+** Ellipses
** Polygons
* Text Drawing
@@ -30,7 +30,7 @@ Graphics Rendering
** Basic fonts are compiled in the library
** Font rendering can be altered by style attributes
** Supports, for example, pixel multiplication and tracking
-** Includes basic suppport for freetype
+** Includes basic support for freetype
* Bitmaps and Blitting
** Create, Destroy bitmap
@@ -44,7 +44,7 @@ Graphics Rendering
** Read support for GIF
* Graphic backed input event handling
-** Linux Framebuffer
+** Linux Frame-buffer
** SDL support
** Experimental X11 support
@@ -60,7 +60,7 @@ Bitmap Filters
** Separable Convolution
** General Convolution
-* Arihtmetics filters
+* Arithmetics filters
** Addition
** Multiplication
** Difference
diff --git a/doc/loaders.txt b/doc/loaders.txt
index 72aae8c..0f31498 100644
--- a/doc/loaders.txt
+++ b/doc/loaders.txt
@@ -9,7 +9,7 @@ a failure 'NULL' is returned and 'errno' is set.
The possible errno values are:
* anything returned by fopen(), fclose(), fseek(), ...
-* 'ENOSYS' if library wasn't compiled with particual library support
+* 'ENOSYS' if library wasn't compiled with particular library support
* 'ENOMEM' as returned by malloc()
* 'EIO'/'EILSEQ' invalid image data
* 'ECANCELED' loading canceled from callback
@@ -27,7 +27,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
Loads image from a file. The format is now matched by an image file extension.
-File sinature loading method is on the TODO.
+File signature loading method is on the TODO.
[source,c]
-------------------------------------------------------------------------------
@@ -40,16 +40,17 @@ int GP_SaveImage(GP_Context *src, const char *dst_path,
-------------------------------------------------------------------------------
Saves a context into a file. The file format is matched accordingly to the
-file extension, if extension is invalid or if support for request image format
-wasn't compiled in, non-zero is returned and 'errno' is set to 'ENOSYS'.
+file extension, if extension is invalid or if support for requested image
+format wasn't compiled in, non-zero is returned and 'errno' is set to
+'ENOSYS'.
-Returns zero on succes and non-zero on failure and 'errno' is set. The
+Returns zero on success and non-zero on failure and 'errno' is set. The
possible errno values are 'ENOSYS' for unknown format and anything that could
be returned by 'fopen()', 'open()', 'fwrite()', 'write()', 'seek()', etc...
PNG
~~~
-The 'PNG' loading support is optionaly implemented by libpng.
+The 'PNG' loading support is optionally implemented by libpng.
Just now, the 'PNG' support is not fully finished. Images with alpha channel
are not supported yet.
@@ -65,7 +66,7 @@ int GP_OpenPNG(const char *src_path, FILE **f);
Opens file and checks for 'PNG' signature. Returns zero on success (file
could be opened, signature matches), the opened file is returned and the file
-possition points right after the end of the 'PNG' signature.
+position points right after the end of the 'PNG' signature.
Upon failure 'errno' is filled.
@@ -81,7 +82,7 @@ GP_Context *GP_ReadPNG(FILE *f, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
Loads 'PNG' file into context the file pointer must point to the start of the
-'PNG' data stream (eg. should point right after the signature). The context,
+'PNG' data stream (i.e. should point right after the signature). The context,
to store the image to, is allocated. The loading process could by aborted by a
callback, in such case all memory is freed.
@@ -94,7 +95,7 @@ callback, in such case all memory is freed.
GP_Context *GP_LoadPNG(const char *src_path, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Same as abowe but takes path to the file as a parameter and check for the
+Same as above but takes path to the file as a parameter and check for the
signature. Basically this combines both of the calls above.
[source,c]
@@ -117,7 +118,7 @@ returned and 'errno' is set to 'ENOSYS'.
JPEG
~~~~
-The 'JPEG' loading support is optionaly implemented by jpeg library.
+The 'JPEG' loading support is optionally implemented by jpeg library.
[source,c]
-------------------------------------------------------------------------------
@@ -130,7 +131,7 @@ int GP_OpenJPG(const char *src_path, FILE **f);
Opens file and checks for 'JPG' signature upon successful return (file could
be opened, signature matches), the opened file is returned and the file
-possition points right after the end of the 'JPG' signature.
+position points right after the end of the 'JPG' signature.
This function is semi-internal, you should rather use functions listed below.
@@ -147,7 +148,7 @@ GP_Context *GP_ReadJPG(FILE *f, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
Loads 'JPG' file into context the file pointer must point to the start of the
-'JPG' data stream (eg. should point right after the signature). The context,
+'JPG' data stream (i.e. should point right after the signature). The context,
to store the image to, is allocated. The loading process could by aborted by a
callback, in such case all memory is freed and the call returns 'NULL' and
'errno' is set to 'ECANCELED'.
@@ -161,7 +162,7 @@ callback, in such case all memory is freed and the call returns 'NULL' and
GP_Context *GP_LoadJPG(const char *src_path, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Same as abowe but takes path to the file as a parameter and check for the
+Same as above but takes path to the file as a parameter and check for the
signature. Basically this combines both of the calls above.
[source,c]
@@ -179,12 +180,12 @@ is closed and removed before the call returns non-zero and 'errno' is set to
'ECANCELED'.
The 'JPG' format could store either 'G8' or 'RGB888' pixeltypes and you must
-convert the context into one of them before this fucntions is called.
+convert the context into one of them before this functions is called.
GIF
~~~
-The 'GIF' format is supported optionaly by giflib library.
+The 'GIF' format is supported optionally by giflib library.
[source,c]
-------------------------------------------------------------------------------
@@ -227,7 +228,7 @@ Currently this function loads only first image from the gif container.
GP_Context *GP_LoadGIF(const char *src_path, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Same as abowe but takes path to the file as a parameter and check for the
+Same as above but takes path to the file as a parameter and check for the
signature. Basically this combines both of the calls above.
BMP
@@ -248,7 +249,7 @@ int GP_OpenBMP(const char *src_path, FILE **f,
Opens file and checks for 'BMP' signature upon successful return (file could
be opened, signature matches) zero is returned and the parameters, if
-non-'NULL', are initalized. Upon failure non-zero is returned and 'errno' is
+non-'NULL', are initialized. Upon failure non-zero is returned and 'errno' is
set.
This function is semi-internal, you should rather use functions listed below.
@@ -278,7 +279,7 @@ Currently this function loads only first image from the 'GIF' container.
GP_Context *GP_LoadBMP(const char *src_path, GP_ProgressCallback *callback);
-------------------------------------------------------------------------------
-Same as abowe but takes path to the file as a parameter and check for the
+Same as above but takes path to the file as a parameter and check for the
signature. Basically this combines both of the calls above.
PBM, PGM, PPM
diff --git a/doc/pixel_types.txt b/doc/pixel_types.txt
index bf5acd8..b54ad7a 100644
--- a/doc/pixel_types.txt
+++ b/doc/pixel_types.txt
@@ -2,10 +2,10 @@ Supported pixel sizes
---------------------
The default maximum size of a single pixel is 32 bits. The limitations would
-be analoguous for other settings (8, 16 and 64).
+be analogous for other settings (8, 16 and 64).
Pixel sizes 8, 16 and 32 are supported on all systems and generally very efficient
-(assigment is used for all operations). 24 bpp is supported, but the operations may be
+(assignment is used for all operations). 24 bpp is supported, but the operations may be
slightly slower.
Pixel sizes 1, 2 and 4 depend on bit-endian setting and are supported on all systems.
@@ -19,7 +19,7 @@ to decode/encode.
Pixel sizes between 25 and 31 are not supported at all, as these pixels might not fit
into a 32-bit byte-aligned window.
-The pixel sizes to be supported must be explicitely listed in the configuration file,
+The pixel sizes to be supported must be explicitly listed in the configuration file,
each including the bit-endian if required (see below).
Supported pixel types
-----------------------------------------------------------------------
Summary of changes:
doc/backends.txt | 50 +++++++++++++++++++++++++-------------------------
doc/context.txt | 8 ++++----
doc/drawing_api.txt | 2 +-
doc/filters.txt | 16 ++++++++--------
doc/general.txt | 8 ++++----
doc/loaders.txt | 37 +++++++++++++++++++------------------
doc/pixel_types.txt | 6 +++---
7 files changed, 64 insertions(+), 63 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 16abe6513b0fa77891c43da149b891edea2a912b (commit)
via f966f16f2202d808c1286a6e06b4d6c182741986 (commit)
from 5da172bec1439fa9219e02da0f1e68383d56caad (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 -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/16abe6513b0fa77891c43da149b891edea2a…
commit 16abe6513b0fa77891c43da149b891edea2a912b
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 13 13:47:45 2012 +0200
doc: Fix typo.
diff --git a/doc/context.txt b/doc/context.txt
index 294d026..00c6c08 100644
--- a/doc/context.txt
+++ b/doc/context.txt
@@ -203,6 +203,6 @@ GP_Context *GP_ContextConvert(const GP_Context *src, GP_Context *dst,
Provides basic context conversion functionality. A newly allocated context is
returned.
-This fuction does no error distribution, it only multiplies or rounds the pixel
+This function does no error distribution, it only multiplies or rounds the pixel
values. If you need something better use Floyd Steinberg dithering instead.
http://repo.or.cz/w/gfxprim.git/commit/f966f16f2202d808c1286a6e06b4d6c18274…
commit f966f16f2202d808c1286a6e06b4d6c182741986
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sun May 13 13:47:13 2012 +0200
backends: GP_BackendInit() Add default size for X11.
diff --git a/libs/backends/GP_BackendInit.c b/libs/backends/GP_BackendInit.c
index fb49b92..b00fd10 100644
--- a/libs/backends/GP_BackendInit.c
+++ b/libs/backends/GP_BackendInit.c
@@ -140,9 +140,13 @@ static void backend_x11_help(FILE *help, const char *err)
static GP_Backend *backend_x11_init(char *params, const char *caption,
FILE *help)
{
- unsigned int w, h, n;
+ unsigned int n, w = 640, h = 480;
- if (sscanf(params, "%u%*[xX]%u%n", &w, &h, &n) == 2 && n == strlen(params))
+ if (params == NULL)
+ return GP_BackendX11Init(NULL, 0, 0, w, h, caption);
+
+ if (sscanf(params, "%u%*[xX]%u%n", &w, &h, &n) == 2 &&
+ n == strlen(params))
return GP_BackendX11Init(NULL, 0, 0, w, h, caption);
backend_x11_help(help, "X11: Invalid parameters");
-----------------------------------------------------------------------
Summary of changes:
doc/context.txt | 2 +-
libs/backends/GP_BackendInit.c | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 5da172bec1439fa9219e02da0f1e68383d56caad (commit)
from 92cadf14e3dddf0bc97848999152f3ae2e8d53a5 (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 -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/5da172bec1439fa9219e02da0f1e68383d56…
commit 5da172bec1439fa9219e02da0f1e68383d56caad
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat May 12 21:56:31 2012 +0200
backends: fb: restore KB mode on exit.
diff --git a/libs/backends/GP_LinuxFB.c b/libs/backends/GP_LinuxFB.c
index 3a2cf7e..d6de2de 100644
--- a/libs/backends/GP_LinuxFB.c
+++ b/libs/backends/GP_LinuxFB.c
@@ -41,9 +41,15 @@
struct fb_priv {
GP_Context context;
uint32_t bsize;
+
+ int flag;
+
+ /* console fd, nr and saved data */
int con_fd;
int con_nr;
int last_con_nr;
+ int saved_kb_mode;
+
int fb_fd;
char path[];
};
@@ -91,7 +97,7 @@ static int allocate_console(struct fb_priv *fb, int flag)
if (ioctl(fd, VT_GETSTATE, &vts) == 0)
fb->last_con_nr = vts.v_active;
- else
+ else
fb->last_con_nr = -1;
if (ioctl(fd, VT_ACTIVATE, nr) < 0) {
@@ -130,6 +136,16 @@ static int allocate_console(struct fb_priv *fb, int flag)
return -1;
}
+ if (ioctl(fd, KDGKBMODE, &fb->saved_kb_mode)) {
+ GP_DEBUG(1, "Failed to ioctl KDGKBMODE %s: %s",
+ buf, strerror(errno));
+ close(fd);
+ return -1;
+ }
+
+ GP_DEBUG(2, "Previous keyboard mode was '%i'",
+ fb->saved_kb_mode);
+
if (ioctl(fd, KDSKBMODE, K_MEDIUMRAW) < 0) {
GP_DEBUG(1, "Failed to ioctl KDSKBMODE %s: %s",
buf, strerror(errno));
@@ -183,6 +199,14 @@ static void fb_exit(GP_Backend *self)
/* reset keyboard */
ioctl(fb->con_fd, KDSETMODE, KD_TEXT);
+ /* restore keyboard mode */
+ if (fb->flag) {
+ if (ioctl(fb->con_fd, KDSKBMODE, fb->saved_kb_mode) < 0) {
+ GP_DEBUG(1, "Failed to ioctl KDSKBMODE (restore KBMODE)"
+ " /dev/tty%i: %s", fb->con_nr, strerror(errno));
+ }
+ }
+
/* switch back console */
if (fb->last_con_nr != -1)
ioctl(fb->con_fd, VT_ACTIVATE, fb->last_con_nr);
@@ -267,6 +291,7 @@ GP_Backend *GP_BackendLinuxFBInit(const char *path, int flag)
fb->fb_fd = fd;
fb->bsize = fscri.smem_len;
strcpy(fb->path, path);
+ fb->flag = flag;
fb->context.w = vscri.xres;
fb->context.h = vscri.yres;
-----------------------------------------------------------------------
Summary of changes:
libs/backends/GP_LinuxFB.c | 27 ++++++++++++++++++++++++++-
1 files changed, 26 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 92cadf14e3dddf0bc97848999152f3ae2e8d53a5 (commit)
from e6ffc65a598d5e457fab45f6f968642e3036be08 (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 -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/92cadf14e3dddf0bc97848999152f3ae2e8d…
commit 92cadf14e3dddf0bc97848999152f3ae2e8d53a5
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat May 12 21:17:02 2012 +0200
backends: A few fixes for linux fb.
* Back at tty1 (tty0 has root root permissions while tty1 is root tty)
* Added O_NONBLOCK for console open() (so that poll wouldn't block)
* Added more debug messages
diff --git a/libs/backends/GP_LinuxFB.c b/libs/backends/GP_LinuxFB.c
index 654989d..3a2cf7e 100644
--- a/libs/backends/GP_LinuxFB.c
+++ b/libs/backends/GP_LinuxFB.c
@@ -58,25 +58,29 @@ static int allocate_console(struct fb_priv *fb, int flag)
char buf[255];
/* allocate and switch to new console */
- fd = open("/dev/tty0", O_WRONLY);
+ GP_DEBUG(1, "Allocating new console");
+
+ fd = open("/dev/tty1", O_WRONLY);
if (fd < 0) {
- GP_DEBUG(1, "Opening console /dev/tty0 failed: %s",
+ GP_DEBUG(1, "Opening console /dev/tty1 failed: %s",
strerror(errno));
return -1;
}
if (ioctl(fd, VT_OPENQRY, &nr) < 0) {
- GP_DEBUG(1, "Failed to ioctl VT_OPENQRY /dev/tty0: %s",
+ GP_DEBUG(1, "Failed to ioctl VT_OPENQRY /dev/tty1: %s",
strerror(errno));
close(fd);
return -1;
}
+ GP_DEBUG(1, "Has been granted tty%i", nr);
+
close(fd);
snprintf(buf, sizeof(buf), "/dev/tty%i", nr);
- fd = open(buf, O_RDWR);
+ fd = open(buf, O_RDWR | O_NONBLOCK);
if (fd < 0) {
GP_DEBUG(1, "Opening console %s failed: %s",
@@ -97,6 +101,8 @@ static int allocate_console(struct fb_priv *fb, int flag)
return -1;
}
+ GP_DEBUG(1, "Waiting for tty%i to activate", nr);
+
if (ioctl(fd, VT_WAITACTIVE, nr) < 0) {
GP_DEBUG(1, "Failed to ioctl VT_WAITACTIVE %s: %s",
buf, strerror(errno));
@@ -205,6 +211,8 @@ GP_Backend *GP_BackendLinuxFBInit(const char *path, int flag)
goto err1;
/* open and mmap framebuffer */
+ GP_DEBUG(1, "Opening framebuffer '%s'", path);
+
fd = open(path, O_RDWR);
if (fd < 0) {
@@ -224,6 +232,9 @@ GP_Backend *GP_BackendLinuxFBInit(const char *path, int flag)
goto err3;
}
+ GP_DEBUG(1, "Have framebufer %ix%i %s %ibpp", vscri.xres, vscri.yres,
+ vscri.grayscale ? "Gray" : "RGB", vscri.bits_per_pixel);
+
/*
* Framebuffer is grayscale.
*/
-----------------------------------------------------------------------
Summary of changes:
libs/backends/GP_LinuxFB.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via e6ffc65a598d5e457fab45f6f968642e3036be08 (commit)
from 2b7d85a804de2382d10e8f6ea2153b0e47b3e6e0 (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 -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/e6ffc65a598d5e457fab45f6f968642e3036…
commit e6ffc65a598d5e457fab45f6f968642e3036be08
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat May 12 20:31:44 2012 +0200
tests: Fix build.
diff --git a/tests/drivers/framebuffer_test.c b/tests/drivers/framebuffer_test.c
index 29cdb3a..518d3b4 100644
--- a/tests/drivers/framebuffer_test.c
+++ b/tests/drivers/framebuffer_test.c
@@ -63,7 +63,7 @@ int main(void)
GP_SetDebugLevel(10);
- backend = GP_BackendLinuxFBInit("/dev/fb0");
+ backend = GP_BackendLinuxFBInit("/dev/fb0", 0);
if (backend == NULL) {
fprintf(stderr, "Failed to initalize framebuffern");
-----------------------------------------------------------------------
Summary of changes:
tests/drivers/framebuffer_test.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")