Initial commit

master
David Holland 2019-03-25 00:06:49 +01:00
commit 09f9555cc8
38 changed files with 10491 additions and 0 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
Builds/Android/*
Builds/iOS/*
Builds/MacOSX/*
Builds/VisualStudio2017/*
Builds/LinuxMakefile/*
Builds/CLion/*
Builds/MSVC/*
!Builds/MSVC/Makefile
Documentation/doc/*
!Documentation/doc/Documentation.html
Documentation/JUCE/doc
Documentation/JUCE/build
.vs
.TMP
.DS_Store
.old
.bak

63
Builds/MSVC/Makefile Normal file
View File

@ -0,0 +1,63 @@
PROJECT_NAME =CommuniCare_Manager
DEBUG_POSTFIX =_debug
!IFNDEF DUSTEDIT_PATH
DUSTEDIT_PATH =$(BASE)/../../DustEdit
!ENDIF
!IFNDEF MSVC_PATH
MSVC_PATH =$(DUSTEDIT_PATH)/windows/msvc2019
!ENDIF
!IFNDEF WIN_SDK_PATH
WIN_SDK_PATH =$(DUSTEDIT_PATH)/windows/sdk_10
!ENDIF
!IFNDEF JUCE_PATH
JUCE_PATH =$(DUSTEDIT_PATH)/JUCE
!ENDIF
BASE =../..
SOURCE_DIR =$(BASE)/Source
JUCE_LIB_DIR =$(BASE)/JuceLibraryCode
RESOURCE_DIR =$(BASE)/Resources
BUILD_DIR =build
CPP_14 =/std:c++14
CPP_17 =/std:c++17
MAX_OPTIMIZE_SIZE =/O1
MAX_OPTIMIZE_SPEED =/O2
OPTIMIZE_NONE =/Od
ENABLE_SYSINTERNAL_FUNCS =/Oi
MSVC_INCLUDES =/I $(MSVC_PATH)/include/
WIN_SDK_INCLUDES =/I $(WIN_SDK_PATH)/include/10.0.17763.0/cppwinrt/ /I $(WIN_SDK_PATH)/include/10.0.17763.0/shared/ /I $(WIN_SDK_PATH)/include/10.0.17763.0/ucrt/ /I $(WIN_SDK_PATH)/include/10.0.17763.0/um/ /I $(WIN_SDK_PATH)/include/10.0.17763.0/winrt/
JUCE_INCLUDE_DIR =/I $(JUCE_PATH)/modules
APP_INCLUDE_DIR =/I $(JUCE_LIB_DIR)
GENERAL_INCLUDES =$(MSVC_INCLUDES) $(WIN_SDK_INCLUDES) $(JUCE_INCLUDE_DIR) $(APP_INCLUDE_DIR)
MSVC_LIBS =/LIBPATH:$(MSVC_PATH)/lib/x64/
WIN_SDK_LIBS =/LIBPATH:$(WIN_SDK_PATH)/lib/10.0.17763.0/um/x64/ /LIBPATH:$(WIN_SDK_PATH)/lib/10.0.17763.0/ucrt/x64/
GENERAL_LIBS =$(MSVC_LIBS) $(WIN_SDK_LIBS)
DEBUG_BUILD_D =/D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "_WINDOWS" /D "DEBUG" /D "_DEBUG" /D "JUCE_APP_VERSION=1.12.0" /D "JUCE_APP_VERSION_HEX=0x10c00" /D "JucePlugin_Build_VST=0" /D "JucePlugin_Build_VST3=0" /D "JucePlugin_Build_AU=0" /D "JucePlugin_Build_AUv3=0" /D "JucePlugin_Build_RTAS=0" /D "JucePlugin_Build_AAX=0" /D "JucePlugin_Build_Standalone=0"
DEBUG_BUILD_ADDITIONAL =/MP /GS /W4 /Zc:wchar_t /Zi /Gm- /Od /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /GR /Gd /utf-8
DEBUG_BUILD =$(DEBUG_BUILD_D) $(DEBUG_BUILD_ADDITIONAL) /EHsc /MDd /FC /diagnostics:classic /nologo
DEBUG_BUILD_LINKER_OPTS =/OUT:"$(BUILD_DIR)/$(PROJECT_NAME)$(DEBUG_POSTFIX).exe" /MANIFEST /NXCOMPAT /PDB:"$(PROJECT_NAME)$(DEBUG_POSTFIX).pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /LARGEADDRESSAWARE /DEBUG /MACHINE:X64 /NODEFAULTLIB:"libcmt.lib" /NODEFAULTLIB:"msvcrt.lib" /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"$(PROJECT_NAME)$(DEBUG_POSTFIX).exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
RELEASE_BUILD_D =/D "_CRT_SECURE_NO_WARNINGS" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "JUCE_APP_VERSION=1.0.0" /D "JUCE_APP_VERSION_HEX=0x10000" /D "JucePlugin_Build_VST=0" /D "JucePlugin_Build_VST3=0" /D "JucePlugin_Build_AU=0" /D "JucePlugin_Build_AUv3=0" /D "JucePlugin_Build_RTAS=0" /D "JucePlugin_Build_AAX=0" /D "JucePlugin_Build_Standalone=0"
RELEASE_BUILD_ADDITIONAL =/MP /GS /GL /W4 /Zc:wchar_t /Zi /Gm- /Ox /Zc:inline /fp:precise /errorReport:prompt /WX- /Zc:forScope /GR /Gd /utf-8
RELEASE_BUILD =$(RELEASE_BUILD_D) $(RELEASE_BUILD_ADDITIONAL) /EHsc /MD /FC /diagnostics:classic /nologo
RELEASE_BUILD_LINKER_OPTS =/OUT:"$(BUILD_DIR)/$(PROJECT_NAME).exe" /MANIFEST /LTCG:incremental /NXCOMPAT /PDB:"$(PROJECT_NAME).pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /LARGEADDRESSAWARE /MACHINE:X64 /OPT:REF /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"$(PROJECT_NAME).exe.intermediate.manifest" /OPT:ICF /ERRORREPORT:PROMPT /NOLOGO /TLBID:1
#JUCE_FILES_ALL =$(JUCE_LIB_DIR)/include_juce_audio_basics.cpp $(JUCE_LIB_DIR)/include_juce_audio_devices.cpp $(JUCE_LIB_DIR)/include_juce_audio_formats.cpp $(JUCE_LIB_DIR)/include_juce_audio_processors.cpp $(JUCE_LIB_DIR)/include_juce_core.cpp $(JUCE_LIB_DIR)/include_juce_cryptography.cpp $(JUCE_LIB_DIR)/include_juce_data_structures.cpp $(JUCE_LIB_DIR)/include_juce_events.cpp $(JUCE_LIB_DIR)/include_juce_graphics.cpp $(JUCE_LIB_DIR)/include_juce_gui_basics.cpp $(JUCE_LIB_DIR)/include_juce_gui_extra.cpp $(JUCE_LIB_DIR)/include_juce_opengl.cpp $(JUCE_LIB_DIR)/include_juce_video.cpp
JUCE_FILES =$(JUCE_LIB_DIR)/include_juce_core.cpp $(JUCE_LIB_DIR)/include_juce_data_structures.cpp $(JUCE_LIB_DIR)/include_juce_events.cpp $(JUCE_LIB_DIR)/include_juce_graphics.cpp $(JUCE_LIB_DIR)/include_juce_gui_basics.cpp $(JUCE_LIB_DIR)/include_juce_gui_extra.cpp
MAIN_FILES =$(SOURCE_DIR)/AddEntryComponent.cpp $(SOURCE_DIR)/AddUserComponent.cpp $(SOURCE_DIR)/ExpandArea.cpp $(SOURCE_DIR)/ExpandEntryArea.cpp $(SOURCE_DIR)/ExpandUserArea.cpp $(SOURCE_DIR)/PostFunctions.cpp $(SOURCE_DIR)/Main.cpp $(JUCE_FILES)
debug: $(MAIN_FILES)
cl $(CPP_14) $(GENERAL_INCLUDES) $(DEBUG_BUILD) $(MAIN_FILES) /link $(GENERAL_LIBS) $(DEBUG_BUILD_LINKER_OPTS)
release: $(MAIN_FILES)
cl $(CPP_14) $(GENERAL_INCLUDES) $(RELEASE_BUILD) $(MAIN_FILES) /link $(GENERAL_LIBS) $(RELEASE_BUILD_LINKER_OPTS)

2494
Documentation/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

2487
Documentation/JUCE/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
SHELL := /bin/bash
ifndef MODULES_DIR
$(error Please specify MODULES_DIR=path/to/juce/modules)
endif
SOURCE_FILES := $(shell find $(MODULES_DIR) -type f -name "juce_*.h" -or -name "juce_*.dox" | sed 's/ /\\ /g')
.PHONEY: clean
doc/index.html: build/juce_modules.dox Doxyfile
doxygen
build/juce_modules.dox: process_source_files.py $(SOURCE_FILES)
rm -rf build
python $< $(MODULES_DIR) build
clean:
rm -rf build doc

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,25 @@
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<!--END TITLEAREA-->
<!-- end header part -->

View File

@ -0,0 +1,168 @@
#!/usr/bin/env python
import os
import shutil
import re
import argparse
def get_curly_brace_scope_end(string, start_pos):
"""Given a string and a starting position of an opening brace, find the
position of the closing brace.
"""
start_pos += 1
string_end = len(string)
bracket_counter = 1
while start_pos < string_end:
if string[start_pos] == "{":
bracket_counter += 1
elif string[start_pos] == "}":
bracket_counter -= 1
if bracket_counter == 0:
return start_pos
start_pos += 1
return -1
def remove_juce_namespaces(source):
"""Return a string of source code with any juce namespaces removed.
"""
namespace_regex = re.compile(r"\s+namespace\s+juce\s*{")
match = namespace_regex.search(source)
while (match is not None):
source = source[:match.start()] + source[match.end():]
end = get_curly_brace_scope_end(source, match.start() - 1)
if end != -1:
source = source[:end] + source[end + 1:]
match = namespace_regex.search(source)
continue
else:
raise ValueError("failed to find the end of the "
+ match.group(1) + " namespace")
return source
def add_doxygen_group(path, group_name):
"""Add a Doxygen group to the file at 'path'.
The addition of juce namespacing code to all of the source files breaks
backwards compatibility by changing the doc URLs, so we need to remove
the namespaces.
"""
filename = os.path.basename(path)
if re.match(r"^juce_.*\.(h|dox)", filename):
with open(path, "r") as f:
content = f.read()
with open(path, "w") as f:
f.write("\r\n/** @weakgroup " + group_name + "\r\n * @{\r\n */\r\n")
f.write(remove_juce_namespaces(content))
f.write("\r\n/** @}*/\r\n")
###############################################################################
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("source_dir",
help="the directory to search for source files")
parser.add_argument("dest_dir",
help="the directory in which to place processed files")
parser.add_argument("--subdirs",
help="if specified, only include these comma separated"
"subdirectories")
args = parser.parse_args()
# Get the list of JUCE modules to include.
if args.subdirs:
juce_modules = args.subdirs.split(",")
else:
juce_modules = []
for item in os.listdir(args.source_dir):
if os.path.isdir(os.path.join(args.source_dir, item)):
juce_modules.append(item)
# Copy the JUCE modules to the temporary directory, and process the source
# files.
module_definitions = []
for module_name in juce_modules:
# Copy the required modules.
original_module_dir = os.path.join(args.source_dir, module_name)
module_path = os.path.join(args.dest_dir, module_name)
shutil.copytree(original_module_dir, module_path)
# Parse the module header to get module information.
module_header = os.path.join(module_path, module_name + ".h")
with open(module_header, "r") as f:
content = f.read()
block_info_result = re.match(r".*BEGIN_JUCE_MODULE_DECLARATION"
"(.*)"
"END_JUCE_MODULE_DECLARATION.*",
content,
re.DOTALL)
detail_lines = []
for line in block_info_result.group(1).split("\n"):
stripped_line = line.strip()
if stripped_line:
result = re.match(r"^.*?description:\s*(.*)$", stripped_line)
if result:
short_description = result.group(1)
else:
detail_lines.append(stripped_line)
# The module header causes problems for Doxygen, so delete it.
os.remove(module_header)
# Create a Doxygen group definition for the module.
module_definiton = []
module_definiton.append("/** @defgroup {n} {n}".format(n=module_name))
module_definiton.append(" {d}".format(d=short_description))
module_definiton.append("")
for line in detail_lines:
module_definiton.append(" - {l}".format(l=line))
module_definiton.append("")
module_definiton.append(" @{")
module_definiton.append("*/")
# Create a list of the directories in the module that we can use as
# subgroups and create the Doxygen group hierarchy string.
dir_contents = os.listdir(module_path)
# Ignore "native" folders as these are excluded by doxygen.
try:
dir_contents.remove("native")
except ValueError:
pass
subdirs = []
for item in dir_contents:
if (os.path.isdir(os.path.join(module_path, item))):
subdirs.append(item)
module_groups = {}
for subdir in subdirs:
subgroup_name = "{n}-{s}".format(n=module_name, s=subdir)
module_groups[subgroup_name] = os.path.join(module_path, subdir)
module_definiton.append("")
module_definiton.append(
"/** @defgroup {tag} {n} */".format(tag=subgroup_name, n=subdir)
)
module_definiton.append("")
module_definiton.append("/** @} */")
module_definitions.append("\r\n".join(module_definiton))
# Put the top level files into the main group.
for filename in (set(dir_contents) - set(subdirs)):
add_doxygen_group(os.path.join(module_path, filename), module_name)
# Put subdirectory files into their respective groups.
for group_name in module_groups:
for dirpath, dirnames, filenames in os.walk(module_groups[group_name]):
for filename in filenames:
filepath = os.path.join(dirpath, filename)
add_doxygen_group(filepath, group_name)
# Create an extra header file containing the module hierarchy.
with open(os.path.join(args.dest_dir, "juce_modules.dox"), "w") as f:
f.write("\r\n\r\n".join(module_definitions))

10
Documentation/Makefile Normal file
View File

@ -0,0 +1,10 @@
SHELL := /bin/bash
doc/index.html: Doxyfile JUCE/doc/juce.tag
doxygen
JUCE/doc/juce.tag:
$(error Please compile the JUCE documentation first!)
clean:
rm -rf doc/html

File diff suppressed because one or more lines are too long

25
Documentation/header.html Normal file
View File

@ -0,0 +1,25 @@
<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<!--END TITLEAREA-->
<!-- end header part -->

70
EULA.txt Normal file
View File

@ -0,0 +1,70 @@
CommuniCare e.V. Manager
Copyright (c) 2018 DustVoice
*** END USER LICENSE AGREEMENT ***
IMPORTANT: PLEASE READ THIS LICENSE CAREFULLY BEFORE USING THIS SOFTWARE.
1. LICENSE
By receiving, opening the file package, and/or using CommuniCare e.V. Manager("Software") containing this software, you agree that this End User User License Agreement(EULA) is a legally binding and valid contract and agree to be bound by it. You agree to abide by the intellectual property laws and all of the terms and conditions of this Agreement.
Unless you have a different license agreement signed by DustVoice your use of CommuniCare e.V. Manager indicates your acceptance of this license agreement and warranty.
Subject to the terms of this Agreement, DustVoice grants to you a limited, non-exclusive, non-transferable license, without right to sub-license, to use CommuniCare e.V. Manager in accordance with this Agreement and any other written agreement with DustVoice. DustVoice does not transfer the title of CommuniCare e.V. Manager to you; the license granted to you is not a sale. This agreement is a binding legal agreement between DustVoice and the purchasers or users of CommuniCare e.V. Manager.
If you do not agree to be bound by this agreement, remove CommuniCare e.V. Manager from your computer now and, if applicable, promptly return to DustVoice by mail any copies of CommuniCare e.V. Manager and related documentation and packaging in your possession.
2. DISTRIBUTION
CommuniCare e.V. Manager and the license herein granted shall not be copied, shared, distributed, re-sold, offered for re-sale, transferred or sub-licensed in whole or in part except that you may make one copy for archive purposes only. For information about redistribution of CommuniCare e.V. Manager contact DustVoice.
3. USER AGREEMENT
3.1 Use
Your license to use CommuniCare e.V. Manager is limited to the number of licenses purchased by you. You shall not allow others to use, copy or evaluate copies of CommuniCare e.V. Manager.
3.2 Use Restrictions
You shall use CommuniCare e.V. Manager in compliance with all applicable laws and not for any unlawful purpose. Without limiting the foregoing, use, display or distribution of CommuniCare e.V. Manager together with material that is pornographic, racist, vulgar, obscene, defamatory, libelous, abusive, promoting hatred, discriminating or displaying prejudice based on religion, ethnic heritage, race, sexual orientation or age is strictly prohibited.
Each licensed copy of CommuniCare e.V. Manager may be used on one single computer location by one user. Use of CommuniCare e.V. Manager means that you have loaded, installed, or run CommuniCare e.V. Manager on a computer or similar device. If you install CommuniCare e.V. Manager onto a multi-user platform, server or network, each and every individual user of CommuniCare e.V. Manager must be licensed separately.
You may make one copy of CommuniCare e.V. Manager for backup purposes, providing you only have one copy installed on one computer being used by one person. Other users may not use your copy of CommuniCare e.V. Manager . The assignment, sublicense, networking, sale, or distribution of copies of CommuniCare e.V. Manager are strictly forbidden without the prior written consent of DustVoice. It is a violation of this agreement to assign, sell, share, loan, rent, lease, borrow, network or transfer the use of CommuniCare e.V. Manager. If any person other than yourself uses CommuniCare e.V. Manager registered in your name, regardless of whether it is at the same time or different times, then this agreement is being violated and you are responsible for that violation!
3.3 Copyright Restriction
This Software contains copyrighted material, trade secrets and other proprietary material. You shall not, and shall not attempt to, modify, reverse engineer, disassemble or decompile CommuniCare e.V. Manager. Nor can you create any derivative works or other works that are based upon or derived from CommuniCare e.V. Manager in whole or in part.
DustVoice's name, logo and graphics file that represents CommuniCare e.V. Manager shall not be used in any way to promote products developed with CommuniCare e.V. Manager . DustVoice retains sole and exclusive ownership of all right, title and interest in and to CommuniCare e.V. Manager and all Intellectual Property rights relating thereto.
Copyright law and international copyright treaty provisions protect all parts of CommuniCare e.V. Manager, products and services. No program, code, part, image, audio sample, or text may be copied or used in any way by the user except as intended within the bounds of the single user program. All rights not expressly granted hereunder are reserved for DustVoice.
3.4 Limitation of Responsibility
You will indemnify, hold harmless, and defend DustVoice , its employees, agents and distributors against any and all claims, proceedings, demand and costs resulting from or in any way connected with your use of DustVoice's Software.
In no event (including, without limitation, in the event of negligence) will DustVoice , its employees, agents or distributors be liable for any consequential, incidental, indirect, special or punitive damages whatsoever (including, without limitation, damages for loss of profits, loss of use, business interruption, loss of information or data, or pecuniary loss), in connection with or arising out of or related to this Agreement, CommuniCare e.V. Manager or the use or inability to use CommuniCare e.V. Manager or the furnishing, performance or use of any other matters hereunder whether based upon contract, tort or any other theory including negligence.
DustVoice's entire liability, without exception, is limited to the customers' reimbursement of the purchase price of the Software (maximum being the lesser of the amount paid by you and the suggested retail price as listed by DustVoice ) in exchange for the return of the product, all copies, registration papers and manuals, and all materials that constitute a transfer of license from the customer back to DustVoice.
3.5 Warranties
Except as expressly stated in writing, DustVoice makes no representation or warranties in respect of this Software and expressly excludes all other warranties, expressed or implied, oral or written, including, without limitation, any implied warranties of merchantable quality or fitness for a particular purpose.
3.6 Governing Law
This Agreement shall be governed by the law of the Germany applicable therein. You hereby irrevocably attorn and submit to the non-exclusive jurisdiction of the courts of Germany therefrom. If any provision shall be considered unlawful, void or otherwise unenforceable, then that provision shall be deemed severable from this License and not affect the validity and enforceability of any other provisions.
3.7 Termination
Any failure to comply with the terms and conditions of this Agreement will result in automatic and immediate termination of this license. Upon termination of this license granted herein for any reason, you agree to immediately cease use of CommuniCare e.V. Manager and destroy all copies of CommuniCare e.V. Manager supplied under this Agreement. The financial obligations incurred by you shall survive the expiration or termination of this license.
4. DISCLAIMER OF WARRANTY
THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OR MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. THIS DISCLAIMER CONCERNS ALL FILES GENERATED AND EDITED BY CommuniCare e.V. Manager AS WELL.
5. CONSENT OF USE OF DATA
You agree that DustVoice may collect and use information gathered in any manner as part of the product support services provided to you, if any, related to CommuniCare e.V. Manager.DustVoice may also use this information to provide notices to you which may be of use or interest to you

185
JuceLibraryCode/AppConfig.h Normal file
View File

@ -0,0 +1,185 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
There's a section below where you can add your own custom code safely, and the
Projucer will preserve the contents of that block, but the best way to change
any of these definitions is by using the Projucer's project settings.
Any commented-out settings will assume their default values.
*/
#pragma once
//==============================================================================
// [BEGIN_USER_CODE_SECTION]
// (You can add your own code in this section, and the Projucer will not overwrite it)
#include <iostream>
// #define JUCE_TITLE_BAR
#define USE_LIGHT_COLORSCHEME
#if !DONT_SET_USING_STD_NAMESPACE
using namespace std;
#endif
// [END_USER_CODE_SECTION]
/*
==============================================================================
In accordance with the terms of the JUCE 5 End-Use License Agreement, the
JUCE Code in SECTION A cannot be removed, changed or otherwise rendered
ineffective unless you have a JUCE Indie or Pro license, or are using JUCE
under the GPL v3 license.
End User License Agreement: www.juce.com/juce-5-licence
==============================================================================
*/
// BEGIN SECTION A
#ifndef JUCE_DISPLAY_SPLASH_SCREEN
#define JUCE_DISPLAY_SPLASH_SCREEN 1
#endif
#ifndef JUCE_REPORT_APP_USAGE
#define JUCE_REPORT_APP_USAGE 1
#endif
// END SECTION A
#define JUCE_USE_DARK_SPLASH_SCREEN 1
//==============================================================================
#define JUCE_MODULE_AVAILABLE_juce_core 1
#define JUCE_MODULE_AVAILABLE_juce_data_structures 1
#define JUCE_MODULE_AVAILABLE_juce_events 1
#define JUCE_MODULE_AVAILABLE_juce_graphics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_basics 1
#define JUCE_MODULE_AVAILABLE_juce_gui_extra 1
#define JUCE_MODULE_AVAILABLE_juce_opengl 1
#define JUCE_GLOBAL_MODULE_SETTINGS_INCLUDED 1
//==============================================================================
// juce_core flags:
#ifndef JUCE_FORCE_DEBUG
//#define JUCE_FORCE_DEBUG 0
#endif
#ifndef JUCE_LOG_ASSERTIONS
//#define JUCE_LOG_ASSERTIONS 0
#endif
#ifndef JUCE_CHECK_MEMORY_LEAKS
//#define JUCE_CHECK_MEMORY_LEAKS 1
#endif
#ifndef JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
//#define JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES 0
#endif
#ifndef JUCE_INCLUDE_ZLIB_CODE
//#define JUCE_INCLUDE_ZLIB_CODE 1
#endif
#ifndef JUCE_USE_CURL
//#define JUCE_USE_CURL 0
#endif
#ifndef JUCE_LOAD_CURL_SYMBOLS_LAZILY
//#define JUCE_LOAD_CURL_SYMBOLS_LAZILY 0
#endif
#ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS
//#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1
#endif
#ifndef JUCE_ALLOW_STATIC_NULL_VARIABLES
//#define JUCE_ALLOW_STATIC_NULL_VARIABLES 0
#endif
#ifndef JUCE_STRICT_REFCOUNTEDPOINTER
#define JUCE_STRICT_REFCOUNTEDPOINTER 1
#endif
//==============================================================================
// juce_events flags:
#ifndef JUCE_EXECUTE_APP_SUSPEND_ON_IOS_BACKGROUND_TASK
//#define JUCE_EXECUTE_APP_SUSPEND_ON_IOS_BACKGROUND_TASK 0
#endif
//==============================================================================
// juce_graphics flags:
#ifndef JUCE_USE_COREIMAGE_LOADER
//#define JUCE_USE_COREIMAGE_LOADER 1
#endif
#ifndef JUCE_USE_DIRECTWRITE
//#define JUCE_USE_DIRECTWRITE 1
#endif
#ifndef JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING
//#define JUCE_DISABLE_COREGRAPHICS_FONT_SMOOTHING 0
#endif
//==============================================================================
// juce_gui_basics flags:
#ifndef JUCE_ENABLE_REPAINT_DEBUGGING
//#define JUCE_ENABLE_REPAINT_DEBUGGING 0
#endif
#ifndef JUCE_USE_XRANDR
//#define JUCE_USE_XRANDR 1
#endif
#ifndef JUCE_USE_XINERAMA
//#define JUCE_USE_XINERAMA 1
#endif
#ifndef JUCE_USE_XSHM
//#define JUCE_USE_XSHM 1
#endif
#ifndef JUCE_USE_XRENDER
//#define JUCE_USE_XRENDER 0
#endif
#ifndef JUCE_USE_XCURSOR
//#define JUCE_USE_XCURSOR 1
#endif
#ifndef JUCE_WIN_PER_MONITOR_DPI_AWARE
//#define JUCE_WIN_PER_MONITOR_DPI_AWARE 1
#endif
//==============================================================================
// juce_gui_extra flags:
#ifndef JUCE_WEB_BROWSER
//#define JUCE_WEB_BROWSER 1
#endif
#ifndef JUCE_ENABLE_LIVE_CONSTANT_EDITOR
//#define JUCE_ENABLE_LIVE_CONSTANT_EDITOR 0
#endif
//==============================================================================
#ifndef JUCE_STANDALONE_APPLICATION
#if defined(JucePlugin_Name) && defined(JucePlugin_Build_Standalone)
#define JUCE_STANDALONE_APPLICATION JucePlugin_Build_Standalone
#else
#define JUCE_STANDALONE_APPLICATION 1
#endif
#endif

View File

@ -0,0 +1,40 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
This is the header file that your files should include in order to get all the
JUCE library headers. You should avoid including the JUCE headers directly in
your own source files, because that wouldn't pick up the correct configuration
options for your app.
*/
#pragma once
#include "AppConfig.h"
#include <juce_core/juce_core.h>
#include <juce_data_structures/juce_data_structures.h>
#include <juce_events/juce_events.h>
#include <juce_graphics/juce_graphics.h>
#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_gui_extra/juce_gui_extra.h>
#include <juce_opengl/juce_opengl.h>
#if ! DONT_SET_USING_JUCE_NAMESPACE
// If your code uses a lot of JUCE classes, then this will obviously save you
// a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE.
using namespace juce;
#endif
#if ! JUCE_DONT_DECLARE_PROJECTINFO
namespace ProjectInfo
{
const char* const projectName = "CommuniCare_Client";
const char* const companyName = "";
const char* const versionString = "1.0.0";
const int versionNumber = 0x10000;
}
#endif

View File

@ -0,0 +1,12 @@
Important Note!!
================
The purpose of this folder is to contain files that are auto-generated by the Projucer,
and ALL files in this folder will be mercilessly DELETED and completely re-written whenever
the Projucer saves your project.
Therefore, it's a bad idea to make any manual changes to the files in here, or to
put any of your own files in here if you don't want to lose them. (Of course you may choose
to add the folder's contents to your version-control system so that you can re-merge your own
modifications after the Projucer has saved its changes).

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_core/juce_core.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_core/juce_core.mm>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_data_structures/juce_data_structures.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_data_structures/juce_data_structures.mm>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_events/juce_events.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_events/juce_events.mm>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_graphics/juce_graphics.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_graphics/juce_graphics.mm>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_gui_basics/juce_gui_basics.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_gui_basics/juce_gui_basics.mm>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_gui_extra/juce_gui_extra.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_gui_extra/juce_gui_extra.mm>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_opengl/juce_opengl.cpp>

View File

@ -0,0 +1,9 @@
/*
IMPORTANT! This file is auto-generated each time you save your
project - if you alter its contents, your changes may be overwritten!
*/
#include "AppConfig.h"
#include <juce_opengl/juce_opengl.mm>

