Revision: 55092
http://brlcad.svn.sourceforge.net/brlcad/?rev=55092&view=rev
Author: starseeker
Date: 2013-04-09 17:31:36 +0000 (Tue, 09 Apr 2013)
Log Message:
-----------
Add if_tk.c back in, fix compilation.
Modified Paths:
--------------
brlcad/trunk/src/libfb/CMakeLists.txt
brlcad/trunk/src/libfb/if_tk.c
Modified: brlcad/trunk/src/libfb/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libfb/CMakeLists.txt 2013-04-09 17:20:05 UTC (rev
55091)
+++ brlcad/trunk/src/libfb/CMakeLists.txt 2013-04-09 17:31:36 UTC (rev
55092)
@@ -30,6 +30,7 @@
set(fbwgl_srcs if_wgl.c)
endif(WIN32)
if(BRLCAD_ENABLE_TK)
+ set(FBTKDEFS "-DIF_TK")
set(fbtk_srcs if_tk.c)
endif(BRLCAD_ENABLE_TK)
@@ -67,6 +68,7 @@
-DIF_AB
${FBX11DEFS}
${FBOGLDEFS}
+ ${FBTKDEFS}
${XOPEN_DEFINE}
)
Modified: brlcad/trunk/src/libfb/if_tk.c
===================================================================
--- brlcad/trunk/src/libfb/if_tk.c 2013-04-09 17:20:05 UTC (rev 55091)
+++ brlcad/trunk/src/libfb/if_tk.c 2013-04-09 17:31:36 UTC (rev 55092)
@@ -78,78 +78,6 @@
char *tkwrite_buffer;
-HIDDEN int fb_tk_open(FBIO *ifp, const char *file, int width, int height),
- fb_tk_close(FBIO *ifp),
- tk_clear(FBIO *ifp, unsigned char *pp),
- tk_read(FBIO *ifp, int x, int y, unsigned char *pixelp, size_t count),
- tk_write(FBIO *ifp, int x, int y, const unsigned char *pixelp, size_t
count),
- tk_rmap(FBIO *ifp, ColorMap *cmp),
- tk_wmap(FBIO *ifp, const ColorMap *cmp),
- tk_view(FBIO *ifp, int xcenter, int ycenter, int xzoom, int yzoom),
- tk_getview(FBIO *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom),
- tk_setcursor(FBIO *ifp, const unsigned char *bits, int xbits, int ybits,
int xorig, int yorig),
- tk_cursor(FBIO *ifp, int mode, int x, int y),
- tk_getcursor(FBIO *ifp, int *mode, int *x, int *y),
- tk_readrect(FBIO *ifp, int xmin, int ymin, int width, int height, unsigned
char *pp),
- tk_writerect(FBIO *ifp, int xmin, int ymin, int width, int height, const
unsigned char *pp),
- tk_bwreadrect(FBIO *ifp, int xmin, int ymin, int width, int height,
unsigned char *pp),
- tk_bwwriterect(FBIO *ifp, int xmin, int ymin, int width, int height, const
unsigned char *pp),
- tk_poll(FBIO *ifp),
- tk_flush(FBIO *ifp),
- tk_free(FBIO *ifp),
- tk_help(FBIO *ifp);
-
-/* This is the ONLY thing that we "export" */
-FBIO tk_interface = {
- 0,
- fb_tk_open,
- fb_tk_close,
- tk_clear,
- tk_read,
- tk_write,
- tk_rmap,
- tk_wmap,
- tk_view,
- tk_getview,
- tk_setcursor,
- tk_cursor,
- tk_getcursor,
- tk_readrect,
- tk_writerect,
- tk_bwreadrect,
- tk_bwwriterect,
- tk_poll,
- tk_flush,
- tk_free,
- tk_help,
- "Debugging Interface",
- 32*1024, /* max width */
- 32*1024, /* max height */
- "/dev/tk",
- 512, /* current/default width */
- 512, /* current/default height */
- -1, /* select fd */
- -1, /* file descriptor */
- 1, 1, /* zoom */
- 256, 256, /* window center */
- 0, 0, 0, /* cursor */
- PIXEL_NULL, /* page_base */
- PIXEL_NULL, /* page_curp */
- PIXEL_NULL, /* page_endp */
- -1, /* page_no */
- 0, /* page_ref */
- 0L, /* page_curpos */
- 0L, /* page_pixels */
- 0, /* debug */
- {0}, /* u1 */
- {0}, /* u2 */
- {0}, /* u3 */
- {0}, /* u4 */
- {0}, /* u5 */
- {0} /* u6 */
-};
-
-
HIDDEN int
fb_tk_open(FBIO *ifp, const char *file, int width, int height)
{
@@ -383,18 +311,18 @@
}
-HIDDEN int
+HIDDEN ssize_t
tk_read(FBIO *ifp, int x, int y, unsigned char *pixelp, size_t count)
{
FB_CK_FBIO(ifp);
fb_log("fb_read(0x%lx, %4d, %4d, 0x%lx, %ld)\n",
(unsigned long)ifp, x, y,
(unsigned long)pixelp, (long)count);
- return (int)count;
+ return (ssize_t)count;
}
-HIDDEN int
+HIDDEN ssize_t
tk_write(FBIO *ifp, int UNUSED(x), int y, const unsigned char *pixelp, size_t
count)
{
uint32_t line[3];
@@ -419,7 +347,7 @@
sleep(1);
}
- return (int)count;
+ return (ssize_t)count;
}
@@ -612,7 +540,58 @@
return 0;
}
+/* This is the ONLY thing that we "export" */
+FBIO tk_interface = {
+ 0,
+ fb_tk_open,
+ fb_tk_close,
+ tk_clear,
+ tk_read,
+ tk_write,
+ tk_rmap,
+ tk_wmap,
+ tk_view,
+ tk_getview,
+ tk_setcursor,
+ tk_cursor,
+ tk_getcursor,
+ tk_readrect,
+ tk_writerect,
+ tk_bwreadrect,
+ tk_bwwriterect,
+ tk_poll,
+ tk_flush,
+ tk_free,
+ tk_help,
+ "Debugging Interface",
+ 32*1024, /* max width */
+ 32*1024, /* max height */
+ "/dev/tk",
+ 512, /* current/default width */
+ 512, /* current/default height */
+ -1, /* select fd */
+ -1, /* file descriptor */
+ 1, 1, /* zoom */
+ 256, 256, /* window center */
+ 0, 0, 0, /* cursor */
+ PIXEL_NULL, /* page_base */
+ PIXEL_NULL, /* page_curp */
+ PIXEL_NULL, /* page_endp */
+ -1, /* page_no */
+ 0, /* page_ref */
+ 0L, /* page_curpos */
+ 0L, /* page_pixels */
+ 0, /* debug */
+ {0}, /* u1 */
+ {0}, /* u2 */
+ {0}, /* u3 */
+ {0}, /* u4 */
+ {0}, /* u5 */
+ {0} /* u6 */
+};
+
+
#else
/* quell empty-compilation unit warnings */
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits