Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabbed windows #65

Closed
wants to merge 146 commits into from
Closed

Tabbed windows #65

wants to merge 146 commits into from

Conversation

ahuston-0
Copy link
Collaborator

This is absolutely not ready to be merged yet, I am submitting this to keep track of comments and make notes regarding any breaking changes for the main branch.

This PR should not be submitted until the work by the senior design teams are done in the summer (this way nobody fetches upstream and grabs a version that works differently than their code).

The major focus of this branch is to implement windows with tabs. Progress with that has stagnated a bit, however lots of other stuff has been done.

Dov Kruger and others added 30 commits June 17, 2021 14:14
Demonstrates possible applications of fold expression and parameter
packing for generic types. Has applications for creating metadata and
writing data for XDL types.

Co-authored-by: Dov Kruger <[email protected]>
Co-authored-by: David Krauthamer <[email protected]>
Add XDLArrays, an extension of DynArrays designed to dump generic XDL
objects into a byte format near compile-time for exporting during
run time.

Continue implementing importing XDL data from raw C++ types.

Implement unimplemented XDL type.

Co-authored-by: Dov Kruger <[email protected]>
Data builder should be working using the new ArrayOfBytes class

A new error code has been added for unimplemented functionality

A new DataType has been added for type definitions

Functions for compatibility between ArrayOfBytes and existing XDL types
have been added

Values have been added back into XDL types

XDLArray has been marked for deletion, having been functionally replaced
by the ArrayOfBytes
The XDL code now compiles. Adds a method of creating an XDLRequest
using existing XDLType pointers.

Makes Buffer's checkAvailableWrite method public. Need to check if a
method of getting that information already exists publicly.

Copies the Date and JulianDate types into std to convert them to XDL
types.

DynArray now converts the data pointer to a void or char pointer
(depending on the context) before performing any operations on it. This
is to allow manipulation of the array while preserving the constant
behavior of DynArrays of const objects.

XDL Lists have been abstracted out to List.hh. This is to prevent std.hh
from being flooded by list code.

Add Calendar type to the CompoundTypes.

Convert the readMeta used by SymbolTable.cc to the new readMeta.

Add a test for sending Stocks with the new List type.
We need to go over why Structs are no longer working properly, but for
the most part this is almsot working.
SolarSystem has some imports removed and now moves copies of names instead
of passing by reference. Constructor is now explicit to prevent
accidental implicit conversion.

TestDrawBlockMap now implements move constructor and move operator=.
TODO: consider making callbacks a namespace. Everything in there seems
static anyway.
clang-tidy was complaining about a non-virtual public destructor, but
fixing that required implementing a destructor. After some more
bargaining with clang-tidy, I had to implement the big five.
SocketIO explicitly declared err_code as static, but this is already
implicity done due to err_code being in an anonymous namespace. The
explicit use of static has been removed.

SocketIO send and recv have new type signatures. Each function now
returns a ssize_t to be in line with Linux's function signatures. Given
that the functions originally returned an int. No functionality should
change. SocketIO recv used to take in a const char* buffer and cast to
a char*. Given that recv does modify the buffer, the buffer is now
explicitly a char* and then will be either kept a char* (on Windows) or
implicitly cast to a void* (on Linux). Given that void* and char* have
the same size, this should not present any issues.

SocketIO send and recv now use the flags provided. Previously, each
function passed 0 as the only flag. Be aware that Grail is designed to
be cross-platform and, as such, any flags used should be avaiable on
Windows or Linux.
XDLRequest had an unnecessary import which was removed. The function
buildData is also commented out, as it is the base case for a function
which is also commented out.

GLWinFonts had a few loops where the counter is guarenteed to never be
negative, so int was replaced with uint32_t.

Callbacks had a static void function that was never given a void type
when it was declared. The implementation gave the correct type, but the
declaration needed to be fixed.
Currently, there are many places where an if-statement with only one
line following it is used without providing any braces. This is
primarily done out of convenience, however it also means many flags by
clang-tidy for readability issues. We solved this with indentation,
however if it ever becomes an issue we can always revert the setting so
any if-statement without braces triggers a warning.
DynArray has several spots it could use uint32_t and was instead using
int. This has been fixed.

Adds in a comment asking for feedback on what operator new does. It
seems to just return one of the parameters without doing anything.

Converts DynArray::find(T&) to a const function, as contents of the
array nor the key are ever modified.

Adds comments that should be recognized by clang-tidy to remove any
warnings about pointer arithmetic. This is a container implementation
and some pointer arithmetic seems unavoidable.
There are several modifications that were made for compatbility reasons,
however these changes are all several months old by now. These changes
are being added in all at once. Fixes will be made as the CI/CD system
reports errors.

AxisWidget: Include cstring to provide strlen

MultiText/MultiText2: Remove functions that have "unsigned long long" as
a parameter. Using functions with byte-specific types end up being
better for cross-platform compatbility.

Benchmark: Remove sys/times include. MSYS does not provide this and we
do not need it anymore.

DynArray: Add DynArray<T>::removeAt(uint32_t index) -> T. This removes a
particular element from the array and returns it. Warning: This
currently achieves this by copying the object to a temp variable,
sliding all other elements forward by one (without moving?), and then
returning the copy. For some reason, this invokes the original object's
destructor if its the last element in the array? I believe this needs
to be rewritten a bit before it is ready for use.

testDynArray: This runs through a couple test cases for DynArrays
(adding and removing integers, strings, and Tabs). This was originally
done as a way to test how adding and removing tabs worked out, but could
be useful in the future. This should eventually turn into a compile-time
test using static_assert, as DynArray should be able to be made into an
entirely constexpr class.

testfmt: Removes constexpr specifier on functions that call sprintf.
constexpr cannot be used on non-constexpr functions and sprintf is not
constexpr.
I think these changes should have already been added in a previous
commit. Hopefully there is nothing funky going on here, but I'll
investigate the commit history after the merge is completed.
CMake checks the hash of several json files during configuration and
runs a python script for that json file if it has been updated since the
last configuration. The messages emitted from this code generation step
had an extra newline at the end. This has been removed to keep all CMake
messages uniformly spaced
testfmt: sprintf is a C function and therefore cannot be used in a
constexpr function. As such, the functions using sprintf are no longer
marked as constexpr.
Build CI depends on the name of the branch, which has been changed since
the last commit. This should update that information.
@ahuston-0 ahuston-0 self-assigned this Jan 19, 2022
@ahuston-0 ahuston-0 added the enhancement New feature or request label Jan 19, 2022
tabbed_windows is now a part of a PR, so every test is getting run twice. This has been fixed to only have one test set running per commit.
@ahuston-0
Copy link
Collaborator Author

Closing because the original version of this branch (tabbed-windows) is being used again.

@ahuston-0 ahuston-0 closed this Feb 1, 2022
@ahuston-0 ahuston-0 mentioned this pull request Feb 1, 2022
@ahuston-0 ahuston-0 deleted the tabbed_windows branch February 1, 2022 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XDLTypes adding themselves to types array Possible MPV/memory bug in tabbed-windows branch
2 participants