109
Project.jucer Normal file
View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="JUwTlW" name="CommuniCare_Client" projectType="guiapp" jucerVersion="5.4.3"
bundleIdentifier="com.dustvoice.communicare_ev.client" displaySplashScreen="1"
reportAppUsage="1">
<MAINGROUP id="BtubpG" name="CommuniCare_Client">
<GROUP id="{1C002555-22F8-2282-E7F1-8DD1798493C6}" name="Resources"/>
<GROUP id="{57D026C1-66BD-7F4F-AB17-B364C90C9DAC}" name="Source">
<FILE id="aTqMcG" name="DefaultLookAndFeel.h" compile="0" resource="0"
file="Source/DefaultLookAndFeel.h"/>
<FILE id="CiyfLB" name="UserInteraction.h" compile="0" resource="0"
file="Source/UserInteraction.h"/>
<FILE id="Fyl5QM" name="Main.cpp" compile="1" resource="0" file="Source/Main.cpp"/>
</GROUP>
</MAINGROUP>
<EXPORTFORMATS>
<XCODE_IPHONE targetFolder="Builds/iOS" smallIcon="hPw3qv" bigIcon="hPw3qv">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_core" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../../../JUCE/modules"/>
</MODULEPATHS>
</XCODE_IPHONE>
<ANDROIDSTUDIO targetFolder="Builds/Android" androidInternetNeeded="1" androidVibratePermissionNeeded="1"
androidExternalWriteNeeded="1" androidExternalReadNeeded="1"
androidTheme="@android:style/Theme.NoTitleBar" smallIcon="hPw3qv"
bigIcon="hPw3qv" androidTargetSDK="26" gradleVersion="4.10.1"
gradleWrapperVersion="3.3.2">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_core" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../../../JUCE/modules"/>
</MODULEPATHS>
</ANDROIDSTUDIO>
<VS2017 targetFolder="Builds/VisualStudio2017" extraCompilerFlags="/bigobj /utf-8"
smallIcon="hPw3qv" bigIcon="hPw3qv">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug" characterSet="Unicode"/>
<CONFIGURATION isDebug="0" name="Release" characterSet="Unicode"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_opengl"/>
<MODULEPATH id="juce_gui_extra"/>
<MODULEPATH id="juce_gui_basics"/>
<MODULEPATH id="juce_graphics"/>
<MODULEPATH id="juce_events"/>
<MODULEPATH id="juce_data_structures"/>
<MODULEPATH id="juce_core"/>
</MODULEPATHS>
</VS2017>
<LINUX_MAKE targetFolder="Builds/LinuxMakefile" smallIcon="hPw3qv" bigIcon="hPw3qv">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_opengl" path="../../juce"/>
<MODULEPATH id="juce_gui_extra" path="../../juce"/>
<MODULEPATH id="juce_gui_basics" path="../../juce"/>
<MODULEPATH id="juce_graphics" path="../../juce"/>
<MODULEPATH id="juce_events" path="../../juce"/>
<MODULEPATH id="juce_data_structures" path="../../juce"/>
<MODULEPATH id="juce_core" path="../../juce"/>
</MODULEPATHS>
</LINUX_MAKE>
<CLION targetFolder="Builds/CLion" clionMakefileEnabled="1">
<MODULEPATHS>
<MODULEPATH id="juce_opengl" path="../../juce"/>
<MODULEPATH id="juce_gui_extra" path="../../juce"/>
<MODULEPATH id="juce_gui_basics" path="../../juce"/>
<MODULEPATH id="juce_graphics" path="../../juce"/>
<MODULEPATH id="juce_events" path="../../juce"/>
<MODULEPATH id="juce_data_structures" path="../../juce"/>
<MODULEPATH id="juce_core" path="../../juce"/>
</MODULEPATHS>
</CLION>
</EXPORTFORMATS>
<MODULES>
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_opengl" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
</MODULES>
<LIVE_SETTINGS>
<WINDOWS buildEnabled="0"/>
<LINUX/>
<OSX/>
</LIVE_SETTINGS>
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1"/>
</JUCERPROJECT>

3
README.adoc Normal file
View File

@ -0,0 +1,3 @@
= README
This is a repository for the mobile Apps.

55
Source/.clang-format Normal file
View File

@ -0,0 +1,55 @@
AccessModifierOffset : '-4'
AlignAfterOpenBracket : Align
AlignConsecutiveAssignments : 'false'
AlignConsecutiveDeclarations : 'false'
AlignEscapedNewlinesLeft : 'false'
AlignOperands : 'true'
AlignTrailingComments : 'false'
AllowAllParametersOfDeclarationOnNextLine : 'false'
AllowShortBlocksOnASingleLine : 'false'
AllowShortCaseLabelsOnASingleLine : 'false'
AllowShortFunctionsOnASingleLine : All
AllowShortIfStatementsOnASingleLine : 'false'
AllowShortLoopsOnASingleLine : 'false'
AlwaysBreakAfterDefinitionReturnType : None
AlwaysBreakAfterReturnType : None
AlwaysBreakBeforeMultilineStrings : 'false'
AlwaysBreakTemplateDeclarations : 'true'
BinPackArguments : 'false'
BinPackParameters : 'false'
BreakAfterJavaFieldAnnotations : 'false'
BreakBeforeBinaryOperators : NonAssignment
BreakBeforeBraces : Allman
BreakBeforeTernaryOperators : 'true'
BreakConstructorInitializersBeforeComma : 'false'
BreakStringLiterals : 'false'
ColumnLimit : '0'
ConstructorInitializerAllOnOneLineOrOnePerLine : 'true'
ConstructorInitializerIndentWidth : '4'
ContinuationIndentWidth : '4'
Cpp11BracedListStyle : 'false'
DerivePointerAlignment : 'false'
DisableFormat : 'false'
ExperimentalAutoDetectBinPacking : 'false'
IndentCaseLabels : 'true'
IndentWidth : '4'
IndentWrappedFunctionNames : 'true'
KeepEmptyLinesAtTheStartOfBlocks : 'false'
Language : Cpp
MaxEmptyLinesToKeep : '1'
NamespaceIndentation : Inner
PointerAlignment : Left
ReflowComments : 'false'
SortIncludes : 'true'
SpaceAfterCStyleCast : 'true'
SpaceBeforeAssignmentOperators : 'true'
SpaceBeforeParens : ControlStatements
SpaceInEmptyParentheses : 'false'
SpacesInAngles : 'false'
SpacesInCStyleCastParentheses : 'false'
SpacesInContainerLiterals : 'true'
SpacesInParentheses : 'false'
SpacesInSquareBrackets : 'false'
Standard : Cpp11
TabWidth : '4'
UseTab : Never

View File

@ -0,0 +1,8 @@
import os
def Settings( **kwargs ):
env = os.getenv('JUCE_PATH')
if env != None:
return {
'flags': [ '-x', 'c++', '-ID:\\JUCE\\modules', '-I../JuceLibraryCode' ],
}

View File

@ -0,0 +1,24 @@
#ifndef DUST_LOOK_AND_FEEL_H
#define DUST_LOOK_AND_FEEL_H
#include "JuceHeader.h"
/**
@file DefaultLookAndFeel.h
@author DustVoice
@class DefaultLookAndFeel
Custom LookAndFeel, for the application
*/
class DefaultLookAndFeel : public LookAndFeel_V4
{
public:
using LookAndFeel_V4::LookAndFeel_V4;
int getDefaultFontSize() { return 32; }
Font getTextButtonFont(TextButton&, int buttonHeight) override { return Font(jmax(24.0f, buttonHeight * 0.8f)); }
Font getLabelFont(Label& label) override { return Font(jmax(24.0f, label.getFont().getHeight() * 1.8f)); };
};
#endif

109
Source/Main.cpp Normal file
View File

