SGL
Namespaces | Classes | Typedefs | Enumerations | Functions
sgl Namespace Reference

Namespaces

 exceptions
 
 math
 
 priv
 

Classes

class  ConsoleStreambuf
 
class  ConsoleStreambufQt
 
class  EchoInputStreambuf
 
class  ForwardingStreambuf
 
class  GArc
 This graphical object subclass represents an elliptical arc. More...
 
class  GBrowserPane
 A GBrowserPane is a graphical interactor that displays a web page. More...
 
class  GButton
 This interactor subclass represents an onscreen button. More...
 
class  GCanvas
 A GCanvas is a graphical drawing surface on which you can draw shapes, lines, and colors, as well as setting the RGB color values of individual pixels. More...
 
class  GCheckBox
 This interactor subclass represents an onscreen check box. More...
 
class  GChooser
 This interactor subclass represents a selectable drop-down list. More...
 
class  GClipboard
 The GClipboard class contains static methods you can use to get and set the contents of the system clipboard. More...
 
class  GColor
 This class provides static methods for dealing with colors. More...
 
class  GColorChooser
 The GColorChooser class contains static methods for popping up color-choosing dialog boxes that allow the user to select a color. More...
 
class  GCompound
 This graphical object subclass consists of a collection of other graphical objects. More...
 
class  GContainer
 A GContainer is a logical grouping for interactors. More...
 
struct  GDimension
 This struct contains real-valued width and height fields. More...
 
class  GDownloader
 A GDownloader can download files and data over an internet connection. More...
 
class  GDrawingSurface
 GDrawingSurface is an abstract superclass for types that allow drawing shapes and pixels onto themselves as a pixel background layer. More...
 
class  GEvent
 A GEvent represents a user action that has occurred on a graphical interactor. More...
 
class  GFileChooser
 The GFileChooser class contains static methods for popping up file-choosing dialog boxes that allow the user to select a file. More...
 
class  GFont
 This class contains static methods for dealing with fonts in our GUI system. More...
 
class  GFontChooser
 The GFontChooser class contains static methods for popping up font-choosing dialog boxes that allow the user to select a font family, size, and style. More...
 
class  GImage
 This graphical object subclass represents an image from a file. More...
 
class  GInteractor
 This abstract class is the superclass for all graphical interactors. More...
 
class  GLabel
 A GLabel represents a text string. More...
 
class  GLine
 This graphical object subclass represents a line segment. More...
 
class  GObject
 This class is the common superclass of all graphical objects that can be displayed on a graphical window. More...
 
class  GObservable
 A GObservable object is one that is able to send out events. More...
 
class  GOptionPane
 This class provides static methods that pop up graphical input/output dialog boxes on the screen. More...
 
class  GOval
 This graphical object subclass represents an oval inscribed in a rectangular box. More...
 
struct  GPoint
 This struct contains real-valued x and y fields. More...
 
class  GPolygon
 This graphical object subclass represents a polygon bounded by line segments. More...
 
class  GRadioButton
 This interactor subclass represents an onscreen radio button. More...
 
class  GRect
 A GRect is a graphical object whose appearance consists of a rectangular box. More...
 
struct  GRectangle
 This struct contains real-valued x, y, width, and height fields. More...
 
class  GRoundRect
 A GRoundRect represents a graphical object whose appearance consists of a rectangular box with rounded corners. More...
 
class  GScrollBar
 A GScrollBar represents a horizontal or vertical scroll bar that can be dragged by the user. More...
 
class  GScrollPane
 A GScrollPane is a container that wraps another interactor with scroll bars. More...
 
class  GSlider
 This interactor subclass represents an onscreen slider. More...
 
class  GSound
 
This class encapsulates a sound file. More...
 
class  GSpacer
 A GSpacer is just an empty blob of space that helps you pad layouts. More...
 
class  GTable
 A GTable represents a graphical editable 2D table, like a mediocre facsimile of an Excel spreadsheet. More...
 
struct  GTableIndex
 This is a small structure representing a row and column in a table. More...
 
class  GText
 This graphical object subclass represents a text string. More...
 
class  GTextArea
 A GTextArea is a multi-line editable text box. More...
 
class  GTextField
 This interactor subclass represents a text field for entering short text strings. More...
 
class  GThread
 The GThread class is a utility class containing static methods that allow you to run code on various system threads. More...
 
class  GTimer
 This class implements a simple interval timer that generates a GTimerEvent with a specified frequency. More...
 
class  GWindow
 This class represents a graphics window that supports simple graphics. More...
 
class  QSGLApplication
 

Typedefs

typedef GEvent GActionEvent
 
typedef GEvent GChangeEvent
 
typedef GChooser GComboBox
 
typedef std::function< void(GEvent)> GEventListener
 Types for the event listener functions to be passed to various interactors. More...
 
typedef std::function< void()> GEventListenerVoid
 Types for the event listener functions to be passed to various interactors. More...
 
typedef GEvent GHyperlinkEvent
 
typedef GEvent GKeyEvent
 
typedef GEvent GMouseEvent
 
typedef GEvent GScrollEvent
 
typedef GEvent GServerEvent
 
typedef GEvent GTableEvent
 
typedef GLabel GTextLabel
 
typedef std::function< void()> GThunk
 An alias for a function wrapper around a void function with no parameters and no return. More...
 
typedef std::function< int()> GThunkInt
 An alias for a function wrapper around a function with no parameters and an int return (such as main()). More...
 
typedef GEvent GTimerEvent
 
typedef GEvent GWindowEvent
 

Enumerations

enum  EventClass { NULL_EVENT = 0x0000, ACTION_EVENT = 0x0010, KEY_EVENT = 0x0020, TIMER_EVENT = 0x0040, WINDOW_EVENT = 0x0080, MOUSE_EVENT = 0x0100, CLICK_EVENT = 0x0200, TABLE_EVENT = 0x0400, SERVER_EVENT = 0x0800, CHANGE_EVENT = 0x1000, HYPERLINK_EVENT = 0x2000, SCROLL_EVENT = 0x4000, ANY_EVENT }
 Represents all major categories of events. More...
 
enum  EventType {
  NULL_TYPE = 0, WINDOW_CLOSED = WINDOW_EVENT + 1, WINDOW_RESIZED = WINDOW_EVENT + 2, CONSOLE_CLOSED = WINDOW_EVENT + 3, WINDOW_CLOSING = WINDOW_EVENT + 4, WINDOW_MINIMIZED = WINDOW_EVENT + 5, WINDOW_RESTORED = WINDOW_EVENT + 6, WINDOW_MAXIMIZED = WINDOW_EVENT + 7, ACTION_PERFORMED = ACTION_EVENT + 1, ACTION_MENU = ACTION_EVENT + 2, MOUSE_CLICKED = MOUSE_EVENT + 1, MOUSE_PRESSED = MOUSE_EVENT + 2, MOUSE_RELEASED = MOUSE_EVENT + 3, MOUSE_MOVED = MOUSE_EVENT + 4, MOUSE_DRAGGED = MOUSE_EVENT + 5, MOUSE_ENTERED = MOUSE_EVENT + 6, MOUSE_EXITED = MOUSE_EVENT + 7, MOUSE_WHEEL_DOWN = MOUSE_EVENT + 8, MOUSE_WHEEL_UP = MOUSE_EVENT + 9, MOUSE_DOUBLE_CLICKED = MOUSE_EVENT + 10,
  KEY_PRESSED = KEY_EVENT + 1, KEY_RELEASED = KEY_EVENT + 2, KEY_TYPED = KEY_EVENT + 3, TIMER_TICKED = TIMER_EVENT + 1, TABLE_UPDATED = TABLE_EVENT + 1, TABLE_SELECTED = TABLE_EVENT + 2, TABLE_EDIT_BEGIN = TABLE_EVENT + 3, TABLE_REPLACE_BEGIN = TABLE_EVENT + 4, TABLE_EDIT_CANCEL = TABLE_EVENT + 5, TABLE_CUT = TABLE_EVENT + 6, TABLE_COPY = TABLE_EVENT + 7, TABLE_PASTE = TABLE_EVENT + 8, SERVER_REQUEST = SERVER_EVENT + 1, STATE_CHANGED = CHANGE_EVENT + 1, HYPERLINK_CLICKED = HYPERLINK_EVENT + 1, SCROLL_SCROLLED = SCROLL_EVENT + 1
}
 Defines the event subtypes for all events. More...
 
