Data structure for the Synema frames. More...
#include <frame-common.h>
Data Fields | |
gchar * | type |
Type of the monitoring tool for this frame. | |
size_ratio_t | size |
Size ratio to use for that frame. | |
machine_t * | display_machine |
The machine for which data should be displayed. | |
time_period_t | display_period |
Period for which the data should be shown. | |
gdouble | avg_refresh_time |
Last calculated average refresh time for a frame. | |
gdouble | avg_refresh_timeout |
Time left until recalculating the average refresh time. | |
struct __frame_table_t * | parent |
The frames table to which this frame is attached. | |
gboolean | hidden |
Tells whether the frame is being displayed or is in an hidden frames stack. | |
guint | id |
An unique identifier for the frame. | |
frame_error_t | last_err |
The type of the last error that occurred. | |
void * | priv |
A pointer to data specific to a monitoring tool. | |
GList *(* | build_func_list )() |
Called during frame init, returns a list of functions that you want to be available for frames of your plugin's type. | |
GList *(* | build_time_periods )() |
Called during frame init, returns a list of time periods available for your plugin. | |
int(* | init_private )(struct __frame_t *) |
Called automatically when the frame is initialised. | |
int(* | restore_private )(struct __frame_t *, GKeyFile *) |
Called automatically after a frame has been restored. | |
int(* | save_private )(struct __frame_t *, GKeyFile *) |
Called automatically when a frame is saved. | |
int(* | free_private )(struct __frame_t *) |
Called automatically before the frame is destroyed. | |
int(* | is_refreshing_needed )(struct __frame_t *) |
Tells if the frame's images should be recomputed. | |
int(* | refresh_content )(struct __frame_t *) |
Computes the new images with ploticus. | |
int(* | draw_area )(struct __frame_t *, cairo_t *) |
Draws what needs to be displayed in a cairo surface. | |
char *(* | get_display_name )(struct __frame_t *) |
Returns the display name to use for the frame. | |
int(* | frame_size_changed )(struct __frame_t *) |
Reflets a frame size change in the plugin's internal data. | |
int(* | display_machine_changed )(struct __frame_t *) |
Reflects the display machine change in the plugin's internal data. | |
int(* | time_period_changed )(struct __frame_t *) |
Reflects the time period change in the plugin's internal data. | |
int(* | button_press_handler )(struct __frame_t *, GdkEventButton *) |
Handles mouse button press events. | |
int(* | button_release_handler )(struct __frame_t *, GdkEventButton *) |
Handles mouse button release events. |
Data structure for the Synema frames.
This is a frame in which data will be displayed about a monitoring tool. The struct contains all the data necessary, including the drawing area where each plugin developer will display it's data, widgets to switch machines and display periods, etc.
The struct also contains pointers to functions that must be written by each plugin developer.
Definition at line 73 of file frame-common.h.
gdouble frame_t::avg_refresh_time |
Last calculated average refresh time for a frame.
Definition at line 82 of file frame-common.h.
gdouble frame_t::avg_refresh_timeout |
Time left until recalculating the average refresh time.
Definition at line 83 of file frame-common.h.
GList*(* frame_t::build_func_list)() |
Called during frame init, returns a list of functions that you want to be available for frames of your plugin's type.
In this function, you should make a GList containing func_list_t structs that all contain a display name and a pointer to a function.
These functions will be added in a frame-specific menu, in the order they are found.
The calling function is in charge of freeing the list.
GList*(* frame_t::build_time_periods)() |
Called during frame init, returns a list of time periods available for your plugin.
In this function, you should create a GList of time_period_t structs that you want to be available for your frame. It will be automatically called during the initialisation of the frame. The list will be freed automatically by the calling function.
int(* frame_t::button_press_handler)(struct __frame_t *, GdkEventButton *) |
Handles mouse button press events.
You should use this function to handle mouse button press events. The GdkEvent parameter will give you the coordinates, the mouse button pressed, and it will tell if it is a single, double or triple click.
You can then use this information to simulate a button click if the coordinates are in a rectangle drawn with cairo.
[out] | frame_t | * the frame on which the event occurred |
[in] | GdkEventButton | * the data about the button press event |
int(* frame_t::button_release_handler)(struct __frame_t *, GdkEventButton *) |
Handles mouse button release events.
You should use this function to handle mouse button release events. The GdkEvent parameter will give you the coordinates, the mouse button releaseed, and it will tell if it is a single, double or triple click.
You can then use this information to simulate a button click if the coordinates are in a rectangle drawn with cairo.
[out] | frame_t | * the frame on which the event occurred |
[in] | GdkEventButton | * the data about the button release event |
The machine for which data should be displayed.
Definition at line 78 of file frame-common.h.
int(* frame_t::display_machine_changed)(struct __frame_t *) |
Reflects the display machine change in the plugin's internal data.
In this function, you should make sure your internal data is in sync with the new machine, so that the data computed by ploticus matches this machine.
[in,out] | frame_t | * the frame whose machine changed |
Period for which the data should be shown.
Definition at line 79 of file frame-common.h.
int(* frame_t::draw_area)(struct __frame_t *, cairo_t *) |
Draws what needs to be displayed in a cairo surface.
This function is where you should draw lines, text and pictures to the screen. It contains a cairo surface clipped to the region where redrawing is needed. You should only do cairo and gdk drawing here and you should not compute images with ploticus.
[in] | frame_t | * the frame which needs to be redrawn |
[out] | cairo_t | * the cairo surface in which you should draw |
int(* frame_t::frame_size_changed)(struct __frame_t *) |
Reflets a frame size change in the plugin's internal data.
This function may or may not be needed depending on your implementation. It's the place where you should change your internal data to make sure the drawing function now draws on a surface matching the new size of the drawing area.
[in,out] | frame_t | * the frame whose size changed |
int(* frame_t::free_private)(struct __frame_t *) |
Called automatically before the frame is destroyed.
In this function, you should free all the data pointed by the priv member. Do not free anything else, it will be taken care of by the free function calling this one before destroying the frame.
[out] | frame_t | * the frame for which private data should be freed |
char*(* frame_t::get_display_name)(struct __frame_t *) |
Returns the display name to use for the frame.
This function returns a static string that can be used as a display name for the frame in the main GUI.
[in] | frame_t | * the frame whose name is wanted |
gboolean frame_t::hidden |
Tells whether the frame is being displayed or is in an hidden frames stack.
Definition at line 85 of file frame-common.h.
guint frame_t::id |
An unique identifier for the frame.
Definition at line 86 of file frame-common.h.
int(* frame_t::init_private)(struct __frame_t *) |
Called automatically when the frame is initialised.
You should initialise your private_data structure and do anything you need to do right after frame initialisation in this function.
[in,out] | frame_t | * the frame that has just been initialised |
int(* frame_t::is_refreshing_needed)(struct __frame_t *) |
Tells if the frame's images should be recomputed.
This function tells if reports changed and the ploticus-generated pictures need to be drawn again.
[in] | frame_t | * the frame which you want to check |
The type of the last error that occurred.
Definition at line 87 of file frame-common.h.
struct __frame_table_t* frame_t::parent [read] |
The frames table to which this frame is attached.
Definition at line 84 of file frame-common.h.
void* frame_t::priv |
A pointer to data specific to a monitoring tool.
Definition at line 106 of file frame-common.h.
int(* frame_t::refresh_content)(struct __frame_t *) |
Computes the new images with ploticus.
This function tells if reports changed and the ploticus-generated images need to be drawn again. You can do anything such as generating these images and computing textual reports in this function.
You should only compute the images for the current set of machine and time period. However, you can compute them for several sizes.
[in,out] | frame_t | * the frame for which data should be refreshed |
int(* frame_t::restore_private)(struct __frame_t *, GKeyFile *) |
Called automatically after a frame has been restored.
In this function, you should load from the GKeyFile anything you saved in the save_private function. This is meant to allow you to restore the state your private data had when your frame was saved.
[out] | frame_t | * the frame whose private data should be restored |
[in] | GKeyFile | * the file containing the data to restore |
int(* frame_t::save_private)(struct __frame_t *, GKeyFile *) |
Called automatically when a frame is saved.
In this function, you should save in a GKeyFile anything in the frame's private data you need to can restore the state of the frame later.
[out] | frame_t | * the frame whose private data should be saved |
[in] | GKeyFile | * the file in which the data should be saved |
Size ratio to use for that frame.
Definition at line 77 of file frame-common.h.
int(* frame_t::time_period_changed)(struct __frame_t *) |
Reflects the time period change in the plugin's internal data.
In this function, you should make sure your internal data is in sync with the new time period, so that the data computed by ploticus matches this time period.
[in,out] | frame_t | * the frame whose time period changed |
gchar* frame_t::type |
Type of the monitoring tool for this frame.
Definition at line 74 of file frame-common.h.