@ -0,0 +1,109 @@
#include "DefaultLookAndFeel.h"
#include "JuceHeader.h"
class MainApplication : public JUCEApplication
{
public:
MainApplication() {}
const String getApplicationName() override { return ProjectInfo::projectName; }
const String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; }
void initialise(const String& commandLine) override
{
mainWindow = make_unique<MainWindow>(getApplicationName());
openGlContext = make_unique<OpenGLContext>();
openGlContext->attachTo(*mainWindow);
}
void shutdown() override
{
openGlContext->detach();
openGlContext = nullptr;
mainWindow = nullptr;
}
void systemRequestedQuit() override
{
quit();
}
void anotherInstanceStarted(const String& commandLine) override
{
}
class MainWindow : public DocumentWindow
{
public:
MainWindow(String name) : DocumentWindow(name, Desktop::getInstance().getDefaultLookAndFeel().findColour(ResizableWindow::backgroundColourId), DocumentWindow::allButtons)
{
#ifdef JUCE_TITLE_BAR
setUsingNativeTitleBar(false);
#else
setUsingNativeTitleBar(true);
#endif
#ifdef USE_LIGHT_COLORSCHEME
defaultLookAndFeel = make_unique<DefaultLookAndFeel>(LookAndFeel_V4::getLightColourScheme());
#else
defaultLookAndFeel = make_unique<DefaultLookAndFeel>(LookAndFeel_V4::getDarkColourScheme());
#endif
LookAndFeel::setDefaultLookAndFeel(defaultLookAndFeel.get());
viewport = make_unique<Viewport>();
defaultComponent = make_unique<Component>();
viewport->setViewedComponent(defaultComponent.get(), false);
viewport->setScrollBarsShown(true, false, true, false);
viewport->setScrollOnDragEnabled(true);
#if JUCE_IOS || JUCE_ANDROID
Rectangle<int> area = Desktop::getInstance().getDisplays().getMainDisplay().totalArea;
#else
Rectangle<int> area = Rectangle<int>(0, 0, 500, 800);
#endif
viewport->setSize(area.getWidth(), area.getHeight());
defaultComponent->setSize(viewport->getWidth() - (viewport->isVerticalScrollBarShown() ? viewport->getScrollBarThickness() : 0), viewport->getHeight() - (viewport->isHorizontalScrollBarShown() ? viewport->getScrollBarThickness() : 0) + 200);
setContentOwned(viewport.get(), true);
#if JUCE_IOS || JUCE_ANDROID
setFullScreen(true);
#else
setResizable(true, true);
centreWithSize(viewport->getWidth(), viewport->getHeight());
#endif
setVisible(true);
}
void closeButtonPressed() override
{
JUCEApplication::getInstance()->systemRequestedQuit();
}
void paint(Graphics& g) override
{
g.fillAll(getLookAndFeel().findColour(ResizableWindow::backgroundColourId));
}
private:
unique_ptr<DefaultLookAndFeel> defaultLookAndFeel;
unique_ptr<Viewport> viewport;
unique_ptr<Component> defaultComponent;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MainWindow)
};
private:
unique_ptr<MainWindow> mainWindow;
unique_ptr<OpenGLContext> openGlContext;
};
START_JUCE_APPLICATION(MainApplication)

360
Source/UserInteraction.h Normal file
View File

