diff --git a/sources/modules/compilation-model/translation-units.md b/sources/modules/compilation-model/translation-units.md index 94141b3..e130183 100644 --- a/sources/modules/compilation-model/translation-units.md +++ b/sources/modules/compilation-model/translation-units.md @@ -3,4 +3,108 @@ _Skeleton descriptions are typeset in italic text,_ _so please don't remove these descriptions when editing the topic._ -This topic is currently under construction and will soon be filled with information :) +### Overview + +_Provides a short natural language abstract of the module’s contents._ +_Specifies the different levels of teaching._ + +------------------------------------------------------------------------ +Level Objective +----------------- ------------------------------------------------------ +Foundational + +Main --- + +Advanced --- + +------------------------------------------------------------------------ + +### Motivation + +_Why is this important?_ +_Why do we want to learn/teach this topic?_ + +### Topic introduction + +_Very brief introduction to the topic._ + +_TODO: +_introduce notion of object file + +C++ Compilation model allows the developer to seperate their +declarations and definitions into various files so as to: + +* organize code logically, +* facilitate reuse, +* reduce rebuild times, +* reduce file sizes and scopes, +* avoid naming collisions, +* and produce compiled libraries. + + +### Foundational: Building code from multiple files + +#### Background/Required Knowledge + +A student: + +1. Is able to define a variable, function, or class +2. Is able to access declarations from either module import or header inclusion + +Questions: +modules and/or functions? + + +#### Student outcomes + +_A list of things "a student should be able to" after the curriculum._ +_The next word should be an action word and testable in an exam._ +_Max 5 items._ + +A student should be able to: + +1. create a declaration for variables, functions, and classes separate from their definitions +2. compile and link code from multiple implementation files +3. explain how includes or imports work within their translation unit + +#### Caveats + +_This section mentions subtle points to understand, like anything resulting in +implementation-defined, unspecified, or undefined behavior._ + +#### Points to cover + +_This section lists important details for each point._ + +Declarations and definitions can be within same file + +### Main: Organizing code across multiple translation units + +#### Background/Required Knowledge + +* All of the above. + +#### Student outcomes + +A student should be able to: + +1. package code into libraries +2. explain trade-offs for placing code in header files vs implementation files + +#### Caveats + +#### Points to cover + +### Advanced + +_These are important topics that are not expected to be covered but provide +guidance where one can continue to investigate this topic in more depth._ + +A student should be able to: + +1. explain how an anonymous namespace functions within their translation unit +2. One-definition-rule shennanigans +3. Pimpl pattern +4. Template definitions in translation unit it's used in? + + diff --git a/sources/modules/external/graphical-user-interfaces.md b/sources/modules/external/graphical-user-interfaces.md new file mode 100644 index 0000000..b63a124 --- /dev/null +++ b/sources/modules/external/graphical-user-interfaces.md @@ -0,0 +1,104 @@ +## External libraries: Desktop Graphical User Interfaces {#extern-gui} + +_Skeleton descriptions are typeset in italic text,_ +_so please don't remove these descriptions when editing the topic._ + +### Overview + +_Provides a short natural language abstract of the module’s contents._ +_Specifies the different levels of teaching._ + +------------------------------------------------------------------------ +Level Objective +----------------- ------------------------------------------------------ +Foundational: Basic us of desktop graphical user interfaces + +Main: Different forms of IO and accessibility + +Advanced: Internationalization and customization + +------------------------------------------------------------------------ + +### Motivation + +_Why is this important?_ +_Why do we want to learn/teach this topic?_ + +For some applications a graphical user interface is beneficial. However, graphical user interfaces are not part of the C++ standard and external libraries are needed. We provide generic teaching goals and do not focus on a specific external library. Some mentionable libraries are: [Qt](https://www.qt.io/), [Cairo](https://www.cairographics.org/), and [wxWidgets](https://www.wxwidgets.org/). + +### Topic introduction + +_Very brief introduction to the topic._ + +### Foundational: Basic use of desktop graphical user interfaces + +#### Background/Required Knowledge + +A student: + +1. should know linking libraries +2. should know [header files](../compilation-model/headers.md) +3. should know about [build systems](../compilation-model/buildsystems.md) + +#### Student outcomes + +_A list of things "a student should be able to" after the curriculum._ +_The next word should be an action word and testable in an exam._ +_Max 5 items._ + +A student should be able to: + +1. link against the external library +2. write an application with one window +3. add simple widgets like text boxes and buttons to the window +4. catch events of buttons or other elements +5. explain the mechanics of event-driven programming + +#### Points to cover + +* use basic API functions +* layout of the window +* handle events by callbacks + +#### Caveats + +_This section mentions subtle points to understand, like anything resulting in +implementation-defined, unspecified, or undefined behavior._ + +* programming user interfaces in C++ and in general require plenty of boiler plate code +* API calls are specific to one library and might not be transferable to other libraries +* Some libraries are written in C + +### Main: Different forms of IO and accessibility + +#### Background/Required Knowledge + +* All of the above. + +#### Student outcomes + +A student should be able to: + +1. add more advanced elements, like tables or images +2. handle multiple windows +3. show error and warning popups +4. use different forms of IO, like keyboard, mouse, or touch pad +5. explain basic of fonts and accessibility + +#### Caveats + +* programming user interfaces is rather complex and might not applicable for most students + +#### Points to cover + +* More advanced API calls and design patterns + +### Advanced: Technicalities and tools + +_These are important topics that are not expected to be covered but provide +guidance where one can continue to investigate this topic in more depth._ + +* Internationalization +* Font designers +* Hardware acceleration +* Custom widget generation