enum  HorizontalAlignment { ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_HORIZONTAL_STRETCH }
 The supported kinds of horizontal alignment of a widget or onscreen object. More...
 
enum  Modifier { SHIFT_DOWN = 1 << 0, CTRL_DOWN = 1 << 1, META_DOWN = 1 << 2, ALT_DOWN = 1 << 3, ALT_GRAPH_DOWN = 1 << 4, BUTTON1_DOWN = 1 << 5, BUTTON2_DOWN = 1 << 6, BUTTON3_DOWN = 1 << 7 }
 A set of constants used to check whether various event modifiers are in effect. More...
 
enum  SwingConstants { SWING_CENTER, SWING_TOP, SWING_LEFT, SWING_BOTTOM, SWING_RIGHT }
 Constants for alignments and icon positions. More...
 
enum  VerticalAlignment { ALIGN_MIDDLE, ALIGN_TOP, ALIGN_BOTTOM, ALIGN_VERTICAL_STRETCH }
 The supported kinds of vertical alignment of a widget or onscreen object. More...
 

Functions

int convertColorToRGB(string colorName)
 Converts a color name into an integer that encodes the red, green, and blue components of the color. More...
 
string convertRGBToColor(int rgb)
 Converts an rgb value into a color name in the form "#rrggbb". More...
 
void endLineConsoleQt(bool isStderr)
 
bool exitEnabled()
 Returns true if the std::exit function is enabled. More...
 
void exitGraphics()
 Closes all graphics windows and exits from the application without waiting for any additional user interaction. More...
 
string getLibraryInfoPanelMessage()
 
string getLibraryVersion()
 
string getLineConsoleQt()
 
GEvent getNextEvent(int mask=ANY_EVENT)
 Checks to see if there are any events of the desired type waiting on the event queue. More...
 
double getScreenHeight()
 Returns the height of the entire display screen. More...
 
GDimension getScreenSize()
 Returns the width/height of the entire display screen. More...
 
double getScreenWidth()
 Returns the width of the entire display screen. More...
 
void initializeLibrary(int argc, char **argv)
 Initializes the SGL C++ library. More...
 
void initializeStudentThread()
 This is for any initialization that needs to be done in the student's thread rather than on the Qt GUI main thread. More...
 
void native_set_thread_name(const char *name)
 
void native_thread_exit()
 
bool operator!=(const GDimension &d1, const GDimension &d2)
 Compares two GDimension objects for inequality. More...
 
bool operator!=(const GPoint &p1, const GPoint &p2)
 Compares two GPoint objects for inequality. More...
 
bool operator!=(const GRectangle &r1, const GRectangle &r2)
 Compares two rectangles for inequality. More...
 
bool operator!=(const GTableIndex &loc1, const GTableIndex &loc2)
 
GDimension operator*(const GDimension &d, double scale)
 Multiplies the width and height of the given GDimension object by the given scale factor and returns the scaled dimension object. More...
 
GPoint operator*(const GPoint &p, double scale)
 Multiplies the x and y coordinates of the given point by the given scale factor and returns the scaled point. More...
 
bool operator<(const GDimension &d1, const GDimension &d2)
 Relational operators that compare two GDimension objects by width and then by height. More...
 
