Skip to content

Commit

Permalink
Add more high-level comments
Browse files Browse the repository at this point in the history
  • Loading branch information
samehattia committed Jan 25, 2019
1 parent c0c11aa commit 6fe3c7b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 18 deletions.
24 changes: 9 additions & 15 deletions include/ezgl/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,6 @@ class application {
*/
void quit();

/**
* Set the disable_event_loop flag to new_setting
* Call with new_setting == true to make the event_loop immediately return.
* Needed only for auto-marking
*
* @param new_setting The new state of disable_event_loop flag
*/
static void set_disable_event_loop(bool new_setting)
{
disable_event_loop = new_setting;
}

private:
// The package path to the XML file that describes the UI.
std::string m_main_ui;
Expand Down Expand Up @@ -322,10 +310,16 @@ class application {

// The user-defined callback function for handling keyboard press
key_callback_fn key_press_callback;

// A flag to disable event loop (default is false)
static bool disable_event_loop;
};
}

/**
* Set the disable_event_loop flag to new_setting
* Call with new_setting == true to make the event_loop immediately return.
* Needed only for auto-marking
*
* @param new_setting The new state of disable_event_loop flag
*/
void set_disable_event_loop(bool new_setting);

#endif //EZGL_APPLICATION_HPP
2 changes: 2 additions & 0 deletions include/ezgl/callback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace ezgl {

/**** Callback functions for keyboard and mouse input, and for all the ezgl predefined buttons. *****/

/**
* React to a <a href = "https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-key-press-event">keyboard
* press event</a>.
Expand Down
1 change: 1 addition & 0 deletions include/ezgl/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace ezgl {

/**
* Manages the transformations between coordinate systems.
* Application code doesn't (and can't) call these functions; they are for ezgl internal use.
*
* The camera class manages transformations between a GTK widget, world, and "screen" coordinate system. A GTK widget
* has dimensions that change based on the user, and its aspect ratio may not match the world coordinate system. The
Expand Down
2 changes: 2 additions & 0 deletions include/ezgl/canvas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

namespace ezgl {

/**** Functions in this class are for ezgl internal use; application code doesn't need to call them ****/

class renderer;

/**
Expand Down
3 changes: 3 additions & 0 deletions include/ezgl/control.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

namespace ezgl {

/**** Functions to manipulate what is visible on the screen; used by ezgl's predefined buttons. ****/
/**** Application code does not have to ever call these functions. ****/

class canvas;

/**
Expand Down
4 changes: 4 additions & 0 deletions include/ezgl/graphics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class renderer {
*/
rectangle get_visible_world();

/**** Functions to set graphics attributes (for all subsequent drawing calls). ****/

/**
* Change the color for subsequent draw calls.
*
Expand Down Expand Up @@ -246,6 +248,8 @@ class renderer {
*/
void set_vert_text_just(text_just vert_just);

/**** Functions to draw various graphics primitives ****/

/**
* Draw a line.
*
Expand Down
11 changes: 8 additions & 3 deletions src/application.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "ezgl/application.hpp"

namespace ezgl {

// A flag to disable event loop (default is false)
bool application::disable_event_loop = false;
bool disable_event_loop = false;

namespace ezgl {

void application::startup(GtkApplication *, gpointer user_data)
{
Expand Down Expand Up @@ -358,3 +358,8 @@ void application::refresh_drawing()
cnv->redraw();
}
}

void set_disable_event_loop(bool new_setting)
{
disable_event_loop = new_setting;
}

0 comments on commit 6fe3c7b

Please sign in to comment.