src/*: fix missing functions to generate GLArea
The new UI prototype did not bring functions to generate a GLArea at the correct location in the code tree. This commit fixes this. Signed-off-by: Adrien 'neox' Bourmault <neox@a-lec.org>
This commit is contained in:
parent
ad398cfaad
commit
77dbdaac0c
|
@ -82,3 +82,88 @@ void util_pile_test(); // called in fsm/measure.c
|
|||
void util_double_list_test(); // " "
|
||||
void util_sorted_list_test(); // " "
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
* Look for stack entry and returns stack_id
|
||||
*
|
||||
* @params container_widget, generally the GtkBox that contains the GLArea
|
||||
*
|
||||
* @returns stack_id
|
||||
*/
|
||||
long util_gl_get_stack(void *container_widget);
|
||||
|
||||
/*
|
||||
* Look for stack entry and returns stack_id
|
||||
*
|
||||
* @params container_widget, generally the GtkBox that contains the GLArea
|
||||
*
|
||||
* @returns stack_id
|
||||
*/
|
||||
long util_gl_is_util_ready(void *container_widget);
|
||||
|
||||
/*
|
||||
* Look for stack entry and initializes OpenGL for it
|
||||
*
|
||||
* @params container_widget, generally the GtkBox that contains the GLArea
|
||||
*
|
||||
* @returns bool, true if success
|
||||
*/
|
||||
bool util_gl_init_stack(void *container_widget, GError *error_buffer);
|
||||
|
||||
/*
|
||||
* Look for stack entry and shutdowns OpenGL for it
|
||||
*
|
||||
* @params container_widget, generally the GtkBox that contains the GLArea
|
||||
*
|
||||
* @returns bool, true if success
|
||||
*/
|
||||
bool util_gl_shutdown_stack(void *container_widget, GError *error_buffer);
|
||||
|
||||
void util_gl_clean_stack_index(void);
|
||||
|
||||
/*
|
||||
* Look for stack entry and triggers OpenGL for drawing
|
||||
*
|
||||
* @params container_widget, generally the GtkBox that contains the GLArea
|
||||
*
|
||||
* @returns bool, true if success
|
||||
*/
|
||||
bool util_gl_render_stack(GtkWidget *container_widget);
|
||||
|
||||
/*
|
||||
* Look for stack entry and triggers OpenGL for drawing
|
||||
*
|
||||
* @params container_widget, generally the GtkBox that contains the GLArea
|
||||
*
|
||||
* @returns bool, true if success
|
||||
*/
|
||||
bool util_gl_update_axis(GtkWidget *container_widget, int axis, int value);
|
||||
|
||||
/*
|
||||
* Look for every stack entry and shutdowns OpenGL for it
|
||||
*
|
||||
* @params void
|
||||
*
|
||||
* @returns bool, true if success
|
||||
*/
|
||||
void util_gl_shutdown_all_stacks(void);
|
||||
|
||||
/*
|
||||
* Creates a slider widget
|
||||
*
|
||||
* @params axis, meaning which axis we're building (for label)
|
||||
*
|
||||
* @returns GtkWidget*, pointer to the new widget
|
||||
*/
|
||||
GtkWidget *create_axis_slider(int axis);
|
||||
|
||||
/*
|
||||
* Creates GLArea and indexes it
|
||||
*
|
||||
* @params target_mode, meaning which util_gl_stack we're on
|
||||
* target_widget, meaning the box that will host the GLArea
|
||||
*
|
||||
* @returns bool, true if success
|
||||
*/
|
||||
bool util_gl_setup_glarea(int target_mode, GtkWidget *target_widget);
|
|
@ -31,6 +31,7 @@
|
|||
#include "../include/signal.h"
|
||||
#include "../include/widget.h"
|
||||
#include "../include/graphics.h"
|
||||
#include "../include/util.h"
|
||||
|
||||
|
||||
static void on_auto_notification (const char *message)
|
||||
|
@ -114,7 +115,7 @@ gboolean on_glarea_render(GtkGLArea *area,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (graphics_render_stack(gtk_widget_get_parent(GTK_WIDGET(area))) == false) {
|
||||
if (util_gl_render_stack(gtk_widget_get_parent(GTK_WIDGET(area))) == false) {
|
||||
on_auto_notification("Failed to render corresponding graphic stack !");
|
||||
return false;
|
||||
}
|
||||
|
@ -138,7 +139,7 @@ void on_glarea_realize(GtkWidget *widget)
|
|||
}
|
||||
|
||||
// Link graphical stack to widget
|
||||
if (graphics_init_graphics_stack(gtk_widget_get_parent(widget),
|
||||
if (util_gl_init_stack(gtk_widget_get_parent(widget),
|
||||
internal_error) == false) {
|
||||
on_auto_notification(
|
||||
"Failed to link the graphic stack to widgets !");
|
||||
|
@ -163,7 +164,7 @@ void on_glarea_unrealize(GtkWidget *widget)
|
|||
}
|
||||
|
||||
// Destroy graphic stack
|
||||
if (graphics_shutdown_graphics_stack(gtk_widget_get_parent(widget),
|
||||
if (util_gl_shutdown_stack(gtk_widget_get_parent(widget),
|
||||
internal_error) == false) {
|
||||
on_auto_notification(
|
||||
"Failed to shutdown the graphic stack !");
|
||||
|
@ -185,7 +186,7 @@ void on_axis_value_change(GtkAdjustment *adjustment, gpointer data)
|
|||
g_assert(axis >= 0 && axis < N_AXIS);
|
||||
|
||||
/* Update the rotation angle */
|
||||
graphics_update_axis_stack(container_widget,
|
||||
util_gl_update_axis(container_widget,
|
||||
axis,
|
||||
gtk_adjustment_get_value(adjustment));
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ long util_gl_get_stack(void *container_widget)
|
|||
*
|
||||
* @returns stack_id
|
||||
*/
|
||||
long util_gl_is_util_ready(void *container_widget)
|
||||
long util_gl_is_ready(void *container_widget)
|
||||
{
|
||||
// look for stack_index entry
|
||||
for (int i = 0; i < stack_index_size; i++) {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "../../../include/fsm.h"
|
||||
#include "../../../include/widget.h"
|
||||
#include "../../../include/signal.h"
|
||||
#include "../../../include/util.h"
|
||||
|
||||
static GtkAdjustment *X_adjust;
|
||||
static GtkAdjustment *Y_adjust;
|
||||
|
@ -89,7 +90,7 @@ static void *get_ZOOM_box()
|
|||
void *widget_get_space_view(int partition_space_vs_camera)
|
||||
{
|
||||
GtkBox *drawbox = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0));
|
||||
ui_setup_glarea (GTK_BOX (drawbox));
|
||||
util_gl_setup_glarea (0, GTK_WIDGET (drawbox));
|
||||
|
||||
GtkBox *camera = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2));
|
||||
gtk_box_append (camera, GTK_WIDGET (get_XYZ_box()));
|
||||
|
|
Loading…
Reference in New Issue