bool operator<(const GPoint &p1, const GPoint &p2)
 Relational operators that compare points by x-coordinate and then by y-coordinate. More...
 
bool operator<(const GRectangle &r1, const GRectangle &r2)
 Relational operators that compare rectangles by x, y, then width, then height. More...
 
bool operator<(const GTableIndex &loc1, const GTableIndex &loc2)
 Relational operators for comparing table locations. More...
 
std::ostream & operator<<(std::ostream &os, const GDimension &dim)
 Writes the GDimension to the given output stream. More...
 
std::ostream & operator<<(std::ostream &os, const GPoint &pt)
 Writes the given point to the given output stream. More...
 
std::ostream & operator<<(std::ostream &os, const GRectangle &rect)
 Writes the given rectangle to the given output stream. More...
 
std::ostream & operator<<(std::ostream &out, const GEvent &event)
 Writes the given event to the given output stream. More...
 
std::ostream & operator<<(std::ostream &out, const GTableIndex &loc)
 I/O stream operators for reading or writing locations in their toString format. More...
 
std::ostream & operator<<(std::ostream &out, const GObject &obj)
 Prints the given graphical object to an output stream. More...
 
bool operator<=(const GDimension &d1, const GDimension &d2)
 Relational operators that compare two GDimension objects by width and then by height. More...
 
bool operator<=(const GPoint &p1, const GPoint &p2)
 Relational operators that compare points by x-coordinate and then by y-coordinate. More...
 
bool operator<=(const GRectangle &r1, const GRectangle &r2)
 Relational operators that compare rectangles by x, y, then width, then height. More...
 
bool operator<=(const GTableIndex &loc1, const GTableIndex &loc2)
 
bool operator==(const GDimension &d1, const GDimension &d2)
 Compares two GDimension objects for equality. More...
 
bool operator==(const GPoint &p1, const GPoint &p2)
 Compares two GPoint objects for equality. More...
 
bool operator==(const GRectangle &r1, const GRectangle &r2)
 Compares two rectangles for equality. More...
 
bool operator==(const GTableIndex &loc1, const GTableIndex &loc2)
 
bool operator>(const GDimension &d1, const GDimension &d2)
 Relational operators that compare two GDimension objects by width and then by height. More...
 
bool operator>(const GPoint &p1, const GPoint &p2)
 Relational operators that compare points by x-coordinate and then by y-coordinate. More...
 
bool operator>(const GRectangle &r1, const GRectangle &r2)
 Relational operators that compare rectangles by x, y, then width, then height. More...
 
bool operator>(const GTableIndex &loc1, const GTableIndex &loc2)
 
bool operator>=(const GDimension &d1, const GDimension &d2)
 Relational operators that compare two GDimension objects by width and then by height. More...
 
bool operator>=(const GPoint &p1, const GPoint &p2)
 Relational operators that compare points by x-coordinate and then by y-coordinate. More...
 
bool operator>=(const GRectangle &r1, const GRectangle &r2)
 Relational operators that compare rectangles by x, y, then width, then height. More...
 
bool operator>=(const GTableIndex &loc1, const GTableIndex &loc2)
 
std::istream & operator>>(std::istream &input, GTableIndex &loc)
 
void pause(double milliseconds)
 Pauses for the indicated number of milliseconds. More...
 
void putConsoleQt(string str, bool isStderr)
 
void repaint()
 Issues a request to update the most recently created graphics window. More...
 
void setExitEnabled(bool enabled)
 Sets whether the std::exit function will be enabled or not. More...
 
void shutdownLibrary()
 Shuts down the SGL C++ library. More...
 
void studentThreadHasExited(string reason)
 
string to_string(const GTableIndex &value)
 Returns a string representation of this location, such as "r2c17". More...
 
HorizontalAlignment toHorizontalAlignment(string alignmentStr)
 Converts a string such as "Center" or "Left" into an alignment value. More...
 
Qt::Alignment toQtAlignment(HorizontalAlignment alignment)
 Converts our alignment values into Qt alignment constants. More...
 