@ -0,0 +1,360 @@
#ifndef USER_INTERACTION_H
#define USER_INTERACTION_H
#include "JuceHeader.h"
/**
@file UserInteraction.h
@author DustVoice
@class UserInteraction
A Wrapper class for AlertWindows that enables the caller to quickly and efficiently interact with the user,
without the hassle of handling the AlertWindow itself.
*/
class UserInteraction
{
public:
/**
@returns Button Colour for the default option, for example the "OK" button.
*/
static Colour getDefaultButtonColour()
{
return Colour(static_cast<uint8>(0x00), static_cast<uint8>(0xb0 - 40), static_cast<uint8>(0xb9 - 40), static_cast<uint8>(0xff));
}
/**
@returns The normal Button Colour
*/
static Colour getStandardButtonColour()
{
const Colour buttonColour = TextButton().findColour(TextButton::ColourIds::buttonColourId);
return Colour(buttonColour.getRed(), buttonColour.getGreen(), buttonColour.getBlue());
}
/**
@class UserInputTextFieldMeta
Holds metadata for custom TextFields in an AlertWindow.
User input can be obtained by calling getResult().
@see showUserInput()
*/
struct UserInputTextFieldMeta
{
public:
UserInputTextFieldMeta(const String& name, const String& initialContents = String(), const String& onScreenLabel = String(), const bool isPasswordBox = false) : name(name), initialContents(initialContents), onScreenLabel(onScreenLabel), isPasswordBox(isPasswordBox){};
~UserInputTextFieldMeta() = default;
UserInputTextFieldMeta(const UserInputTextFieldMeta& other) : name(other.name), initialContents(other.initialContents), onScreenLabel(other.onScreenLabel), isPasswordBox(other.isPasswordBox)
{
this->setResult(other.getResult());
}
UserInputTextFieldMeta(const UserInputTextFieldMeta&& other) noexcept : name(other.name), initialContents(other.initialContents), onScreenLabel(other.onScreenLabel), isPasswordBox(other.isPasswordBox)
{
this->setResult(other.getResult());
}
UserInputTextFieldMeta& operator=(const UserInputTextFieldMeta& other)
{
name = other.name;
initialContents = other.initialContents;
onScreenLabel = other.onScreenLabel;
isPasswordBox = other.isPasswordBox;
setResult(other.getResult());
return *this;
}
UserInputTextFieldMeta& operator=(UserInputTextFieldMeta&& other) noexcept
{
if (this != &other)
{
name = other.name;
initialContents = other.initialContents;
onScreenLabel = other.onScreenLabel;
isPasswordBox = other.isPasswordBox;
setResult(other.getResult());
}
return *this;
}
String name;
String initialContents;
String onScreenLabel;
bool isPasswordBox;
void setResult(const String& newResult) { result = newResult; }
String getResult() const { return result; }
private:
String result;
};
/**
Displays a little message box with a single button.
@param title The title of the msgBox
@param message Show the user a message
@param alertIcon The AlertIconType to display within the AlertWindow @see AlertWindow::AlertIconType
@see AlertWindow::runModalLoop
*/
static void showUserInfo(const String& title, const String& message, AlertWindow::AlertIconType alertIcon = AlertWindow::InfoIcon)
{
auto alertWindow = make_unique<AlertWindow>(title, message, alertIcon);
alertWindow->addButton(TRANS(L"Verstanden"), 0, KeyPress(KeyPress::returnKey));
const Array<Component*> comp_arr = alertWindow->getChildren();
auto ok = dynamic_cast<TextButton*>(comp_arr[0]);
if (ok)
{
ok->setColour(TextButton::ColourIds::buttonColourId, getDefaultButtonColour());
}
alertWindow->setVisible(true);
#ifdef JUCE_ANDROID
unique_ptr<Component> alertComponent = move(alertWindow);
alertComponent->setAlwaysOnTop(true);
alertComponent->enterModalState(true, ModalCallbackFunction::create([](int) {}), true);
alertComponent.release();
#else
const int i = alertWindow->runModalLoop();
#endif
}
/**
Displays a little confirmation box with a yes and no button.
@param title The title of the msgBox
@param message Show the user a message
@param alertIcon The AlertIconType to display within the AlertWindow @see AlertWindow::AlertIconType
@param async Launch msgBox asynchronously
@param callback Only effective when launched asynchronously. Handle "return" value here.
@return Returns true if user clicked on yes and false if user clicked on no. Returns always true, when launched asynchronously. In this case handle rerturn value through the callback function.
@see AlertWindow::runModalLoop
*/
static bool showUserConfirm(const String& title, const String& message, AlertWindow::AlertIconType alertIcon = AlertWindow::InfoIcon, bool async = false, function<void(bool)> callback = 0)
{
auto alertWindow = make_unique<AlertWindow>(title, message, alertIcon);
alertWindow->addButton(TRANS(L"Ja, fortfahren"), 0, KeyPress(KeyPress::returnKey));
alertWindow->addButton(TRANS(L"Nein, abbrechen"), 1, KeyPress(KeyPress::escapeKey));
const Array<Component*> comp_arr = alertWindow->getChildren();
auto ok = dynamic_cast<TextButton*>(comp_arr[0]);
if (ok)
{
ok->setColour(TextButton::ColourIds::buttonColourId, getDefaultButtonColour());
}
auto cancel = dynamic_cast<TextButton*>(comp_arr[1]);
if (cancel)
{
cancel->setColour(TextButton::ColourIds::buttonColourId, getStandardButtonColour());
}
alertWindow->setVisible(true);
if (!async)
{
#ifdef JUCE_ANDROID
/** Seems like you were trying to use a synchronous Alert under Android.
This is NOT allowed!
*/
jassert(false);
#else
return (alertWindow->runModalLoop() == 0);
#endif
}
else
{
unique_ptr<Component> alertComponent = move(alertWindow);
alertComponent->setAlwaysOnTop(true);
alertComponent->enterModalState(true, ModalCallbackFunction::create([callback](int result) {
if (callback)
{
callback(result == 0);
}
}),
true);
alertComponent.release();
}
return true;
}
/**
Displays a little message box with custom buttons.
@param title The title of the msgBox
@param message Show the user a message
@param options A vector of Strings containing a name for each button you want to add
@param defaultOption Makes the button with this index value the default button. This means, it is highlighted and assigned the returnKey
@param defaultEscapeOption Makes the button with this index value the default cancel button by assigning it the escapeKey
@param alertIcon The AlertIconType to display within the AlertWindow @see AlertWindow::AlertIconType
@return Returns the index of the clicked button: @code
vector<String> options = { L"Ok", L"Not Ok", L"Cancel" };
if (UserInteraction::showUserOptions(L"Is it ok?", L"Long text...", options, 0, 2, AlertWindow::QuestionIcon) == 1)
{
// User clicked Not Ok
(...)
}
@endcode
@see AlertWindow::runModalLoop()
*/
static int showUserOptions(const String& title, const String& message, vector<String> options, const AlertWindow::AlertIconType alertIcon = AlertWindow::InfoIcon, const int defaultOption = 0, const int defaultEscapeOption = -1, bool async = false, function<void(int)> callback = 0)
{
auto alertWindow = make_unique<AlertWindow>(title, message, alertIcon);
for (int i = 0; i < options.size(); ++i)
{
KeyPress kp = KeyPress();
if (i == defaultOption)
{
kp = KeyPress(KeyPress::returnKey);
}
else if (i == defaultEscapeOption)
{
kp = KeyPress(KeyPress::escapeKey);
}
alertWindow->addButton(options.at(i), i, kp);
}
const Array<Component*> comp_arr = alertWindow->getChildren();
for (int i = 0; i < comp_arr.size(); ++i)
{
auto tb = dynamic_cast<TextButton*>(comp_arr[i]);
if (tb)
{
if (i == defaultOption)
{
tb->setColour(TextButton::ColourIds::buttonColourId, getDefaultButtonColour());
}
else
{
tb->setColour(TextButton::ColourIds::buttonColourId, getStandardButtonColour());
}
}
}
alertWindow->setVisible(true);
if (!async)
{
#ifdef JUCE_ANDROID
/** Seems like you were trying to use a synchronous Alert under Android.
This is NOT allowed!
*/
jassert(false);
#else
const int i = alertWindow->runModalLoop();
return i;
#endif
}
else
{
unique_ptr<Component> alertComponent = move(alertWindow);
alertComponent->setAlwaysOnTop(true);
alertComponent->enterModalState(true, ModalCallbackFunction::create([callback](int result) {
callback(result);
}),
true);
alertComponent.release();
}
return -1;
}
/**
Displays a little message box with custom buttons and text fields.
@see UserInteraction::UserInputTextFieldMeta
@param title The title of the msgBox
@param message Show the user a message
@param options A vector of Strings containing a name for each button you want to add
@param options A vector of custom text fields metadata of the custom struct UserInputTextFieldMeta. On return, the user input can be obtained by calling getResult() on the UserInputTextFieldMeta. @see UserInputTextFieldMeta
@param defaultOption Makes the button with this index value the default button. This means, it is highlighted and assigned the returnKey
@param defaultEscapeOption Makes the button with this index value the default cancel button by assigning it the escapeKey
@param alertIcon The AlertIconType to display within the AlertWindow @see AlertWindow::AlertIconType
@return Returns the index of the clicked button: @code
vector<String> options = { L"Ok", L"Not Ok", L"Cancel" };
if (UserInteraction::showUserOptions(L"Is it ok?", L"Long text...", options, 0, 2, AlertWindow::QuestionIcon) == 1)
{
// User clicked Not Ok
(...)
}
@endcode
@see AlertWindow::runModalLoop
*/
static int showUserInput(const String& title, const String& message, vector<String> options, vector<UserInputTextFieldMeta>& userInputTextFields, AlertWindow::AlertIconType alertIcon = AlertWindow::InfoIcon, const int defaultOption = 0, int defaultEscapeOption = -1)
{
auto alertWindow = make_unique<AlertWindow>(title, message, alertIcon);
for (UserInputTextFieldMeta tf : userInputTextFields)
{
alertWindow->addTextEditor(tf.name, tf.initialContents, tf.onScreenLabel, tf.isPasswordBox);
}
for (int i = 0; i < options.size(); ++i)
{
KeyPress kp = KeyPress();
if (i == defaultOption)
{
kp = KeyPress(KeyPress::returnKey);
}
else if (i == defaultEscapeOption)
{
kp = KeyPress(KeyPress::escapeKey);
}
alertWindow->addButton(options.at(i), i, kp);
}
const Array<Component*> comp_arr = alertWindow->getChildren();
for (int i = 0, j = 0; i < comp_arr.size(); ++i)
{
auto tb = dynamic_cast<TextButton*>(comp_arr[i]);
if (tb)
{
if (j == defaultOption)
{
tb->setColour(TextButton::ColourIds::buttonColourId, Colour(static_cast<uint8>(0x00), static_cast<uint8>(0xb0 - 40), static_cast<uint8>(0xb9 - 40), static_cast<uint8>(0xff)));
}
else
{
tb->setColour(TextButton::ColourIds::buttonColourId, getStandardButtonColour());
}
++j;
}
}
alertWindow->setVisible(true);
#ifdef JUCE_ANDROID
/** Seems like you were trying to use a UserInteraction::showUserInput under Android.
This is NOT allowed!
*/
jassert(false);
#else
const int i = alertWindow->runModalLoop();
vector<String> textEditorContents;
for (UserInputTextFieldMeta& tf : userInputTextFields)
{
tf.setResult(alertWindow->getTextEditorContents(tf.name));
}
return i;
#endif
}
};
#endif

141
pre-commit.hook Normal file
View File

