forked from old/legacy-imlib2
Moving over to the new home in the efm module.
SVN revision: 2742
This commit is contained in:
parent
50d5d7dc8c
commit
426b37c2bd
|
@ -1,20 +0,0 @@
|
|||
config.guess
|
||||
config.h.in
|
||||
config.sub
|
||||
ltconfig
|
||||
ltmain.sh
|
||||
aclocal.m4
|
||||
stamp-h.in
|
||||
Makefile.in
|
||||
configure
|
||||
config.log
|
||||
config.h
|
||||
config.cache
|
||||
libtool
|
||||
config.status
|
||||
stamp-h
|
||||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
*.lo
|
||||
*.la
|
|
@ -1,16 +0,0 @@
|
|||
# A list of all the files in the current directory which can be regenerated
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
LDFLAGS = -L/usr/X11R6/lib
|
||||
INCLUDES = -I. -I$(top_srcdir)/dox -I/usr/X11R6/include \
|
||||
-I$(top_srcdir)/src \
|
||||
$(X_CFLAGS) -I$(prefix)/include -I$(includedir) \
|
||||
-DPREFIX=\""$(prefix)"\"
|
||||
|
||||
LIBOBJS = @LIBOBJS@
|
||||
|
||||
bin_PROGRAMS = dox2
|
||||
dox2_SOURCES = main.c dox.h hotspot.c style.c utils.c style.h
|
||||
dox2_LDADD = -lX11
|
||||
|
||||
EXTRA_DIST =
|
48
dox/dox.h
48
dox/dox.h
|
@ -1,48 +0,0 @@
|
|||
#ifndef _DOX_H_
|
||||
#define _DOX_H_
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xos.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/Xresource.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#include <dirent.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "Imlib2.h"
|
||||
#include "style.h"
|
||||
|
||||
typedef struct __dox_hotspot
|
||||
{
|
||||
char *name;
|
||||
int x;
|
||||
int y;
|
||||
int w;
|
||||
int h;
|
||||
struct __dox_hotspot *next;
|
||||
} DoxHotspot;
|
||||
|
||||
void parse_args( int argc, char **argv );
|
||||
|
||||
void init_hotspot();
|
||||
void add_hotspot( char *target, int x, int y, int w, int h );
|
||||
char *check_hotspot( int x, int y );
|
||||
void tidy_hotspots();
|
||||
|
||||
void load_dss( char *file );
|
||||
|
||||
int __find_string( char *haystack, char *needle );
|
||||
char *__stripwhitespace( char *str );
|
||||
char *__copystr( char *str, int start, int end );
|
||||
|
||||
#endif /* _DOX_H_ */
|
|
@ -1,51 +0,0 @@
|
|||
#include "dox.h"
|
||||
|
||||
DoxHotspot *root;
|
||||
|
||||
void init_hotspot()
|
||||
{
|
||||
root = malloc( sizeof( DoxHotspot ) );
|
||||
root->name = strdup( "root" );
|
||||
root->x = 0;
|
||||
root->y = 0;
|
||||
root->w = 0;
|
||||
root->h = 0;
|
||||
root->next = NULL;
|
||||
printf( "Hotspots initialised.\n" );
|
||||
}
|
||||
|
||||
void add_hotspot( char *target, int x, int y, int w, int h )
|
||||
{
|
||||
DoxHotspot *ptr;
|
||||
for( ptr = root; ptr->next != NULL; ptr = ptr->next )
|
||||
;
|
||||
ptr->next = malloc( sizeof( DoxHotspot ) );
|
||||
ptr = ptr->next;
|
||||
ptr->name = strdup( "root" );
|
||||
ptr->x = 0;
|
||||
ptr->y = 0;
|
||||
ptr->w = 0;
|
||||
ptr->h = 0;
|
||||
ptr->next = NULL;
|
||||
printf( "Hotspot added\n" );
|
||||
}
|
||||
|
||||
char *check_hotspot( int x, int y )
|
||||
{
|
||||
DoxHotspot *ptr;
|
||||
for( ptr = root; ptr != NULL; ptr = ptr->next )
|
||||
{
|
||||
if( (x >= ptr->x) && (x <= (ptr->x + ptr->w)) &&
|
||||
(y >= ptr->y) && (y <= (ptr->y + ptr->h)) )
|
||||
{
|
||||
printf( "Found Hotspot\n" );
|
||||
return ptr->name;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void tidy_hotspots()
|
||||
{
|
||||
|
||||
}
|
14
dox/main.c
14
dox/main.c
|
@ -1,14 +0,0 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
printf( "dox - version 2.0 - Imlib2\n" );
|
||||
init_hotspot();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void parse_args( int argc, char **argv )
|
||||
{
|
||||
printf( "We should parse the args\n" );
|
||||
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#include "dox.h"
|
||||
|
||||
void load_dss( char *file )
|
||||
{
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<style
|
||||
|
||||
title.font.name = "brooklyn.ttf",
|
||||
title.font.size = 35,
|
||||
title.font.colour = "#ffffff",
|
||||
|
||||
link.normal.colour = "#aaaaff",
|
||||
link.normal.font.name = "brooklyn.ttf",
|
||||
link.normal.font.size = 26,
|
||||
|
||||
link.visited.colour = "#ffaaaa",
|
||||
link.visited.font.name = "brooklyn.ttf",
|
||||
link.visited.font.size = 26,
|
||||
|
||||
background.picture = "bg.png",
|
||||
|
||||
/>
|
37
dox/style.h
37
dox/style.h
|
@ -1,37 +0,0 @@
|
|||
#ifndef _STYLE_H_
|
||||
#define _STYLE_H_
|
||||
|
||||
typedef struct __dox_style_bg
|
||||
{
|
||||
char *file;
|
||||
Imlib_Image im;
|
||||
} DoxStyleBg;
|
||||
|
||||
typedef struct __dox_style_font
|
||||
{
|
||||
char *name;
|
||||
char *colour;
|
||||
int size;
|
||||
Imlib_Font font;
|
||||
} DoxFont;
|
||||
|
||||
typedef struct __dox_style_link
|
||||
{
|
||||
DoxFont font;
|
||||
char *colour;
|
||||
} DoxStyleLink;
|
||||
|
||||
typedef struct __dox_style_links
|
||||
{
|
||||
DoxStyleLink normal;
|
||||
DoxStyleLink visited;
|
||||
} DoxStyleLinks;
|
||||
|
||||
typedef struct __dox_style
|
||||
{
|
||||
DoxFont title;
|
||||
DoxStyleLinks link;
|
||||
DoxStyleBg background;
|
||||
} DoxStyle;
|
||||
|
||||
#endif
|
|
@ -1,6 +0,0 @@
|
|||
<page name="test">
|
||||
<link to="otherpage">Test Link</link>
|
||||
<nl/>
|
||||
Test text.
|
||||
<image from="testimg.png"/>
|
||||
</page>
|
37
dox/utils.c
37
dox/utils.c
|
@ -1,37 +0,0 @@
|
|||
#include "dox.h"
|
||||
|
||||
int __find_string( char *haystack, char *needle )
|
||||
{
|
||||
if( strstr( haystack, needle ) != NULL )
|
||||
return ( strstr( haystack, needle ) - haystack );
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *__stripwhitespace( char *str )
|
||||
{
|
||||
int i, strt = 0, in_quote = 0;
|
||||
char *tmpstr = calloc( strlen(str)+1, sizeof(char) );
|
||||
for( i = 0; i < strlen(str); i++ )
|
||||
{
|
||||
if( str[i] == '\"' )
|
||||
in_quote = (in_quote == 0 ? 1 : 0);
|
||||
if( in_quote || ! isspace(*(str+i)) )
|
||||
tmpstr[strt++] = str[i];
|
||||
}
|
||||
strcpy( str, tmpstr );
|
||||
free(tmpstr);
|
||||
return str;
|
||||
}
|
||||
|
||||
char *__copystr( char *str, int start, int end )
|
||||
{
|
||||
int i = 0;
|
||||
char *rstr = calloc( 1024, sizeof( char ) );
|
||||
if( start <= end && end < strlen( str ) )
|
||||
{
|
||||
for( i = start; i <= end; i++ )
|
||||
rstr[i-start] = str[i];
|
||||
return rstr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
Loading…
Reference in New Issue