Qt::Alignment toQtAlignment(VerticalAlignment alignment)
 Converts our alignment values into Qt alignment constants. More...
 
string toString(HorizontalAlignment alignment)
 Converts an alignment value into a string such as "Center" or "Left". More...
 
string toString(VerticalAlignment alignment)
 Converts an alignment value into a string such as "Middle" or "Top". More...
 
VerticalAlignment toVerticalAlignment(string alignmentStr)
 Converts a string such as "Middle" or "Top" into an alignment value. More...
 
GMouseEvent waitForClick()
 Waits for a mouse click to occur anywhere in any window, returning the event that occurred. More...
 
GEvent waitForEvent(int mask=ANY_EVENT)
 
Dismisses the process until an event occurs whose type is covered by the event mask. More...
 

Typedef Documentation

◆ GActionEvent

◆ GChangeEvent

◆ GComboBox

◆ GEventListener

typedef std::function<void(GEvent)> GEventListener

Types for the event listener functions to be passed to various interactors.

◆ GEventListenerVoid

typedef std::function<void()> GEventListenerVoid

Types for the event listener functions to be passed to various interactors.

◆ GHyperlinkEvent

◆ GKeyEvent

typedef GEvent GKeyEvent

◆ GMouseEvent

◆ GScrollEvent

◆ GServerEvent

◆ GTableEvent

◆ GTextLabel

typedef GLabel GTextLabel

◆ GThunk

typedef std::function<void()> GThunk

An alias for a function wrapper around a void function with no parameters and no return.

◆ GThunkInt

typedef std::function<int()> GThunkInt

An alias for a function wrapper around a function with no parameters and an int return (such as main()).

◆ GTimerEvent

◆ GWindowEvent

Enumeration Type Documentation

◆ EventClass

enum EventClass

Represents all major categories of events.

Enumerator
NULL_EVENT 
ACTION_EVENT 
KEY_EVENT 
TIMER_EVENT 
WINDOW_EVENT 
MOUSE_EVENT 
CLICK_EVENT 
TABLE_EVENT 
SERVER_EVENT 
CHANGE_EVENT 
HYPERLINK_EVENT 
SCROLL_EVENT 
ANY_EVENT 

◆ EventType

enum EventType

Defines the event subtypes for all events.

An event type is a subcategory within an event class.

Enumerator
NULL_TYPE 
WINDOW_CLOSED 
WINDOW_RESIZED 
CONSOLE_CLOSED 
WINDOW_CLOSING 
WINDOW_MINIMIZED 
WINDOW_RESTORED 
WINDOW_MAXIMIZED 
ACTION_PERFORMED 
ACTION_MENU 
MOUSE_CLICKED 
MOUSE_PRESSED 
MOUSE_RELEASED 
MOUSE_MOVED 
MOUSE_DRAGGED 
MOUSE_ENTERED 
MOUSE_EXITED 
MOUSE_WHEEL_DOWN 
MOUSE_WHEEL_UP 
MOUSE_DOUBLE_CLICKED 
KEY_PRESSED 
KEY_RELEASED 
KEY_TYPED 
TIMER_TICKED 
TABLE_UPDATED 
TABLE_SELECTED 
TABLE_EDIT_BEGIN 
TABLE_REPLACE_BEGIN 
TABLE_EDIT_CANCEL 
TABLE_CUT 
TABLE_COPY 
TABLE_PASTE 
SERVER_REQUEST 
STATE_CHANGED 
HYPERLINK_CLICKED 
SCROLL_SCROLLED 

◆ HorizontalAlignment

The supported kinds of horizontal alignment of a widget or onscreen object.

Enumerator
ALIGN_CENTER 
ALIGN_LEFT 
ALIGN_RIGHT 
ALIGN_HORIZONTAL_STRETCH 

◆ Modifier

enum Modifier

A set of constants used to check whether various event modifiers are in effect.

These constants can be combined in a single modifier int using bitwise operators.

