/contrib/media/updf/apps/pdfdraw.c |
---|
File deleted |
/contrib/media/updf/apps/pdfextract.c |
---|
File deleted |
/contrib/media/updf/apps/Makefile |
---|
12,7 → 12,7 |
APPS_SRC := $(notdir $(wildcard *.c)) |
default: $(patsubst %.c,%.o,$(APPS_SRC)) |
$(LD) $(LDFLAGS) $(LIBPATH) -o updf kolibri.o pdfapp.o kos_main.o -lmupdf -lfreetype -lfitz -lgcc -lfitz -ldraw -ljpeg -ljbig2dec -lfreetype -lopenjpeg -lz -lc.dll --subsystem native |
$(LD) $(LDFLAGS) $(LIBPATH) --subsystem native -o updf kolibri.o pdfapp.o kos_main.o -lmupdf -lfitz -lgcc -lfitz -ldraw -ljpeg -ljbig2dec -lfreetype -lopenjpeg -lz -lc.dll |
objcopy updf -O binary |
/contrib/media/updf/apps/kolibri.c |
---|
33,6 → 33,10 |
asm volatile ("int $0x40"::"a"(67), "b"(x), "c"(y), "d"(-1), "S"(-1)); |
} |
void kol_wnd_size(unsigned x, unsigned y) |
{ |
asm volatile ("int $0x40"::"a"(67), "b"(-1), "c"(-1), "d"(x), "S"(y)); |
}; |
void kol_event_mask(unsigned e) |
{ |
485,17 → 489,6 |
} |
void kos_move_window(int posx, int posy, int sizex, int sizey) |
{ |
__asm__ __volatile__( |
"int $0x40" |
::"a"(67), |
"b"(posx), |
"c"(posy), |
"d"(sizex), |
"S"(sizey)); |
}; |
void kos_text(int x, int y, int color, const char* text, int len) |
{ |
asm volatile ("int $0x40"::"a"(4),"b"((x<<16) | y),"c"(color),"d"((unsigned long)text),"S"(len)); |
513,7 → 506,7 |
if(y) *y = v & 0xFFFF; |
}; |
int kol_get_key() |
int kos_get_key() |
{ |
unsigned short __ret; |
asm volatile("int $0x40":"=a"(__ret):"0"(2)); |
/contrib/media/updf/apps/kolibri.h |
---|
97,7 → 97,11 |
void kol_exit(); |
void kol_sleep(unsigned d); |
void kol_wnd_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned cs, unsigned b, char *t); |
#define OLD -1 |
void kol_wnd_move(unsigned x, unsigned y); |
void kol_wnd_size(unsigned x, unsigned y); |
void kol_wnd_caption(char *s); |
void kol_event_mask(unsigned e); |
unsigned kol_event_wait(); |
154,22 → 158,19 |
int kol_clip_num(); |
char* kol_clip_get(int n); |
int kol_clip_set(int n, char buffer[]); |
void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c); |
void kos_blit(int dstx, int dsty, int w, int h, int srcx, |
int srcy,int srcw, int srch, int stride, char *d); |
int kos_random(int num); |
int kos_get_mouse_wheels(void); |
#define OLD -1 |
void kos_move_window(int posx, int posy, int sizex, int sizey); |
void kos_screen_max(int* x, int* y); |
int kos_get_key(); |
void kos_text(int x, int y, int color, const char* text, int len); |
void kol_btn_define(unsigned x, unsigned y, unsigned w, unsigned h, unsigned d, unsigned c); |
void kos_screen_max(int* x, int* y); |
int kol_get_key(); |
//// Struct from menuet/os.h |
//// Need rewrite! |
typedef unsigned char __u8; |
typedef unsigned short __u16; |
/contrib/media/updf/apps/kos_main.c |
---|
1,6 → 1,5 |
/*==== INCLUDES ====*/ |
//#include <menuet/os.h> |
#include <kos32sys.h> |
#include "fitz.h" |
#include "mupdf.h" |
415,14 → 414,14 |
if (Form.window_state > 2) continue; // if Rolled-up |
// Minimal size (700x600) |
if (Form.winx_size < 700) kos_move_window(OLD, OLD, 700, OLD); |
if (Form.winy_size < 600) kos_move_window(OLD, OLD, OLD, 600); |
if (Form.winx_size < 700) kol_wnd_size(700, OLD); |
if (Form.winy_size < 600) kol_wnd_size(OLD, 600); |
DrawMainWindow(); |
break; |
case evKey: |
key = kol_get_key(); |
key = kos_get_key(); |
if (key_mode_enter_page_number) |
{ |
HandleNewPageNumber(key); |