nux-4.0.6+14.04.20141107/ 0000755 0000153 0177776 00000000000 12427165411 014733 5 ustar pbuser nogroup 0000000 0000000 nux-4.0.6+14.04.20141107/tools/ 0000755 0000153 0177776 00000000000 12427165411 016073 5 ustar pbuser nogroup 0000000 0000000 nux-4.0.6+14.04.20141107/tools/Makefile.am 0000644 0000153 0177776 00000000334 12427165212 020126 0 ustar pbuser nogroup 0000000 0000000 CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
pkglibexec_PROGRAMS = unity_support_test
unity_support_test_CFLAGS = $(UNITY_SUPPORT_TEST_CFLAGS) $(MAINTAINER_CFLAGS)
unity_support_test_LDFLAGS = $(UNITY_SUPPORT_TEST_LIBS)
nux-4.0.6+14.04.20141107/tools/unity_support_test.c 0000644 0000153 0177776 00000064466 12427165212 022261 0 ustar pbuser nogroup 0000000 0000000 // Copyright © 2011 Canonical Ltd
//
// This program is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License version 3 as published by the
// Free Software Foundation. This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details. You should have received a copy of the GNU
// General Public License along with this program. If not, see
// .
//
// Authored by:
// Loïc Molinari
// Jay Taoko
// unity_support_test checks for Unity support on a X11 display. All the checks
// are based on what's done in Compiz (core/plugins/opengl/src/screen.cpp).
//
// $ gcc -std=c99 unity_support_test.c -o unity_support_test `pkg-config
// > --cflags --libs gl x11 libpci xcomposite xdamage`
#include
#include
#include
#include
#include
#ifndef NUX_OPENGLES_20
#include
#define GLX_GLXEXT_PROTOTYPES
#include
#undef GLX_GLXEXT_PROTOTYPES
#else
#include
#include
#include
#endif
#include
#include
#include
#include
#include
#include
#ifndef NUX_OPENGLES_20
typedef GLXContext NUXContext;
#else
typedef EGLConfig NUXContext;
#endif
// Enables colored console output at build time.
#define COLORED_OUTPUT 1
// Gets the number of elements in an array.
#define ARRAY_SIZE(array) (sizeof (array) / sizeof ((array)[0]))
enum {
// Extension flags.
FLAG_GLX_SGIX_FBCONFIG = (1 << 0),
FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP = (1 << 1),
FLAG_GL_ARB_NON_POWER_OF_TWO = (1 << 2),
FLAG_GL_NV_TEXTURE_RECTANGLE = (1 << 3),
FLAG_GL_EXT_TEXTURE_RECTANGLE = (1 << 4),
FLAG_GL_ARB_TEXTURE_RECTANGLE = (1 << 5),
FLAG_GL_ARB_VERTEX_PROGRAM = (1 << 6),
FLAG_GL_ARB_FRAGMENT_PROGRAM = (1 << 7),
FLAG_GL_ARB_VERTEX_BUFFER_OBJECT = (1 << 8),
FLAG_GL_EXT_FRAMEBUFFER_OBJECT = (1 << 9),
FLAG_GL_ARB_FRAMEBUFFER_OBJECT = (1 << 10),
FLAG_SOFTWARE_RENDERING = (1 << 11),
FLAG_BLACKLISTED = (1 << 12),
FLAG_GL_OES_EGL_IMAGE = (1 << 13),
FLAG_EGL_KHR_IMAGE_PIXMAP = (1 << 14),
// Extension masks.
MASK_GL_NON_POWER_OF_TWO = (FLAG_GL_ARB_NON_POWER_OF_TWO
| FLAG_GL_NV_TEXTURE_RECTANGLE
| FLAG_GL_EXT_TEXTURE_RECTANGLE
| FLAG_GL_ARB_TEXTURE_RECTANGLE),
MASK_GL_FRAMEBUFFER_OBJECT = (FLAG_GL_EXT_FRAMEBUFFER_OBJECT
| FLAG_GL_ARB_FRAMEBUFFER_OBJECT)
};
// PCI device identity.
struct PciDevice {
unsigned short vendor;
unsigned short device;
};
// Blacklists of GPUs for Compiz.
struct PciDevice gpu_blacklist[] = {
{ 0x8086, 0x3577 }, // Intel : 82830M/MG
{ 0x8086, 0x2562 }, // Intel : 82845G aka Poulsbo
{ 0x1002, 0x4c57 }, // ATI : Radeon Mobility 7500
{ 0x10de, 0x0322 }, // nVidia: GeForce FX 5200
{ 0x10de, 0x0326 }, // nVidia: GeForce FX 5500
{ 0x10de, 0x0240 }, // nVidia: GeForce 6150
{ 0x10de, 0x01d3 }, // nVidia: GeForce Go 7300 SE / 7200 GS
{ 0x10de, 0x01d7 }, // nVidia: GeForce Go 7300 / Quadro NVS 110M
{ 0x10de, 0x01d8 } // nVidia: GeForce Go 7400
};
typedef struct _TestResults {
char *vendor, *renderer, *version;
int result, major, minor;
int indirect;
int compiz;
unsigned int flags;
char *error;
} TestResults;
// Checks whether an extension is supported by the GLX/OpenGL implementation
// given the extension name and the list of supported extensions.
static int is_extension_supported (const char* extensions,
const char* extension) {
if (extensions != NULL && extension != NULL) {
const size_t len = strlen (extension);
char* p = (char*) extensions;
char* end = p + strlen (p);
while (p < end) {
const size_t size = strcspn (p, " ");
if (len == size && strncmp (extension, p, size) == 0)
return 1;
p += size + 1;
}
}
return 0;
}
// Gets the OpenGL version number given the string.
static void get_opengl_version (const char *version, int* major, int* minor) {
int tmp = 0, i;
if (!version)
{
*major = 0;
*minor = 0;
return;
}
for (i = 0; isdigit (version[i]); i++)
tmp = tmp * 10 + (version[i] - 48);
if (version[i++] == '.') {
*major = tmp;
*minor = (version[i] - 48);
} else {
*major = 0;
*minor = 0;
}
}
static void print_help () {
fprintf (stdout,
"Check for Unity support on a X11 display.\n"
"\n"
"Usage:\n"
" unity-support-test [ options ]\n"
" -d, --display name: Specify the X11 display\n"
" -i, --indirect: Force an indirect rendering context\n"
" -p, --print: Print detection results on stdout\n"
" -c, --compiz: Only check for Compiz support\n"
" -h, --help: Show help\n");
}
static void print_report (const char* vendor, const char* renderer,
const char* version, int major, int minor,
unsigned int flags, int compiz, int result,
const char* error) {
if (error == NULL) {
#if COLORED_OUTPUT == 1
const char* yes = "\033[32;01myes\033[00m";
const char* no = "\033[31;01mno\033[00m";
#else
const char* yes = "yes";
const char* no = "no";
#endif
fprintf (stdout,
"OpenGL vendor string: %s\n"
"OpenGL renderer string: %s\n"
"OpenGL version string: %s\n"
"\n"
"Not software rendered: %s\n"
"Not blacklisted: %s\n"
"GLX fbconfig: %s\n"
"GLX texture from pixmap: %s\n"
"GL npot or rect textures: %s\n",
vendor, renderer, version,
flags & FLAG_SOFTWARE_RENDERING ? no : yes,
flags & FLAG_BLACKLISTED ? no : yes,
flags & FLAG_GLX_SGIX_FBCONFIG ? yes : no,
flags & FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP ? yes : no,
flags & MASK_GL_NON_POWER_OF_TWO ? yes : no);
if (compiz == 0) {
#ifndef NUX_OPENGLES_20
fprintf (stdout,
"GL vertex program: %s\n"
"GL fragment program: %s\n"
"GL vertex buffer object: %s\n"
"GL framebuffer object: %s\n"
"GL version is 1.4+: %s\n"
"\n"
"Unity 3D supported: %s\n",
flags & FLAG_GL_ARB_VERTEX_PROGRAM ? yes : no,
flags & FLAG_GL_ARB_FRAGMENT_PROGRAM ? yes : no,
flags & FLAG_GL_ARB_VERTEX_BUFFER_OBJECT ? yes : no,
flags & MASK_GL_FRAMEBUFFER_OBJECT ? yes : no,
(major >= 2 || (major == 1 && minor >= 4)) ? yes : no,
result == 0 ? yes : no);
#else
fprintf (stdout,
"GL OES EGL image: %s\n"
"EGL KHR image pixmap: %s\n"
"EGL version is 1.4+: %s\n"
"\n"
"Unity supported: %s\n",
flags & FLAG_GL_OES_EGL_IMAGE ? yes : no,
flags & FLAG_EGL_KHR_IMAGE_PIXMAP ? yes : no,
(major >= 2 || (major == 1 && minor >= 4)) ? yes : no,
result == 0 ? yes : no);
#endif
} else {
fprintf (stdout, "\nCompiz supported: %s\n",
result == 0 ? yes : no);
}
} else {
fprintf (stdout, "Error: %s\n", error);
}
}
static int check_root_visual (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
// Retrieve root window visual.
XWindowAttributes attr;
XVisualInfo vinfo_template;
int nr_vinfos;
if (XGetWindowAttributes (display, root, &attr) == 0) {
results->error = strdup ("unable to get root window attributes");
results->result = 1;
return 0;
}
vinfo_template.visualid = XVisualIDFromVisual (attr.visual);
*vinfos = XGetVisualInfo (display, VisualIDMask, &vinfo_template, &nr_vinfos);
if (nr_vinfos == 0) {
results->error = strdup ("unable to get visual informations for default visual");
results->result = 1;
return 0;
}
return 1;
}
static int check_xcomposite (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
// Check for XComposite
int composite_major, composite_minor;
int composite_tmp;
if (!XQueryExtension (display, COMPOSITE_NAME, &composite_tmp, &composite_tmp, &composite_tmp))
{
results->error = strdup ("no composite extension");
results->result = 1;
return 0;
}
XCompositeQueryVersion (display, &composite_major, &composite_minor);
if (composite_major == 0 && composite_minor < 2)
{
results->error = strdup ("old composite extension");
results->result = 1;
return 0;
}
return 1;
}
static int check_damage_extension (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
int damage_tmp;
if (!XDamageQueryExtension (display, &damage_tmp, &damage_tmp))
{
results->error = strdup ("no damage extension");
results->result = 1;
return 0;
}
return 1;
}
static int check_fixes_extension (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
int fixes_tmp;
if (!XFixesQueryExtension (display, &fixes_tmp, &fixes_tmp))
{
results->error = strdup ("no fixes extension");
results->result = 1;
return 0;
}
return 1;
}
#ifdef NUX_OPENGLES_20
static int check_egl_config (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_RED_SIZE, 1,
EGL_GREEN_SIZE, 1,
EGL_BLUE_SIZE, 1,
EGL_NONE
};
EGLint ctx_attribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
XVisualInfo *visInfo, visTemplate;
XSetWindowAttributes attr;
Window win;
int num_visuals;
unsigned long mask;
const int width = 400, height = 300;
const char* name = "Unity Support Test";
EGLDisplay egl_dpy;
EGLSurface egl_surf;
EGLContext egl_ctx;
EGLConfig config;
EGLint num_configs;
EGLint vid;
egl_dpy = eglGetDisplay(display);
if (!eglChooseConfig (egl_dpy, attribs, &config, 1, &num_configs)) {
results->error = strdup ("OpenGLES: couldn't get an EGL visual config");
results->result = 1;
return 0;
}
if (num_configs <= 0) {
results->error = strdup ("OpenGLES: no valid config found (!num_configs)");
results->result = 1;
return 0;
}
if (!eglGetConfigAttrib (egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
results->error = strdup ("OpenGLES: eglGetConfigAttrib() failed");
results->result = 1;
return 0;
}
/* The X window visual must match the EGL config */
visTemplate.visualid = vid;
visInfo = XGetVisualInfo (display, VisualIDMask, &visTemplate, &num_visuals);
if (!visInfo) {
results->error = strdup ("OpenGLES: unable to get a matching X visual");
results->result = 1;
return 0;
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap (display, root, visInfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow (display, root, 0, 0, width, height,
0, visInfo->depth, InputOutput,
visInfo->visual, mask, &attr);
/* set hints and properties */
{
XSizeHints sizehints;
sizehints.x = 0;
sizehints.y = 0;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints (display, win, &sizehints);
XSetStandardProperties (display, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
eglBindAPI (EGL_OPENGL_ES_API);
egl_surf = eglCreateWindowSurface (egl_dpy, config, win, NULL);
if (egl_surf == EGL_NO_SURFACE) {
results->error = strdup ("OpenGLES: eglCreateWindowSurface failed");
results->result = 1;
return 0;
}
context = eglCreateContext (egl_dpy, config, EGL_NO_CONTEXT, ctx_attribs);
if (context == EGL_NO_CONTEXT) {
results->error = strdup ("OpenGLES: eglCreateContext failed");
results->result = 1;
return 0;
}
if (!eglMakeCurrent (egl_dpy, egl_surf, egl_surf, context)) {
results->error = strdup ("OpenGLES: eglMakeCurrent() failed");
results->result = 1;
return 0;
}
XFree(visInfo);
eglDestroySurface (egl_dpy, egl_surf);
XDestroyWindow (display, win);
return 1;
}
#else
static int check_glx_config (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
// Check root window visual capabilities.
int value;
glXGetConfig (display, *vinfos, GLX_USE_GL, &value);
if (value == 0) {
results->error = strdup ("OpenGL rendering is not supported by the root visual");
results->result = 1;
return 0;
}
return 1;
}
static int check_colorbuffers (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
int value;
glXGetConfig (display,*vinfos, GLX_DOUBLEBUFFER, &value);
if (value == 0) {
results->error = strdup ("color buffers of the root visual are not double-buffered");
results->result = 1;
return 0;
}
return 1;
}
#endif
static int check_context (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
#ifndef NUX_OPENGLES_20
// Create and map the OpenGL context to the root window and get the strings.
*context = glXCreateContext (display, *vinfos, NULL, !results->indirect);
if (*context == NULL) {
results->error = strdup ("unable to create the OpenGL context");
results->result = 1;
return 0;
}
glXMakeCurrent (display, root, *context);
#endif
results->vendor = (char*) glGetString (GL_VENDOR);
results->renderer = (char*) glGetString (GL_RENDERER);
results->version = (char*) glGetString (GL_VERSION);
return 1;
}
static int check_extensions (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
// Fill flags with the supported OpenGL extensions.
const char* gl_extensions = (char*)glGetString (GL_EXTENSIONS);
if (gl_extensions == NULL) {
results->error = strdup ("invalid OpenGL extensions string");
results->result = 1;
return 0;
}
const struct { const char* name; const unsigned int flag; } gl_extension[] = {
{ "GL_ARB_texture_non_power_of_two", FLAG_GL_ARB_NON_POWER_OF_TWO },
{ "GL_NV_texture_rectangle", FLAG_GL_NV_TEXTURE_RECTANGLE },
{ "GL_EXT_texture_rectangle", FLAG_GL_EXT_TEXTURE_RECTANGLE },
{ "GL_ARB_texture_rectangle", FLAG_GL_ARB_TEXTURE_RECTANGLE },
{ "GL_ARB_vertex_program", FLAG_GL_ARB_VERTEX_PROGRAM },
{ "GL_ARB_fragment_program", FLAG_GL_ARB_FRAGMENT_PROGRAM },
{ "GL_ARB_vertex_buffer_object", FLAG_GL_ARB_VERTEX_BUFFER_OBJECT },
{ "GL_EXT_framebuffer_object", FLAG_GL_EXT_FRAMEBUFFER_OBJECT },
{ "GL_ARB_framebuffer_object", FLAG_GL_ARB_FRAMEBUFFER_OBJECT },
{ "GL_OES_EGL_image", FLAG_GL_OES_EGL_IMAGE },
{ NULL, 0 }
};
for (int i = 0; gl_extension[i].name != NULL; i++)
if (is_extension_supported (gl_extensions, gl_extension[i].name) == 1)
results->flags |= gl_extension[i].flag;
#ifndef NUX_OPENGLES_20
// Fill results->flags with the supported GLX extensions.
const char* glx_extensions = glXQueryExtensionsString (display, screen);
const struct { const char* name; const unsigned int flag; } glx_extension[] = {
{ "GLX_SGIX_fbconfig", FLAG_GLX_SGIX_FBCONFIG },
{ "GLX_EXT_texture_from_pixmap", FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP },
{ NULL, 0 }
};
for (int i = 0; glx_extension[i].name != NULL; i++)
if (is_extension_supported (glx_extensions, glx_extension[i].name) == 1)
results->flags |= glx_extension[i].flag;
if (results->flags & FLAG_GLX_SGIX_FBCONFIG) {
if (glXGetProcAddressARB ((unsigned char*)"glXQueryDrawable") == NULL ||
glXGetProcAddressARB ((unsigned char*)"glXGetFBConfigs") == NULL ||
glXGetProcAddressARB ((unsigned char*)"glXGetFBConfigAttrib") == NULL ||
glXGetProcAddressARB ((unsigned char*)"glXCreatePixmap") == NULL ||
glXGetProcAddressARB ((unsigned char*)"glXDestroyPixmap") == NULL) {
results->flags &= ~FLAG_GLX_SGIX_FBCONFIG;
}
}
if (results->flags & FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP) {
if (glXGetProcAddressARB ((unsigned char*)"glXBindTexImageEXT") == NULL ||
glXGetProcAddressARB ((unsigned char*)"glXReleaseTexImageEXT") == NULL) {
results->flags &= ~FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP;
}
}
#else
EGLDisplay egl_dpy = eglGetDisplay(display);
const char* egl_extensions = eglQueryString (egl_dpy, EGL_EXTENSIONS);
const struct { const char* name; const unsigned int flag; } egl_extension[] = {
{ "EGL_KHR_image_pixmap", FLAG_EGL_KHR_IMAGE_PIXMAP },
{ NULL, 0 }
};
for (int i = 0; egl_extension[i].name != NULL; i++)
if (is_extension_supported (egl_extensions, egl_extension[i].name) == 1)
results->flags |= egl_extension[i].flag;
#endif
return 1;
}
static int check_blacklist (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results)
{
// Check for software rendering.
if (results->renderer != NULL &&
(strncmp (results->renderer, "Software Rasterizer", 19) == 0 ||
strncmp (results->renderer, "Mesa X11", 8) == 0 ||
strstr (results->renderer, "on softpipe") != NULL)) {
results->flags |= FLAG_SOFTWARE_RENDERING;
}
// jaytaoko: Balcklist the Geforce FX cards
if (results->renderer != NULL) {
char* str = strstr (results->renderer, "GeForce FX");
if (str != NULL) {
results->flags |= FLAG_BLACKLISTED;
}
}
// FIXME(loicm): Compiz does a last check to test whether there's a fbconfig
// available for the default depth or not.
// Scan the PCI devices searching for blacklisted GPUs.
// FIXME: pci or not is not actually related with PCI, it's just that if pci_init
// fails it exit directly :-(
#ifndef NUX_OPENGLES_20
const int gpu_blacklist_size = ARRAY_SIZE (gpu_blacklist);
struct pci_access* access;
struct pci_dev* dev;
access = pci_alloc ();
pci_init (access);
pci_scan_bus (access);
dev = access->devices;
while (dev != NULL) {
pci_fill_info (dev, PCI_FILL_IDENT);
for (int i = 0; i < gpu_blacklist_size; i++) {
if (dev->vendor_id == gpu_blacklist[i].vendor &&
dev->device_id == gpu_blacklist[i].device) {
results->flags |= FLAG_BLACKLISTED;
}
}
dev = dev->next;
}
pci_cleanup (access);
#endif
return 1;
}
int (*tests[]) (Display *display,
unsigned int screen,
Window root,
NUXContext *context,
XVisualInfo **vinfos,
TestResults *results) = {
check_root_visual,
check_xcomposite,
check_damage_extension,
check_fixes_extension,
#ifndef NUX_OPENGLES_20
check_glx_config,
check_colorbuffers,
#else
check_egl_config,
#endif
check_context,
check_extensions,
check_blacklist
};
#ifndef NUX_OPENGLES_20
const unsigned int c_num_tests = 9;
#else
const unsigned int c_num_tests = 8;
#endif
int main (int argc, char* argv[]) {
char *display_name = NULL;
int screen;
unsigned int print = 0;
Window root;
XVisualInfo *vinfos = NULL;
Display *display = NULL;
NUXContext context = NULL;
TestResults results;
#ifdef NUX_OPENGLES_20
EGLDisplay egl_dpy;
#endif
char resultfilename[30];
int resultfile;
int forcecheck = 0;
memset(&results, 0, sizeof(TestResults));
// Basic command-line parsing.
for (int i = 1; i < argc; i++) {
if (((strncmp (argv[i], "-d", 2) == 0) ||
(strncmp (argv[i], "--display", 9) == 0)) &&
(i + 1 < argc)) {
display_name = argv[i + 1];
i++;
} else if ((strncmp (argv[i], "-i", 2) == 0) ||
(strncmp (argv[i], "--indirect", 10) == 0)) {
results.indirect = 1;
} else if ((strncmp (argv[i], "-p", 2) == 0) ||
(strncmp (argv[i], "--print", 7) == 0)) {
print = 1;
} else if ((strncmp (argv[i], "-c", 2) == 0) ||
(strncmp (argv[i], "--compiz", 8) == 0)) {
results.compiz = 1;
} else if ((strncmp (argv[i], "-f", 2) == 0) ||
(strncmp (argv[i], "--force-check", 13) == 0)) {
forcecheck = 1;
} else if ((strncmp (argv[i], "-h", 2) == 0) ||
(strncmp (argv[i], "--help", 6) == 0)) {
print_help ();
return 2;
} else {
fprintf (stderr, "Error: unknown command-line option `%s'\n\n", argv[i]);
print_help ();
return 2;
}
}
// can skip some tests if not forced
if (!forcecheck && !print) {
if (access("/tmp/unity_support_test.0", F_OK) == 0) {
return 0;
}
if (getenv ("UNITY_FORCE_START")) {
fprintf (stdout, "Warning: UNITY_FORCE_START enabled, no check for unity or compiz support.\n");
return 0;
}
}
// Open a X11 connection and get the root window.
display = XOpenDisplay (display_name);
#ifndef NUX_OPENGLES_20
// Before doing anything with GLX, check that it is supported on the system.
Bool glx_supported = False;
int dummy0, dummy1;
if (display)
glx_supported = glXQueryExtension(display, &dummy0, &dummy1);
#endif
if (!display) {
results.error = strdup ("unable to open display");
// exit with 5, to tell "it's not an error we should cache"
results.result = 5;
}
#ifndef NUX_OPENGLES_20
else if (!glx_supported) {
results.error = strdup ("GLX is not available on the system");
// exit with 5, to tell "it's not an error we should cache"
results.result = 5;
}
#endif
else
{
screen = DefaultScreen (display);
root = XRootWindow (display, screen);
#ifndef NUX_OPENGLES_20
// Do the tests, if one of them fails break out of the loop
for (unsigned int i = 0; i < c_num_tests; i++)
if (!(*tests[i]) (display, screen, root, &context, &vinfos, &results))
break;
if (results.compiz == 0) {
// Unity compatibility checks.
get_opengl_version (results.version, &results.major, &results.minor);
if ((results.major >= 2 || (results.major == 1 && results.minor >= 4)) &&
(results.flags & FLAG_GLX_SGIX_FBCONFIG) &&
(results.flags & FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP) &&
(results.flags & MASK_GL_NON_POWER_OF_TWO) &&
(results.flags & FLAG_GL_ARB_VERTEX_PROGRAM) &&
(results.flags & FLAG_GL_ARB_FRAGMENT_PROGRAM) &&
(results.flags & FLAG_GL_ARB_VERTEX_BUFFER_OBJECT) &&
(results.flags & MASK_GL_FRAMEBUFFER_OBJECT) &&
(~results.flags & FLAG_SOFTWARE_RENDERING) &&
(~results.flags & FLAG_BLACKLISTED)) {
results.result = 0;
} else {
results.result = 1;
}
} else {
// Compiz compatibility checks.
if ((results.flags & FLAG_GLX_SGIX_FBCONFIG) &&
(results.flags & FLAG_GLX_EXT_TEXTURE_FROM_PIXMAP) &&
(results.flags & MASK_GL_NON_POWER_OF_TWO) &&
(~results.flags & FLAG_SOFTWARE_RENDERING) &&
(~results.flags & FLAG_BLACKLISTED)) {
results.result = 0;
} else {
results.result = 1;
}
}
#else
egl_dpy = eglGetDisplay(display);
if (!eglInitialize (egl_dpy, &results.major, &results.minor)) {
results.error = strdup ("OpenGLES: eglInitialize() failed");
results.result = 1;
} else {
// Do the tests, if one of them fails break out of the loop
for (unsigned int i = 0; i < c_num_tests; i++)
if (!(*tests[i]) (display, screen, root, &context, &vinfos, &results))
break;
if (results.compiz == 0) {
// Unity compatibility checks.
if ((results.major >= 2 || (results.major == 1 && results.minor >= 4)) &&
(results.flags & FLAG_GL_OES_EGL_IMAGE) &&
(results.flags & FLAG_EGL_KHR_IMAGE_PIXMAP) &&
(~results.flags & FLAG_SOFTWARE_RENDERING) &&
(~results.flags & FLAG_BLACKLISTED)) {
results.result = 0;
} else {
results.result = 1;
}
} else {
// Compiz compatibility checks.
if ((results.flags & FLAG_GL_OES_EGL_IMAGE) &&
(results.flags & FLAG_EGL_KHR_IMAGE_PIXMAP) &&
(~results.flags & FLAG_SOFTWARE_RENDERING) &&
(~results.flags & FLAG_BLACKLISTED)) {
results.result = 0;
} else {
results.result = 1;
}
}
}
#endif
}
if (print == 1) {
print_report (results.vendor, results.renderer,
results.version, results.major,
results.minor, results.flags,
results.compiz, results.result, results.error);
}
if (vinfos != NULL)
XFree (vinfos);
#ifndef NUX_OPENGLES_20
if (context != NULL)
glXDestroyContext (display, context);
#else
if (context == EGL_NO_CONTEXT)
eglDestroyContext (egl_dpy, context);
if (egl_dpy)
eglTerminate (egl_dpy);
#endif
if (display != NULL)
XCloseDisplay (display);
if (results.error != NULL)
free (results.error);
// drop result file
if (results.result != 5) {
snprintf(resultfilename, sizeof(resultfilename), "/tmp/unity_support_test.%i", results.result);
resultfile = open(resultfilename, O_CREAT|O_WRONLY|O_EXCL, 0666);
if (resultfile > 0)
close(resultfile);
}
return results.result;
}
nux-4.0.6+14.04.20141107/tools/compose_key_list_generator.py 0000755 0000153 0177776 00000010212 12427165212 024061 0 ustar pbuser nogroup 0000000 0000000 #!/usr/bin/python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Convert XOrg libX11 compose sequences such as
# http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre
#
# To use it, just download the Compose.pre file you want, then launch this
# script like:
# ./compose_key_list_generator.py /path/Compose.pre [/path/output_file.c]
#
# Marco Trevisan (Treviño) -- Copyright 2012
#
# Released under the GPLv2 terms.
import os, sys, re, codecs
from gi.repository import Gdk
DEFAULT_OUTPUT = "/tmp/parsed_keys.cpp"
input_file = sys.argv[1]
output_file = sys.argv[2] if len(sys.argv) > 2 else DEFAULT_OUTPUT
keys_match = re.compile("(?P<[^:]+)[\s]*:[\s]*\"(\\\)?(?P.*)\"[\s]*(?P[^\s]+)?[\s]*#[\s]*(?P.+)")
unicode_keys = re.compile("^U[0-9A-Fa-f]{4,6}$");
blacklisted_keys = ["EZH", "ezh", "dead_double_grave", "dead_inverted_breve",
"dead_greek", "greaterthanequal", "lessthanequal",
"underbar", "rightarrow", "leftarrow"]
combinations = {u"": ["ubuntu", "UBUNTU"]}
descriptions = {u"": "UBUNTU CIRCLE"}
def key_list_has_invalid_keys(keys):
if len([k for k in keys if unicode_keys.match(k)]):
return True
if 0 in [Gdk.keyval_from_name(k) for k in keys]:
return True
if len([k for k in keys if k in blacklisted_keys]):
return True
return False
def escape_char(char):
escape_list = ["\\", "\""]
for e in escape_list:
char = char.replace(e, "\\"+e)
return char
def make_cpp_output(output_file):
keycode = """/* This file has been automatically generated using the
* compose_key_list_generator.py script.
*/
#include
#include
struct ComposeSequence
{
const static unsigned int MAX_SYMBOLS = %d;
KeySym symbols[MAX_SYMBOLS];
const char* result;
};
static const size_t COMPOSE_SEQUENCES_SIZE = %d;
static const ComposeSequence COMPOSE_SEQUENCES[] = {
%s};
"""
keyarray = ""
sequencies_size = 0;
max_values = 0
for c in combinations.keys():
thiscombo = combinations[c]
if not len(thiscombo):
continue
first = True
for combo in thiscombo:
# Fix manually set combinations
if (type(combo) is str):
combo = [k for k in combo]
combo.insert(0, "Multi_key")
# Add 'XK_' prefix to key names
combo = ["XK_" + k for k in combo]
combo.append("XK_VoidSymbol")
combosize = len(combo)
if combosize > max_values:
max_values = combosize
desc = " // " + descriptions[c] if first else ""
keyarray += " {{%s}, \"%s\"},%s\n" % (", ".join(combo), escape_char(c), desc)
sequencies_size += 1
first = False
output = keycode % (max_values, sequencies_size, keyarray)
out = file(output_file, "w")
out.write(output.encode('utf-8'))
out.close()
if not os.path.exists(input_file):
print("Missing argument, you need to pass a Compose.pre file to this!")
sys.exit()
print "Parsing "+input_file+", saving it to "+output_file+"..."
composefile = codecs.open(input_file, 'r', 'utf-8')
for line in composefile:
parts = re.match(keys_match, line)
if not parts:
continue
keybinding = parts.group("keybinding")
if not keybinding:
print "Error while matching keybinding in line\n\t"+line
char = parts.group("char")
keys = re.compile("<([^>]+)>").findall(keybinding)
desc = parts.group("desc")
if parts.group("charcode"):
desc = parts.group("charcode") + " | " + desc
# Ignore the group if it contains unknown values
if key_list_has_invalid_keys(keys):
continue
# Ignoring unknown keys
if 0 in [Gdk.keyval_from_name(k) for k in keys]:
continue
if not char in combinations:
combinations[char] = [keys]
else:
if not keys in combinations[char]:
combinations[char] += [keys]
if not char in descriptions:
descriptions[char] = desc
composefile.close();
make_cpp_output(output_file)
nux-4.0.6+14.04.20141107/doxygen-include.am 0000644 0000153 0177776 00000013045 12427165212 020352 0 ustar pbuser nogroup 0000000 0000000 # ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
# Copyright (C) 2004 Oren Ben-Kiki
# This file is distributed under the same terms as the Automake macro files.
# Generate automatic documentation using Doxygen. Goals and variables values
# are controlled by the various DX_COND_??? conditionals set by autoconf.
#
# The provided goals are:
# doxygen-doc: Generate all doxygen documentation.
# doxygen-run: Run doxygen, which will generate some of the documentation
# (HTML, CHM, CHI, MAN, RTF, XML) but will not do the post
# processing required for the rest of it (PS, PDF, and some MAN).
# doxygen-man: Rename some doxygen generated man pages.
# doxygen-ps: Generate doxygen PostScript documentation.
# doxygen-pdf: Generate doxygen PDF documentation.
#
# Note that by default these are not integrated into the automake goals. If
# doxygen is used to generate man pages, you can achieve this integration by
# setting man3_MANS to the list of man pages generated and then adding the
# dependency:
#
# $(man3_MANS): doxygen-doc
#
# This will cause make to run doxygen and generate all the documentation.
#
# The following variable is intended for use in Makefile.am:
#
# DX_CLEANFILES = everything to clean.
#
# This is usually added to MOSTLYCLEANFILES.
## --------------------------------- ##
## Format-independent Doxygen rules. ##
## --------------------------------- ##
if DX_COND_doc
## ------------------------------- ##
## Rules specific for HTML output. ##
## ------------------------------- ##
if DX_COND_html
DX_CLEAN_HTML = @DX_DOCDIR@/html
endif DX_COND_html
## ------------------------------ ##
## Rules specific for CHM output. ##
## ------------------------------ ##
if DX_COND_chm
DX_CLEAN_CHM = @DX_DOCDIR@/chm
if DX_COND_chi
DX_CLEAN_CHI = @DX_DOCDIR@/@PACKAGE@.chi
endif DX_COND_chi
endif DX_COND_chm
## ------------------------------ ##
## Rules specific for MAN output. ##
## ------------------------------ ##
if DX_COND_man
DX_CLEAN_MAN = @DX_DOCDIR@/man
endif DX_COND_man
## ------------------------------ ##
## Rules specific for RTF output. ##
## ------------------------------ ##
if DX_COND_rtf
DX_CLEAN_RTF = @DX_DOCDIR@/rtf
endif DX_COND_rtf
## ------------------------------ ##
## Rules specific for XML output. ##
## ------------------------------ ##
if DX_COND_xml
DX_CLEAN_XML = @DX_DOCDIR@/xml
endif DX_COND_xml
## ----------------------------- ##
## Rules specific for PS output. ##
## ----------------------------- ##
if DX_COND_ps
DX_CLEAN_PS = @DX_DOCDIR@/@PACKAGE@.ps
DX_PS_GOAL = doxygen-ps
doxygen-ps: @DX_DOCDIR@/@PACKAGE@.ps
@DX_DOCDIR@/@PACKAGE@.ps: @DX_DOCDIR@/@PACKAGE@.tag
cd @DX_DOCDIR@/latex; \
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
$(DX_LATEX) refman.tex; \
$(MAKEINDEX_PATH) refman.idx; \
$(DX_LATEX) refman.tex; \
countdown=5; \
while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
refman.log > /dev/null 2>&1 \
&& test $$countdown -gt 0; do \
$(DX_LATEX) refman.tex; \
countdown=`expr $$countdown - 1`; \
done; \
$(DX_DVIPS) -o ../@PACKAGE@.ps refman.dvi
endif DX_COND_ps
## ------------------------------ ##
## Rules specific for PDF output. ##
## ------------------------------ ##
if DX_COND_pdf
DX_CLEAN_PDF = @DX_DOCDIR@/@PACKAGE@.pdf
DX_PDF_GOAL = doxygen-pdf
doxygen-pdf: @DX_DOCDIR@/@PACKAGE@.pdf
@DX_DOCDIR@/@PACKAGE@.pdf: @DX_DOCDIR@/@PACKAGE@.tag
cd @DX_DOCDIR@/latex; \
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
$(DX_PDFLATEX) refman.tex; \
$(DX_MAKEINDEX) refman.idx; \
$(DX_PDFLATEX) refman.tex; \
countdown=5; \
while $(DX_EGREP) 'Rerun (LaTeX|to get cross-references right)' \
refman.log > /dev/null 2>&1 \
&& test $$countdown -gt 0; do \
$(DX_PDFLATEX) refman.tex; \
countdown=`expr $$countdown - 1`; \
done; \
mv refman.pdf ../@PACKAGE@.pdf
endif DX_COND_pdf
## ------------------------------------------------- ##
## Rules specific for LaTeX (shared for PS and PDF). ##
## ------------------------------------------------- ##
if DX_COND_latex
DX_CLEAN_LATEX = @DX_DOCDIR@/latex
endif DX_COND_latex
.PHONY: doxygen-run doxygen-doc $(DX_PS_GOAL) $(DX_PDF_GOAL)
.INTERMEDIATE: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
doxygen-run: @DX_DOCDIR@/@PACKAGE@.tag
doxygen-doc: doxygen-run $(DX_PS_GOAL) $(DX_PDF_GOAL)
@DX_DOCDIR@/@PACKAGE@.tag: $(DX_CONFIG) $(pkginclude_HEADERS)
rm -rf @DX_DOCDIR@
$(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
DX_CLEANFILES = \
@DX_DOCDIR@/@PACKAGE@.tag \
-r \
$(DX_CLEAN_HTML) \
$(DX_CLEAN_CHM) \
$(DX_CLEAN_CHI) \
$(DX_CLEAN_MAN) \
$(DX_CLEAN_RTF) \
$(DX_CLEAN_XML) \
$(DX_CLEAN_PS) \
$(DX_CLEAN_PDF) \
$(DX_CLEAN_LATEX)
endif DX_COND_doc
nux-4.0.6+14.04.20141107/Makefile.am 0000644 0000153 0177776 00000000552 12427165212 016770 0 ustar pbuser nogroup 0000000 0000000 SUBDIRS = data NuxCore NuxGraphics Nux examples gputests tests tools
CXXFLAGS += -fno-permissive
include $(top_srcdir)/Makefile.am.coverage
include doxygen-include.am
if BUILD_DOCUMENTATION
all: doxygen-doc
endif
DISTCLEANFILES = doc/html/* doc/*
EXTRA_DIST = $(DX_CONFIG) autogen.sh COPYING.gpl .bzrignore
check-headless:
cd tests; $(MAKE) check-headless
nux-4.0.6+14.04.20141107/examples/ 0000755 0000153 0177776 00000000000 12427165411 016551 5 ustar pbuser nogroup 0000000 0000000 nux-4.0.6+14.04.20141107/examples/coverflow.cpp 0000644 0000153 0177776 00000006446 12427165212 021274 0 ustar pbuser nogroup 0000000 0000000 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
/*
* Copyright (C) 2012 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by: Jason Smith
* Authored by: Jay Taoko
*/
const char* movie_list[] = {
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
"nux.png",
0
};
#include "Nux/Nux.h"
#include "Nux/HLayout.h"
#include "NuxGraphics/GraphicsDisplay.h"
#include "NuxGraphics/GLShader.h"
#include "NuxGraphics/GpuDevice.h"
#include "NuxGraphics/GLDeviceObjects.h"
#include "NuxGraphics/GLShader.h"
#include "NuxGraphics/GraphicsEngine.h"
#include "Nux/Coverflow.h"
#include "Nux/CoverflowItem.h"
namespace nux
{
//class BaseTexture;
class BasicCoverflowItem : public CoverflowItem
{
public:
BasicCoverflowItem(std::string const& name, std::string const& filename);
ObjectPtr GetTexture() const;
private:
ObjectPtr texture_;
};
BasicCoverflowItem::BasicCoverflowItem(std::string const& name,
std::string const& filename)
: CoverflowItem(name)
{
texture_.Adopt(LoadTextureFromFile(filename));
}
ObjectPtr BasicCoverflowItem::GetTexture() const
{
return texture_;
}
}
void CoverflowThread(nux::NThread* thread, void* /* InitData */)
{
nux::Coverflow* coverflow = new nux::Coverflow();
coverflow->fov = 45;
coverflow->true_perspective = false;
coverflow->folding_angle = 45;
coverflow->reflection_size = 0.5f;
coverflow->show_reflection = true;
nux::HLayout* main_layout(new nux::HLayout(NUX_TRACKER_LOCATION));
main_layout->AddView(coverflow, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
static_cast(thread)->SetLayout(main_layout);
int i = 0;
nux::CoverflowModel::Ptr model = coverflow->model();
std::string base_path = PKGDATADIR"/UITextures/";
while(movie_list[i] != NULL)
{
std::string name = "Nux The Movie";
std::string movie_path = base_path + movie_list[i];
nux::CoverflowItem::Ptr item(new nux::BasicCoverflowItem(name, movie_path));
model->AddItem(item);
i++;
}
}
int main()
{
nux::NuxInitialize(0);
std::unique_ptr wt(nux::CreateGUIThread("CoverFlow", 1100, 480, 0, &CoverflowThread, 0));
wt->Run(0);
return 0;
}
nux-4.0.6+14.04.20141107/examples/abstract-separator.h 0000644 0000153 0177776 00000002545 12427165212 022530 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic® Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Jay Taoko
*
*/
#ifndef ABSTRACTSEPARATOR_H
#define ABSTRACTSEPARATOR_H
#include "Nux/View.h"
namespace nux
{
class AbstractSeparator: public View
{
public:
AbstractSeparator (NUX_FILE_LINE_PROTO);
AbstractSeparator (const Color &color, float Alpha0, float Alpha1, int Border, NUX_FILE_LINE_PROTO);
~AbstractSeparator();
void SetColor (const Color &color);
void SetAlpha (float Alpha0, float Alpha1);
void SetBorderSize (int Border);
protected:
Color m_Color;
float m_Alpha0;
float m_Alpha1;
int m_BorderSize;
};
}
#endif // ABSTRACTSEPARATOR_H
nux-4.0.6+14.04.20141107/examples/line-separator.cpp 0000644 0000153 0177776 00000004461 12427165212 022206 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic® Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "line-separator.h"
namespace nux
{
HSeparator::HSeparator()
{
SetMinimumHeight (1);
SetMaximumHeight (1);
}
HSeparator::HSeparator (const Color &color, float Alpha0, float Alpha1, int Border)
: AbstractSeparator (color, Alpha0, Alpha1, Border)
{
SetMinimumHeight (1);
SetMaximumHeight (1);
}
HSeparator::~HSeparator()
{
}
void HSeparator::Draw (GraphicsEngine &GfxContext, bool /* force_draw */)
{
Geometry base = GetGeometry();
base.OffsetPosition(3, 0);
base.OffsetSize(-6, 0);
int y0 = base.y + base.GetHeight() / 2;
GetGraphicsDisplay()->GetGraphicsEngine()->GetRenderStates().SetBlend (TRUE, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (base.GetWidth() - 2 * m_BorderSize > 0)
{
Color color0 = m_Color;
Color color1 = m_Color;
color0.alpha = m_Alpha0;
color1.alpha = m_Alpha1;
GetPainter().Draw2DLine (GfxContext, base.x, y0, base.x + m_BorderSize, y0, color0, color1);
GetPainter().Draw2DLine (GfxContext, base.x + m_BorderSize, y0, base.x + base.GetWidth() - m_BorderSize, y0, color1, color1);
GetPainter().Draw2DLine (GfxContext, base.x + base.GetWidth() - m_BorderSize, y0, base.x + base.GetWidth(), y0, color1, color0);
}
else
{
Color color1 = m_Color;
color1.alpha = m_Alpha1;
GetPainter().Draw2DLine (GfxContext, base.x, y0, base.x + base.GetWidth(), y0, color1, color1);
}
GetGraphicsDisplay()->GetGraphicsEngine()->GetRenderStates().SetBlend (FALSE);
}
}
nux-4.0.6+14.04.20141107/examples/Makefile.am 0000644 0000153 0177776 00000007326 12427165212 020614 0 ustar pbuser nogroup 0000000 0000000 CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
if BUILD_EXAMPLES
# This tells automake that we want to build binaries, but they shouldn't be
# installed. For each individual example, add it's binary name here
noinst_PROGRAMS = text_entry_focus \
shortcut_keys \
coverflow \
kinetic_scroll_view
#button \
# cairo \
# cairo_wrapper \
# canvas \
# checkbox \
# combobox \
# gridlayout \
# layeredlayout \
# moveable_view \
# pango_combobox \
# pangotextedit \
# rotate_texture_area \
# scrollview \
# tab_view \
# textedit \
# tiles_view \
# timegraph \
# timeline \
# tooltip
if HAVE_GEIS
noinst_PROGRAMS += gestures
endif
# We only have to do this AM_ once to affect all the binaries we build from
# this Makefile
AM_CPPFLAGS = \
-I$(srcdir) \
-I$(top_srcdir) \
-I$(top_builddir)/Nux \
-DPREFIX=\""$(prefix)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DG_LOG_DOMAIN=\"NuxExamples\" \
-DPKGDATADIR=\""$(pkgdatadir)/@NUX_API_VERSION@"\" \
$(GCC_FLAGS) \
$(NUX_CORE_CFLAGS) \
$(NUX_EXAMPLES_CFLAGS) \
$(NUX_CFLAGS) \
$(IBUS_CFLAGS) \
$(MAINTAINER_CFLAGS) \
$(GEIS_CFLAGS)
ALL_LIBS = \
$(top_builddir)/NuxCore/libnux-core-@NUX_API_VERSION@.la \
$(top_builddir)/NuxGraphics/libnux-graphics-@NUX_API_VERSION@.la \
$(top_builddir)/Nux/libnux-@NUX_API_VERSION@.la \
$(NUX_EXAMPLES_LIBS) \
$(NUX_LIBS) \
$(IBUS_LIBS) \
$(GEIS_LIBS)
# This is the individual executable build. For every $exe in noinst_PROGRAMS
# you need a $exe_SOURCES and $exe_LDADD so it builds
#combobox_SOURCES = combobox.cpp
#combobox_LDADD = $(ALL_LIBS)
#cairo_SOURCES = cairo.cpp
#cairo_LDADD = $(ALL_LIBS)
#cairo_wrapper_SOURCES = cairo_wrapper.cpp
#cairo_wrapper_LDADD = $(ALL_LIBS)
#canvas_SOURCES = canvas.cpp
#canvas_LDADD = $(ALL_LIBS)
#textedit_SOURCES = textedit.cpp
#textedit_LDADD = $(ALL_LIBS)
#button_SOURCES = button.cpp
#button_LDADD = $(ALL_LIBS)
#checkbox_SOURCES = checkbox.cpp
#checkbox_LDADD = $(ALL_LIBS)
#tooltip_SOURCES = tooltip.cpp
#tooltip_LDADD = $(ALL_LIBS)
#timeline_SOURCES = timeline.cpp
#timeline_LDADD = $(ALL_LIBS)
#timegraph_SOURCES = timegraph.cpp
#timegraph_LDADD = $(ALL_LIBS)
#gridlayout_SOURCES = gridlayout.cpp
#gridlayout_LDADD = $(ALL_LIBS)
#pangotextedit_SOURCES = pangotextedit.cpp
#pangotextedit_LDADD = $(ALL_LIBS)
#moveable_view_SOURCES = moveable_view.cpp
#moveable_view_LDADD = $(ALL_LIBS)
#layeredlayout_SOURCES = layeredlayout.cpp
#layeredlayout_LDADD = $(ALL_LIBS)
#scrollview_SOURCES = scrollview.cpp
#scrollview_LDADD = $(ALL_LIBS)
#tab_view_SOURCES = tab_view.cpp
#tab_view_LDADD = $(ALL_LIBS)
#pango_combobox_SOURCES = pango_combobox.cpp
#pango_combobox_LDADD = $(ALL_LIBS)
#rotate_texture_area_SOURCES = rotate_texture_area.cpp
#rotate_texture_area_LDADD = $(ALL_LIBS)
#tiles_view_SOURCES = tiles_view.cpp
#tiles_view_LDADD = $(ALL_LIBS)
text_entry_focus_SOURCES = text_entry_focus.cpp
text_entry_focus_LDADD = $(ALL_LIBS)
shortcut_keys_SOURCES = shortcut-keys.cpp line-separator.cpp line-separator.h abstract-separator.h abstract-separator.cpp
shortcut_keys_LDADD = $(ALL_LIBS)
coverflow_SOURCES = coverflow.cpp
coverflow_LDADD = $(ALL_LIBS)
kinetic_scroll_view_SOURCES = kinetic_scroll_view.cpp TestButton.h TestButton.cpp
kinetic_scroll_view_LDADD = $(ALL_LIBS)
if HAVE_GEIS
gestures_SOURCES = gestures.cpp
gestures_LDADD = $(ALL_LIBS)
endif
# To distribute source add the source code here
#sourceexampledir = "$(pkgdatadir)/examples"
#sourceexample_DATA = $(combobox_SOURCES) \
#
endif
nux-4.0.6+14.04.20141107/examples/kinetic_scroll_view.cpp 0000644 0000153 0177776 00000004024 12427165212 023312 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright (C) 2012 - Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Daniel d'Andrada
*/
#include
#include
#include
#include
#include "TestButton.h"
using namespace nux;
View *CreateKineticScrollView()
{
VLayout *layout = new VLayout (NUX_TRACKER_LOCATION);
char buffer[500];
for (int i = 0; i < 100; i++)
{
sprintf(buffer, "TestButton %d", i+1);
Button *button = new TestButton(buffer, NUX_TRACKER_LOCATION);
button->SetMinimumHeight(50);
layout->AddView(button, 1, eLeft, eFull);
}
KineticScrollView *kinetic_scroll_view = new KineticScrollView(NUX_TRACKER_LOCATION);
kinetic_scroll_view->SetLayout(layout);
kinetic_scroll_view->SetScrollableDirections(ScrollableDirectionsVertical);
return kinetic_scroll_view;
}
void UserInterfaceInitialization(NThread* /* thread */, void* /* InitData */)
{
HLayout* mainLayout = new HLayout(NUX_TRACKER_LOCATION);
mainLayout->AddView(CreateKineticScrollView(), 1, eCenter, eFull);
GetWindowThread()->SetLayout(mainLayout);
}
int main()
{
NuxInitialize(0);
WindowThread* window_thread = CreateGUIThread(
"KineticScrollView Example", 640, 300, 0, &UserInterfaceInitialization, 0);
// Start the main loop.
window_thread->Run(NULL);
delete window_thread;
return 0;
}
nux-4.0.6+14.04.20141107/examples/button.cpp 0000644 0000153 0177776 00000006565 12427165212 020603 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/CheckBox.h"
#include "Nux/ToggleButton.h"
#include "Nux/Button.h"
#include "Nux/TextureArea.h"
void UserInterfaceInitialization(nux::NThread* thread, void* init_data)
{
// Create a vertical Layout
nux::VLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION);
//Create a button of type Button
nux::Button* button = new nux::Button ("Party on Garth", NUX_TRACKER_LOCATION);
// Add the button to the layout
layout->AddView (
button,
0,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_MATCHCONTENT);
// Create a button with an image
nux::ColorLayer color (nux::Color (0.6, 0.4, 0.7, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
nux::Button* button_with_image = new nux::Button("Party on Wayne", texture_area, NUX_TRACKER_LOCATION);
//button_with_image->image_position = nux::NUX_POSITION_BOTTOM;
// Add the button to the layout
layout->AddView (
button_with_image,
0,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_MATCHCONTENT);
color = nux::Color (0.6, 0.4, 0.7, 1.0);
texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
nux::Button* button_without_image = new nux::Button(texture_area, NUX_TRACKER_LOCATION);
// Add the button to the layout
layout->AddView (
button_without_image,
0,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_MATCHCONTENT);
nux::ToggleButton *toggle_button = new nux::ToggleButton ("This is a Toggle button, nux just doesn't have a theme for that", NUX_TRACKER_LOCATION);
layout->AddView (
toggle_button,
0,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_MATCHCONTENT);
nux::CheckBox *check_button = new nux::CheckBox ("Check box widget? Check!", NUX_TRACKER_LOCATION);
layout->AddView (
check_button,
0,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_MATCHCONTENT);
// Control the position of elements inside the layout
layout->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
// Set the layout as the container of the window thread
nux::GetWindowThread ()->SetLayout (layout);
// Set the background color of the window
nux::ColorLayer background (nux::Color (0xFF222222));
static_cast (thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
// Initialize Nux subsystem
nux::NuxInitialize (0);
// Create a Window thread
nux::WindowThread* wt = nux::CreateGUIThread(
TEXT("Button"),
800,
600,
0,
&UserInterfaceInitialization,
0);
// Start the main loop
wt->Run (0);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/textedit.cpp 0000644 0000153 0177776 00000003246 12427165212 021113 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/EditTextBox.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(TEXT(""), NUX_TRACKER_LOCATION);
nux::EditTextBox* text_box_edit = new nux::EditTextBox(TEXT("Hello World!"), NUX_TRACKER_LOCATION);
text_box_edit->SetMaximumWidth(300);
MainVLayout->AddView(text_box_edit, 0, nux::eCenter, nux::eFull);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Edit Text Box"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/TestButton.cpp 0000644 0000153 0177776 00000004350 12427165212 021371 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright (C) 2012 - Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Daniel d'Andrada
*/
#include
#include "TestButton.h"
#include
using namespace nux;
TestButton::TestButton(const std::string& button_label, NUX_FILE_LINE_DECL)
: nux::Button(button_label, NUX_FILE_LINE_PARAM)
{
persistent_active_state_ = true;
}
TestButton::~TestButton()
{
}
void TestButton::Draw(GraphicsEngine &graphics_engine, bool force_draw)
{
Geometry base = GetGeometry();
graphics_engine.PushClippingRectangle(base);
GetPainter().PaintBackground(graphics_engine, base);
if (visual_state_ == VISUAL_STATE_PRESSED)
{
GetPainter().PaintTextureShape(graphics_engine, base, eBUTTON_FOCUS);
}
else if (visual_state_ == VISUAL_STATE_PRELIGHT)
{
GetPainter().PaintTextureShape(graphics_engine, base, eBUTTON_PRELIGHT);
}
else if (!active_)
{
GetPainter().PaintTextureShape(graphics_engine, base, eBUTTON_NORMAL);
}
if (GetCompositionLayout())
{
GetPainter().PushPaintLayerStack();
{
Geometry clip_geo = base;
clip_geo.OffsetPosition(left_clip_, top_clip_);
clip_geo.OffsetSize(-left_clip_ - right_clip_, -top_clip_ - bottom_clip_);
graphics_engine.PushClippingRectangle(clip_geo);
GetPainter().PushPaintLayerStack();
GetCompositionLayout()->ProcessDraw(graphics_engine, force_draw);
GetPainter().PopPaintLayerStack();
graphics_engine.PopClippingRectangle();
}
GetPainter().PopPaintLayerStack();
}
graphics_engine.PopClippingRectangle();
}
nux-4.0.6+14.04.20141107/examples/tooltip.cpp 0000644 0000153 0177776 00000073124 12427165212 020755 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/WindowCompositor.h"
#include "Nux/BaseWindow.h"
#include "Nux/Button.h"
#include "NuxGraphics/GraphicsEngine.h"
#include "NuxGraphics/Events.h"
#include "Nux/TextureArea.h"
#include "NuxImage/CairoGraphics.h"
#include
#include
#if defined(NUX_OS_LINUX)
#include
#endif
#define ANCHOR_WIDTH 10.0f
#define ANCHOR_HEIGHT 18.0f
#define RADIUS 5.0f
#define BLUR_INTENSITY 8
#define LINE_WIDTH 1.0f
#define PADDING_SIZE 1
#define H_MARGIN 30
#define V_MARGIN 4
#define FONT_FACE "Ubuntu 13"
namespace nux
{
class Tooltip : public BaseWindow
{
NUX_DECLARE_OBJECT_TYPE(Tooltip, BaseWindow);
public:
Tooltip (int x,
int y,
NString text);
~Tooltip ();
long ProcessEvent (IEvent& iEvent,
long traverseInfo,
long processEventInfo);
void Draw (GraphicsEngine& gfxContext,
bool forceDraw);
void DrawContent (GraphicsEngine& gfxContext,
bool forceDraw);
protected:
void PreLayoutManagement ();
long PostLayoutManagement (long layoutResult);
void PositionChildLayout (float offsetX,
float offsetY);
void LayoutWindowElements ();
void NotifyConfigurationChange (int width,
int height);
ObjectPtr _texture2D;
int _anchorX;
int _anchorY;
nux::NString _labelText;
int _dpiX;
int _dpiY;
cairo_font_options_t* _fontOpts;
private:
void ComputeFullMaskPath (cairo_t* cr,
gfloat anchor_width,
gfloat anchor_height,
gint width,
gint height,
gint upper_size,
gfloat radius,
guint pad);
void DrawDraw (cairo_t* cr,
gboolean outline,
gfloat line_width,
gfloat* rgba,
gboolean negative,
gboolean stroke);
void DrawTintDotHighlight (cairo_t* cr,
gint width,
gint height,
gfloat hl_x,
gfloat hl_y,
gfloat hl_size,
gfloat* rgba_tint,
gfloat* rgba_hl);
void DrawOutlineShadow (cairo_t* cr,
gint width,
gint height,
gfloat anchor_width,
gfloat anchor_height,
gint upper_size,
gfloat corner_radius,
guint blur_coeff,
gfloat* rgba_shadow,
gfloat line_width,
gint padding_size,
gfloat* rgba_line);
void ComputeOutline (cairo_t* cr,
gfloat line_width,
gfloat* rgba_line,
gint width,
gfloat anchor_width,
gfloat corner_radius,
gint padding_size);
void DrawMask (cairo_t* cr,
gint width,
gint height,
gfloat radius,
guint shadow_radius,
gfloat anchor_width,
gfloat anchor_height,
gint upper_size,
gboolean negative,
gboolean outline,
gfloat line_width,
gint padding_size,
gfloat* rgba);
void GetDPI ();
void GetTextExtents (char* font,
int* width,
int* height);
void DrawLabel (cairo_t* cr,
gint width,
gint height,
gfloat* rgba);
};
NUX_IMPLEMENT_OBJECT_TYPE(Tooltip);
void
DrawCairo (cairo_t* cr,
gboolean outline,
gfloat line_width,
gfloat* rgba,
gboolean negative,
gboolean stroke)
{
// prepare drawing
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
// actually draw the mask
if (outline)
{
cairo_set_line_width (cr, line_width);
cairo_set_source_rgba (cr, rgba[0], rgba[1], rgba[2], rgba[3]);
}
else
{
if (negative)
cairo_set_source_rgba (cr, 1.0f, 1.0f, 1.0f, 1.0f);
else
cairo_set_source_rgba (cr, 0.0f, 0.0f, 0.0f, 0.0f);
}
// stroke or fill?
if (stroke)
cairo_stroke_preserve (cr);
else
cairo_fill_preserve (cr);
}
void
Tooltip::ComputeFullMaskPath (cairo_t* cr,
gfloat anchor_width,
gfloat anchor_height,
gint width,
gint height,
gint upper_size,
gfloat radius,
guint pad)
{
// 0 1 2 3
// +--+--------+--+
// | |
// + 14 + 4
// | |
// | |
// | |
// + 13 |
// / |
// / |
// + 12 |
// \ |
// \ |
// 11 + |
// | |
// | |
// | |
// 10 + + 5
// | |
// +--+--------+--+ 6
// 9 8 7
gfloat padding = pad;
float ZEROPOINT5 = 0.5f;
gfloat HeightToAnchor = 0.0f;
HeightToAnchor = ((gfloat) height - 2.0f * radius - anchor_height -2*padding) / 2.0f;
if (HeightToAnchor < 0.0f)
{
g_warning ("Anchor-height and corner-radius a higher than whole texture!");
return;
}
//gint dynamic_size = height - 2*radius - 2*padding - anchor_height;
//gint upper_dynamic_size = upper_size;
//gint lower_dynamic_size = dynamic_size - upper_dynamic_size;
if (upper_size >= 0)
{
if(upper_size > height - 2.0f * radius - anchor_height -2 * padding)
{
//g_warning ("[_compute_full_mask_path] incorrect upper_size value");
HeightToAnchor = 0;
}
else
{
HeightToAnchor = height - 2.0f * radius - anchor_height -2 * padding - upper_size;
}
}
else
{
HeightToAnchor = (height - 2.0f * radius - anchor_height -2*padding) / 2.0f;
}
cairo_translate (cr, -0.5f, -0.5f);
// create path
cairo_move_to (cr, padding + anchor_width + radius + ZEROPOINT5, padding + ZEROPOINT5); // Point 1
cairo_line_to (cr, width - padding - radius, padding + ZEROPOINT5); // Point 2
cairo_arc (cr,
width - padding - radius + ZEROPOINT5,
padding + radius + ZEROPOINT5,
radius,
-90.0f * G_PI / 180.0f,
0.0f * G_PI / 180.0f); // Point 4
cairo_line_to (cr,
(gdouble) width - padding + ZEROPOINT5,
(gdouble) height - radius - padding + ZEROPOINT5); // Point 5
cairo_arc (cr,
(gdouble) width - padding - radius + ZEROPOINT5,
(gdouble) height - padding - radius + ZEROPOINT5,
radius,
0.0f * G_PI / 180.0f,
90.0f * G_PI / 180.0f); // Point 7
cairo_line_to (cr,
anchor_width + padding + radius + ZEROPOINT5,
(gdouble) height - padding + ZEROPOINT5); // Point 8
cairo_arc (cr,
anchor_width + padding + radius + ZEROPOINT5,
(gdouble) height - padding - radius,
radius,
90.0f * G_PI / 180.0f,
180.0f * G_PI / 180.0f); // Point 10
cairo_line_to (cr,
padding + anchor_width + ZEROPOINT5,
(gdouble) height - padding - radius - HeightToAnchor + ZEROPOINT5 ); // Point 11
cairo_line_to (cr,
padding + ZEROPOINT5,
(gdouble) height - padding - radius - HeightToAnchor - anchor_height / 2.0f + ZEROPOINT5); // Point 12
cairo_line_to (cr,
padding + anchor_width + ZEROPOINT5,
(gdouble) height - padding - radius - HeightToAnchor - anchor_height + ZEROPOINT5); // Point 13
cairo_line_to (cr, padding + anchor_width + ZEROPOINT5,
padding + radius + ZEROPOINT5); // Point 14
cairo_arc (cr,
padding + anchor_width + radius + ZEROPOINT5,
padding + radius + ZEROPOINT5,
radius,
180.0f * G_PI / 180.0f,
270.0f * G_PI / 180.0f);
cairo_close_path (cr);
}
void
ComputeMask (cairo_t* cr)
{
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_fill_preserve (cr);
}
void
Tooltip::ComputeOutline (cairo_t* cr,
gfloat line_width,
gfloat* rgba_line,
gint width,
gfloat anchor_width,
gfloat corner_radius,
gint padding_size)
{
cairo_pattern_t* pattern = NULL;
double offset = 0.0;
if (width == 0)
{
g_warning ("%s(): passed in width is 0!", G_STRFUNC);
return;
}
offset = ((double) padding_size + anchor_width + corner_radius) /
(double) width;
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_line_width (cr, line_width);
pattern = cairo_pattern_create_linear (0.0, 0.0, (double) width, 0.0);
cairo_pattern_add_color_stop_rgba (pattern,
0.0,
rgba_line[0],
rgba_line[1],
rgba_line[2],
0.7);
cairo_pattern_add_color_stop_rgba (pattern,
offset,
rgba_line[0],
rgba_line[1],
rgba_line[2],
0.7);
cairo_pattern_add_color_stop_rgba (pattern,
offset + 0.0125,
rgba_line[0],
rgba_line[1],
rgba_line[2],
0.4);
cairo_pattern_add_color_stop_rgba (pattern,
1.0,
rgba_line[0],
rgba_line[1],
rgba_line[2],
0.4);
cairo_set_source (cr, pattern);
cairo_stroke (cr);
cairo_pattern_destroy (pattern);
}
void
Tooltip::DrawTintDotHighlight (cairo_t* cr,
gint width,
gint height,
gfloat hl_x,
gfloat hl_y,
gfloat hl_size,
gfloat* rgba_tint,
gfloat* rgba_hl)
{
cairo_surface_t* dots_surf = NULL;
cairo_t* dots_cr = NULL;
cairo_pattern_t* dots_pattern = NULL;
cairo_pattern_t* hl_pattern = NULL;
// create context for dot-pattern
dots_surf = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 4, 4);
dots_cr = cairo_create (dots_surf);
// clear normal context
cairo_scale (cr, 1.0f, 1.0f);
cairo_set_source_rgba (cr, 0.0f, 0.0f, 0.0f, 0.0f);
cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (cr);
// prepare drawing for normal context
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
// create path in normal context
ComputeFullMaskPath (cr,
ANCHOR_WIDTH,
ANCHOR_HEIGHT,
width,
height,
-1,
RADIUS,
PADDING_SIZE);
//cairo_rectangle (cr, 0.0f, 0.0f, (gdouble) width, (gdouble) height);
// fill path of normal context with tint
cairo_set_source_rgba (cr,
rgba_tint[0],
rgba_tint[1],
rgba_tint[2],
rgba_tint[3]);
cairo_fill_preserve (cr);
// create pattern in dot-context
cairo_set_operator (dots_cr, CAIRO_OPERATOR_CLEAR);
cairo_paint (dots_cr);
cairo_scale (dots_cr, 1.0f, 1.0f);
cairo_set_operator (dots_cr, CAIRO_OPERATOR_OVER);
cairo_set_source_rgba (dots_cr,
rgba_hl[0],
rgba_hl[1],
rgba_hl[2],
rgba_hl[3]);
cairo_rectangle (dots_cr, 0.0f, 0.0f, 1.0f, 1.0f);
cairo_fill (dots_cr);
cairo_rectangle (dots_cr, 2.0f, 2.0f, 1.0f, 1.0f);
cairo_fill (dots_cr);
dots_pattern = cairo_pattern_create_for_surface (dots_surf);
// fill path of normal context with dot-pattern
// FIXME: using the path from ComputeFullMaskPath() and not a plain rect.
// path triggers a bug in cairo (yet to be filed), so repeating of the dot-
// pattern produces wrong pattern in the end, a viable work-around still
// needs to be thought up
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_set_source (cr, dots_pattern);
cairo_pattern_set_extend (dots_pattern, CAIRO_EXTEND_REPEAT);
cairo_fill_preserve (cr);
cairo_pattern_destroy (dots_pattern);
cairo_surface_destroy (dots_surf);
cairo_destroy (dots_cr);
// draw highlight
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
hl_pattern = cairo_pattern_create_radial ((double)hl_x,
(double)hl_y,
(double)0.0f,
(double)hl_x,
(double)hl_y,
(double)hl_size);
cairo_pattern_add_color_stop_rgba (hl_pattern,
0.0f,
1.0f,
1.0f,
1.0f,
0.65f);
cairo_pattern_add_color_stop_rgba (hl_pattern,
1.0f,
1.0f,
1.0f,
1.0f,
0.0f);
cairo_set_source (cr, hl_pattern);
cairo_fill (cr);
cairo_pattern_destroy (hl_pattern);
}
void
Tooltip::DrawMask (cairo_t* cr,
gint width,
gint height,
gfloat radius,
guint shadow_radius,
gfloat anchor_width,
gfloat anchor_height,
gint upper_size,
gboolean negative,
gboolean outline,
gfloat line_width,
gint padding_size,
gfloat* rgba)
{
ComputeFullMaskPath (cr,
anchor_width,
anchor_height,
width,
height,
upper_size,
radius,
padding_size);
}
void
Tooltip::GetDPI ()
{
#if defined(NUX_OS_LINUX)
Display* display = NULL;
int screen = 0;
double dpyWidth = 0.0;
double dpyHeight = 0.0;
double dpyWidthMM = 0.0;
double dpyHeightMM = 0.0;
double dpiX = 0.0;
double dpiY = 0.0;
display = XOpenDisplay (NULL);
screen = DefaultScreen (display);
dpyWidth = (double) DisplayWidth (display, screen);
dpyHeight = (double) DisplayHeight (display, screen);
dpyWidthMM = (double) DisplayWidthMM (display, screen);
dpyHeightMM = (double) DisplayHeightMM (display, screen);
dpiX = dpyWidth * 25.4 / dpyWidthMM;
dpiY = dpyHeight * 25.4 / dpyHeightMM;
_dpiX = (int) (dpiX + 0.5);
_dpiY = (int) (dpiY + 0.5);
XCloseDisplay (display);
#elif defined(NUX_OS_WINDOWS)
_dpiX = 72;
_dpiY = 72;
#endif
}
void
Tooltip::GetTextExtents (char* font,
int* width,
int* height)
{
cairo_surface_t* surface = NULL;
cairo_t* cr = NULL;
PangoLayout* layout = NULL;
PangoFontDescription* desc = NULL;
PangoContext* pangoCtx = NULL;
PangoRectangle logRect = {0, 0, 0, 0};
// sanity check
if (!font || !width || !height)
return;
surface = cairo_image_surface_create (CAIRO_FORMAT_A1, 1, 1);
cr = cairo_create (surface);
layout = pango_cairo_create_layout (cr);
desc = pango_font_description_from_string (font);
pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
pango_layout_set_font_description (layout, desc);
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
pango_layout_set_text (layout, _labelText.GetTCharPtr(), -1);
pangoCtx = pango_layout_get_context (layout); // is not ref'ed
pango_cairo_context_set_font_options (pangoCtx, _fontOpts);
pango_cairo_context_set_resolution (pangoCtx, _dpiX);
pango_layout_context_changed (layout);
pango_layout_get_extents (layout, NULL, &logRect);
*width = logRect.width / PANGO_SCALE;
*height = logRect.height / PANGO_SCALE;
// clean up
pango_font_description_free (desc);
g_object_unref (layout);
cairo_destroy (cr);
cairo_surface_destroy (surface);
}
void
Tooltip::DrawLabel (cairo_t* cr,
gint width,
gint height,
gfloat* rgba)
{
int textWidth = 0;
int textHeight = 0;
PangoLayout* layout = NULL;
PangoFontDescription* desc = NULL;
PangoContext* pangoCtx = NULL;
GetTextExtents ((char*) FONT_FACE,
&textWidth,
&textHeight);
cairo_set_source_rgba (cr, rgba[0], rgba[1], rgba[2], rgba[3]);
cairo_set_font_options (cr, _fontOpts);
layout = pango_cairo_create_layout (cr);
desc = pango_font_description_from_string ((char*) FONT_FACE);
pango_font_description_set_weight (desc, PANGO_WEIGHT_NORMAL);
pango_layout_set_font_description (layout, desc);
pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END);
pango_layout_set_text (layout, _labelText.GetTCharPtr(), -1);
pangoCtx = pango_layout_get_context (layout); // is not ref'ed
pango_cairo_context_set_font_options (pangoCtx, _fontOpts);
pango_cairo_context_set_resolution (pangoCtx, (double) _dpiX);
pango_layout_context_changed (layout);
cairo_move_to (cr,
ANCHOR_WIDTH + (float) ((width - ANCHOR_WIDTH) - textWidth) / 2.0f,
(float) (height - textHeight) / 2.0f);
pango_cairo_show_layout (cr, layout);
cairo_fill (cr);
// clean up
pango_font_description_free (desc);
g_object_unref (layout);
}
void
Tooltip::DrawOutlineShadow (cairo_t* cr,
gint width,
gint height,
gfloat anchor_width,
gfloat anchor_height,
gint upper_size,
gfloat corner_radius,
guint blur_coeff,
gfloat* rgba_shadow,
gfloat line_width,
gint padding_size,
gfloat* rgba_line)
{
ComputeFullMaskPath (cr,
anchor_width,
anchor_height,
width,
height,
upper_size,
corner_radius,
padding_size);
//DrawCairo (cr, TRUE, line_width, rgba_shadow, FALSE, FALSE);
//ctk_surface_blur (surf, blur_coeff);
//ComputeMask (cr);
ComputeOutline (cr,
line_width,
rgba_line,
width,
anchor_width,
corner_radius,
padding_size);
}
Tooltip::Tooltip (int x,
int y,
NString text)
: BaseWindow("", NUX_TRACKER_LOCATION)
{
_anchorX = x;
_anchorY = y;
_labelText = text;
_fontOpts = cairo_font_options_create ();
// FIXME: hard-coding these for the moment, as we don't have
// gsettings-support in place right now
cairo_font_options_set_antialias (_fontOpts, CAIRO_ANTIALIAS_SUBPIXEL);
cairo_font_options_set_hint_metrics (_fontOpts, CAIRO_HINT_METRICS_ON);
cairo_font_options_set_hint_style (_fontOpts, CAIRO_HINT_STYLE_SLIGHT);
cairo_font_options_set_subpixel_order (_fontOpts, CAIRO_SUBPIXEL_ORDER_RGB);
// make sure _dpiX and _dpiY are initialized correctly
GetDPI ();
}
Tooltip::~Tooltip ()
{
cairo_font_options_destroy(_fontOpts);
}
long
Tooltip::ProcessEvent (IEvent& ievent,
long TraverseInfo,
long ProcessEventInfo)
{
return 0;
}
void Tooltip::Draw (GraphicsEngine& gfxContext,
bool forceDraw)
{
Geometry base = GetGeometry();
// the elements position inside the window are referenced to top-left window
// corner. So bring base to (0, 0).
base.SetX (0);
base.SetY (0);
gfxContext.PushClippingRectangle (base);
gPainter.PushDrawShapeLayer (gfxContext,
base,
eSHAPE_CORNER_ROUND10,
nux::Color(0xFF707070), eAllCorners, true);
TexCoordXForm texxform;
texxform.SetWrap(TEXWRAP_REPEAT, TEXWRAP_REPEAT);
texxform.SetTexCoordType (TexCoordXForm::OFFSET_COORD);
gfxContext.QRP_GLSL_1Tex (base.x,
base.y,
base.width,
base.height,
_texture2D->GetDeviceTexture(),
texxform,
Color(1.0f, 1.0f, 1.0f, 1.0f));
gPainter.PopBackground ();
gfxContext.PopClippingRectangle ();
}
void Tooltip::DrawContent (GraphicsEngine &GfxContext, bool force_draw)
{
/*Geometry base = GetGeometry();
int x = base.x;
int y = base.y;
// The elements position inside the window are referenced to top-left window corner. So bring base to (0, 0).
base.SetX (0);
base.SetY (0);
if (UseBlurredBackground() )
{
TexCoordXForm texxform;
texxform.uoffset = (float) x / (float) GetThreadWindowCompositor().GetScreenBlurTexture()->GetWidth();
texxform.voffset = (float) y / (float) GetThreadWindowCompositor().GetScreenBlurTexture()->GetHeight();
texxform.SetTexCoordType (TexCoordXForm::OFFSET_COORD);
gPainter.PushTextureLayer (GfxContext, base, GetThreadWindowCompositor().GetScreenBlurTexture(), texxform, Color::White, true);
}
else
{
//nuxDebugMsg(TEXT("[BaseWindow::DrawContent]"));
gPainter.PushShapeLayer (GfxContext, base, eSHAPE_CORNER_ROUND10, m_background_color, eAllCorners, true);
//GfxContext.QRP_GLSL_Color(base.x, base.y, base.width, base.height, Color(1.0f, 0.0f, 0.0f, 1.0f));
//GfxContext.QRP_GLSL_Color(base.x, base.y, base.width, base.height, Color(1.0f / (float) (std::rand () % 100), 1.0f / (float) (std::rand () % 100), 1.0f / (float) (std::rand () % 100), 0.5f));
}
if (m_layout)
{
GfxContext.PushClippingRectangle (base);
m_layout->ProcessDraw (GfxContext, force_draw);
GfxContext.PopClippingRectangle();
}
gPainter.PopBackground();*/
}
void Tooltip::PreLayoutManagement ()
{
}
long
Tooltip::PostLayoutManagement (long LayoutResult)
{
long result = BaseWindow::PostLayoutManagement (LayoutResult);
int textWidth = 0;
int textHeight = 0;
Geometry base;
float rgbaTint[4] = {0.0f, 0.0f, 0.0f, 0.7f};
float rgbaHighlight[4] = {1.0f, 1.0f, 1.0f, 0.15f};
float rgbaLine[4] = {1.0f, 1.0f, 1.0f, 0.75f};
float rgbaShadow[4] = {0.0f, 0.0f, 0.0f, 0.48f};
float rgbaText[4] = {1.0f, 1.0f, 1.0f, 1.0f};
GetTextExtents ((char*) FONT_FACE,
&textWidth,
&textHeight);
base.x = _anchorX;
base.y = _anchorY;
base.width = textWidth + 2 * H_MARGIN + ANCHOR_WIDTH + 2 * PADDING_SIZE;
base.height = textHeight + 2 * V_MARGIN + 2 * PADDING_SIZE;
SetGeometry (base);
CairoGraphics* cairo_graphics = new CairoGraphics (CAIRO_FORMAT_ARGB32,
base.GetWidth (),
base.GetHeight ());
cairo_t *cr = cairo_graphics->GetContext ();
DrawTintDotHighlight (cr,
base.GetWidth (),
base.GetHeight (),
base.GetWidth () / 2.0f,
15.0f,
base.GetWidth () / 2.0f,
rgbaTint,
rgbaHighlight);
DrawOutlineShadow (cr,
base.GetWidth (),
base.GetHeight (),
ANCHOR_WIDTH,
ANCHOR_HEIGHT,
-1,
RADIUS,
BLUR_INTENSITY,
rgbaShadow,
LINE_WIDTH,
PADDING_SIZE,
rgbaLine);
DrawLabel (cr,
base.GetWidth (),
base.GetHeight (),
rgbaText);
nux::NBitmapData* bitmap = cairo_graphics->GetBitmap();
// Texture2D is the high level representation of an image that is backed by
// an actual opengl texture.
_texture2D = GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableTexture ();
// It is initially owned, and now we have a pointer to it, so unref
_texture2D->UnReference();
_texture2D->Update(bitmap);
delete bitmap;
delete cairo_graphics;
return result;
}
void
Tooltip::PositionChildLayout (float offsetX,
float offsetY)
{
}
void
Tooltip::LayoutWindowElements ()
{
}
void
Tooltip::NotifyConfigurationChange (int width,
int height)
{
}
}
void
initGUIThread (nux::NThread* thread,
void* data)
{
nux::VLayout* layout = new nux::VLayout (TEXT(""), NUX_TRACKER_LOCATION);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
nux::GetWindowThread ()->SetLayout (layout);
}
int main (int argc,
char const** argv)
{
nux::WindowThread* thread = NULL;
nux::NuxInitialize (0);
thread = nux::CreateGUIThread (TEXT ("NUX/Unity Tooltips"),
600,
400,
0,
&initGUIThread,
0);
nux::Tooltip* tooltip1 = new nux::Tooltip (64, 64, TEXT("GEdit"));
nux::Tooltip* tooltip2 = new nux::Tooltip (64, 128, TEXT("Firefox"));
nux::Tooltip* tooltip3 = new nux::Tooltip (64, 192, TEXT("Chromium"));
tooltip1->ShowWindow(true);
tooltip2->ShowWindow(true);
tooltip3->ShowWindow(true);
thread->Run (NULL);
tooltip3->UnReference();
tooltip2->UnReference();
tooltip1->UnReference();
delete thread;
return 0;
}
nux-4.0.6+14.04.20141107/examples/TestButton.h 0000644 0000153 0177776 00000002217 12427165212 021036 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright (C) 2012 - Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Daniel d'Andrada
*/
#ifndef DAN_TESTBUTTON_H
#define DAN_TESTBUTTON_H
#include
#include
class TestButton : public nux::Button
{
public:
TestButton(const std::string& button_label, NUX_FILE_LINE_PROTO);
virtual ~TestButton();
protected:
virtual void Draw(nux::GraphicsEngine &graphics_engine, bool force_draw);
};
#endif
nux-4.0.6+14.04.20141107/examples/abstract-separator.cpp 0000644 0000153 0177776 00000003235 12427165212 023060 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic® Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "abstract-separator.h"
namespace nux
{
AbstractSeparator::AbstractSeparator (NUX_FILE_LINE_DECL)
: View (NUX_FILE_LINE_PARAM)
, m_Color(0xFFFFFFFF)
, m_Alpha0(0.0f)
, m_Alpha1(0.592f)
, m_BorderSize(10)
{
}
AbstractSeparator::AbstractSeparator (const Color &color, float Alpha0, float Alpha1, int Border, NUX_FILE_LINE_DECL)
: View (NUX_FILE_LINE_PARAM)
, m_Color (color)
, m_Alpha0 (Alpha0)
, m_Alpha1 (Alpha1)
, m_BorderSize (Border)
{
}
AbstractSeparator::~AbstractSeparator()
{
}
void AbstractSeparator::SetColor (const Color &color)
{
m_Color = color;
}
void AbstractSeparator::SetAlpha (float Alpha0, float Alpha1)
{
m_Alpha0 = Alpha0;
m_Alpha1 = Alpha1;
}
void AbstractSeparator::SetBorderSize (int Border)
{
m_BorderSize = Border;
}
}
nux-4.0.6+14.04.20141107/examples/layeredlayout.cpp 0000644 0000153 0177776 00000010613 12427165212 022140 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Neil Jagdish Patel
*
*/
#include "Nux/Nux.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include "Nux/TextureArea.h"
#include "Nux/HLayout.h"
#include "Nux/VLayout.h"
#include "Nux/LayeredLayout.h"
#include "Nux/ToggleButton.h"
#include "Nux/ComboBoxSimple.h"
class Foo
{
public:
Foo ()
{
nux::VLayout *main_layout((new nux::VLayout(NUX_TRACKER_LOCATION)));
nux::ComboBoxSimple *combo = new nux::ComboBoxSimple (NUX_TRACKER_LOCATION);
combo->SetMinimumWidth (150);
combo->sigTriggered.connect (sigc::mem_fun (this, &Foo::OnComboChangedFoRealz));
main_layout->AddView (combo, 0, nux::eCenter, nux::eFix);
layered_layout = new nux::LayeredLayout (NUX_TRACKER_LOCATION);
for (int i = 0; i < 10; i++)
{
gchar *text = g_strdup_printf ("Button %d", i);
nux::LayeredLayout *layered = new nux::LayeredLayout (NUX_TRACKER_LOCATION);
nux::ColorLayer color (nux::color::RandomColor ());
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
layered->AddLayer (texture_area);
nux::HLayout *hori = new nux::HLayout (NUX_TRACKER_LOCATION);
nux::Button* button = new nux::Button ("Big Button", NUX_TRACKER_LOCATION);
button->SetMinMaxSize (200, 100);
hori->AddView (button, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
hori->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
layered->AddLayer (hori);
hori = new nux::HLayout (NUX_TRACKER_LOCATION);
button = new nux::ToggleButton (text, NUX_TRACKER_LOCATION);
button->SetMinMaxSize (100, 50);
hori->AddView (button, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
hori->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
layered->AddLayout (hori);
button = new nux::ToggleButton ("This button is insensitive", NUX_TRACKER_LOCATION);
button->SetSensitive (false);
layered->AddLayer (button, false, 10, 10, 180, 40);
button = new nux::ToggleButton ("This button has x, y, w, h set", NUX_TRACKER_LOCATION);
layered->AddLayer (button, false, 400, 10, 180, 40);
nux::ROPConfig rop;
rop.Blend = true;
rop.SrcBlend = GL_ONE;
rop.DstBlend = GL_ONE_MINUS_SRC_ALPHA;
nux::Color col (0x55005500);
nux::ColorLayer c (col, true, rop);
texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&c);
layered->AddLayer (texture_area, false, 0, 100, 600, 200);
button = new nux::ToggleButton ("YOU CANT SEE ME!!!!!", NUX_TRACKER_LOCATION);
layered->AddLayer (button, true);
button->SetVisible (false);
layered->SetPaintAll (true);
layered->SetInputMode (nux::LayeredLayout::INPUT_MODE_COMPOSITE);
layered->Raise (hori, texture_area);
button = new nux::ToggleButton ("YOU CANT SEE ME!!!!!", NUX_TRACKER_LOCATION);
layered->AddLayer (button, true);
layered->RemoveLayer (button);
layered_layout->AddLayout (layered);
combo->AddItem (text);
g_free (text);
}
main_layout->AddLayout (layered_layout, 1);
nux::GetWindowThread ()->SetLayout(main_layout);
}
~Foo ()
{
}
void OnComboChangedFoRealz (nux::ComboBoxSimple *simple)
{
g_debug ("Active: %d", simple->GetSelectionIndex ());
layered_layout->SetActiveLayerN (simple->GetSelectionIndex ());
}
nux::LayeredLayout *layered_layout;
};
void LayeredLayoutInit(nux::NThread* thread, void* InitData)
{
}
int main(int argc, char **argv)
{
Foo *foo;
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Layered Layout"), 600, 400, 0, &LayeredLayoutInit, 0);
foo = new Foo ();
wt->Run(NULL);
delete wt;
delete foo;
return 0;
}
nux-4.0.6+14.04.20141107/examples/rotate_texture_area.cpp 0000644 0000153 0177776 00000005703 12427165212 023327 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TextureArea.h"
#include "Nux/TimerProc.h"
nux::TimerFunctor *timer_functor = 0;
nux::TimerHandle timer_handle;
float angle = 0.0f;
void UpdateAngle (void *v)
{
angle += 0.1f;
if (angle >= nux::Const::pi)
{
angle = 0.0f;
}
nux::TextureArea* texture_area = NUX_STATIC_CAST (nux::TextureArea*, v);
if (texture_area)
{
texture_area->Set2DRotation (angle);
timer_handle = nux::GetTimer().AddTimerHandler (10, timer_functor, texture_area);
if (angle == 0)
{
nux::ColorLayer color_layer (nux::color::RandomColor ());
texture_area->SetPaintLayer (&color_layer);
}
}
}
void UserInterfaceInitialization(nux::NThread* thread, void* init_data)
{
// Create a vertical Layout
nux::VLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION);
//Create a button of type PushButton
nux::TextureArea* texture_area = new nux::TextureArea(NUX_TRACKER_LOCATION);
// Set the button maximum width/height
texture_area->SetMaximumWidth (160);
texture_area->SetMaximumHeight (80);
texture_area->SetTextColor (nux::color::Pink);
texture_area->Set2DRotation (0.0);
// Add the button to the layout
layout->AddView (
texture_area,
1,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_FULL);
// Control the position of elements inside the layout
layout->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
// Set the layout as the container of the window thread
nux::GetWindowThread ()->SetLayout (layout);
// Set the background color of the window
nux::ColorLayer background (nux::Color (0xFF222222));
static_cast (thread)->SetWindowBackgroundPaintLayer(&background);
timer_functor = new nux::TimerFunctor;
timer_functor->OnTimerExpired.connect (sigc::ptr_fun (&UpdateAngle));
timer_handle = nux::GetTimer().AddTimerHandler (5, timer_functor, texture_area);
}
int main(int argc, char **argv)
{
// Initialize Nux subsystem
nux::NuxInitialize (0);
// Create a Window thread
nux::WindowThread* wt = nux::CreateGUIThread(
TEXT("Rotate Texture Area"),
400,
300,
0,
&UserInterfaceInitialization,
0);
// Start the main loop
wt->Run (0);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/pangotextedit.cpp 0000644 0000153 0177776 00000003312 12427165212 022132 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TextEntry.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::TextEntry* text_entry = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);
text_entry->SetMaximumWidth(300);
text_entry->SetMinimumHeight (20);
MainVLayout->AddView(text_entry, 0, nux::eCenter, nux::eFull);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Text Entry"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/combobox.cpp 0000644 0000153 0177776 00000003644 12427165212 021073 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/ComboBoxSimple.h"
#include "Nux/TableCtrl.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(TEXT(""), NUX_TRACKER_LOCATION);
nux::ComboBoxSimple* combobox = new nux::ComboBoxSimple(NUX_TRACKER_LOCATION);
combobox->AddItem("A");
combobox->AddItem("B");
combobox->AddItem("C");
combobox->AddItem("D");
combobox->AddItem("E");
combobox->RemoveAllItem ();
combobox->AddItem("N");
combobox->AddItem("U");
combobox->AddItem("X");
combobox->SetMaximumWidth(150);
MainVLayout->AddView(combobox, 0, nux::eCenter, nux::eFull);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("ComboBox"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/gestures.cpp 0000644 0000153 0177776 00000005376 12427165212 021130 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2012 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Daniel d'Andrada
*
*/
#include "Nux/FloatingWindow.h"
#include "Nux/GesturesSubscription.h"
#include "Nux/Nux.h"
#include "Nux/WindowThread.h"
#include
using namespace nux;
BaseWindow *window = nullptr;
class GesturalWindow : public FloatingWindow
{
NUX_DECLARE_OBJECT_TYPE(GesturalWindow, FloatingWindow);
public:
GesturalWindow(const char *window_name = "", NUX_FILE_LINE_PROTO)
: FloatingWindow(window_name, NUX_FILE_LINE_PARAM)
{
CreateGesturesSubscription(TOUCH_GESTURE, 3);
event_count = 0;
}
virtual ~GesturalWindow() {}
virtual GestureDeliveryRequest GestureEvent(const nux::GestureEvent & /* event */)
{
std::cout << "GesturalWindow got GestureEvent "
<< ++event_count << "\n";
return GestureDeliveryRequest::NONE;
}
int event_count;
};
NUX_IMPLEMENT_OBJECT_TYPE(GesturalWindow);
int GesturesEventInspector(Area* /* area */, Event* event, void* /* data */)
{
if (event->type < EVENT_GESTURE_BEGIN || event->type > EVENT_GESTURE_END)
return false;
GestureEvent *gesture_event = static_cast(event);
if (gesture_event->type == EVENT_GESTURE_BEGIN)
{
std::cout << "Gesture begun\n";
}
else if (gesture_event->type == EVENT_GESTURE_UPDATE)
std::cout << "Gesture updated\n";
else
std::cout << "Gesture ended\n";
return false;
}
void UserInterfaceInitialization(NThread* /* thread */, void* /* InitData */)
{
window = new GesturalWindow(TEXT("Gestural Window"), NUX_TRACKER_LOCATION);
window->SetBaseXY(100, 20);
window->ShowWindow(true);
}
int main()
{
// Initialize Nux.
NuxInitialize(0);
// Create a window thread.
WindowThread* window_thread = CreateGUIThread(
"Gestures", 640, 300, 0, &UserInterfaceInitialization, 0);
window_thread->InstallEventInspector(GesturesEventInspector, nullptr);
// Start the main loop.
window_thread->Run(NULL);
window->Dispose(); // will cause the window to be deleted (as ref count is zeroed)
delete window_thread;
return 0;
}
nux-4.0.6+14.04.20141107/examples/cairo.cpp 0000644 0000153 0177776 00000004465 12427165212 020362 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include "Nux/TextureArea.h"
#include "NuxGraphics/CairoGraphics.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::CairoGraphics cairo_graphics(CAIRO_FORMAT_ARGB32, 64, 64);
cairo_t *cr = cairo_graphics.GetContext();
cairo_set_line_width (cr, 1);
cairo_set_source_rgba (cr, 0.0f, 1.0f, 0.5f, 1.0f);
cairo_rectangle (cr, 0, 0, 32, 32);
cairo_fill (cr);
cairo_set_source_rgba (cr, 1.0f, 0.0f, 0.5f, 1.0f);
cairo_rectangle (cr, 32, 32, 32, 32);
cairo_fill (cr);
cairo_destroy (cr);
nux::NBitmapData* bitmap = cairo_graphics.GetBitmap();
// Texture2D is the high level representation of an image that is backed by an actual opengl texture.
nux::Texture2D* texture2D = new nux::Texture2D();
texture2D->Update(bitmap);
nux::VLayout* MainVLayout((new nux::VLayout()));
// TextureArea is a widget that uses the image we have created above to render on the screen.
nux::TextureArea* texture_area = new nux::TextureArea();
texture_area->SetTexture(texture2D);
texture_area->SetMinMaxSize(64, 64);
MainVLayout->AddView(texture_area, 1, nux::eCenter, nux::eFix);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Cairo Graphics"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/checkbox.cpp 0000644 0000153 0177776 00000003244 12427165212 021045 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/CheckBox.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(TEXT(""), NUX_TRACKER_LOCATION);
nux::CheckBox* checkbox = new nux::CheckBox("Hello World!", NUX_TRACKER_LOCATION);
checkbox->SetMaximumWidth(80);
checkbox->SetMaximumHeight(60);
MainVLayout->AddView(checkbox, 1, nux::eCenter, nux::eFull);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Edit Text Box"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/tiles_view.cpp 0000644 0000153 0177776 00000032213 12427165212 021427 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TextEntry.h"
#include "Nux/ScrollView.h"
#include "Nux/GridHLayout.h"
#include "Nux/GridVLayout.h"
#include "Nux/TextureArea.h"
#include "Nux/Panel.h"
#include "Nux/MenuPage.h"
#include "NuxCore/Logger.h"
#include "NuxGraphics/IOpenGLFrameBufferObject.h"
#include "NuxGraphics/IOpenGLBaseTexture.h"
nux::NString tile_vertex_shader = TEXT (" \n\
#version 110 \n\
attribute vec4 position; \n\
attribute vec4 texcoord; \n\
attribute vec4 color; \n\
uniform mat4 mvp_matrix; \n\
varying vec4 texcoord0; \n\
varying vec4 color0; \n\
void main() \n\
{ \n\
texcoord0 = texcoord; \n\
color0 = color; \n\
gl_Position = mvp_matrix * position; \n\
}");
nux::NString tile_fragment_shader = TEXT (" \n\
#version 110 \n\
varying vec4 texcoord0; \n\
varying vec4 color0; \n\
uniform sampler2D texture_unit0; \n\
void main() \n\
{ \n\
gl_FragColor = color0; \n\
}");
class Tile;
class TilesView: public nux::View
{
NUX_DECLARE_OBJECT_TYPE(TilesView, View);
public:
TilesView(NUX_FILE_LINE_PROTO);
~TilesView();
void AddTile(Tile *tile);
protected:
nux::Area* FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type);
void OnMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags);
void ShowPopupMenu(int x, int y);
void Draw(nux::GraphicsEngine &graphics_engine, bool force_draw);
void DrawContent(nux::GraphicsEngine &graphics_engine, bool force_draw);
private:
Tile *focus_tile_;
nux::GridHLayout *grid_layout_;
nux::MenuPage *popup_menu_;
nux::ColorLayer background_color_layer_;
};
class Tile: public nux::TextureArea
{
NUX_DECLARE_OBJECT_TYPE(Tile, TextureArea);
public:
Tile(NUX_FILE_LINE_PROTO);
~Tile();
protected:
void OnMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
void Draw(nux::GraphicsEngine &graphics_engine, bool force_draw);
private:
nux::ObjectPtr fbo_;
nux::ObjectPtr texture_;
nux::ObjectPtr depth_texture_;
nux::ObjectPtr fragment_shader_prog_;
nux::ObjectPtr vertex_shader_prog_;
nux::ObjectPtr shader_prog_;
};
NUX_IMPLEMENT_OBJECT_TYPE(TilesView);
TilesView::TilesView(NUX_FILE_LINE_DECL)
: View(NUX_FILE_LINE_PARAM)
, background_color_layer_(nux::color::Orange, true)
{
popup_menu_ = new nux::MenuPage("", NUX_TRACKER_LOCATION);
popup_menu_->AddAction("Position");
popup_menu_->AddAction("Remove");
popup_menu_->AddAction("Configure");
popup_menu_->SetParentObject(this);
popup_menu_->SetOnClosureContinueEventCycle(true);
background_color_layer_.SetColor(nux::color::Orange);
mouse_up.connect(sigc::mem_fun(this, &TilesView::OnMouseDown));
grid_layout_ = new nux::GridHLayout(NUX_TRACKER_LOCATION);
grid_layout_->ForceChildrenSize(true);
grid_layout_->SetChildrenSize(64, 64);
grid_layout_->EnablePartialVisibility(false);
grid_layout_->SetVerticalExternalMargin(32);
grid_layout_->SetHorizontalExternalMargin(32);
grid_layout_->SetVerticalInternalMargin(32);
grid_layout_->SetHorizontalInternalMargin(32);
grid_layout_->SetStretchFactor(1);
grid_layout_->SetHeightMatchContent(false);
SetLayout(grid_layout_);
}
TilesView::~TilesView()
{
popup_menu_->UnParentObject();
}
void TilesView::AddTile(Tile *tile)
{
if (tile == NULL)
return;
grid_layout_->AddView(tile, 1, nux::eLeft, nux::eFull);
}
nux::Area* TilesView::FindAreaUnderMouse(const nux::Point& mouse_position, nux::NuxEventType event_type)
{
bool mouse_inside = TestMousePointerInclusionFilterMouseWheel(mouse_position, event_type);
if(mouse_inside == false)
return NULL;
if (event_type == nux::NUX_MOUSE_PRESSED)
{
focus_tile_ = static_cast(grid_layout_->FindAreaUnderMouse(mouse_position, event_type));
}
else
{
//focus_tile_ = NULL;
}
if((event_type == nux::NUX_MOUSE_WHEEL) && (!AcceptMouseWheelEvent()))
return NULL;
return this;
}
void TilesView::OnMouseDown(int x, int y, unsigned long mouse_button_state, unsigned long special_keys_state)
{
if (nux::GetEventButton(mouse_button_state) == nux::NUX_MOUSE_BUTTON3)
{
if (focus_tile_)
{
ShowPopupMenu(x + 2, y + 2);
}
}
}
void TilesView::ShowPopupMenu(int x, int y)
{
popup_menu_->StopMenu();
popup_menu_->StartMenu(x, y, 0, 0, false);
}
void TilesView::Draw(nux::GraphicsEngine &graphics_engine, bool force_draw)
{
background_color_layer_.SetGeometry(GetGeometry());
background_color_layer_.Renderlayer(graphics_engine);
}
void TilesView::DrawContent(nux::GraphicsEngine &graphics_engine, bool force_draw)
{
nux::GetWindowThread()->GetPainter().PushLayer(graphics_engine, GetGeometry(), &background_color_layer_);
if (m_CompositionLayout)
m_CompositionLayout->ProcessDraw(graphics_engine, force_draw);
nux::GetWindowThread()->GetPainter().PopBackground();
}
class TileManager
{
public:
TileManager();
~TileManager();
Tile* CreateTile();
TilesView* GetTilesView();
private:
TilesView* tiles_view_;
nux::ObjectPtr fbo_;
nux::ObjectPtr texture_;
nux::ObjectPtr depth_texture_;
};
TileManager::TileManager()
{
tiles_view_ = new TilesView(NUX_TRACKER_LOCATION);
}
TileManager::~TileManager()
{
}
Tile* TileManager::CreateTile()
{
Tile *tile = new Tile(NUX_TRACKER_LOCATION);
tiles_view_->AddTile(tile);
return tile;
}
TilesView* TileManager::GetTilesView()
{
return tiles_view_;
}
NUX_IMPLEMENT_OBJECT_TYPE(Tile);
Tile::Tile(NUX_FILE_LINE_DECL)
: nux::TextureArea(NUX_FILE_LINE_PARAM)
{
fbo_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateFrameBufferObject();
texture_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(1, 1, 1, nux::BITFMT_R8G8B8A8);
depth_texture_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(1, 1, 1, nux::BITFMT_D24S8);
fragment_shader_prog_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreatePixelShader();
vertex_shader_prog_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateVertexShader();
shader_prog_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateShaderProgram();
vertex_shader_prog_->SetShaderCode(TCHAR_TO_ANSI(*tile_vertex_shader));
fragment_shader_prog_->SetShaderCode(TCHAR_TO_ANSI(*tile_fragment_shader));
shader_prog_->ClearShaderObjects();
shader_prog_->AddShaderObject(vertex_shader_prog_);
shader_prog_->AddShaderObject(fragment_shader_prog_);
shader_prog_->Link();
}
Tile::~Tile()
{
}
void Tile::Draw(nux::GraphicsEngine &graphics_engine, bool force_draw)
{
int width = GetBaseWidth();
int height = GetBaseHeight();
if ((texture_->GetWidth() != width) || (texture_->GetHeight() != height))
{
texture_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(width, height, 1, nux::BITFMT_R8G8B8A8);
}
if ((depth_texture_->GetWidth() != width) || (depth_texture_->GetHeight() != height))
{
depth_texture_ = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateSystemCapableDeviceTexture(width, height, 1, nux::BITFMT_D24S8);
}
//nux::ObjectPtr prev_fbo = nux::GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject();
fbo_->FormatFrameBufferObject(width, height, nux::BITFMT_R8G8B8A8);
fbo_->SetRenderTarget(0, texture_->GetSurfaceLevel(0));
fbo_->SetDepthSurface(depth_texture_->GetSurfaceLevel(0));
fbo_->Activate();
fbo_->EmptyClippingRegion();
nux::GetGraphicsDisplay()->GetGraphicsEngine()->SetContext(0, 0, width, height);
nux::GetGraphicsDisplay()->GetGraphicsEngine()->SetViewport(0, 0, width, height);
nux::GetGraphicsDisplay()->GetGraphicsEngine()->Push2DWindow(width, height);
nux::Geometry geo = GetAbsoluteGeometry();
{
nux::Color color = nux::color::RandomColor();
float w = width;
float h = height;
float vertex_buffer[] =
{
0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0, 0, color.red, color.green, color.blue, color.alpha,
0.0f, h, 0.0f, 1.0f, 0.0f, 1.0f, 0, 0, color.red, color.green, color.blue, color.alpha,
w, h, 0.0f, 1.0f, 1.0f, 1.0f, 0, 0, color.red, color.green, color.blue, color.alpha,
w, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0, 0, color.red, color.green, color.blue, color.alpha,
};
CHECKGL(glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0));
CHECKGL(glBindBufferARB (GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
shader_prog_->Begin();
int texture_unit0_location = shader_prog_->GetUniformLocationARB("texture_unit0");
int vertex_attrib_location = shader_prog_->GetAttributeLocation("position");
int texture_coord_attrib_location = shader_prog_->GetAttributeLocation("texture");
int color_attrib_location = shader_prog_->GetAttributeLocation("color");
if (texture_unit0_location != -1)
{
graphics_engine.SetTexture(GL_TEXTURE0, 0);
CHECKGL(glUniform1iARB(texture_unit0_location, 0));
}
int mvp_matrix_location = shader_prog_->GetUniformLocationARB ("mvp_matrix");
nux::Matrix4 mvp_matrix = graphics_engine.GetOpenGLModelViewProjectionMatrix();
shader_prog_->SetUniformLocMatrix4fv((GLint) mvp_matrix_location, 1, false, (GLfloat *) &(mvp_matrix.m));
CHECKGL(glEnableVertexAttribArrayARB(vertex_attrib_location));
CHECKGL(glVertexAttribPointerARB ( (GLuint) vertex_attrib_location, 4, GL_FLOAT, GL_FALSE, 48, vertex_buffer));
if (texture_coord_attrib_location != -1)
{
CHECKGL ( glEnableVertexAttribArrayARB (texture_coord_attrib_location) );
CHECKGL ( glVertexAttribPointerARB ( (GLuint) texture_coord_attrib_location, 4, GL_FLOAT, GL_FALSE, 48, vertex_buffer + 4) );
}
if (color_attrib_location != -1)
{
CHECKGL ( glEnableVertexAttribArrayARB (color_attrib_location) );
CHECKGL ( glVertexAttribPointerARB ( (GLuint) color_attrib_location, 4, GL_FLOAT, GL_FALSE, 48, vertex_buffer + 8) );
}
CHECKGL ( glDrawArrays (GL_TRIANGLE_FAN, 0, 4) );
CHECKGL ( glDisableVertexAttribArrayARB (vertex_attrib_location) );
if (texture_coord_attrib_location != -1)
CHECKGL ( glDisableVertexAttribArrayARB (texture_coord_attrib_location) );
if (color_attrib_location != -1)
CHECKGL ( glDisableVertexAttribArrayARB (color_attrib_location) );
shader_prog_->End();
}
//nux::GetGraphicsDisplay()->GetGraphicsEngine()->QRP_Color(0, 0, geo.width, geo.height, nux::color::Aubergine);
nux::GetWindowCompositor().RestoreRenderingSurface();
nux::TexCoordXForm texxform;
nux::GetGraphicsDisplay()->GetGraphicsEngine()->QRP_1Tex(geo.x, geo.y, geo.width, geo.height, texture_, texxform, nux::color::White);
//nux::TextureArea::Draw(graphics_engine, force_draw);
}
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(NUX_TRACKER_LOCATION);
TileManager *tile_manager = new TileManager();
for (int i = 0; i < 10; i++)
{
tile_manager->CreateTile();
tile_manager->CreateTile();
tile_manager->CreateTile();
tile_manager->CreateTile();
tile_manager->CreateTile();
}
MainVLayout->AddView(tile_manager->GetTilesView(), 1, nux::eCenter, nux::MINOR_SIZE_FULL);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::logging::Logger logger("test.tile_view");
logger.SetLogLevel(nux::logging::Debug);
LOG_DEBUG(logger) << "\nTest\n";
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("ScrollView"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/timegraph.cpp 0000644 0000153 0177776 00000006233 12427165212 021240 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TimeGraph.h"
#include "Nux/TimerProc.h"
nux::TimerFunctor *timer_functor;
nux::TimerHandle timer_handler;
float time_value = 0;
void GraphTimerInterrupt (void *data)
{
time_value += 0.001f;
nux::TimeGraph* timegraph = NUX_STATIC_CAST (nux::TimeGraph*, data);
for (int i = 0; i < 3; i++)
{
if (i == 0)
timegraph->UpdateGraph (i, nux::GetWindowThread ()->GetFrameRate() );
if (i == 1)
timegraph->UpdateGraph (i, nux::RandomUInt (25) + 25);
if (i == 2)
timegraph->UpdateGraph (i, 30 * (std::sin (time_value) + 1) + nux::RandomUInt (10) );
}
timer_handler = nux::GetTimer().AddTimerHandler (100, timer_functor, timegraph);
}
void UserInterfaceInitialization(nux::NThread* thread, void* init_data)
{
// Create a vertical Layout
nux::VLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::TimeGraph* timegraph = new nux::TimeGraph(TEXT("Graph"));
timegraph->ShowColumnStyle ();
timegraph->SetYAxisBounds (0.0, 200.0f);
timegraph->AddGraph (nux::Color (0xFF9AD61F), nux::Color (0x50191919) );
timegraph->AddGraph (nux::Color (0xFF00FF00), nux::Color (0x5000FF00) );
timegraph->AddGraph (nux::Color (0xFFFF0022), nux::Color (0x50BB0022) );
timer_functor = new nux::TimerFunctor ();
timer_functor->OnTimerExpired.connect (sigc::ptr_fun (&GraphTimerInterrupt));
timer_handler = nux::GetTimer ().AddTimerHandler (1000, timer_functor, timegraph);
// Add the timegraph to the layout
layout->AddView (
timegraph,
1,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_FULL);
// Control the position of elements inside the layout
layout->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
layout->SetHorizontalExternalMargin (4);
layout->SetVerticalExternalMargin (4);
// Set the layout as the container of the window thread
nux::GetWindowThread ()->SetLayout (layout);
// Set the background color of the window
nux::ColorLayer background (nux::Color (0xFF2D2D2D));
static_cast (thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
// Initialize Nux subsystem
nux::NuxInitialize (0);
// Create a Window thread
nux::WindowThread* wt = nux::CreateGUIThread(
TEXT("Time Graph"),
300,
200,
0,
&UserInterfaceInitialization,
0);
// Start the main loop
wt->Run (0);
delete timer_functor;
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/text_entry_focus.cpp 0000644 0000153 0177776 00000004544 12427165212 022667 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TextEntry.h"
void ThreadWidgetInit(nux::NThread* thread, void* /* InitData */)
{
nux::VLayout* MainVLayout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::TextEntry* text_entry_0 = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);
nux::TextEntry* text_entry_1 = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);
nux::TextEntry* text_entry_2 = new nux::TextEntry(TEXT("0123456789 abcdefghijklmnopqrstuvwxyz"), NUX_TRACKER_LOCATION);
text_entry_0->SetMaximumWidth(300);
text_entry_0->SetMinimumHeight (20);
text_entry_0->SetCompletion("test completion");
text_entry_1->SetMaximumWidth(300);
text_entry_1->SetMinimumHeight (20);
text_entry_2->SetMaximumWidth(300);
text_entry_2->SetMinimumHeight (20);
MainVLayout->AddView(text_entry_0, 0, nux::eCenter, nux::eFull);
MainVLayout->AddView(text_entry_1, 0, nux::eCenter, nux::eFull);
MainVLayout->AddView(text_entry_2, 0, nux::eCenter, nux::eFull, 1.0, nux::NUX_LAYOUT_BEGIN);
MainVLayout->SetVerticalInternalMargin(10);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main()
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Text Entry"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/scrollview.cpp 0000644 0000153 0177776 00000004776 12427165212 021463 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TextEntry.h"
#include "Nux/ScrollView.h"
#include "Nux/GridHLayout.h"
#include "Nux/GridVLayout.h"
#include "Nux/TextureArea.h"
#include "Nux/Panel.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::GridHLayout *grid_h_layout ((new nux::GridHLayout (NUX_TRACKER_LOCATION)));
for (int i = 0; i < 5360; i++)
{
nux::ColorLayer color (nux::color::RandomColor ());
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
grid_h_layout->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
grid_h_layout->ForceChildrenSize (true);
grid_h_layout->SetChildrenSize (64, 42);
grid_h_layout->EnablePartialVisibility (true);
grid_h_layout->SetVerticalExternalMargin (4);
grid_h_layout->SetHorizontalExternalMargin (4);
grid_h_layout->SetVerticalInternalMargin (4);
grid_h_layout->SetHorizontalInternalMargin (4);
nux::ScrollView *scroll_view = new nux::ScrollView(NUX_TRACKER_LOCATION);
grid_h_layout->SetStretchFactor(1);
scroll_view->SetLayout(grid_h_layout);
MainVLayout->AddView(scroll_view, 1, nux::eCenter, nux::eFull);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("ScrollView"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/moveable_view.cpp 0000644 0000153 0177776 00000006716 12427165212 022112 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TimeGraph.h"
#include "Nux/TimerProc.h"
#include "Nux/FloatingWindow.h"
nux::TimerFunctor *timer_functor;
nux::TimerHandle timer_handler;
float time_value = 0;
nux::FloatingWindow* moveable_view = NULL;
void GraphTimerInterrupt (void *data)
{
time_value += 0.001f;
nux::TimeGraph* timegraph = NUX_STATIC_CAST (nux::TimeGraph*, data);
for (int i = 0; i < 3; i++)
{
if (i == 0)
timegraph->UpdateGraph (i, nux::GetWindowThread ()->GetFrameRate() );
if (i == 1)
timegraph->UpdateGraph (i, nux::RandomUInt (25) + 25);
if (i == 2)
timegraph->UpdateGraph (i, 30 * (std::sin (time_value) + 1) + nux::RandomUInt (10) );
}
timer_handler = nux::GetTimer().AddTimerHandler (100, timer_functor, timegraph);
}
void UserInterfaceInitialization(nux::NThread* thread, void* init_data)
{
// Create a vertical Layout
nux::VLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::TimeGraph* timegraph = new nux::TimeGraph(TEXT("Graph"));
timegraph->ShowColumnStyle ();
timegraph->SetYAxisBounds (0.0, 200.0f);
timegraph->AddGraph (nux::Color (0xFF9AD61F), nux::Color (0x50191919) );
timegraph->AddGraph (nux::Color (0xFF00FF00), nux::Color (0x5000FF00) );
timegraph->AddGraph (nux::Color (0xFFFF0022), nux::Color (0x50BB0022) );
timer_functor = new nux::TimerFunctor ();
timer_functor->OnTimerExpired.connect (sigc::ptr_fun (&GraphTimerInterrupt));
timer_handler = nux::GetTimer ().AddTimerHandler (1000, timer_functor, timegraph);
// Add the timegraph to the layout
layout->AddView (
timegraph,
1,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_FULL);
// Control the position of elements inside the layout
layout->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
layout->SetHorizontalExternalMargin (4);
layout->SetVerticalExternalMargin (4);
moveable_view = new nux::FloatingWindow(TEXT("Moveable View"), NUX_TRACKER_LOCATION);
moveable_view->SetLayout(layout);
moveable_view->ShowWindow(true);
moveable_view->SetBaseXY(10, 10);
// Set the layout as the container of the window thread
//nux::GetWindowThread ()->SetLayout (layout);
// Set the background color of the window
nux::ColorLayer background (nux::Color (0xFF202020));
static_cast (thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
// Initialize Nux subsystem
nux::NuxInitialize (0);
// Create a Window thread
nux::WindowThread* wt = nux::CreateGUIThread(
TEXT("Moveable View"),
600,
400,
0,
&UserInterfaceInitialization,
0);
// Start the main loop
wt->Run (0);
moveable_view->Dispose();
delete timer_functor;
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/cairo_wrapper.cpp 0000644 0000153 0177776 00000007776 12427165212 022132 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright (C) 2011 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by: Mirco Müller TerminateThread ();
}
void
example (void* data)
{
nux::Geometry geom = {0, 0, 200, 150};
g_canvas = new nux::CairoWrapper (geom, sigc::ptr_fun (callback));
std::string filename = "/tmp/cairo-wrapper-example.png";
g_canvas->DumpToFile (filename);
}
void ThreadWidgetInit (nux::NThread* thread, void* initData)
{
g_timer = new nux::TimerFunctor ();
g_timer->OnTimerExpired.connect (sigc::ptr_fun (&example));
g_handler = nux::GetTimer().AddTimerHandler (1000,
g_timer,
nux::GetWindowThread ());
}
int main (int argc,
char** argv)
{
nux::NuxInitialize (0);
nux::WindowThread* wt = NULL;
wt = nux::CreateGUIThread (TEXT ("Cairo-Wrapper Example"),
400,
400,
0,
&ThreadWidgetInit,
0);
wt->Run (NULL);
delete wt;
delete g_canvas;
delete g_timer;
return 0;
}
nux-4.0.6+14.04.20141107/examples/gridlayout.cpp 0000644 0000153 0177776 00000005550 12427165212 021444 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include "Nux/TextureArea.h"
#include "Nux/HLayout.h"
#include "Nux/VLayout.h"
#include "Nux/GridHLayout.h"
#include "Nux/GridVLayout.h"
void GridLayoutInit(nux::NThread* thread, void* InitData)
{
int a = 0;
nux::HLayout *main_layout((new nux::HLayout(NUX_TRACKER_LOCATION)));
nux::GridHLayout *grid_h_layout ((new nux::GridHLayout (NUX_TRACKER_LOCATION)));
for (int i = 0; i < 30; i++)
{
nux::ColorLayer color (nux::color::RandomColor ());
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->SetVisible (a % 2);
grid_h_layout->AddView (texture_area, 1, nux::eLeft, nux::eFull);
a++;
}
grid_h_layout->ForceChildrenSize (true);
grid_h_layout->SetChildrenSize (64, 42);
grid_h_layout->EnablePartialVisibility (false);
grid_h_layout->SetVerticalExternalMargin (4);
grid_h_layout->SetHorizontalExternalMargin (4);
grid_h_layout->SetVerticalInternalMargin (4);
grid_h_layout->SetHorizontalInternalMargin (4);
nux::GridVLayout *grid_v_layout ((new nux::GridVLayout (NUX_TRACKER_LOCATION)));
for (int i = 0; i < 30; i++)
{
nux::ColorLayer color (nux::color::RandomColor());
nux::TextureArea* texture_area = new nux::TextureArea();
texture_area->SetPaintLayer (&color);
texture_area->SetVisible (a % 2);
grid_v_layout->AddView(texture_area, 1, nux::eLeft, nux::eFull);
a++;
}
grid_v_layout->ForceChildrenSize (true);
grid_v_layout->SetChildrenSize (64, 64);
grid_v_layout->EnablePartialVisibility (false);
grid_v_layout->SetVerticalExternalMargin (6);
grid_v_layout->SetHorizontalExternalMargin (6);
grid_v_layout->SetVerticalInternalMargin (6);
grid_v_layout->SetHorizontalInternalMargin (6);
main_layout->AddLayout (grid_h_layout, 1);
main_layout->AddLayout (grid_v_layout, 1);
nux::GetWindowThread ()->SetLayout(main_layout);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Grid Layout"), 1024, 600, 0, &GridLayoutInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/canvas.cpp 0000644 0000153 0177776 00000011752 12427165212 020535 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright (C) 2011 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Authored by: Mirco Müller AddView (foocanvas, 1, nux::eCenter, nux::eFull);
layout->AddView (barcanvas, 1, nux::eCenter, nux::eFull);
layout->SetContentDistribution (nux::eStackCenter);
nux::GetWindowThread()->SetLayout (layout);
}
int main (int argc,
char** argv)
{
nux::NuxInitialize (0);
nux::WindowThread* wt = NULL;
wt = nux::CreateGUIThread (TEXT ("Canvas Example"),
400,
400,
0,
&ThreadWidgetInit,
0);
wt->Run (NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/shortcut-keys.cpp 0000644 0000153 0177776 00000014172 12427165212 022105 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/StaticText.h"
#include "line-separator.h"
int SECTION_NAME_FONT_SIZE = 17;
int SHORTKEY_ENTRY_FONT_SIZE = 13;
int INTER_SPACE_SHORTKEY_DESCRIPTION = 0;
int SHORTKEY_COLUMN_WIDTH = 150 + 100;
int DESCRIPTION_COLUMN_WIDTH = 265 + 100;
nux::LinearLayout *CreateSectionLayout(const char *section_name)
{
nux::VLayout *layout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::StaticText* section_name_view = new nux::StaticText(section_name, NUX_TRACKER_LOCATION);
section_name_view->SetTextPointSize(SECTION_NAME_FONT_SIZE);
section_name_view->SetFontName("Ubuntu Bold");
layout->AddView(section_name_view, 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_MATCHCONTENT);
layout->AddView(new nux::SpaceLayout(30, 30, 30, 30), 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_MATCHCONTENT);
return layout;
}
nux::LinearLayout *CreateShortKeyEntryLayout(const char *shortkey, const char *description)
{
nux::HLayout *layout = new nux::HLayout("EntryLayout", NUX_TRACKER_LOCATION);
nux::HLayout *shortkey_layout = new nux::HLayout(NUX_TRACKER_LOCATION);
nux::HLayout *description_layout = new nux::HLayout(NUX_TRACKER_LOCATION);
nux::StaticText* shortkey_view = new nux::StaticText(shortkey, NUX_TRACKER_LOCATION);
shortkey_view->SetTextAlignment(nux::StaticText::ALIGN_LEFT);
shortkey_view->SetTextPointSize(SHORTKEY_ENTRY_FONT_SIZE);
shortkey_view->SetMinimumWidth(SHORTKEY_COLUMN_WIDTH);
shortkey_view->SetMaximumWidth(SHORTKEY_COLUMN_WIDTH);
nux::StaticText* description_view = new nux::StaticText(description, NUX_TRACKER_LOCATION);
description_view->SetTextAlignment(nux::StaticText::ALIGN_LEFT);
description_view->SetTextPointSize(SHORTKEY_ENTRY_FONT_SIZE);
description_view->SetMinimumWidth(DESCRIPTION_COLUMN_WIDTH);
description_view->SetMaximumWidth(DESCRIPTION_COLUMN_WIDTH);
shortkey_layout->AddView(shortkey_view, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT);
shortkey_layout->SetContentDistribution(nux::MAJOR_POSITION_START);
shortkey_layout->SetMinimumWidth(SHORTKEY_COLUMN_WIDTH);
shortkey_layout->SetMaximumWidth(SHORTKEY_COLUMN_WIDTH);
description_layout->AddView(description_view, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT);
description_layout->SetContentDistribution(nux::MAJOR_POSITION_START);
description_layout->SetMinimumWidth(DESCRIPTION_COLUMN_WIDTH);
description_layout->SetMaximumWidth(DESCRIPTION_COLUMN_WIDTH);
layout->AddLayout(shortkey_layout, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT);
layout->AddLayout(description_layout, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_MATCHCONTENT);
layout->SetSpaceBetweenChildren(INTER_SPACE_SHORTKEY_DESCRIPTION);
description_layout->SetContentDistribution(nux::MAJOR_POSITION_START);
return layout;
}
nux::LinearLayout *CreateIntermediateLayout()
{
nux::VLayout *layout = new nux::VLayout(NUX_TRACKER_LOCATION);
return layout;
}
void UserInterfaceInitialization(nux::NThread* thread, void* /* InitData */)
{
nux::VLayout *root_layout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::LinearLayout *section_layout = CreateSectionLayout("Launcher");
nux::LinearLayout *intermediate_layout = CreateIntermediateLayout();
intermediate_layout->SetContentDistribution(nux::MAJOR_POSITION_START);
intermediate_layout->AddLayout(CreateShortKeyEntryLayout("Super (Press)", "Open Launcher, displays shortcuts."), 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_FULL);
intermediate_layout->AddLayout(CreateShortKeyEntryLayout("Alt + F1 (Press)", "Open Launcher keyboard navigation mode."), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
intermediate_layout->AddLayout(CreateShortKeyEntryLayout("Super + Tab", "Switch application via Launcher."), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
intermediate_layout->AddLayout(CreateShortKeyEntryLayout("Super + 1 to 9", "Same as clicking on a Launcher icon."), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
intermediate_layout->AddLayout(CreateShortKeyEntryLayout("Super + Shift + 1 to 9", "Open a new window of the app."), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
intermediate_layout->AddLayout(CreateShortKeyEntryLayout("Super + T", "Open the Rubbish Bin."), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
section_layout->AddLayout(intermediate_layout, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
// Add space before the line
section_layout->AddView(new nux::SpaceLayout(30, 30, 30, 30), 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_MATCHCONTENT);
section_layout->AddView(new nux::HSeparator(), 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
// Add space after the line
section_layout->AddView(new nux::SpaceLayout(30, 30, 30, 30), 0, nux::MINOR_POSITION_START, nux::MINOR_SIZE_MATCHCONTENT);
root_layout->AddView(section_layout, 1, nux::MINOR_POSITION_START, nux::MINOR_SIZE_FULL);
nux::GetWindowThread ()->SetLayout(root_layout);
nux::ColorLayer background(nux::Color(0xFF222222));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main()
{
// Initialize Nux.
nux::NuxInitialize(0);
// Create a window thread.
nux::WindowThread* wt = nux::CreateGUIThread("Shortcut Keys", 640, 300, 0, &UserInterfaceInitialization, 0);
// Start the main loop.
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/line-separator.h 0000644 0000153 0177776 00000002372 12427165212 021652 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic® Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License, as
* published by the Free Software Foundation; either version 2.1 or 3.0
* of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the applicable version of the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of both the GNU Lesser General Public
* License along with this program. If not, see
*
* Authored by: Jay Taoko
*
*/
#ifndef HSEPARATOR_H
#define HSEPARATOR_H
#include "abstract-separator.h"
namespace nux
{
class HSeparator: public AbstractSeparator
{
public:
HSeparator();
HSeparator (const Color &color, float Alpha0, float Alpha1, int Border);
~HSeparator();
protected:
virtual void Draw (GraphicsEngine &GfxContext, bool force_draw);
virtual void DrawContent (GraphicsEngine & /* GfxContext */, bool /* force_draw */) {};
};
}
#endif // HSEPARATOR_H
nux-4.0.6+14.04.20141107/examples/timeline.cpp 0000644 0000153 0177776 00000004477 12427165212 021076 0 ustar pbuser nogroup 0000000 0000000 #include "Nux/Nux.h"
#include "Nux/TimelineEasings.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/Button.h"
#include "Nux/ColorPreview.h"
#include "Nux/TextureArea.h"
#include "Nux/PaintLayer.h"
class TimelineTestClass
{
public:
nux::Timeline *timeline_1;
nux::Timeline *timeline_2;
nux::TextureArea *texture_area;
nux::TextureArea *texture_area_2;
void OnNewFrame (unsigned long msecs)
{
nux::Color color = nux::Color ((float)timeline_1->GetProgress (), 0.5, 0.6, 1.0);
nux::ColorLayer *colorlayer = new nux::ColorLayer(color);
texture_area->SetPaintLayer (colorlayer);
}
void OnNewFrame2 (unsigned long msecs)
{
nux::Color color = nux::Color (0.6, (float)timeline_2->GetProgress (), 0.5, 1.0);
nux::ColorLayer *colorlayer = new nux::ColorLayer(color);
texture_area_2->SetPaintLayer (colorlayer);
}
void Init (nux::Layout *layout)
{
texture_area = new nux::TextureArea ();
layout->AddView(texture_area, 1, nux::eCenter, nux::eFull);
texture_area_2 = new nux::TextureArea ();
layout->AddView (texture_area_2, 1, nux::eCenter, nux::eFull);
timeline_1 = new nux::TimelineEaseInOutQuad (1000, "Timeline_1", NUX_TRACKER_LOCATION);
timeline_1->Looping = true;
timeline_1->NewFrame.connect (sigc::mem_fun (this, &TimelineTestClass::OnNewFrame));
timeline_2 = new nux::TimelineEaseOutQuad (2000, "Timeline_2", NUX_TRACKER_LOCATION);
//timeline_2->Looping = true;
timeline_2->NewFrame.connect (sigc::mem_fun (this, &TimelineTestClass::OnNewFrame2));
}
};
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
TimelineTestClass *self = (TimelineTestClass*) InitData;
nux::VLayout* MainVLayout = new nux::VLayout("", NUX_TRACKER_LOCATION);
self->Init (MainVLayout);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
TimelineTestClass *test_class = new TimelineTestClass ();
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("Timeline Test"), 400, 300, 0, ThreadWidgetInit, test_class);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/tab_view.cpp 0000644 0000153 0177776 00000004521 12427165212 021056 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/TabView.h"
#include "Nux/TextureArea.h"
#include "Nux/PaintLayer.h"
void UserInterfaceInitialization(nux::NThread* thread, void* init_data)
{
// Create a vertical Layout
nux::VLayout* layout = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::TabView* tabview(new nux::TabView());
nux::ColorLayer color_layer (nux::color::Black, true);
nux::VLayout *tab_view_layout = 0;
nux::TextureArea *texture_area = 0;
for (int i = 0; i < 50; i++)
{
tab_view_layout = new nux::VLayout ();
texture_area = new nux::TextureArea ();
color_layer.SetColor (nux::color::RandomColor ());
texture_area->SetPaintLayer (&color_layer);
tab_view_layout->AddView (texture_area, 1);
nux::NString str = nux::NString::Printf("View %d", i);
tabview->AddTab (str.GetTCharPtr (), tab_view_layout);
}
// Add the button to the layout
layout->AddView (
tabview,
1,
nux::MINOR_POSITION_CENTER,
nux::MINOR_SIZE_FULL);
// Set the layout as the container of the window thread
nux::GetWindowThread ()->SetLayout (layout);
// Set the background color of the window
nux::ColorLayer background (nux::Color (0xFF2D2D2D));
static_cast (thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
// Initialize Nux subsystem
nux::NuxInitialize (0);
// Create a Window thread
nux::WindowThread* wt = nux::CreateGUIThread(
TEXT("Tab View"),
400,
300,
0,
&UserInterfaceInitialization,
0);
// Start the main loop
wt->Run (0);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/focus.cpp 0000644 0000153 0177776 00000017370 12427165212 020403 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/WindowThread.h"
#include "NuxGraphics/GraphicsEngine.h"
#include "Nux/TextureArea.h"
#include "Nux/TextEntry.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/GridHLayout.h"
#include "Nux/ScrollView.h"
#include "Nux/TextureArea.h"
#include "Nux/ComboBoxSimple.h"
float frand ()
{
return ((float)rand ()) / RAND_MAX;
}
static void OnFocusChildChanged (nux::Area *layout, nux::Area *view)
{
g_debug ("focus has changed, woo %i", rand ());
}
static void OnFocusChanged (nux::Area *view)
{
g_debug ("focus on a specific child has changed %i", rand ());
nux::TextureArea *texarea = (nux::TextureArea *)view;
if (view->GetFocused ())
{
nux::ColorLayer color (nux::Color (0.2, 1.0, 0.2, 1.0));
texarea->SetPaintLayer (&color);
}
else
{
nux::ColorLayer color (nux::Color (0.6, 0.+ frand ()*0.3, 0.2+ frand ()*0.3, 1.0));
texarea->SetPaintLayer (&color);
}
}
void UserInterfaceInitialization(nux::NThread* thread, void* init_data)
{
// Create a vertical Layout
nux::HLayout* layout = new nux::HLayout(NUX_TRACKER_LOCATION);
nux::VLayout* layout_left = new nux::VLayout (NUX_TRACKER_LOCATION);
nux::HLayout* content_layout = new nux::HLayout (NUX_TRACKER_LOCATION);
nux::VLayout* layout_right = new nux::VLayout (NUX_TRACKER_LOCATION);
//nux::HLayout* layout_top = new nux::HLayout(NUX_TRACKER_LOCATION);
nux::TextEntry* text_entry = new nux::TextEntry ("This is some text", NUX_TRACKER_LOCATION);
text_entry->SetTextColor (nux::Color (1.0, 1.0, 1.0, 1.0));
nux::ComboBoxSimple *combo = new nux::ComboBoxSimple (NUX_TRACKER_LOCATION);
combo->SetMinimumWidth (150);
combo->SetCanFocus (true);
combo->AddItem ("Item A");
combo->AddItem ("Item B");
combo->AddItem ("Item C");
combo->AddItem ("Item D");
combo->AddItem ("Item E");
//layout->AddView (_combo, 0, nux::eCenter, nux::eFix);
//nux::ScrollView *layout_scroll = new nux::ScrollView (NUX_TRACKER_LOCATION);
nux::VLayout* layout_scroll_container = new nux::VLayout (NUX_TRACKER_LOCATION);
nux::VLayout* layout_scroll_1 = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::HLayout* layout_scroll_11 = new nux::HLayout(NUX_TRACKER_LOCATION);
nux::ScrollView *layout_scroll_12 = new nux::ScrollView (NUX_TRACKER_LOCATION);
nux::GridHLayout* layout_scroll_12_content = new nux::GridHLayout (NUX_TRACKER_LOCATION);
layout_scroll_12->EnableHorizontalScrollBar (false);
layout_scroll_12->EnableVerticalScrollBar (true);
layout_scroll_12->SetLayout (layout_scroll_12_content);
layout_scroll_1->AddLayout (layout_scroll_11, 0, nux::MINOR_POSITION_TOP);
layout_scroll_1->AddView (layout_scroll_12, 1, nux::MINOR_POSITION_TOP);
nux::VLayout* layout_scroll_2 = new nux::VLayout(NUX_TRACKER_LOCATION);
nux::HLayout* layout_scroll_21 = new nux::HLayout(NUX_TRACKER_LOCATION);
nux::GridHLayout* layout_scroll_22 = new nux::GridHLayout (NUX_TRACKER_LOCATION);
layout_scroll_2->AddLayout (layout_scroll_21, 0, nux::MINOR_POSITION_TOP);
layout_scroll_2->AddLayout (layout_scroll_22, 1, nux::MINOR_POSITION_TOP);
//layout_scroll_container->AddView (text_entry, 0, nux::MINOR_POSITION_TOP);
layout_scroll_container->AddView (combo, 0, nux::eCenter, nux::eFix);
//layout_scroll->SetLayout (layout_scroll_container);
layout_scroll_container->AddLayout (layout_scroll_1, 1, nux::MINOR_POSITION_TOP);
layout_scroll_container->AddLayout (layout_scroll_2, 1, nux::MINOR_POSITION_TOP);
content_layout->AddLayout (layout_scroll_container, 1, nux::MINOR_POSITION_TOP);
layout->AddLayout (layout_left, 0);
layout->AddLayout (content_layout, 1);
layout->AddLayout (layout_right, 0);
layout->ChildFocusChanged.connect (sigc::ptr_fun(&OnFocusChildChanged));
// for (int i = 0; i < 6; i++)
// {
// nux::ColorLayer color (nux::Color (0.2, 0.2, 0.2+ frand ()*0.3, 1.0));
// nux::TextureArea* texture_area = new nux::TextureArea ();
// texture_area->SetPaintLayer (&color);
// texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//
// layout_top->AddView (texture_area, 1, nux::eLeft, nux::eFull);
// }
for (int i = 0; i < 6; i++)
{
nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//~ //~
layout_scroll_11->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
for (int i = 0; i < 128; i++)
{
nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//~ //~
layout_scroll_12_content->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
for (int i = 0; i < 6; i++)
{
nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//~ //~
layout_scroll_21->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
for (int i = 0; i < 16; i++)
{
nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//~ //~
layout_scroll_22->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
for (int i = 0; i < 16; i++)
{
nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//~ //~
layout_left->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
for (int i = 0; i < 16; i++)
{
nux::ColorLayer color (nux::Color (0.2, 0.2, 0.4+ frand ()*0.3, 1.0));
nux::TextureArea* texture_area = new nux::TextureArea ();
texture_area->SetPaintLayer (&color);
texture_area->FocusChanged.connect (sigc::ptr_fun (&OnFocusChanged));
//~ //~
layout_right->AddView (texture_area, 1, nux::eLeft, nux::eFull);
}
// Control the position of elements inside the layout
layout->SetContentDistribution (nux::MAJOR_POSITION_CENTER);
// Set the layout as the container of the window thread
nux::GetWindowThread ()->SetLayout (layout);
layout->SetFocused (true);
// Set the background color of the window
nux::ColorLayer background (nux::Color (0xFF2D2D2D));
static_cast (thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
// Initialize Nux subsystem
nux::NuxInitialize (0);
// Create a Window thread
nux::WindowThread* wt = nux::CreateGUIThread(
TEXT("Push Button"),
800,
600,
0,
&UserInterfaceInitialization,
0);
// Start the main loop
wt->Run (0);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/examples/pango_combobox.cpp 0000644 0000153 0177776 00000004212 12427165212 022247 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "Nux/Nux.h"
#include "Nux/VLayout.h"
#include "Nux/HLayout.h"
#include "Nux/WindowThread.h"
#include "Nux/ComboBoxSimple.h"
#include "Nux/TableCtrl.h"
void ThreadWidgetInit(nux::NThread* thread, void* InitData)
{
nux::VLayout* MainVLayout = new nux::VLayout(TEXT(""), NUX_TRACKER_LOCATION);
nux::ComboBoxSimple* combobox = new nux::ComboBoxSimple(NUX_TRACKER_LOCATION);
combobox->AddItem (TEXT("Hello Unity Team0"), 0);
combobox->AddItem (TEXT("Hello Unity Team11"), 1);
combobox->AddItem (TEXT("Hello Unity Team222"), 2);
combobox->AddItem (TEXT("Hello Unity Team3333"), 3);
combobox->AddItem (TEXT("Hello Unity Team44444"), 4);
combobox->AddItem (TEXT("Bonjour Unity Team"), 5);
combobox->AddItem (TEXT("Hola Unity Team"), 6);
combobox->AddItem (TEXT("Guten Tag Unity Team"), 7);
//combobox->SetPopupWindowSize(120, 150);
combobox->SetMaximumWidth(250);
MainVLayout->AddView(combobox, 0, nux::eCenter, nux::eFull);
MainVLayout->SetContentDistribution(nux::eStackCenter);
nux::GetWindowThread ()->SetLayout(MainVLayout);
nux::ColorLayer background(nux::Color(0xFF4D4D4D));
static_cast(thread)->SetWindowBackgroundPaintLayer(&background);
}
int main(int argc, char **argv)
{
nux::NuxInitialize(0);
nux::WindowThread* wt = nux::CreateGUIThread(TEXT("ComboBox"), 400, 300, 0, &ThreadWidgetInit, 0);
wt->Run(NULL);
delete wt;
return 0;
}
nux-4.0.6+14.04.20141107/doxygen.cfg 0000644 0000153 0177776 00000205134 12427165212 017075 0 ustar pbuser nogroup 0000000 0000000 # Doxyfile 1.7.1
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project
#
# All text after a hash (#) is considered a comment and will be ignored
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# http://www.gnu.org/software/libiconv for the list of possible encodings.
DOXYFILE_ENCODING = UTF-8
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
# by quotes) that should identify the project.
PROJECT_NAME = $(PROJECT)-$(VERSION)
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = $(DOCDIR)
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
# format and will distribute the generated files over these directories.
# Enabling this option can be useful when feeding doxygen a huge amount of
# source files, where putting all generated files in the same directory would
# otherwise cause performance problems for the file system.
CREATE_SUBDIRS = NO
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
# The default language is English, other supported languages are:
# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
# include brief member descriptions after the members that are listed in
# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
# the brief description of a member or function before the detailed description.
# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
# This tag implements a quasi-intelligent brief description abbreviator
# that is used to form the text in various listings. Each string
# in this list, if found as the leading text of the brief description, will be
# stripped from the text and the result after processing the whole list, is
# used as the annotated text. Otherwise, the brief description is used as-is.
# If left blank, the following values are used ("$name" is automatically
# replaced with the name of the entity): "The $name class" "The $name widget"
# "The $name file" "is" "provides" "specifies" "contains"
# "represents" "a" "an" "the"
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
INLINE_INHERITED_MEMB = NO
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = YES
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. The tag can be used to show relative paths in the file list.
# If left blank the directory from which doxygen is run is used as the
# path to strip.
STRIP_FROM_PATH = $(SRCDIR)
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
# the reader which header file to include in order to use a class.
# If left blank only the name of the header file containing the class
# definition is used. Otherwise one should specify the include paths that
# are normally passed to the compiler using the -I flag.
STRIP_FROM_INC_PATH = $(SRCDIR)
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
# (but less readable) file names. This can be useful is your file systems
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = YES
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
# comment as the brief description. If set to NO, the comments
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
QT_AUTOBRIEF = NO
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
# comments) as a brief description. This used to be the default behaviour.
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
# re-implements.
INHERIT_DOCS = YES
# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
# For example adding "sideeffect=\par Side Effects:\n" will allow you to
# put the command \sideeffect (or @sideeffect) in the documentation, which
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
ALIASES =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
OPTIMIZE_OUTPUT_FOR_C = NO
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
# sources only. Doxygen will then generate output that is more tailored for
# Java. For instance, namespaces will be presented as packages, qualified
# scopes will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
# sources only. Doxygen will then generate output that is more tailored for
# Fortran.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
# sources. Doxygen will then generate output that is tailored for
# VHDL.
OPTIMIZE_OUTPUT_VHDL = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given extension.
# Doxygen has a built-in mapping, but you can override or extend it using this
# tag. The format is ext=language, where ext is a file extension, and language
# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
EXTENSION_MAPPING =
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
# to include (a tag file for) the STL sources as input, then you should
# set this tag to YES in order to let doxygen match functions declarations and
# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
# func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
BUILTIN_STL_SUPPORT = YES
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
# Doxygen will parse them like normal C++ but will assume all classes use public
# instead of private inheritance when no explicit protection keyword is present.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate getter
# and setter methods for a property. Setting this option to YES (the default)
# will make doxygen to replace the get and set methods by a property in the
# documentation. This will only work if the methods are indeed getting or
# setting a simple type. If this is not the case, or you want to show the
# methods anyway, you should set this option to NO.
IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to
# NO to prevent subgrouping. Alternatively, this can be done per class using
# the \nosubgrouping command.
SUBGROUPING = YES
# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
# is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
# namespace, or class. And the struct will be named TypeS. This can typically
# be useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
TYPEDEF_HIDES_STRUCT = NO
# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
# determine which symbols to keep in memory and which to flush to disk.
# When the cache is full, less often used symbols will be written to disk.
# For small to medium size projects (<1000 input files) the default value is
# probably good enough. For larger projects a too small cache size can cause
# doxygen to be busy swapping symbols to and from disk most of the time
# causing a significant performance penality.
# If the system has enough physical memory increasing the cache will improve the
# performance by keeping more symbols in memory. Note that the value works on
# a logarithmic scale so increasing the size by one will rougly double the
# memory usage. The cache size is given by this formula:
# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
# corresponding to a cache size of 2^16 = 65536 symbols
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
# documentation are documented, even if no documentation was available.
# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = NO
# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = NO
# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
# This flag is only useful for Objective-C code. When set to YES local
# methods, which are defined in the implementation section but not in
# the interface are included in the documentation.
# If set to NO (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
# 'anonymous_namespace{file}', where file will be replaced with the base
# name of the file that contains the anonymous namespace. By default
# anonymous namespace are hidden.
EXTRACT_ANON_NSPACES = NO
# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
# undocumented members of documented classes, files or namespaces.
# If set to NO (the default) these members will be included in the
# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = NO
# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
# undocumented classes that are normally visible in the class hierarchy.
# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
# friend (class|struct|union) declarations.
# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
# documentation blocks found inside the body of a function.
# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
# file names in lower-case letters. If set to YES upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
CASE_SENSE_NAMES = NO
# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
# will list include files with double quotes in the documentation
# rather than with sharp brackets.
FORCE_LOCAL_INCLUDES = NO
# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
# will sort the (detailed) documentation of file and class members
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
# brief documentation of file, namespace and class members alphabetically
# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = NO
# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
# will sort the (brief and detailed) documentation of class members so that
# constructors and destructors are listed first. If set to NO (the default)
# the constructors will appear in the respective orders defined by
# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
SORT_MEMBERS_CTORS_1ST = NO
# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
# hierarchy of group names into alphabetical order. If set to NO (the default)
# the group names will appear in their defined order.
SORT_GROUP_NAMES = NO
# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
# sorted by fully-qualified names, including namespaces. If set to
# NO (the default), the class list will be sorted only by class name,
# not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
# Note: This option applies only to the class list, not to the
# alphabetical list.
SORT_BY_SCOPE_NAME = NO
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = NO
# The GENERATE_TESTLIST tag can be used to enable (YES) or
# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = NO
# The GENERATE_BUGLIST tag can be used to enable (YES) or
# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = NO
# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
# the initial value of a variable or define consists of for it to appear in
# the documentation. If the initializer consists of more lines than specified
# here it will be hidden. Use a value of 0 to hide initializers completely.
# The appearance of the initializer of individual variables and defines in the
# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
# If the sources in your project are distributed over multiple directories
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
# in the documentation. The default is NO.
SHOW_DIRECTORIES = YES
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.
SHOW_FILES = YES
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
# Namespaces page.
# This will remove the Namespaces entry from the Quick Index
# and from the Folder Tree View (if specified). The default is YES.
SHOW_NAMESPACES = YES
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
# popen()) the command , where is the value of
# the FILE_VERSION_FILTER tag, and is the name of an input file
# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. The create the layout file
# that represents doxygen's defaults, run doxygen with the -l option.
# You can optionally specify a file name after the option, if omitted
# DoxygenLayout.xml will be used as the name of the layout file.
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some
# parameters in a documented function, or documenting parameters that
# don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be abled to get warnings for
# functions that are documented, but have no documentation for their parameters
# or return value. If set to NO (the default) doxygen will only warn about
# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
# The WARN_FORMAT tag determines the format of the warning messages that
# doxygen can produce. The string should contain the $file, $line, and $text
# tags, which will be replaced by the file and line number from which the
# warning originated and the warning text. Optionally the format may contain
# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = "$file:$line: $text"
# The WARN_LOGFILE tag can be used to specify a file to which warning
# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE = doxy-warnings.log
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
# The INPUT tag can be used to specify the files and/or directories that contain
# documented source files. You may enter file names like "myfile.cpp" or
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = $(SRCDIR)
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
# also the default input encoding. Doxygen uses libiconv (or the iconv built
# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
# the list of possible encodings.
INPUT_ENCODING = UTF-8
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank the following patterns are tested:
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS = *.cpp \
*.h
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
# certain files from those directories. Note that the wildcards are matched
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS =
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
# AClass::ANamespace, ANamespace::*Test
EXCLUDE_SYMBOLS =
# The EXAMPLE_PATH tag can be used to specify one or more files or
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH = $(SRCDIR)
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
# searched for input files to be used with the \include or \dontinclude
# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = NO
# The IMAGE_PATH tag can be used to specify one or more files or
# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
# by executing (via popen()) the command , where
# is the value of the INPUT_FILTER tag, and is the name of an
# input file. Doxygen will then use the output that the filter program writes
# to standard output.
# If FILTER_PATTERNS is specified, this tag will be
# ignored.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis.
# Doxygen will compare the file name with each pattern and apply the
# filter if there is a match.
# The filters are a list of the form:
# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
# is applied to all files.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = YES
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = YES
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES
# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
# If the REFERENCES_RELATION tag is set to YES
# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = YES
# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
# link to the source code.
# Otherwise they will link to the documentation.
REFERENCES_LINK_SOURCE = YES
# If the USE_HTAGS tag is set to YES then the references to source code
# will point to the HTML generated by the htags(1) tool instead of doxygen
# built-in source browser. The htags tool is part of GNU's global source
# tagging system (see http://www.gnu.org/software/global/global.html). You
# will need version 4.8.6 or higher.
USE_HTAGS = NO
# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = NO
# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index.
# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = $(GENERATE_HTML)
# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
# The HTML_HEADER tag can be used to specify a personal HTML header for
# each generated HTML page. If it is left blank doxygen will generate a
# standard header.
HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER =
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
# fine-tune the look of the HTML output. If the tag is left blank doxygen
# will generate a default style sheet. Note that doxygen will try to copy
# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
# Doxygen will adjust the colors in the stylesheet and background images
# according to this color. Hue is specified as an angle on a colorwheel,
# see http://en.wikipedia.org/wiki/Hue for more information.
# For instance the value 0 represents red, 60 is yellow, 120 is green,
# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
# The allowed range is 0 to 359.
HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
# the colors in the HTML output. For a value of 0 the output will use
# grayscales only. A value of 255 will produce the most vivid colors.
HTML_COLORSTYLE_SAT = 100
# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
# the luminance component of the colors in the HTML output. Values below
# 100 gradually make the output lighter, whereas values above 100 make
# the output darker. The value divided by 100 is the actual gamma applied,
# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
# and 100 does not change the gamma.
HTML_COLORSTYLE_GAMMA = 80
# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
# page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs.
HTML_TIMESTAMP = YES
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded. For this to work a browser that supports
# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
HTML_DYNAMIC_SECTIONS = NO
# If the GENERATE_DOCSET tag is set to YES, additional index files
# will be generated that can be used as input for Apple's Xcode 3
# integrated development environment, introduced with OSX 10.5 (Leopard).
# To create a documentation set, doxygen will generate a Makefile in the
# HTML output directory. Running make will produce the docset in that
# directory and running "make install" will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
# it at startup.
# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
GENERATE_DOCSET = NO
# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
# feed. A documentation feed provides an umbrella under which multiple
# documentation sets from a single provider (such as a company or product suite)
# can be grouped.
DOCSET_FEEDNAME = "Doxygen generated docs"
# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
# should uniquely identify the documentation set bundle. This should be a
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
# will append .docset to the name.
DOCSET_BUNDLE_ID = org.doxygen.Project
# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
# the documentation publisher. This should be a reverse domain-name style
# string, e.g. com.mycompany.MyDocSet.documentation.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the
# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = $(GENERATE_CHM)
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
# be used to specify the file name of the resulting .chm file. You
# can add a path in front of the file if the result should not be
# written to the html output directory.
CHM_FILE = ../$(PROJECT).chm
# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
# be used to specify the location (absolute path including file name) of
# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
# the HTML help compiler on the generated index.hhp.
HHC_LOCATION = $(HHC_PATH)
# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = $(GENERATE_CHI)
# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
# is used to encode HtmlHelp index (hhk), content (hhc) and project file
# content.
CHM_INDEX_ENCODING =
# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
# that can be used as input for Qt's qhelpgenerator to generate a
# Qt Compressed Help (.qch) of the generated HTML documentation.
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
# be used to specify the file name of the resulting .qch file.
# The path specified is relative to the HTML output folder.
QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#namespace
QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
# Qt Help Project output. For more information please see
# http://doc.trolltech.com/qthelpproject.html#virtual-folders
QHP_VIRTUAL_FOLDER = doc
# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
# add. For more information please see
# http://doc.trolltech.com/qthelpproject.html#custom-filters
QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see
#
# Qt Help Project / Custom Filters.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's
# filter section matches.
#
# Qt Help Project / Filter Attributes.
QHP_SECT_FILTER_ATTRS =
# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
# be used to specify the location of Qt's qhelpgenerator.
# If non-empty doxygen will try to run qhelpgenerator on the generated
# .qhp file.
QHG_LOCATION =
# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
# will be generated, which together with the HTML files, form an Eclipse help
# plugin. To install this plugin and make it available under the help contents
# menu in Eclipse, the contents of the directory containing the HTML and XML
# files needs to be copied into the plugins directory of eclipse. The name of
# the directory within the plugins directory should be the same as
# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
# the help appears.
GENERATE_ECLIPSEHELP = NO
# A unique identifier for the eclipse help plugin. When installing the plugin
# the directory name containing the HTML and XML files should also have
# this name.
ECLIPSE_DOC_ID = org.doxygen.Project
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
ENUM_VALUES_PER_LINE = 4
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
# structure should be generated to display hierarchical information.
# If the tag value is set to YES, a side panel will be generated
# containing a tree-like index structure (just like the one that
# is generated for HTML Help). For this to work a browser that supports
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = YES
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
# and Class Hierarchy pages using a tree view instead of an ordered list.
USE_INLINE_TREES = NO
# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
# links to external symbols imported via tag files in a separate window.
EXT_LINKS_IN_WINDOW = NO
# Use this tag to change the font size of Latex formulas included
# as images in the HTML documentation. The default is 10. Note that
# when you change the font size after a successful doxygen run you need
# to manually remove any form_*.png images from the HTML output directory
# to force them to be regenerated.
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are
# not supported properly for IE 6.0, but are supported on all modern browsers.
# Note that when changing this option you need to delete any form_*.png files
# in the HTML output before the changes have effect.
FORMULA_TRANSPARENT = YES
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
# for the HTML output. The underlying search engine uses javascript
# and DHTML and should work on any modern browser. Note that when using
# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
# (GENERATE_DOCSET) there is already a search function so this one should
# typically be disabled. For large projects the javascript based search engine
# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a PHP enabled web server instead of at the web client
# using Javascript. Doxygen will generate the search PHP script and index
# file to put on the web server. The advantage of the server
# based approach is that it scales better to large projects and allows
# full text search. The disadvances is that it is more difficult to setup
# and does not have live searching capabilities.
SERVER_BASED_SEARCH = NO
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = $(GENERATE_LATEX)
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
# Note that when enabling USE_PDFLATEX this option is only used for
# generating bitmaps for formulas in the HTML output, but not in the
# Makefile that is written to the output directory.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
MAKEINDEX_CMD_NAME = makeindex
# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
# The PAPER_TYPE tag can be used to set the paper type that is used
# by the printer. Possible values are: a4, a4wide, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = $(PAPER_SIZE)
# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
EXTRA_PACKAGES =
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
# the generated latex document. The header should contain everything until
# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
LATEX_HEADER =
# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
# is prepared for conversion to pdf (using ps2pdf). The pdf file will
# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = NO
# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = NO
# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
# command to the generated LaTeX files. This will instruct LaTeX to keep
# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = YES
# If LATEX_HIDE_INDICES is set to YES then doxygen will not
# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
# If LATEX_SOURCE_CODE is set to YES then doxygen will include
# source code with syntax highlighting in the LaTeX output.
# Note that which sources are shown also depends on other settings
# such as SOURCE_BROWSER.
LATEX_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
# The RTF output is optimized for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = $(GENERATE_RTF)
# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
# will contain hyperlink fields. The RTF file will
# contain links (just like the HTML output) instead of page references.
# This makes the output suitable for online browsing using WORD or other
# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = $(GENERATE_MAN)
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .1
# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
# then it will generate one additional man file for each entity
# documented in the real man page(s). These additional files
# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
# If the GENERATE_XML tag is set to YES Doxygen will
# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = $(GENERATE_XML)
# The XML_OUTPUT tag is used to specify where the XML pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `xml' will be used as the default path.
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that
# enabling this will significantly increase the size of the XML output.
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
# generate an AutoGen Definitions (see autogen.sf.net) file
# that captures the structure of the code including all
# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
# If the GENERATE_PERLMOD tag is set to YES Doxygen will
# generate a Perl module file that captures the structure of
# the code including all documentation. Note that this
# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
# the necessary Makefile rules, Perl scripts and LaTeX code to be able
# to generate PDF and DVI output from the Perl module output.
PERLMOD_LATEX = NO
# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
# nicely formatted so it can be parsed by a human reader.
# This is useful
# if you want to understand what is going on.
# On the other hand, if this
# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
# The names of the make variables in the generated doxyrules.make file
# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
# names in the source code. If set to NO (the default) only conditional
# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = NO
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = NO
# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
# in the INCLUDE_PATH (see below) will be search if a #include is found.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
# contain include files that are not input files but should be processed by
# the preprocessor.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
INCLUDE_FILE_PATTERNS =
# The PREDEFINED tag can be used to specify one or more macro names that
# are defined before the preprocessor is started (similar to the -D option of
# gcc). The argument of the tag is a list of macros of the form: name
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed. To prevent a macro definition from being
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED =
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED =
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone
# on a line, have an all uppercase name, and do not end with a semicolon. Such
# function macros are typically used for boiler-plate code, and will confuse
# the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
# The TAGFILES option can be used to specify one or more tagfiles.
# Optionally an initial location of the external documentation
# can be added for each tagfile. The format of a tag file without
# this location is as follows:
#
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
#
# TAGFILES = file1=loc1 "file2 = loc2" ...
# where "loc1" and "loc2" can be relative or absolute paths or
# URLs. If a location is present for each tag, the installdox tool
# does not have to be run to correct the links.
# Note that each tag file must have a unique name
# (where the name does NOT include the path)
# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
TAGFILES =
# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE = $(DOCDIR)/$(PROJECT).tag
# If the ALLEXTERNALS tag is set to YES all external classes will be listed
# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = NO
# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = $(PERL_PATH)
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
# or super classes. Setting the tag to NO turns the diagrams off. Note that
# this option is superseded by the HAVE_DOT option below. This is only a
# fallback. It is recommended to install and use dot, since it yields more
# powerful graphs.
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see
# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# If set to YES, the inheritance and collaboration graphs will hide
# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz, a graph visualization
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = $(HAVE_DOT)
# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
# allowed to run in parallel. When set to 0 (the default) doxygen will
# base this on the number of processors available in the system. You can set it
# explicitly to a value larger than 0 to get control over the balance
# between CPU load and processing speed.
DOT_NUM_THREADS = 0
# By default doxygen will write a font called FreeSans.ttf to the output
# directory and reference it in all dot files that doxygen generates. This
# font does not include all possible unicode characters however, so when you need
# these (or just want a differently looking font) you can specify the font name
# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
# which can be done by putting it in a standard location or by setting the
# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
# containing the font.
DOT_FONTNAME = FreeSans.ttf
# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
# The default size is 10pt.
DOT_FONTSIZE = 10
# By default doxygen will tell dot to use the output directory to look for the
# FreeSans.ttf font (which doxygen will put there itself). If you specify a
# different font using DOT_FONTNAME you can set the path where dot
# can find it using this tag.
DOT_FONTPATH =
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
UML_LOOK = NO
# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = NO
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
# tags are set to YES then doxygen will generate a graph for each documented
# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
# If the CALL_GRAPH and HAVE_DOT options are set to YES then
# doxygen will generate a call dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable call graphs
# for selected functions only using the \callgraph command.
CALL_GRAPH = NO
# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
# doxygen will generate a caller dependency graph for every global function
# or class method. Note that enabling this option will significantly increase
# the time of a run. So in most cases it will be better to enable caller
# graphs for selected functions only using the \callergraph command.
CALLER_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif
# If left blank png will be used.
DOT_IMAGE_FORMAT = png
# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH = $(DOT_PATH)
# The DOTFILE_DIRS tag can be used to specify one or more directories that
# contain dot files that are included in the documentation (see the
# \dotfile command).
DOTFILE_DIRS =
# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
# nodes that will be shown in the graph. If the number of nodes in a graph
# becomes larger than this value, doxygen will truncate the graph, which is
# visualized by representing a node as a red box. Note that doxygen if the
# number of direct children of the root node in a graph is already larger than
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
DOT_GRAPH_MAX_NODES = 50
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
# from the root by following a path via at most 3 edges will be shown. Nodes
# that lay further from the root node will be omitted. Note that setting this
# option to 1 or 2 may greatly reduce the computation time needed for large
# code bases. Also note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
MAX_DOT_GRAPH_DEPTH = 0
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
# background. This is disabled by default, because dot on Windows does not
# seem to support this out of the box. Warning: Depending on the platform used,
# enabling this option may lead to badly anti-aliased labels on the edges of
# a graph (i.e. they become hard to read).
DOT_TRANSPARENT = NO
# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
DOT_MULTI_TARGETS = YES
# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
nux-4.0.6+14.04.20141107/gputests/ 0000755 0000153 0177776 00000000000 12427165411 016611 5 ustar pbuser nogroup 0000000 0000000 nux-4.0.6+14.04.20141107/gputests/texture_power_of_2.cpp 0000644 0000153 0177776 00000010770 12427165212 023142 0 ustar pbuser nogroup 0000000 0000000 /*
* Copyright 2010 Inalogic Inc.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with this program. If not, see
*
*
* Authored by: Jay Taoko
*
*/
#include "NuxCore/NuxCore.h"
#include "NuxGraphics/BitmapFormats.h"
#include "NuxGraphics/GraphicsDisplay.h"
#include "NuxGraphics/GLWindowManager.h"
#include "NuxGraphics/GraphicsEngine.h"
/*
* Tests:
* - load 2d textures of various size from the hard drive
* - textures have power of two size 256x256, 128x128, ...., 2x2, 1x1
* - manually load bitmap data into device texture: IOpenGLTexture2D
* - Lock/Unlock device texture data pointer
* - Use immediate mode rendering with glBegin, glEnd
*/
void RenderTexturePowerOfTwo ()
{
nux::GraphicsDisplay* m_GLWindow = gGLWindowManager.CreateGLWindow("Window", 570, 270, nux::WINDOWSTYLE_NORMAL, 0, false);
nux::GraphicsEngine* m_GraphicsContext = m_GLWindow->GetGraphicsEngine();
m_GLWindow->ShowWindow();
const TCHAR* texture_list [] =
{
TEXT("./data/mipmap256x256.png"),
TEXT("./data/mipmap128x128.png"),
TEXT("./data/mipmap64x64.png"),
TEXT("./data/mipmap32x32.png"),
TEXT("./data/mipmap16x16.png"),
TEXT("./data/mipmap8x8.png"),
TEXT("./data/mipmap4x4.png"),
TEXT("./data/mipmap2x2.png"),
TEXT("./data/mipmap1x1.png")
};
nux::ObjectPtr tex [9];
for (int i = 0; i < 9; i++)
{
nux::NBitmapData *bitmap = nux::LoadImageFile(texture_list[i]);
nux::ImageSurface surface = bitmap->GetSurface(0);
surface.GetFormat();
tex[i] = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateTexture(
surface.GetWidth(),
surface.GetHeight(),
1,
surface.GetFormat());
nux::SURFACE_LOCKED_RECT lockrect;
tex[i]->LockRect(0, &lockrect, 0);
BYTE *dest = (BYTE *) lockrect.pBits;
const BYTE *src = surface.GetPtrRawData();
int RowByteSize = surface.GetPitch();
int num_row = surface.GetBlockHeight();
for (int Y = 0; Y < num_row; Y++ )
{
// Take Min(RowByteSize, StrideY): the source and the destination may not have the same Pitch but
// they contain the same amount of valid data since they have the same width, height and format.
nux::Memcpy (dest + Y * lockrect.Pitch, &src[Y * RowByteSize], nux::Min (RowByteSize, lockrect.Pitch) );
}
tex[i]->UnlockRect (0);
}
int w, h;
m_GraphicsContext->GetWindowSize(w, h);
m_GraphicsContext->SetViewport(0, 0, w, h);
m_GraphicsContext->SetContext(0, 0, w, h);
m_GraphicsContext->Push2DWindow(w, h);
nux::Event event;
memset(&event, 0, sizeof(nux::Event));
do
{
CHECKGL( glClearColor(0, 0, 0, 1) );
CHECKGL( glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT) );
m_GLWindow->GetSystemEvent(&event);
if(event.type == nux::NUX_SIZE_CONFIGURATION)
{
m_GraphicsContext->DisableAllTextureMode(0);
m_GraphicsContext->DisableAllTextureMode(1);
m_GraphicsContext->DisableAllTextureMode(2);
m_GraphicsContext->DisableAllTextureMode(3);
m_GraphicsContext->GetWindowSize(w, h);
m_GraphicsContext->SetViewport(0, 0, w, h);
m_GraphicsContext->SetScissor(0, 0, w, h);
m_GraphicsContext->SetContext(0, 0, w, h);
m_GraphicsContext->Push2DWindow(w, h);
}
int x = 10;
int y = 10;
for (int i = 0; i < 9; i++)
{
m_GraphicsContext->SetTexture(GL_TEXTURE0, tex [i]);
if (i > 0)
x += tex[i-1]->GetWidth () + 5;
int width = tex[i]->GetWidth ();
int height = tex[i]->GetHeight ();
nux::TexCoordXForm texxform;
m_GraphicsContext->QRP_GLSL_1Tex(x, y, width, height, tex[i], texxform, nux::color::White);
}
m_GLWindow->SwapBuffer();
} while(event.type != nux::NUX_TERMINATE_APP);
for (int i = 0; i < 9; i++)
{
tex[i].Release ();
}
delete m_GLWindow;
}
int main()
{
nux::NuxCoreInitialize(0);
nux::NuxGraphicsInitialize();
RenderTexturePowerOfTwo ();
return 0;
}
nux-4.0.6+14.04.20141107/gputests/Makefile.am 0000644 0000153 0177776 00000004151 12427165212 020645 0 ustar pbuser nogroup 0000000 0000000 CLEANFILES =
DISTCLEANFILES =
EXTRA_DIST =
if BUILD_GPUTESTS
# This tells automake that we want to build binaries, but they shouldn't be
# installed. For each individual test, add it's binary name here
noinst_PROGRAMS = texture_power_of_2 framebufferobject quad_2texmod texture_copy_blur texture_blur texture_data
if !NUX_OPENGLES_20
noinst_PROGRAMS += arb_programs_limits
endif
# We only have to do this AM_ once to affect all the binaries we build from
# this Makefile
AM_CPPFLAGS = \
-I$(srcdir) \
-I$(top_srcdir) \
-DPREFIX=\""$(prefix)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DG_LOG_DOMAIN=\"NuxGpuTests\" \
$(GCC_FLAGS) \
$(NUX_CORE_CFLAGS) \
$(NUX_GPUTESTS_CFLAGS) \
$(NUX_CFLAGS) \
$(MAINTAINER_CFLAGS)
ALL_LIBS = \
$(top_builddir)/NuxCore/libnux-core-@NUX_API_VERSION@.la \
$(top_builddir)/NuxGraphics/libnux-graphics-@NUX_API_VERSION@.la \
$(top_builddir)/Nux/libnux-@NUX_API_VERSION@.la \
$(NUX_GPUTESTS_LIBS) \
$(NUX_LIBS)
# This is the individual executable build. For every $exe in noinst_PROGRAMS
# you need a $exe_SOURCES and $exe_LDADD so it builds
texture_power_of_2_SOURCES = texture_power_of_2.cpp
texture_power_of_2_LDADD = $(ALL_LIBS)
framebufferobject_SOURCES = framebufferobject.cpp
framebufferobject_LDADD = $(ALL_LIBS)
quad_2texmod_SOURCES = quad_2texmod.cpp
quad_2texmod_LDADD = $(ALL_LIBS)
texture_copy_blur_SOURCES = texture_copy_blur.cpp
texture_copy_blur_LDADD = $(ALL_LIBS)
texture_blur_SOURCES = texture_blur.cpp
texture_blur_LDADD = $(ALL_LIBS)
texture_data_SOURCES = texture_data.cpp
texture_data_LDADD = $(ALL_LIBS)
arb_programs_limits_SOURCES = arb_programs_limits.cpp
arb_programs_limits_LDADD = $(ALL_LIBS)
# distribute source along to the documentation
sourcegputestsdir = $(pkgdatadir)/gputests
sourcegputests_DATA = $(texture_power_of_2_SOURCES) \
$(framebufferobject_SOURCES) \
$(quad_2texmod) \
$(texture_copy_blur_SOURCES) \
$(texture_blur_SOURCES) \
$(texture_data_SOURCES) \
$(arb_programs_limits_SOURCES)
endif
nux-4.0.6+14.04.20141107/gputests/data/ 0000755 0000153 0177776 00000000000 12427165411 017522 5 ustar pbuser nogroup 0000000 0000000 nux-4.0.6+14.04.20141107/gputests/data/mipmap256x256.png 0000755 0000153 0177776 00000006467 12427165212 022414 0 ustar pbuser nogroup 0000000 0000000 PNG
IHDR \rf pHYs nu>
OiCCPPhotoshop ICC profile xڝSgTS=BKKoR RB&*! J!QEEȠQ,
!{kּ>H3Q5B.@
$p d!s# ~<<+" x M0B\t8K @zB @F&S