Enumerator
SHIFT_DOWN 
CTRL_DOWN 
META_DOWN 
ALT_DOWN 
ALT_GRAPH_DOWN 
BUTTON1_DOWN 
BUTTON2_DOWN 
BUTTON3_DOWN 

◆ SwingConstants

Constants for alignments and icon positions.

Retained for backward compatibility; new code should not use this enum.

Enumerator
SWING_CENTER 
SWING_TOP 
SWING_LEFT 
SWING_BOTTOM 
SWING_RIGHT 

◆ VerticalAlignment

The supported kinds of vertical alignment of a widget or onscreen object.

Enumerator
ALIGN_MIDDLE 
ALIGN_TOP 
ALIGN_BOTTOM 
ALIGN_VERTICAL_STRETCH 

Function Documentation

◆ convertColorToRGB()

int convertColorToRGB ( string   colorName)

Converts a color name into an integer that encodes the red, green, and blue components of the color.

See gcolor.h for more details about colors.

◆ convertRGBToColor()

string convertRGBToColor ( int  rgb)

Converts an rgb value into a color name in the form "#rrggbb".

Each of the rr, gg, and bb values are two-digit hexadecimal numbers indicating the intensity of that component. See gcolor.h for more details about colors.

◆ endLineConsoleQt()

void endLineConsoleQt ( bool  isStderr)

◆ exitEnabled()

bool exitEnabled ( )

Returns true if the std::exit function is enabled.

This will be true unless disabled by, say, an autograder.

◆ exitGraphics()

void exitGraphics ( )

Closes all graphics windows and exits from the application without waiting for any additional user interaction.

◆ getLibraryInfoPanelMessage()

string getLibraryInfoPanelMessage ( )

◆ getLibraryVersion()

string getLibraryVersion ( )

◆ getLineConsoleQt()

string getLineConsoleQt ( )

◆ getNextEvent()

GEvent getNextEvent ( int  mask = ANY_EVENT)

Checks to see if there are any events of the desired type waiting on the event queue.

If so, this function returns the event in exactly the same fashion as waitForEvent; if not, getNextEvent returns an invalid event. The mask parameter is optional. If it is missing, getNextEvent accepts any event.

Deprecated:
This function is deprecated and discouraged from use. Instead of calling waitForClick in an event loop, you should attach an event-listening function to the widget of choice using that object's methods such as setActionListener or setMouseListener.

◆ getScreenHeight()

double getScreenHeight ( )

Returns the height of the entire display screen.

◆ getScreenSize()

GDimension getScreenSize ( )

Returns the width/height of the entire display screen.

◆ getScreenWidth()

double getScreenWidth ( )

Returns the width of the entire display screen.

◆ initializeLibrary()

void initializeLibrary ( int  argc,
char **  argv 
)

Initializes the SGL C++ library.

A call to this function is inserted before the student's main() runs. This should be run from the Qt GUI (main) thread.

◆ initializeStudentThread()

void initializeStudentThread ( )

This is for any initialization that needs to be done in the student's thread rather than on the Qt GUI main thread.

Currently this is used primarily to set up exception handlers for the student's thread to catch and report errors.

◆ native_set_thread_name()

void native_set_thread_name ( const char *  name)

◆ native_thread_exit()

void native_thread_exit ( )

◆ operator!=() [1/4]

bool operator!= ( const GDimension d1,
const GDimension d2 
)

Compares two GDimension objects for inequality.

◆ operator!=() [2/4]

bool operator!= ( const GPoint p1,
const GPoint p2 
)

Compares two GPoint objects for inequality.

◆ operator!=() [3/4]

bool operator!= ( const GRectangle r1,
const GRectangle r2 
)

Compares two rectangles for inequality.

◆ operator!=() [4/4]

bool operator!= ( const GTableIndex loc1,
const GTableIndex loc2 
)

◆ operator*() [1/2]

GDimension operator* ( const GDimension d,
double  scale 
)

