Compare commits
1 Commits
9348673adb
...
v0.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ef989579a |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,6 +2,4 @@
|
||||
*.o
|
||||
src/upiwin
|
||||
src/splash.bin
|
||||
src/i_*.bin
|
||||
buildutils/mkgfx
|
||||
output/
|
||||
buildutils/mksplash
|
||||
|
||||
@@ -8,45 +8,45 @@ are *final.*
|
||||
2. This Code of Conduct contains harsh language. Tough shit. Suck it up, Buttercup.
|
||||
3. Anyone who is an *asshole* is **banned** *from this project.* **Permanently.**
|
||||
4. This project has certain objectives. Anything outside of those objectives is *irrelevant,*
|
||||
unless and until the *Owner* changes the objectives. Not you. In particular, if you're a Social
|
||||
unless and until the *Owner* changes the objectives. Not you. In particular, if you’re a Social
|
||||
Justice Warrior trying to join this project to spread your *bullshit,* you are *automatically
|
||||
declared an asshole.* And you're *gone.*
|
||||
declared an asshole.* And you’re *gone.*
|
||||
5. The Owner reserves the right to change this Code of Conduct as they see fit. If, however, you try
|
||||
to force the Owner to change it in ways that are *offensive to them,* or that try to advance
|
||||
"social justice" ideals in any way, shape, or form, you're an *asshole.* And you're *gone.*
|
||||
6. In particular, this project explicitly *rejects* the "Open Code of Conduct" by the TODO Group,
|
||||
the "Contributor Code of Merit" by Coraline Ada Ehmke, the "Citizen Code of Conduct" by
|
||||
Stumptown Syndicate, and any similar "codes of conduct" that may be promulgated. Anyone complaining
|
||||
“social justice” ideals in any way, shape, or form, you’re an *asshole.* And you’re *gone.*
|
||||
6. In particular, this project explicitly *rejects* the “Open Code of Conduct” by the TODO Group,
|
||||
the “Contributor Code of Merit” by Coraline Ada Ehmke, the “Citizen Code of Conduct” by
|
||||
Stumptown Syndicate, and any similar “codes of conduct” that may be promulgated. Anyone complaining
|
||||
about this is an *asshole,* because *who the fuck are you* to tell *the Owner* how *they* should
|
||||
run *their* goddamn project? And you're *gone.*
|
||||
run *their* goddamn project? And you’re *gone.*
|
||||
7. The *one and only* criterion that will be used to determine whether a contribution to this project
|
||||
will be accepted is *the quality of the contribution and how well it solves the problem it was
|
||||
contributed to solve.* **Period.** ("Contribution" may include code, documentation, testing, or fundraising.)
|
||||
contributed to solve.* **Period.** (“Contribution” may include code, documentation, testing, or fundraising.)
|
||||
8. The *one and only* criterion that will be used to judge your worth in relation to this project is
|
||||
*the quality of your contributions (as defined above) to this project.* **Period.**
|
||||
9. The Owner hereby does not give *one milli-micro-nano-fraction of a* **fuck** what race you are,
|
||||
what gender you are or identify as, who you want to sleep with, how old you are, what your height or
|
||||
weight is, what if anything may be different about your body or brain, what language you speak,
|
||||
what country you're from, what God you pray to, where you work, how much money you have,
|
||||
et fucking cetera. Is your contribution any *good?* That's all that matters.
|
||||
10. If your contribution is not accepted, and you start *whining* about how it's "actually" because you're
|
||||
what country you’re from, what God you pray to, where you work, how much money you have,
|
||||
et fucking cetera. Is your contribution any *good?* That’s all that matters.
|
||||
10. If your contribution is not accepted, and you start *whining* about how it’s “actually” because you’re
|
||||
of some-or-other gender/race/religion/nationality/whatthefuckever, you are attempting to have the deck
|
||||
stacked in your favor because you're "special." That makes you an *asshole.* And you're *gone.*
|
||||
stacked in your favor because you’re “special.” That makes you an *asshole.* And you’re *gone.*
|
||||
11. Only those people who have contributed a sufficient quantity of good work to the project,
|
||||
*as determined in the Owner's sole discretion,* will be allowed to assume any board position,
|
||||
administrative position, or management-related role. And, any position that the Owner gives, they can
|
||||
also *take away,* for any reason. Anyone who complains about this is an *asshole.* And they're *gone.*
|
||||
12. You will do your own work. If you try to pass off the work of others as your own, you're a
|
||||
fucking *plagiarist,* and also an *asshole.* And you're *gone.*
|
||||
13. If there's a discussion that cannot be resolved within the scope of the project,
|
||||
also *take away,* for any reason. Anyone who complains about this is an *asshole.* And they’re *gone.*
|
||||
12. You will do your own work. If you try to pass off the work of others as your own, you’re a
|
||||
fucking *plagiarist,* and also an *asshole.* And you’re *gone.*
|
||||
13. If there’s a discussion that cannot be resolved within the scope of the project,
|
||||
*take that shit somewhere else.* The Owner does not want your bullshit here. If you continue to spread
|
||||
your bullshit here, you're an *asshole.* And you're *gone.*
|
||||
your bullshit here, you’re an *asshole.* And you’re *gone.*
|
||||
14. As noted above, the Owner's decisions about any aspect of the project are *final.* Anyone
|
||||
*pissing the Owner off* by getting all up in their face about said decisions is an *asshole.*
|
||||
And they're *gone.*
|
||||
And they’re *gone.*
|
||||
15. Any advisory boards, committees, etc., having to do with this project will answer to *the Owner.*
|
||||
The Owner reserves the right to disband any such whenever the hell they feel like it. As always, anyone
|
||||
complaining about this is an *asshole.* And they're *gone.*
|
||||
complaining about this is an *asshole.* And they’re *gone.*
|
||||
16. Anyone who does not approve of the objectives, direction, or attitude of this project is
|
||||
free to *get the fuck out* at any time. Bye Felicia!
|
||||
|
||||
|
||||
18
LICENSE.md
18
LICENSE.md
@@ -2,7 +2,7 @@ GNU General Public License
|
||||
==========================
|
||||
|
||||
_Version 2, June 1991_
|
||||
_Copyright © 1989, 1991 Free Software Foundation, Inc.,_
|
||||
_Copyright © 1989, 1991 Free Software Foundation, Inc.,_
|
||||
_51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
@@ -62,13 +62,13 @@ modification follow.
|
||||
|
||||
**0.** This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
under the terms of this General Public License. The “Program”, below,
|
||||
refers to any such program or work, and a “work based on the Program”
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
the term “modification”.) Each licensee is addressed as “you”.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
@@ -237,8 +237,8 @@ be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
specifies a version number of this License which applies to it and “any
|
||||
later version”, you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
@@ -257,7 +257,7 @@ of promoting the sharing and reuse of software generally.
|
||||
**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
@@ -285,7 +285,7 @@ free software which everyone can redistribute and change under these terms.
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
the “copyright” line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
@@ -320,7 +320,7 @@ be called something other than `show w` and `show c`; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
school, if any, to sign a “copyright disclaimer” for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
|
||||
7
Makefile
7
Makefile
@@ -18,14 +18,7 @@
|
||||
all:
|
||||
make -C buildutils all
|
||||
make -C src all
|
||||
make output
|
||||
|
||||
output:
|
||||
mkdir -p output
|
||||
cp src/upiwin output
|
||||
cp scripts/*.py output
|
||||
|
||||
clean:
|
||||
-rm -rf output
|
||||
make -C buildutils clean
|
||||
make -C src clean
|
||||
|
||||
@@ -4,14 +4,12 @@
|
||||
|
||||
This project involves the development of a framework for running self-contained applications in Python
|
||||
on a Raspberry Pi with LCD graphical output and touchscreen input. The ultimate goal is to produce a
|
||||
framework which is flexible enough to serve any number of "appliance" needs, by using different Python
|
||||
framework which is flexible enough to serve any number of “appliance” needs, by using different Python
|
||||
scripts over the same native-code substrate, deployed on an inexpensive embedded platform.
|
||||
|
||||
## Hardware requirements
|
||||
|
||||
- Raspberry Pi 3 with PiTFT touchscreen (Adafruit product ID 2423). See
|
||||
[Building the Hardware to Run UPIWIN](docs/hardware-instructions.md) to assemble the hardware, and
|
||||
[Preparing the Operating System for UPIWIN](docs/os-instructions.md) for the system software.
|
||||
- Raspberry Pi 3 with PiTFT touchscreen (Adafruit product ID 2423)
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
@@ -1,37 +0,0 @@
|
||||
# Building the Hardware to Run UPIWIN
|
||||
|
||||
UPIWIN is designed for a hardware configuration with a miniature capacitive-touch touchscreen mounted on a
|
||||
Raspberry Pi computer, making for a compact assembly. This document describes how to assemble one.
|
||||
|
||||
## Parts List
|
||||
|
||||
- Raspberry Pi 3 Model B+ computer
|
||||
- PiTFT Plus 320x240 2.8" Capacitive Touch Touchscreen (Adafruit part number 2423)
|
||||
- Pi Model B+/Pi 2 Case Base - Clear (Adafruit part number 2253)
|
||||
- PiTFT Faceplate and Buttons (Adafruit part number 2807)
|
||||
- 2x Brass M2.5 Standoffs (Adafruit part number 2337)
|
||||
- Additional Raspberry Pi hardware (MicroSD card, power supply, keyboard and display connections)
|
||||
|
||||
## Assembly Instructions
|
||||
|
||||
1. On the back of the PiTFT, solder closed the jumper pads labeled "#18". This will allow the use of GPIO line 18 as
|
||||
a PWM backlight control.
|
||||
2. Attach two standoffs to the underside of the PiTFT (pointing in the same direction as the 40-pin connector), on the
|
||||
right side (the side with the pushbutton switches). Secure with the included nuts.
|
||||
3. Attach the PiTFT to the Raspberry Pi, pressing down hard to seat the 40-pin connector atop the Pi's GPIO pins.
|
||||
4. Seat the completed assembly inside the case base, lining up the holes for the USB and Ethernet ports on the left
|
||||
side. Press down to snap the latches into place.
|
||||
5. Holding the faceplate upside down, insert four plastic buttons into the four small rectangular slots. Invert the
|
||||
case assembly and snap it together with the faceplate, lining the buttons up with the pushbutton switches.
|
||||
6. Connect the Pi to keyboard, display, power, and network (if necessary). Insert the MicroSD card with the operating
|
||||
system installed, and boot as usual.
|
||||
|
||||
## Illustrations
|
||||
|
||||
### Completed subassembly
|
||||
|
||||

|
||||
|
||||
### Completed Assembly
|
||||
|
||||

|
||||
@@ -1,64 +0,0 @@
|
||||
# Preparing the Operating System for UPIWIN
|
||||
|
||||
The Raspberry Pi OS needs to be configured with the appropriate device tree support, software, and libraries to compile
|
||||
and run UPIWIN successfully. This document describes the process.
|
||||
|
||||
## Preparing the Operating System
|
||||
|
||||
1. Download an image of Raspberry Pi OS from
|
||||
[the Raspberry Pi Foundation](https://downloads.raspberrypi.org/raspios_armhf/images/). The most-recent version of
|
||||
Raspberry Pi OS that is known to work with the PiTFT is
|
||||
[the December 4, 2020 image](https://downloads.raspberrypi.org/raspios_armhf/images/raspios_armhf-2020-12-04/).
|
||||
2. Unzip the `.zip` file for your image and write th included `.img` file to a fresh MicroSD card using one of the
|
||||
methods described on [this page](https://www.raspberrypi.org/documentation/computers/getting-started.html).
|
||||
3. Connect your UPIWIN-compatible Raspberry Pi (RPi 3B+ with PiTFT) to power, HDMI display, keyboard, and network
|
||||
(if necessary). Insert the freshly-written MicroSD card into the Pi.
|
||||
4. Turn on the Pi, boot into Raspberry Pi OS, and set it up. Make sure to get updates installed.
|
||||
|
||||
## Installing the PiTFT Drivers
|
||||
|
||||
1. In a terminal window, enter the command `sudo -i` to get a root command prompt.
|
||||
2. Enter the following commands:
|
||||
|
||||
pip3 install --upgrade adafruit-python-shell click
|
||||
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
|
||||
cd Raspberry-Pi-Installer-Scripts
|
||||
python3 adafruit-pitft.py --display=28c --rotation=90
|
||||
|
||||
3. Answer "N" to the questions about the console appearing on the PiTFT display and mirroring HDMI to the PiTFT
|
||||
display.
|
||||
4. Reboot the Pi when prompted.
|
||||
|
||||
## Installing Libraries for UPIWIN
|
||||
|
||||
1. Use `sudo -i` to get a root command prompt.
|
||||
2. Execute the command to install packaged libraries:
|
||||
|
||||
apt install python3-dev libfreetype6-dev libpng-dev ttf-mscorefonts-installer
|
||||
|
||||
3. Execute the commands to install the BCM2835 library:
|
||||
|
||||
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz
|
||||
tar xzvf bcm2835-1.68.tar.gz
|
||||
cd bcm2835-1.68
|
||||
./configure
|
||||
make
|
||||
make check
|
||||
make install
|
||||
|
||||
4. Copy the Arial font to where the code expects to see it:
|
||||
|
||||
mkdir /usr/local/share/fonts/truetype
|
||||
cp /usr/share/fonts/truetype/msttcorefonts/arial.ttf /usr/local/share/fonts/truetype
|
||||
|
||||
## Building the Source
|
||||
|
||||
After cloning the repository for UPIWIN, enter the following commands:
|
||||
|
||||
cd upiwin
|
||||
make
|
||||
|
||||
The resulting executable and demo scripts will be placed into the `output` directory.
|
||||
|
||||
To execute, change to the `output` directory and enter the command `sudo ./upiwin` followed by the name of the script
|
||||
to be run. For example, `sudo ./upiwin demo1.py`.
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB |
14
src/Makefile
14
src/Makefile
@@ -17,12 +17,12 @@
|
||||
# ------------------------------------------------------------------------
|
||||
BUILDUTILS=../buildutils
|
||||
RESOURCES=../resources
|
||||
SPLASHSCREEN=splash-erbosoft.png
|
||||
SPLASHSCREEN=splash-vmwcblk.png
|
||||
|
||||
OBJS=main.o sysinput.o ep_init.o ep_upiwin.o ep_backlight.o ep_msg.o ep_graphics.o ep_devctxt.o ep_bitmap.o \
|
||||
ep_upiwin_tmp.o ep_util.o fbinit.o rect.o gfxobj.o devctxt.o dc_screen.o fontengine.o \
|
||||
resources.o bitmap.o stockobj.o fbprimitive.o log.o gpio.o msg_queue.o time_func.o config.o \
|
||||
i_freehand.o i_line.o i_rect.o i_fillrect.o i_undo.o i_clear.o splash.o sysresources.o
|
||||
bitmap.o stockobj.o fbprimitive.o log.o gpio.o msg_queue.o time_func.o config.o \
|
||||
i_freehand.o i_line.o i_rect.o i_fillrect.o i_undo.o i_clear.o splash.o
|
||||
LIBS=-lpython3.7m -lcrypt -lfreetype -lbcm2835 -lpthread -ldl -lutil -lm
|
||||
CFLAGS=-I/usr/include/python3.7m -I/usr/include/freetype2 -I/usr/include/libpng16 \
|
||||
-Wall -Werror -fstack-protector -fwrapv -fno-PIE -g -O3 -DDEBUG_ASSERT
|
||||
@@ -37,14 +37,6 @@ upiwin: $(OBJS)
|
||||
.c.o:
|
||||
gcc -c $(CFLAGS) $<
|
||||
|
||||
sysresources.o: sysresources.zip
|
||||
objcopy -I binary -O elf32-littlearm -B arm --rename-section \
|
||||
.data=.rodata,alloc,load,readonly,data,contents sysresources.zip sysresources.o
|
||||
|
||||
sysresources.zip: splash.bin
|
||||
-rm sysresources.zip
|
||||
zip sysresources.zip splash.bin
|
||||
|
||||
%.o: %.bin
|
||||
objcopy -I binary -O elf32-littlearm -B arm --rename-section \
|
||||
.data=.rodata,alloc,load,readonly,data,contents $< $@
|
||||
|
||||
@@ -41,7 +41,7 @@ inline static COLORREF COLORREF_from_native(UINT16 cr)
|
||||
return (COLORREF)(((tmp << 19) & 0xF80000) | ((tmp << 5) & 0xFC00) | ((tmp >> 8) & 0xF800));
|
||||
}
|
||||
|
||||
inline static UINT16 apply_rop2(INT32 op, UINT16 disp, UINT16 pen)
|
||||
static inline UINT16 apply_rop2(INT32 op, UINT16 disp, UINT16 pen)
|
||||
{
|
||||
switch (op)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "gfxobj.h"
|
||||
#include "bitmap.h"
|
||||
|
||||
#define DCTXT_SIG_WORD 0x78744344 /* "DCtx" */
|
||||
#define DCTXT_SIG_WORD 0x78744344 /* "DCtx */
|
||||
|
||||
/* Raster operation codes */
|
||||
#define R2_BLACK 1
|
||||
|
||||
@@ -87,3 +87,4 @@ PyObject *Epython_post_quit_message(PyObject *self, PyObject *args)
|
||||
Mq_post1(Sys_Queue, 0, WM_QUIT, exitcode);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "config.h"
|
||||
#include "gpio.h"
|
||||
#include "fbinit.h"
|
||||
#include "resources.h"
|
||||
#include "fontengine.h"
|
||||
#include "time_func.h"
|
||||
#include "ep_init.h"
|
||||
@@ -42,8 +41,6 @@ int main(int argc, char *argv[])
|
||||
return EXIT_FAILURE;
|
||||
else if (hr != S_OK)
|
||||
return EXIT_SUCCESS;
|
||||
if (FAILED(Rsrc_setup()))
|
||||
return EXIT_FAILURE;
|
||||
if (FAILED(Fb_setup()))
|
||||
return EXIT_FAILURE;
|
||||
if (FAILED(FontEng_setup()))
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
/*
|
||||
* UPIWIN - Micro Pi Windowing Framework Kernel
|
||||
* Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include <zip.h>
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "resources.h"
|
||||
|
||||
/* conversion table from zip error codes to our HRESULT values */
|
||||
static const struct tagCONVERSIONTABLE {
|
||||
int zip_err_code;
|
||||
HRESULT sys_err_code;
|
||||
} conversion_table[] = {
|
||||
{ ZIP_ER_OK, S_OK },
|
||||
{ ZIP_ER_SEEK, STG_E_SEEKERROR },
|
||||
{ ZIP_ER_READ, STG_E_READFAULT },
|
||||
{ ZIP_ER_WRITE, STG_E_WRITEFAULT },
|
||||
{ ZIP_ER_NOENT, STG_E_FILENOTFOUND },
|
||||
{ ZIP_ER_MEMORY, E_OUTOFMEMORY },
|
||||
{ ZIP_ER_INVAL, E_INVALIDARG },
|
||||
{ ZIP_ER_INTERNAL, E_UNEXPECTED },
|
||||
{ -1, 0 }
|
||||
}
|
||||
|
||||
/* references to system resource data in zip format */
|
||||
extern uint8_t _binary_sysresources_zip_start[];
|
||||
extern uint8_t _binary_sysresources_zip_end;
|
||||
extern uint8_t _binary_sysresources_zip_size;
|
||||
|
||||
static zip_t *sysresource = NULL; /* system resource file */
|
||||
|
||||
static HRESULT ziperror_to_hresult(zip_error_t *errinfo)
|
||||
{
|
||||
register int i;
|
||||
|
||||
for (i = 0; conversion_table[i].zip_err_code >= 0; i++)
|
||||
if (conversion_table[i].zip_err_code == errinfo->zip_err)
|
||||
return conversion_table[i].sys_err_code;
|
||||
return MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, errinfo->zip_err);
|
||||
}
|
||||
|
||||
static void rsrc_cleanup(void)
|
||||
{
|
||||
zip_close(sysresource);
|
||||
sysresource = NULL;
|
||||
}
|
||||
|
||||
HRESULT Rsrc_setup(void)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
zip_source_t *syssource;
|
||||
zip_error_t errinfo;
|
||||
|
||||
Log(LDEBUG, "system resource length = %u", (UINT)(&_binary_sysresources_zip_size));
|
||||
zip_error_init(&errinfo)
|
||||
syssource = zip_source_buffer_create(_binary_sysresources_zip_start, (zip_uint64_t)(&_binary_sysresources_zip_size),
|
||||
0, &errinfo);
|
||||
if (!syssource)
|
||||
{
|
||||
hr = ziperror_to_hresult(&errinfo);
|
||||
goto error_0;
|
||||
}
|
||||
|
||||
sysresource = zip_open_from_source(syssource, ZIP_RDONLY, &errinfo);
|
||||
if (!sysresource)
|
||||
{
|
||||
hr = ziperror_to_hresult(&errinfo);
|
||||
goto error_1;
|
||||
}
|
||||
|
||||
hr = Config_exitfunc(rsrc_cleanup);
|
||||
if (FAILED(hr))
|
||||
rsrc_cleanup();
|
||||
return hr;
|
||||
|
||||
error_1:
|
||||
zip_source_free(syssource);
|
||||
error_0:
|
||||
zip_error_fini(&errinfo);
|
||||
return hr;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* UPIWIN - Micro Pi Windowing Framework Kernel
|
||||
* Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef __RESOURCES_H_INCLUDED
|
||||
#define __RESOURCES_H_INCLUDED
|
||||
|
||||
#include "wintype.h"
|
||||
|
||||
typedef HANDLE HRESFILE; /* handle to resource file */
|
||||
typedef HANDLE HRSRC; /* handle to resource */
|
||||
|
||||
|
||||
|
||||
extern HRESULT Rsrc_setup(void);
|
||||
|
||||
#endif /* __RESOURCES_H_INCLUDED */
|
||||
48
src/scode.h
48
src/scode.h
@@ -47,7 +47,6 @@
|
||||
#define FACILITY_ITF 4
|
||||
#define FACILITY_UNIX 5
|
||||
#define FACILITY_UPIWIN 6
|
||||
#define FACILITY_ZIP 78
|
||||
|
||||
#define SUCCEEDED(s) (((s) & SEVERITY_ERROR) == 0)
|
||||
#define FAILED(s) (((s) & SEVERITY_ERROR) != 0)
|
||||
@@ -83,55 +82,8 @@
|
||||
#define E_ILLEGAL_METHOD_CALL SCODE_CAST(0x8000000E) /* illegal method call */
|
||||
#define E_UNEXPECTED SCODE_CAST(0x8000FFFF) /* unexpected error */
|
||||
|
||||
/* Storage error codes */
|
||||
#define STG_E_INVALIDFUNCTION SCODE_CAST(0x80030001) /* invalid function */
|
||||
#define STG_E_FILENOTFOUND SCODE_CAST(0x80030002) /* file not found */
|
||||
#define STG_E_PATHNOTFOUND SCODE_CAST(0x80030003) /* path not found */
|
||||
#define STG_E_TOOMANYOPENFILES SCODE_CAST(0x80030004) /* too many open files */
|
||||
#define STG_E_ACCESSDENIED SCODE_CAST(0x80030005) /* access denied */
|
||||
#define STG_E_INVALIDHANDLE SCODE_CAST(0x80030006) /* invalid handle */
|
||||
#define STG_E_INSUFFICIENTMEMORY SCODE_CAST(0x80030008) /* insufficient memory */
|
||||
#define STG_E_INVALIDPOINTER SCODE_CAST(0x80030009) /* invalid pointer */
|
||||
#define STG_E_NOMOREFILES SCODE_CAST(0x80030012) /* no more files to return */
|
||||
#define STG_E_DISKISWRITEPROTECTED SCODE_CAST(0x80030013) /* disk is write protected */
|
||||
#define STG_E_SEEKERROR SCODE_CAST(0x80030019) /* error in seek operation */
|
||||
#define STG_E_WRITEFAULT SCODE_CAST(0x8003001D) /* error in write operation */
|
||||
#define STG_E_READFAULT SCODE_CAST(0x8003001E) /* error in read operation */
|
||||
#define STG_E_SHAREVIOLATION SCODE_CAST(0x80030020) /* sharing violation */
|
||||
#define STG_E_LOCKVIOLATION SCODE_CAST(0x80030021) /* lock violation */
|
||||
#define STG_E_INVALIDPARAMETER SCODE_CAST(0x80030057) /* invalid parameter */
|
||||
#define STG_E_MEDIUMFULL SCODE_CAST(0x80030070) /* insufficient disk space */
|
||||
#define STG_E_UNKNOWN SCODE_CAST(0x800300FD) /* unexpected error */
|
||||
|
||||
/* UPIWIN-specific errorcodes */
|
||||
#define UPIWIN_E_INVALIDSCRIPT SCODE_CAST(0x80060000) /* invalid script file */
|
||||
#define UPIWIN_E_NOSCRIPT SCODE_CAST(0x80060001) /* no script specified */
|
||||
|
||||
/* libzip error codes */
|
||||
#define ZIP_E_MULTIDISK MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 1) /* multidisk not supported */
|
||||
#define ZIP_E_RENAME MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 2) /* rename temp file failed */
|
||||
#define ZIP_E_CLOSE MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 3) /* close failed */
|
||||
#define ZIP_E_CRC MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 7) /* CRC error */
|
||||
#define ZIP_E_WASCLOSED MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 8) /* zip file was closed */
|
||||
#define ZIP_E_EXISTS MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 10) /* file already exists */
|
||||
#define ZIP_E_OPEN MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 11) /* unable to open */
|
||||
#define ZIP_E_TMPOPEN MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 12) /* unable to open temp file */
|
||||
#define ZIP_E_ZLIB MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 13) /* Zlib error */
|
||||
#define ZIP_E_CHANGED MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 15) /* entry was changed */
|
||||
#define ZIP_E_NOCMP MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 16) /* compression method unsupported */
|
||||
#define ZIP_E_EOF MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 17) /* hit end of file */
|
||||
#define ZIP_E_NOTZIP MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 19) /* not a ZIP file */
|
||||
#define ZIP_E_INCONSISTENT MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 21) /* inconsistent archive */
|
||||
#define ZIP_E_REMOVE MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 22) /* remove failed */
|
||||
#define ZIP_E_DELETED MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 23) /* entry deleted */
|
||||
#define ZIP_E_NOCRYPT MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 24) /* encryption not supported */
|
||||
#define ZIP_E_RDONLY MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 25) /* read-only archive */
|
||||
#define ZIP_E_NOPASSWD MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 26) /* no password */
|
||||
#define ZIP_E_BADPASSWD MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 27) /* wrong password */
|
||||
#define ZIP_E_NOTSUPPORTED MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 28) /* operation not supported */
|
||||
#define ZIP_E_BUSY MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 29) /* still in use */
|
||||
#define ZIP_E_TELL MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 30) /* tell failed */
|
||||
#define ZIP_E_CMPDATA MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 31) /* compressed data invalid */
|
||||
#define ZIP_E_CANCELLED MAKE_SCODE(SEVERITY_ERROR, FACILITY_ZIP, 32) /* operation canceled */
|
||||
|
||||
#endif /* __SCODE_H_INCLUDED */
|
||||
|
||||
@@ -150,11 +150,12 @@ static BOOL poll_touchscreen(void)
|
||||
break;
|
||||
|
||||
case EV_ABS:
|
||||
/* The screen driver thinks the screen is horizontal with origin at upper left and max at lower right. */
|
||||
/* Note that the touchscreen driver assumes the screen is "vertical," so swap the x and y axes */
|
||||
/* Also it thinks origin is lower left with up = +y */
|
||||
if (buffer[i].code == ABS_X)
|
||||
touch_x = buffer[i].value;
|
||||
touch_y = Fb_Info->height - buffer[i].value;
|
||||
else if (buffer[i].code == ABS_Y)
|
||||
touch_y = buffer[i].value;
|
||||
touch_x = buffer[i].value;
|
||||
break;
|
||||
|
||||
case EV_KEY:
|
||||
|
||||
Reference in New Issue
Block a user