@ -0,0 +1,141 @@
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by rene.milk@wwu.de
# This file is part of a set of unofficial pre-commit hooks available
# at github.
# Link: https://github.com/githubbrowser/Pre-commit-hooks
# Contact: David Martin, david.martin.mailbox@googlemail.com
##################################################################
# SETTINGS
# set path to clang-format binary
CLANG_FORMAT="/Users/wyi/usr/bin/clang-format"
# remove any older patches from previous commits. Set to true or false.
# DELETE_OLD_PATCHES=false
DELETE_OLD_PATCHES=false
# only parse files with the extensions in FILE_EXTS. Set to true or false.
# if false every changed file in the commit will be parsed with clang-format.
# if true only files matching one of the extensions are parsed with clang-format.
# PARSE_EXTS=true
PARSE_EXTS=true
# file types to parse. Only effective when PARSE_EXTS is true.
# FILE_EXTS=".c .h .cpp .hpp"
FILE_EXTS=".c .h .cpp .hpp .cc .hh .cxx .m"
##################################################################
# There should be no need to change anything below this line.
# Reference: http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
canonicalize_filename () {
local target_file=$1
local physical_directory=""
local result=""
# Need to restore the working directory after work.
pushd `pwd` > /dev/null
cd "$(dirname "$target_file")"
target_file=`basename $target_file`
# Iterate down a (possible) chain of symlinks
while [ -L "$target_file" ]
do
target_file=$(readlink "$target_file")
cd "$(dirname "$target_file")"
target_file=$(basename "$target_file")
done
# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
physical_directory=`pwd -P`
result="$physical_directory"/"$target_file"
# restore the working directory after work.
popd > /dev/null
echo "$result"
}
# exit on error
set -e
# check whether the given file matches any of the set extensions
matches_extension() {
local filename=$(basename "$1")
local extension=".${filename##*.}"
local ext
for ext in $FILE_EXTS; do [[ "$ext" == "$extension" ]] && return 0; done
return 1
}
# necessary check for initial commit
if git rev-parse --verify HEAD >/dev/null 2>&1 ; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
if [ ! -x "$CLANG_FORMAT" ] ; then
printf "Error: clang-format executable not found.\n"
printf "Set the correct path in $(canonicalize_filename "$0").\n"
exit 1
fi
# create a random filename to store our generated patch
prefix="pre-commit-clang-format"
suffix="$(date +%s)"
patch="/tmp/$prefix-$suffix.patch"
# clean up any older clang-format patches
$DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch
# create one patch containing all changes to the files
git diff-index --cached --diff-filter=ACMR --name-only $against -- | while read file;
do
# ignore file if we do check for file extensions and the file
# does not match any of the extensions specified in $FILE_EXTS
if $PARSE_EXTS && ! matches_extension "$file"; then
continue;
fi
# clang-format our sourcefile, create a patch with diff and append it to our $patch
# The sed call is necessary to transform the patch from
# --- $file timestamp
# +++ - timestamp
# to both lines working on the same file and having a a/ and b/ prefix.
# Else it can not be applied with 'git apply'.
"$CLANG_FORMAT" -style=file "$file" | \
diff -u "$file" - | \
sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch"
done
# if no patch has been generated all is ok, clean up the file stub and exit
if [ ! -s "$patch" ] ; then
printf "Files in this commit comply with the clang-format rules.\n"
rm -f "$patch"
exit 0
fi
# a patch has been created, notify the user and exit
printf "\nThe following differences were found between the code to commit "
printf "and the clang-format rules:\n\n"
cat "$patch"
printf "\nYou can apply these changes with:\n git apply $patch\n"
printf "(may need to be called from the root directory of your repository)\n"
printf "Aborting commit. Apply changes and commit again or skip checking with"
printf " --no-verify (not recommended).\n"
exit 1

150
run-clang-format.py Normal file
View File

@ -0,0 +1,150 @@
#!/usr/bin/env python
# pylint: disable=C0111
"""
Runs clang format over all cpp files
"""
from __future__ import print_function
import argparse
import fnmatch
import os
import multiprocessing
import queue
import subprocess
import sys
import threading
def glob_files(args):
files = []
extensions = args.extensions.split(',')
for directory in args.directories:
for root, _, filenames in os.walk(directory):
for ext in extensions:
for filename in fnmatch.filter(filenames, '*.' + ext):
files.append(os.path.join(root, filename))
return files
def parse_args(argv=None):
if argv is None:
argv = sys.argv
parser = argparse.ArgumentParser(
description='Runs clang-format over all files in given directories.'
' Requires clang-format in PATH.')
parser.add_argument('--clang-format-binary', metavar='PATH',
default='clang-format',
help='path to clang-format binary')
parser.add_argument('-e', '--extensions', dest='extensions',
help='comma-delimited list of extensions used to glob source files',
default="c,cc,cpp,cxx,c++,h,hh,hpp,hxx,h++")
parser.add_argument('-style',
help='formatting style',
default="file")
parser.add_argument('--no-inplace', dest='inplace', action='store_false',
help='do not format files inplace, but write output to the console'
' (useful for debugging)',
default=True)
parser.add_argument('-j', metavar='THREAD_COUNT', type=int, default=0,
help='number of clang-format instances to be run in parallel')
parser.add_argument('-v', '--verbose', action='store_true',
help='output verbose comments')
parser.add_argument(metavar='DIRPATH', dest='directories', nargs='*',
help='path(s) used to glob source files')
args = parser.parse_args(argv[1:])
if not args.directories:
args.directories = [os.getcwd()]
check_clang_format_binary(args)
return args
def _get_format_invocation(args, filename):
invocation = [args.clang_format_binary]
invocation.append('-style=' + args.style)
if args.inplace:
invocation.append('-i')
invocation.append(filename)
return invocation
def check_clang_format_binary(args):
"""Checks if invoking supplied clang-format binary works."""
try:
subprocess.check_output([args.clang_format_binary, '--version'])
except OSError:
print('Unable to run clang-format. Is clang-format '
'binary correctly specified?', file=sys.stderr)
raise
def run_format(args, task_queue, formatted_files):
"""Takes filenames out of queue and runs clang-format on them."""
while True:
filename = task_queue.get()
invocation = _get_format_invocation(args, filename)
if args.verbose:
print('Processing {}'.format(filename))
formatted = subprocess.check_output(invocation)
formatted_files[filename] = formatted
task_queue.task_done()
def format_all(args, files):
max_task = args.j
if max_task == 0:
max_task = multiprocessing.cpu_count()
formatted_files = {}
try:
# Spin up a bunch of format-launching threads.
task_queue = queue.Queue(max_task)
for _ in range(max_task):
task_thread = threading.Thread(target=run_format,
args=(args, task_queue, formatted_files))
task_thread.daemon = True
task_thread.start()
# Fill the queue with files.
for name in files:
task_queue.put(name)
# Wait for all threads to be done.
task_queue.join()
except OSError:
print("Cannot find clang-format at '{}'.".format(args.clang_format_binary),
file=sys.stderr)
raise
except subprocess.CalledProcessError as ex:
print("Running clang-format failed with non-zero status.", file=sys.stderr)
print("Command : {}".format(' '.join(ex.cmd)), file=sys.stderr)
print("Return code: {}".format(str(ex.returncode)), file=sys.stderr)
raise
return formatted_files
def main():
args = parse_args()
files = glob_files(args)
format_all(args, files)
if __name__ == '__main__':
main() # pragma: no cover