Multiplies the width and height of the given GDimension object by the given scale factor and returns the scaled dimension object.

◆ operator*() [2/2]

GPoint operator* ( const GPoint p,
double  scale 
)

Multiplies the x and y coordinates of the given point by the given scale factor and returns the scaled point.

◆ operator<() [1/4]

bool operator< ( const GDimension d1,
const GDimension d2 
)

Relational operators that compare two GDimension objects by width and then by height.

◆ operator<() [2/4]

bool operator< ( const GPoint p1,
const GPoint p2 
)

Relational operators that compare points by x-coordinate and then by y-coordinate.

◆ operator<() [3/4]

bool operator< ( const GRectangle r1,
const GRectangle r2 
)

Relational operators that compare rectangles by x, y, then width, then height.

◆ operator<() [4/4]

bool operator< ( const GTableIndex loc1,
const GTableIndex loc2 
)

Relational operators for comparing table locations.

◆ operator<<() [1/6]

std::ostream & operator<< ( std::ostream &  os,
const GDimension dim 
)

Writes the GDimension to the given output stream.

◆ operator<<() [2/6]

std::ostream & operator<< ( std::ostream &  os,
const GPoint pt 
)

Writes the given point to the given output stream.

◆ operator<<() [3/6]

std::ostream & operator<< ( std::ostream &  os,
const GRectangle rect 
)

Writes the given rectangle to the given output stream.

◆ operator<<() [4/6]

std::ostream & operator<< ( std::ostream &  out,
const GEvent event 
)

Writes the given event to the given output stream.

◆ operator<<() [5/6]

std::ostream & operator<< ( std::ostream &  out,
const GTableIndex loc 
)

I/O stream operators for reading or writing locations in their toString format.

◆ operator<<() [6/6]

std::ostream & operator<< ( std::ostream &  out,
const GObject obj 
)

Prints the given graphical object to an output stream.

◆ operator<=() [1/4]

bool operator<= ( const GDimension d1,
const GDimension d2 
)

Relational operators that compare two GDimension objects by width and then by height.

◆ operator<=() [2/4]

bool operator<= ( const GPoint p1,
const GPoint p2 
)

Relational operators that compare points by x-coordinate and then by y-coordinate.

◆ operator<=() [3/4]

bool operator<= ( const GRectangle r1,
const GRectangle r2 
)

Relational operators that compare rectangles by x, y, then width, then height.

◆ operator<=() [4/4]

bool operator<= ( const GTableIndex loc1,
const GTableIndex loc2 
)

◆ operator==() [1/4]

bool operator== ( const GDimension d1,
const GDimension d2 
)

Compares two GDimension objects for equality.

◆ operator==() [2/4]

bool operator== ( const GPoint p1,
const GPoint p2 
)

Compares two GPoint objects for equality.

◆ operator==() [3/4]

bool operator== ( const GRectangle r1,
const GRectangle r2 
)

Compares two rectangles for equality.

◆ operator==() [4/4]

bool operator== ( const GTableIndex loc1,
const GTableIndex loc2 
)

◆ operator>() [1/4]

bool operator> ( const GDimension d1,
const GDimension d2 
)

Relational operators that compare two GDimension objects by width and then by height.

◆ operator>() [2/4]

bool operator> ( const GPoint p1,
const GPoint p2 
)

Relational operators that compare points by x-coordinate and then by y-coordinate.

◆ operator>() [3/4]

bool operator> ( const GRectangle r1,
const GRectangle r2 
)

Relational operators that compare rectangles by x, y, then width, then height.

◆ operator>() [4/4]

bool operator> ( const GTableIndex loc1,
const GTableIndex loc2 
)

◆ operator>=() [1/4]

bool operator>= ( const GDimension d1,
const GDimension d2 
)

Relational operators that compare two GDimension objects by width and then by height.

◆ operator>=() [2/4]

bool operator>= ( const GPoint p1,
const GPoint p2 
)

Relational operators that compare points by x-coordinate and then by y-coordinate.

◆ operator>=() [3/4]

bool operator>= ( const GRectangle r1,
const GRectangle r2 
)

Relational operators that compare rectangles by x, y, then width, then height.

◆ operator>=() [4/4]

bool operator>= ( const GTableIndex loc1,
const GTableIndex loc2 
)

◆ operator>>()

std::istream & operator>> ( std::istream &  input,
GTableIndex loc 
)

◆ pause()

void pause ( double  milliseconds)

Pauses for the indicated number of milliseconds.

This function is useful for animation where the motion would otherwise be too fast.

◆ putConsoleQt()

void putConsoleQt ( string   str,
bool  isStderr 
)

◆ repaint()

void repaint ( )

Issues a request to update the most recently created graphics window.

You can also call the repaint() method on a window directly to repaint that window.

◆ setExitEnabled()

void setExitEnabled ( bool  enabled)

Sets whether the std::exit function will be enabled or not.

If disabled, an error() will be thrown if student tries to exit().

◆ shutdownLibrary()

void shutdownLibrary ( )

Shuts down the SGL C++ library.

A call to this function is inserted after the student's main().

◆ studentThreadHasExited()

void studentThreadHasExited ( string   reason)

◆ to_string()

string to_string ( const GTableIndex value)

Returns a string representation of this location, such as "r2c17".

◆ toHorizontalAlignment()

HorizontalAlignment toHorizontalAlignment ( string   alignmentStr)

Converts a string such as "Center" or "Left" into an alignment value.

◆ toQtAlignment() [1/2]

Qt::Alignment toQtAlignment ( HorizontalAlignment  alignment)

Converts our alignment values into Qt alignment constants.

◆ toQtAlignment() [2/2]

Qt::Alignment toQtAlignment ( VerticalAlignment  alignment)

Converts our alignment values into Qt alignment constants.

◆ toString() [1/2]

string toString ( HorizontalAlignment  alignment)

Converts an alignment value into a string such as "Center" or "Left".

◆ toString() [2/2]

string toString ( VerticalAlignment  alignment)

Converts an alignment value into a string such as "Middle" or "Top".

◆ toVerticalAlignment()

VerticalAlignment toVerticalAlignment ( string   alignmentStr)

Converts a string such as "Middle" or "Top" into an alignment value.

◆ waitForClick()

GMouseEvent waitForClick ( )

Waits for a mouse click to occur anywhere in any window, returning the event that occurred.

Deprecated:
This function is deprecated and discouraged from use. Instead of calling waitForClick in an event loop, you should attach an event-listening function to the widget of choice using that object's methods such as setActionListener or setMouseListener.

◆ waitForEvent()

GEvent waitForEvent ( int  mask = ANY_EVENT)


Dismisses the process until an event occurs whose type is covered by the event mask.

The mask parameter is a combination of the events of interest. For example, to wait for a mouse event or an action event, clients can use the following call:

     e = waitForEvent(MOUSE_EVENT + ACTION_EVENT);
*

The mask parameter is optional. If it is missing, waitForEvent accepts any event.

As a more sophisticated example, the following code is the canonical event loop for an animated application that needs to respond to mouse, key, and timer events:

     GTimer timer(ANIMATION_DELAY_IN_MILLISECONDS);
     timer.start();
     while (true) {
        GEvent e = waitForEvent(TIMER_EVENT + MOUSE_EVENT + KEY_EVENT);
        switch (e.getEventClass()) {
         case TIMER_EVENT:
           takeAnimationStep();
           break;
         case MOUSE_EVENT:
           handleMouseEvent(GMouseEvent(e));
           break;
         case KEY_EVENT:
           handleKeyEvent(GKeyEvent(e));
           break;
        }
     }
*
Deprecated:
This function is deprecated and discouraged from use. Instead of calling waitForClick in an event loop, you should attach an event-listening function to the widget of choice using that object's methods such as setActionListener or setMouseListener.