Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 23207 | Differences between
and this patch

Collapse All | Expand All

(-)glui_v2_1_beta.orig/algebra3.cpp (+3 lines)
Lines 723-728 Link Here
723
{
723
{
724
  int i, j;
724
  int i, j;
725
725
726
  (void)file;
727
726
  fprintf( stderr, "%s:\n", name );
728
  fprintf( stderr, "%s:\n", name );
727
  
729
  
728
  for( i = 0; i < 3; i++ )
730
  for( i = 0; i < 3; i++ )
Lines 846-851 Link Here
846
{
848
{
847
  int i, j;
849
  int i, j;
848
850
851
  (void)file;
849
  fprintf( stderr, "%s:\n", name );
852
  fprintf( stderr, "%s:\n", name );
850
  
853
  
851
  for( i = 0; i < 4; i++ )
854
  for( i = 0; i < 4; i++ )
(-)glui_v2_1_beta.orig/arcball.cpp (-1 / +1 lines)
Lines 83-89 Link Here
83
  float mag;
83
  float mag;
84
  vec2  v2 = (p - center) / radius;
84
  vec2  v2 = (p - center) / radius;
85
  vec3  v3( v2[0], v2[1], 0.0 );
85
  vec3  v3( v2[0], v2[1], 0.0 );
86
  vec3  axis;
87
  
86
  
88
  mag = v2*v2;
87
  mag = v2*v2;
89
  
88
  
Lines 138-143 Link Here
138
137
139
void Arcball::mouse_motion( int x, int y, int shift, int ctrl, int alt )
138
void Arcball::mouse_motion( int x, int y, int shift, int ctrl, int alt )
140
{
139
{
140
  (void)shift;
141
  /* Set the X constraint if CONTROL key is pressed, Y if ALT key */
141
  /* Set the X constraint if CONTROL key is pressed, Y if ALT key */
142
  set_constraints( ctrl != 0, alt != 0 );
142
  set_constraints( ctrl != 0, alt != 0 );
143
143
(-)glui_v2_1_beta.orig/example1.cpp (-1 / +3 lines)
Lines 85-91 Link Here
85
85
86
/**************************************** main() ********************/
86
/**************************************** main() ********************/
87
87
88
void main(int argc, char* argv[])
88
int main(int argc, char* argv[])
89
{
89
{
90
  /****************************************/
90
  /****************************************/
91
  /*   Initialize GLUT and create window  */
91
  /*   Initialize GLUT and create window  */
Lines 136-141 Link Here
136
  GLUI_Master.set_glutIdleFunc( myGlutIdle ); 
136
  GLUI_Master.set_glutIdleFunc( myGlutIdle ); 
137
137
138
  glutMainLoop();
138
  glutMainLoop();
139
140
  return 0; /* never reached */
139
}
141
}
140
142
141
143
(-)glui_v2_1_beta.orig/example2.cpp (-1 / +3 lines)
Lines 181-187 Link Here
181
181
182
/**************************************** main() ********************/
182
/**************************************** main() ********************/
183
183
184
void main(int argc, char* argv[])
184
int main(int argc, char* argv[])
185
{
185
{
186
  /****************************************/
186
  /****************************************/
187
  /*   Initialize GLUT and create window  */
187
  /*   Initialize GLUT and create window  */
Lines 244-247 Link Here
244
  GLUI_Master.set_glutIdleFunc( myGlutIdle );
244
  GLUI_Master.set_glutIdleFunc( myGlutIdle );
245
245
246
  glutMainLoop();
246
  glutMainLoop();
247
248
  return 0; /* not reached */
247
}
249
}
(-)glui_v2_1_beta.orig/example3.cpp (-1 / +3 lines)
Lines 263-269 Link Here
263
263
264
/**************************************** main() ********************/
264
/**************************************** main() ********************/
265
265
266
void main(int argc, char* argv[])
266
int main(int argc, char* argv[])
267
{
267
{
268
  /****************************************/
268
  /****************************************/
269
  /*   Initialize GLUT and create window  */
269
  /*   Initialize GLUT and create window  */
Lines 392-396 Link Here
392
392
393
  /**** Regular GLUT main loop ****/  
393
  /**** Regular GLUT main loop ****/  
394
  glutMainLoop();
394
  glutMainLoop();
395
396
  return 0; /* not reached */
395
}
397
}
396
398
(-)glui_v2_1_beta.orig/example4.cpp (-1 / +3 lines)
Lines 253-259 Link Here
253
253
254
/**************************************** main() ********************/
254
/**************************************** main() ********************/
255
255
256
void main(int argc, char* argv[])
256
int main(int argc, char* argv[])
257
{
257
{
258
  /****************************************/
258
  /****************************************/
259
  /*   Initialize GLUT and create window  */
259
  /*   Initialize GLUT and create window  */
Lines 371-375 Link Here
371
  /**** Regular GLUT main loop ****/
371
  /**** Regular GLUT main loop ****/
372
  
372
  
373
  glutMainLoop();
373
  glutMainLoop();
374
375
  return 0; /* not reached */
374
}
376
}
375
377
(-)glui_v2_1_beta.orig/example5.cpp (-1 / +3 lines)
Lines 310-316 Link Here
310
310
311
/**************************************** main() ********************/
311
/**************************************** main() ********************/
312
312
313
void main(int argc, char* argv[])
313
int main(int argc, char* argv[])
314
{
314
{
315
  /****************************************/
315
  /****************************************/
316
  /*   Initialize GLUT and create window  */
316
  /*   Initialize GLUT and create window  */
Lines 478-482 Link Here
478
  /**** Regular GLUT main loop ****/
478
  /**** Regular GLUT main loop ****/
479
  
479
  
480
  glutMainLoop();
480
  glutMainLoop();
481
482
  return 0; /* not reached */
481
}
483
}
482
484
(-)glui_v2_1_beta.orig/glui.cpp (+9 lines)
Lines 107-112 Link Here
107
107
108
void     GLUI_Main::create_subwindow( int parent_window, int window_alignment )
108
void     GLUI_Main::create_subwindow( int parent_window, int window_alignment )
109
{
109
{
110
  (void)window_alignment;
110
  glut_window_id = glutCreateSubWindow( parent_window, 0,0, 100, 100 );
111
  glut_window_id = glutCreateSubWindow( parent_window, 0,0, 100, 100 );
111
  glDisable( GL_DEPTH_TEST );
112
  glDisable( GL_DEPTH_TEST );
112
  glCullFace( GL_BACK );
113
  glCullFace( GL_BACK );
Lines 605-610 Link Here
605
{
606
{
606
  GLUI_Control *new_control;
607
  GLUI_Control *new_control;
607
608
609
  (void)x;
610
  (void)y;
611
608
  curr_modifiers = glutGetModifiers();
612
  curr_modifiers = glutGetModifiers();
609
613
610
  /*** If it's a tab or shift tab, we don't pass it on to the controls.
614
  /*** If it's a tab or shift tab, we don't pass it on to the controls.
Lines 646-651 Link Here
646
{
650
{
647
  curr_modifiers = glutGetModifiers();
651
  curr_modifiers = glutGetModifiers();
648
652
653
  (void)x;
654
  (void)y;
655
649
  /*** Pass the keystroke onto the active control, if any ***/
656
  /*** Pass the keystroke onto the active control, if any ***/
650
  if ( active_control != NULL )
657
  if ( active_control != NULL )
651
    active_control->special_handler( key, glutGetModifiers() );
658
    active_control->special_handler( key, glutGetModifiers() );
Lines 787-792 Link Here
787
794
788
void    GLUI_Main::entry(int state)
795
void    GLUI_Main::entry(int state)
789
{
796
{
797
  (void)state;
790
  /*if ( NOT active_control OR ( active_control AND ( active_control->type == GLUI_CONTROL_EDITTEXT
798
  /*if ( NOT active_control OR ( active_control AND ( active_control->type == GLUI_CONTROL_EDITTEXT
791
    OR active_control->type == GLUI_CONTROL_SPINNER) ) )*/
799
    OR active_control->type == GLUI_CONTROL_SPINNER) ) )*/
792
  glutSetCursor( GLUT_CURSOR_LEFT_ARROW );
800
  glutSetCursor( GLUT_CURSOR_LEFT_ARROW );
Lines 797-802 Link Here
797
805
798
void    GLUI_Main::visibility(int state)
806
void    GLUI_Main::visibility(int state)
799
{
807
{
808
  (void)state;
800
}
809
}
801
810
802
811
(-)glui_v2_1_beta.orig/glui.h (-17 / +18 lines)
Lines 295-302 Link Here
295
    parent_node= child_head = child_tail = next_sibling = prev_sibling = NULL;
295
    parent_node= child_head = child_tail = next_sibling = prev_sibling = NULL;
296
  }; 
296
  }; 
297
297
298
  friend GLUI_Rollout;
298
  friend class GLUI_Rollout;
299
  friend GLUI_Main;
299
  friend class GLUI_Main;
300
};
300
};
301
301
302
302
Lines 559-569 Link Here
559
559
560
  /********** Friend classes *************/
560
  /********** Friend classes *************/
561
561
562
  friend GLUI_Control;
562
  friend class GLUI_Control;
563
  friend GLUI_Rotation;
563
  friend class GLUI_Rotation;
564
  friend GLUI_Translation;
564
  friend class GLUI_Translation;
565
  friend GLUI;
565
  friend class GLUI;
566
  friend GLUI_Master_Object;
566
  friend class GLUI_Master_Object;
567
567
568
568
569
  /********** Misc functions *************/
569
  /********** Misc functions *************/
Lines 713-735 Link Here
713
  virtual void   get_float_array_val( float *array_ptr );
713
  virtual void   get_float_array_val( float *array_ptr );
714
  
714
  
715
  virtual int mouse_down_handler( int local_x, int local_y ) 
715
  virtual int mouse_down_handler( int local_x, int local_y ) 
716
    { return false; };
716
    { (void)local_x; (void)local_y; return false; };
717
  virtual int mouse_up_handler( int local_x, int local_y, int inside )
717
  virtual int mouse_up_handler( int local_x, int local_y, int inside )
718
    { return false; };
718
    { (void)local_x; (void)local_y; (void)inside; return false; };
719
  virtual int mouse_held_down_handler( int local_x, int local_y, int inside)
719
  virtual int mouse_held_down_handler( int local_x, int local_y, int inside)
720
    { return false; };
720
    { (void)local_x; (void)local_y; (void)inside; return false; };
721
  virtual int key_handler( unsigned char key, int modifiers )
721
  virtual int key_handler( unsigned char key, int modifiers )
722
    { return false; };
722
    { (void)key; (void)modifiers; return false; };
723
  virtual int special_handler( int key,int modifiers )
723
  virtual int special_handler( int key,int modifiers )
724
    { return false; };
724
    { (void)key; (void)modifiers; return false; };
725
725
726
  virtual void update_size( void )     { };
726
  virtual void update_size( void )     { };
727
  virtual void idle( void )            { };
727
  virtual void idle( void )            { };
728
  virtual int  mouse_over( int state, int x, int y ) { return false; };
728
  virtual int  mouse_over( int state, int x, int y )
729
    { (void)state; (void)x; (void)y; return false; };
729
  
730
  
730
  virtual void enable( void ); 
731
  virtual void enable( void ); 
731
  virtual void disable( void );
732
  virtual void disable( void );
732
  virtual void activate( int how )     { active = true; };
733
  virtual void activate( int how )     { (void)how; active = true; };
733
  virtual void disactivate( void )     { active = false; };
734
  virtual void disactivate( void )     { active = false; };
734
735
735
  void         hide_internal( int recurse );
736
  void         hide_internal( int recurse );
Lines 770-776 Link Here
770
  void         sync_live( int recurse, int draw );  /* Reads live variable */
771
  void         sync_live( int recurse, int draw );  /* Reads live variable */
771
  void         init_live( void );
772
  void         init_live( void );
772
  void         output_live( int update_main_gfx );        /** Writes live variable **/
773
  void         output_live( int update_main_gfx );        /** Writes live variable **/
773
  virtual void set_text( char *t )   {};
774
  virtual void set_text( char *t )   { (void)t; };
774
  void         execute_callback( void );
775
  void         execute_callback( void );
775
  void         get_this_column_dims( int *col_x, int *col_y, 
776
  void         get_this_column_dims( int *col_x, int *col_y, 
776
				     int *col_w, int *col_h, 
777
				     int *col_w, int *col_h, 
Lines 815-821 Link Here
815
      float_array_val[i] = last_live_float_array[i] = 0.0;
816
      float_array_val[i] = last_live_float_array[i] = 0.0;
816
  };
817
  };
817
818
818
  ~GLUI_Control();
819
  virtual ~GLUI_Control(void);
819
};
820
};
820
821
821
822
Lines 1478-1484 Link Here
1478
    glut_menu_id   = -1;
1479
    glut_menu_id   = -1;
1479
  };
1480
  };
1480
1481
1481
  ~GLUI_Listbox();
1482
  virtual ~GLUI_Listbox();
1482
};
1483
};
1483
1484
1484
1485
(-)glui_v2_1_beta.orig/glui_button.cpp (+15 lines)
Lines 26-31 Link Here
26
  int_val = 1;   /** A button always in unpressed before here, so
26
  int_val = 1;   /** A button always in unpressed before here, so
27
		   now we invariably set it to 'depressed' **/
27
		   now we invariably set it to 'depressed' **/
28
28
29
  (void)local_x;
30
  (void)local_y;
31
29
  currently_inside = true;
32
  currently_inside = true;
30
33
31
  draw_pressed();
34
  draw_pressed();
Lines 38-43 Link Here
38
41
39
int    GLUI_Button::mouse_up_handler( int local_x, int local_y, int inside )
42
int    GLUI_Button::mouse_up_handler( int local_x, int local_y, int inside )
40
{
43
{
44
  (void)local_x;
45
  (void)local_y;
46
41
  set_int_val( 0 );   /** A button always turns off after you press it **/
47
  set_int_val( 0 );   /** A button always turns off after you press it **/
42
48
43
  draw_unpressed();
49
  draw_unpressed();
Lines 62-67 Link Here
62
int    GLUI_Button::mouse_held_down_handler( int local_x, int local_y,
68
int    GLUI_Button::mouse_held_down_handler( int local_x, int local_y,
63
					     int new_inside)
69
					     int new_inside)
64
{
70
{
71
  (void)local_x;
72
  (void)local_y;
73
65
  if ( NOT new_inside AND currently_inside == true ) {
74
  if ( NOT new_inside AND currently_inside == true ) {
66
    draw_unpressed();
75
    draw_unpressed();
67
  } 
76
  } 
Lines 79-84 Link Here
79
88
80
int    GLUI_Button::key_handler( unsigned char key,int modifiers )
89
int    GLUI_Button::key_handler( unsigned char key,int modifiers )
81
{
90
{
91
  (void)key;
92
  (void)modifiers;
93
82
  return false;
94
  return false;
83
}
95
}
84
96
Lines 135-140 Link Here
135
147
136
void    GLUI_Button::draw( int x, int y )
148
void    GLUI_Button::draw( int x, int y )
137
{
149
{
150
  (void)x;
151
  (void)y;
152
138
  if ( NOT can_draw() )
153
  if ( NOT can_draw() )
139
    return;
154
    return;
140
155
(-)glui_v2_1_beta.orig/glui_checkbox.cpp (+16 lines)
Lines 25-30 Link Here
25
{
25
{
26
  orig_value = int_val;
26
  orig_value = int_val;
27
  
27
  
28
  (void)local_x;
29
  (void)local_y;
30
28
  TOGGLE_BOOL( int_val );
31
  TOGGLE_BOOL( int_val );
29
32
30
  currently_inside = true;
33
  currently_inside = true;
Lines 42-47 Link Here
42
45
43
int    GLUI_Checkbox::mouse_up_handler( int local_x, int local_y, int inside )
46
int    GLUI_Checkbox::mouse_up_handler( int local_x, int local_y, int inside )
44
{
47
{
48
  (void)local_x;
49
  (void)local_y;
50
45
  if ( NOT inside ) {
51
  if ( NOT inside ) {
46
    int_val = orig_value;    
52
    int_val = orig_value;    
47
  }
53
  }
Lines 66-71 Link Here
66
int    GLUI_Checkbox::mouse_held_down_handler( int local_x, int local_y,
72
int    GLUI_Checkbox::mouse_held_down_handler( int local_x, int local_y,
67
					       int inside)
73
					       int inside)
68
{
74
{
75
  (void)local_x;
76
  (void)local_y;
77
  (void)inside;
78
69
  /********** Toggle checked and unchecked bitmap if we're entering or
79
  /********** Toggle checked and unchecked bitmap if we're entering or
70
    leaving the checkbox area **********/
80
    leaving the checkbox area **********/
71
81
Lines 93-98 Link Here
93
103
94
int    GLUI_Checkbox::key_handler( unsigned char key,int modifiers )
104
int    GLUI_Checkbox::key_handler( unsigned char key,int modifiers )
95
{
105
{
106
  (void)key;
107
  (void)modifiers;
108
96
  return false;
109
  return false;
97
}
110
}
98
111
Lines 103-108 Link Here
103
{
116
{
104
  int orig;
117
  int orig;
105
118
119
  (void)x;
120
  (void)y;
121
106
  if ( NOT can_draw() )
122
  if ( NOT can_draw() )
107
    return;
123
    return;
108
124
(-)glui_v2_1_beta.orig/glui_column.cpp (+3 lines)
Lines 27-32 Link Here
27
  int   panel_x, panel_y, panel_w, panel_h, panel_x_off, panel_y_off;
27
  int   panel_x, panel_y, panel_w, panel_h, panel_x_off, panel_y_off;
28
  int   y_diff;
28
  int   y_diff;
29
  
29
  
30
  (void)x;
31
  (void)y;
32
30
  if ( NOT can_draw() )
33
  if ( NOT can_draw() )
31
    return;
34
    return;
32
35
(-)glui_v2_1_beta.orig/glui_control.cpp (+3 lines)
Lines 184-189 Link Here
184
{
184
{
185
  GLUI_Control *node;
185
  GLUI_Control *node;
186
186
187
  (void)x;
188
  (void)y;
189
187
  /*  printf( "%s %d\n", this->name.string, this->hidden );*/
190
  /*  printf( "%s %d\n", this->name.string, this->hidden );*/
188
  if ( NOT can_draw() )
191
  if ( NOT can_draw() )
189
    return;
192
    return;
(-)glui_v2_1_beta.orig/glui_edittext.cpp (-1 / +16 lines)
Lines 51-56 Link Here
51
51
52
int    GLUI_EditText::mouse_up_handler( int local_x, int local_y, int inside )
52
int    GLUI_EditText::mouse_up_handler( int local_x, int local_y, int inside )
53
{
53
{
54
  (void)local_x;
55
  (void)local_y;
56
  (void)inside;
57
54
  return false;
58
  return false;
55
}
59
}
56
60
Lines 224-230 Link Here
224
    }
228
    }
225
229
226
    /******** check whether we have space ******/
230
    /******** check whether we have space ******/
227
    if ( (int)strlen( text ) + 2 >= sizeof( GLUI_String ))
231
    if ( strlen( text ) + 2 >= sizeof( GLUI_String ))
228
      return false;
232
      return false;
229
233
230
    /******** We insert the character into the string ***/
234
    /******** We insert the character into the string ***/
Lines 364-369 Link Here
364
  int orig;
368
  int orig;
365
  int name_x;
369
  int name_x;
366
370
371
  (void)x;
372
  (void)y;
373
367
  if ( NOT can_draw() )
374
  if ( NOT can_draw() )
368
    return;
375
    return;
369
376
Lines 484-489 Link Here
484
  int text_x, i, sel_lo, sel_hi;
491
  int text_x, i, sel_lo, sel_hi;
485
  int orig;
492
  int orig;
486
493
494
  (void)x;
495
  (void)y;
496
487
  if ( NOT can_draw() )
497
  if ( NOT can_draw() )
488
    return;
498
    return;
489
499
Lines 584-589 Link Here
584
{
594
{
585
  int curr_x, i;
595
  int curr_x, i;
586
596
597
  (void)y;
598
587
  /*** See if we clicked outside box ***/
599
  /*** See if we clicked outside box ***/
588
  if ( x < this->x_abs + text_x_offset )
600
  if ( x < this->x_abs + text_x_offset )
589
    return -1;
601
    return -1;
Lines 1032-1037 Link Here
1032
1044
1033
int    GLUI_EditText::mouse_over( int state, int x, int y )
1045
int    GLUI_EditText::mouse_over( int state, int x, int y )
1034
{
1046
{
1047
  (void)x;
1048
  (void)y;
1049
1035
  if ( state ) {
1050
  if ( state ) {
1036
    /*  curr_cursor = GLUT_CURSOR_TEXT;              */
1051
    /*  curr_cursor = GLUT_CURSOR_TEXT;              */
1037
    glutSetCursor( GLUT_CURSOR_TEXT );
1052
    glutSetCursor( GLUT_CURSOR_TEXT );
(-)glui_v2_1_beta.orig/glui_listbox.cpp (+19 lines)
Lines 23-28 Link Here
23
23
24
int    GLUI_Listbox::mouse_down_handler( int local_x, int local_y )
24
int    GLUI_Listbox::mouse_down_handler( int local_x, int local_y )
25
{
25
{
26
 (void)local_x;
27
 (void)local_y;
28
26
  return false;
29
  return false;
27
}
30
}
28
31
Lines 31-36 Link Here
31
34
32
int    GLUI_Listbox::mouse_up_handler( int local_x, int local_y, int inside )
35
int    GLUI_Listbox::mouse_up_handler( int local_x, int local_y, int inside )
33
{
36
{
37
 (void)local_x;
38
 (void)local_y;
39
 (void)inside;
34
40
35
  return false;
41
  return false;
36
}
42
}
Lines 41-46 Link Here
41
int    GLUI_Listbox::mouse_held_down_handler( int local_x, int local_y,
47
int    GLUI_Listbox::mouse_held_down_handler( int local_x, int local_y,
42
					      int inside)
48
					      int inside)
43
{
49
{
50
 (void)local_x;
51
 (void)local_y;
52
 (void)inside;
44
  
53
  
45
  return false;
54
  return false;
46
}
55
}
Lines 50-55 Link Here
50
59
51
int    GLUI_Listbox::key_handler( unsigned char key,int modifiers )
60
int    GLUI_Listbox::key_handler( unsigned char key,int modifiers )
52
{
61
{
62
  (void)key;
63
  (void)modifiers;
64
53
  return false;
65
  return false;
54
}
66
}
55
67
Lines 60-65 Link Here
60
{
72
{
61
  int orig, name_x;
73
  int orig, name_x;
62
74
75
  (void)x;
76
  (void)y;
77
63
  if ( NOT can_draw() )
78
  if ( NOT can_draw() )
64
    return;
79
    return;
65
80
Lines 324-329 Link Here
324
{
339
{
325
  GLUI_Listbox_Item *item;
340
  GLUI_Listbox_Item *item;
326
341
342
  (void)y;
343
327
  /*  printf( "x/y:   %d/%d\n", x, y );              */
344
  /*  printf( "x/y:   %d/%d\n", x, y );              */
328
345
329
  if ( state AND enabled AND x > x_abs + text_x_offset) {
346
  if ( state AND enabled AND x > x_abs + text_x_offset) {
Lines 412-417 Link Here
412
{
429
{
413
  GLUI_Listbox_Item *node, *new_node;
430
  GLUI_Listbox_Item *node, *new_node;
414
431
432
  (void)modifiers;
433
415
  node     = get_item_ptr( int_val );
434
  node     = get_item_ptr( int_val );
416
  new_node = NULL;
435
  new_node = NULL;
417
436
(-)glui_v2_1_beta.orig/glui_mouse_iaction.cpp (+7 lines)
Lines 23-29 Link Here
23
23
24
int    GLUI_Mouse_Interaction::mouse_down_handler( int local_x, int local_y )
24
int    GLUI_Mouse_Interaction::mouse_down_handler( int local_x, int local_y )
25
{
25
{
26
#if 0
26
  int win_h = glutGet( GLUT_WINDOW_HEIGHT );
27
  int win_h = glutGet( GLUT_WINDOW_HEIGHT );
28
#endif
27
29
28
  /*	iaction_mouse_down_handler( local_x, local_y );              */
30
  /*	iaction_mouse_down_handler( local_x, local_y );              */
29
  iaction_mouse_down_handler( local_x-x_abs, local_y-y_abs );
31
  iaction_mouse_down_handler( local_x-x_abs, local_y-y_abs );
Lines 70-75 Link Here
70
  int text_width	= string_width( this->name );
72
  int text_width	= string_width( this->name );
71
  int x_left			= this->w/2 - text_width/2;
73
  int x_left			= this->w/2 - text_width/2;
72
  
74
  
75
  (void)x;
76
  (void)y;
77
73
  if ( NOT glui )
78
  if ( NOT glui )
74
    return;
79
    return;
75
80
Lines 112-117 Link Here
112
  int center_x, center_y;
117
  int center_x, center_y;
113
  int drag_x, drag_y;
118
  int drag_x, drag_y;
114
119
120
  (void)modifiers;
121
115
  center_x = w/2;
122
  center_x = w/2;
116
  center_y = (h-18)/2;
123
  center_y = (h-18)/2;
117
  drag_x   = 0;
124
  drag_x   = 0;
(-)glui_v2_1_beta.orig/glui_panel.cpp (+3 lines)
Lines 25-30 Link Here
25
{
25
{
26
  int top, orig;
26
  int top, orig;
27
27
28
  (void)x;
29
  (void)y;
30
28
  if ( NOT can_draw() )
31
  if ( NOT can_draw() )
29
    return;
32
    return;
30
33
(-)glui_v2_1_beta.orig/glui_radio.cpp (+15 lines)
Lines 23-28 Link Here
23
23
24
void    GLUI_RadioGroup::draw( int x, int y )
24
void    GLUI_RadioGroup::draw( int x, int y )
25
{
25
{
26
  (void)x;
27
  (void)y;
28
26
  if ( NOT can_draw() )
29
  if ( NOT can_draw() )
27
    return;
30
    return;
28
31
Lines 116-121 Link Here
116
119
117
int    GLUI_RadioButton::mouse_down_handler( int local_x, int local_y )
120
int    GLUI_RadioButton::mouse_down_handler( int local_x, int local_y )
118
{
121
{
122
  (void)local_x;
123
  (void)local_y;
124
119
  if ( NOT group )
125
  if ( NOT group )
120
    return false;
126
    return false;
121
127
Lines 135-140 Link Here
135
int    GLUI_RadioButton::mouse_up_handler( int local_x, int local_y, 
141
int    GLUI_RadioButton::mouse_up_handler( int local_x, int local_y, 
136
					   int inside )
142
					   int inside )
137
{
143
{
144
  (void)local_x;
145
  (void)local_y;
146
138
  if ( NOT group )
147
  if ( NOT group )
139
    return false;
148
    return false;
140
149
Lines 168-173 Link Here
168
int    GLUI_RadioButton::mouse_held_down_handler( int local_x, int local_y,
177
int    GLUI_RadioButton::mouse_held_down_handler( int local_x, int local_y,
169
						  int inside)
178
						  int inside)
170
{
179
{
180
  (void)local_x;
181
  (void)local_y;
182
171
  if ( NOT inside AND currently_inside == true ) {
183
  if ( NOT inside AND currently_inside == true ) {
172
    group->set_selected( orig_value );
184
    group->set_selected( orig_value );
173
    group->draw_group( true );
185
    group->draw_group( true );
Lines 189-194 Link Here
189
{
201
{
190
  int orig;
202
  int orig;
191
203
204
  (void)x;
205
  (void)y;
206
192
  orig = set_to_glut_window();
207
  orig = set_to_glut_window();
193
208
194
  if ( NOT group OR NOT can_draw() )
209
  if ( NOT group OR NOT can_draw() )
(-)glui_v2_1_beta.orig/glui_rollout.cpp (+11 lines)
Lines 90-95 Link Here
90
90
91
int   GLUI_Rollout::mouse_down_handler( int local_x, int local_y )
91
int   GLUI_Rollout::mouse_down_handler( int local_x, int local_y )
92
{
92
{
93
  (void)local_x;
94
93
  if ( local_y - y_abs > 18 ) {
95
  if ( local_y - y_abs > 18 ) {
94
    initially_inside = currently_inside = false;
96
    initially_inside = currently_inside = false;
95
    return false;
97
    return false;
Lines 108-113 Link Here
108
110
109
int   GLUI_Rollout::mouse_up_handler( int local_x, int local_y, int inside )
111
int   GLUI_Rollout::mouse_up_handler( int local_x, int local_y, int inside )
110
{
112
{
113
  (void)local_x;
114
  (void)local_y;
115
  (void)inside;
116
111
  draw_unpressed();
117
  draw_unpressed();
112
118
113
  if ( currently_inside ) {    
119
  if ( currently_inside ) {    
Lines 129-134 Link Here
129
{
135
{
130
  int orig, left, right, top, bottom;
136
  int orig, left, right, top, bottom;
131
137
138
  (void)x;
139
  (void)y;
140
132
  if ( NOT can_draw() )
141
  if ( NOT can_draw() )
133
    return;
142
    return;
134
143
Lines 267-272 Link Here
267
					   int local_x, int local_y, 
276
					   int local_x, int local_y, 
268
					   int new_inside )
277
					   int new_inside )
269
{
278
{
279
  (void)local_x;
280
270
  if ( NOT initially_inside )
281
  if ( NOT initially_inside )
271
    return false;
282
    return false;
272
283
(-)glui_v2_1_beta.orig/glui_rotation.cpp (-2 / +11 lines)
Lines 28-34 Link Here
28
28
29
  init_ball();
29
  init_ball();
30
30
31
  local_y = 2.0 * ball->center[1] - local_y;
31
  local_y = static_cast<int>(2.0 * ball->center[1] - local_y);
32
32
33
  ball->mouse_down( local_x, local_y );
33
  ball->mouse_down( local_x, local_y );
34
34
Lines 47-52 Link Here
47
int    GLUI_Rotation::iaction_mouse_up_handler( int local_x, int local_y, 
47
int    GLUI_Rotation::iaction_mouse_up_handler( int local_x, int local_y, 
48
						int inside )
48
						int inside )
49
{
49
{
50
  (void)local_x;
51
  (void)local_y;
52
  (void)inside;
53
50
  copy_float_array_to_ball();
54
  copy_float_array_to_ball();
51
55
52
  ball->mouse_up();
56
  ball->mouse_up();
Lines 60-71 Link Here
60
int    GLUI_Rotation::iaction_mouse_held_down_handler( int local_x, int local_y,
64
int    GLUI_Rotation::iaction_mouse_held_down_handler( int local_x, int local_y,
61
						       int inside)
65
						       int inside)
62
{  
66
{  
67
  (void)inside;
68
63
  if ( NOT glui )
69
  if ( NOT glui )
64
    return 0;
70
    return 0;
65
71
66
  copy_float_array_to_ball();
72
  copy_float_array_to_ball();
67
73
68
  local_y = 2.0 * ball->center[1] - local_y;
74
  local_y = static_cast<int>(2.0 * ball->center[1] - local_y);
69
75
70
  /*	printf( "%d %d\n", local_x, local_y );              */
76
  /*	printf( "%d %d\n", local_x, local_y );              */
71
77
Lines 159-164 Link Here
159
165
160
void     GLUI_Rotation::iaction_dump( FILE *output )
166
void     GLUI_Rotation::iaction_dump( FILE *output )
161
{
167
{
168
    (void)output;
162
}
169
}
163
170
164
171
Lines 166-171 Link Here
166
173
167
int    GLUI_Rotation::iaction_special_handler( int key,int modifiers )
174
int    GLUI_Rotation::iaction_special_handler( int key,int modifiers )
168
{
175
{
176
  (void)key;
177
  (void)modifiers;
169
178
170
  return false;
179
  return false;
171
}
180
}
(-)glui_v2_1_beta.orig/glui_separator.cpp (-1 / +4 lines)
Lines 26-31 Link Here
26
  int width, indent, orig;
26
  int width, indent, orig;
27
  int           cont_x, cont_y, cont_w, cont_h, cont_x_off, cont_y_off;
27
  int           cont_x, cont_y, cont_w, cont_h, cont_x_off, cont_y_off;
28
28
29
  (void)x;
30
  (void)y;
31
29
  if ( NOT can_draw() )
32
  if ( NOT can_draw() )
30
    return;
33
    return;
31
34
Lines 41-47 Link Here
41
    width = this->w;
44
    width = this->w;
42
  }
45
  }
43
46
44
  indent = width * .05;
47
  indent = static_cast<int>(width * .05);
45
48
46
  glLineWidth( 1.0 );
49
  glLineWidth( 1.0 );
47
  glBegin( GL_LINES );
50
  glBegin( GL_LINES );
(-)glui_v2_1_beta.orig/glui_spinner.cpp (-1 / +11 lines)
Lines 93-98 Link Here
93
93
94
int    GLUI_Spinner::mouse_up_handler( int local_x, int local_y, int inside )
94
int    GLUI_Spinner::mouse_up_handler( int local_x, int local_y, int inside )
95
{
95
{
96
  (void)local_x;
97
  (void)local_y;
98
  (void)inside;
99
96
  state = GLUI_SPINNER_STATE_NONE;
100
  state = GLUI_SPINNER_STATE_NONE;
97
101
98
  /*  printf("spinner: mouse up  : %d/%d    inside: %d\n",local_x,local_y,inside);              */
102
  /*  printf("spinner: mouse up  : %d/%d    inside: %d\n",local_x,local_y,inside);              */
Lines 174-180 Link Here
174
178
175
int    GLUI_Spinner::key_handler( unsigned char key,int modifiers )
179
int    GLUI_Spinner::key_handler( unsigned char key,int modifiers )
176
{
180
{
177
  
181
  (void)key;
182
  (void)modifiers;
178
183
179
  return true;
184
  return true;
180
}
185
}
Lines 186-191 Link Here
186
{
191
{
187
  int orig;
192
  int orig;
188
193
194
  (void)x;
195
  (void)y;
196
189
  if ( NOT can_draw() )
197
  if ( NOT can_draw() )
190
    return;
198
    return;
191
199
Lines 252-257 Link Here
252
260
253
int    GLUI_Spinner::special_handler( int key,int modifiers )
261
int    GLUI_Spinner::special_handler( int key,int modifiers )
254
{
262
{
263
  (void)modifiers;
264
255
  if ( key == GLUT_KEY_UP ) {    /** Simulate a click in the up arrow **/
265
  if ( key == GLUT_KEY_UP ) {    /** Simulate a click in the up arrow **/
256
    mouse_down_handler( x_abs + w - GLUI_SPINNER_ARROW_WIDTH + 1,
266
    mouse_down_handler( x_abs + w - GLUI_SPINNER_ARROW_WIDTH + 1,
257
			y_abs + GLUI_SPINNER_ARROW_Y+1 );
267
			y_abs + GLUI_SPINNER_ARROW_Y+1 );
(-)glui_v2_1_beta.orig/glui_statictext.cpp (+3 lines)
Lines 25-30 Link Here
25
{
25
{
26
  int orig;
26
  int orig;
27
27
28
  (void)x;
29
  (void)y;
30
28
  if ( NOT can_draw() )
31
  if ( NOT can_draw() )
29
    return;
32
    return;
30
33
(-)glui_v2_1_beta.orig/glui_translation.cpp (+11 lines)
Lines 83-88 Link Here
83
  trans_mouse_code = GLUI_TRANSLATION_MOUSE_NONE;
83
  trans_mouse_code = GLUI_TRANSLATION_MOUSE_NONE;
84
  locked = GLUI_TRANSLATION_LOCK_NONE;
84
  locked = GLUI_TRANSLATION_LOCK_NONE;
85
85
86
  (void)local_x;
87
  (void)local_y;
88
  (void)inside;
89
86
  translate_and_draw_front();
90
  translate_and_draw_front();
87
91
88
  return false;
92
  return false;
Lines 97-102 Link Here
97
  float x_off, y_off;
101
  float x_off, y_off;
98
  float off_array[2];
102
  float off_array[2];
99
103
104
  (void)inside;
105
100
  x_off = scale_factor * (float)(local_x - down_x);
106
  x_off = scale_factor * (float)(local_x - down_x);
101
  y_off = -scale_factor * (float)(local_y - down_y);
107
  y_off = -scale_factor * (float)(local_y - down_y);
102
108
Lines 181-186 Link Here
181
187
182
void     GLUI_Translation::iaction_dump( FILE *output )
188
void     GLUI_Translation::iaction_dump( FILE *output )
183
{
189
{
190
  (void)output;
184
}
191
}
185
192
186
193
Lines 188-193 Link Here
188
195
189
int    GLUI_Translation::iaction_special_handler( int key,int modifiers )
196
int    GLUI_Translation::iaction_special_handler( int key,int modifiers )
190
{
197
{
198
  (void)key;
199
  (void)modifiers;
191
200
192
  return false;
201
  return false;
193
}
202
}
Lines 301-309 Link Here
301
{
310
{
302
  float x1 = .2, x2 = .4, y1 = .54, y2 = .94, y0;
311
  float x1 = .2, x2 = .4, y1 = .54, y2 = .94, y0;
303
  float x1a, x1b;
312
  float x1a, x1b;
313
#if 0
304
  vec3  col1( 0.0, 0.0, 0.0 ), col2( .45, .45, .45 ), 
314
  vec3  col1( 0.0, 0.0, 0.0 ), col2( .45, .45, .45 ), 
305
    col3( .7, .7, .7 ), col4( 1.0, 1.0, 1.0 );
315
    col3( .7, .7, .7 ), col4( 1.0, 1.0, 1.0 );
306
  vec3  c1, c2, c3, c4, c5, c6;
316
  vec3  c1, c2, c3, c4, c5, c6;
317
#endif
307
  vec3  white(1.0,1.0,1.0), black(0.0,0.0,0.0), gray(.45,.45,.45), 
318
  vec3  white(1.0,1.0,1.0), black(0.0,0.0,0.0), gray(.45,.45,.45), 
308
    bkgd(.7,.7,.7);
319
    bkgd(.7,.7,.7);
309
  int   c_off; /* color index offset */
320
  int   c_off; /* color index offset */
(-)glui_v2_1_beta.orig/makefile (-101 / +105 lines)
Lines 1-101 Link Here
1
1
VERSION  = 2.1
2
.SUFFIXES: .cpp
2
MAJOR    = 2
3
3
LIBNAME  = libglui
4
4
NAME     = glui
5
#Change the following two lines to reflect the locations
5
SONAME   = $(LIBNAME).so.$(MAJOR)
6
# of the GLUT library (.a) and includes on your system
6
7
7
CC       = gcc
8
GLUT_LIB_LOCATION=/unc/walk/lib/sgi_irix
8
CXX      = g++
9
GLUT_INC_LOCATION=/unc/walk/include
9
10
10
CPPFLAGS = $(INCS)
11
CFLAGS = 
11
CFLAGS   =
12
12
CXXFLAGS =
13
13
LDFLAGS  = 
14
#for sgi   -- comment out the lines below to use on HP
14
LDLIBS   = $(LIBS)
15
CC=CC -g0 -o32
15
16
#CC=gcc
16
GLLIBS   = -lGL -lGLU -lglut
17
#CC=g++ -O3
17
INCS     = 
18
CPPFLAGS=-I${GLUT_INC_LOCATION} #-w 
18
LIBS     = $(GLLIBS) -lm
19
GLLIBS=-L${GLUT_LIB_LOCATION} -lglut -lGL -lGLU
19
20
LPATH=${GLUTPATH} 
20
LIBGLUI  = -L./lib/ -lglui
21
INCS= 
21
22
22
GLUI     = lib/$(LIBNAME).a
23
23
SO_GLUI  = lib/$(LIBNAME).so.0
24
libs =     ${GLLIBS}  -lXmu -lXext -lX11 -lXi -lm #-lmalloc 
24
25
25
RM		 = rm -rf
26
LIBGLUI= -Llib -lglui
26
27
27
EXAMPLES = bin/example1 bin/example2 bin/example3 bin/example4 bin/example5
28
All: lib/libglui.a bin/example1 bin/example2 bin/example3 bin/example4 bin/example5
28
EXAMPLES_SRC = $(wildcard example*.cpp)
29
29
30
GLUI_OBJS = glui_add_controls.o glui.o glui_bitmap_img_data.o glui_bitmaps.o glui_button.o glui_edittext.o glui_checkbox.o glui_node.o glui_radio.o glui_statictext.o glui_panel.o glui_separator.o glui_spinner.o glui_control.o glui_column.o glui_translation.o glui_rotation.o glui_mouse_iaction.o glui_listbox.o glui_rollout.o arcball.o algebra3.o quaternion.o
30
all: static shared examples
31
31
static: $(GLUI)
32
bin/example1: $(GLUI_OBJS) example1.o lib/libglui.a
32
shared: $(SO_GLUI)
33
	@echo "Linking example1"
33
examples: $(EXAMPLES)
34
	$(CC)  $(CFLAG) $(CPPFLAGS) $(LPATH) example1.o $(LIBGLUI) $(libs) -o bin/example1
34
35
35
GLUI_SRCS = algebra3.cpp arcball.cpp $(wildcard glui*.cpp) quaternion.cpp
36
bin/example2: $(GLUI_OBJS) example2.o lib/libglui.a
36
GLUI_HDRS = $(wildcard glui*.h)
37
	@echo "Linking example2"
37
GLUI_OBJS = $(GLUI_SRCS:.cpp=.o)
38
	$(CC)  $(CFLAG) $(CPPFLAGS) $(LPATH) example2.o $(LIBGLUI) $(libs) -o bin/example2
38
39
39
install: all
40
bin/example3: $(GLUI_OBJS) example3.o lib/libglui.a
40
	install $(GLUI) /usr/lib
41
	@echo "Linking example3"
41
	install $(SO_GLUI) /usr/lib
42
	$(CC)  $(CFLAG) $(CPPFLAGS) $(LPATH) example3.o $(LIBGLUI) $(libs) -o bin/example3
42
	install $(GLUI_HDRS) /usr/include/gl
43
43
	install -D $(EXAMPLES) /usr/share/${NAME}/bin
44
bin/example4: $(GLUI_OBJS) example4.o lib/libglui.a
44
	install -D $(EXAMPLES_SRC) /usr/share/${NAME}/src
45
	@echo "Linking example4"
45
46
	$(CC)  $(CFLAG) $(CPPFLAGS) $(LPATH) example4.o $(LIBGLUI) $(libs) -o bin/example4
46
$(GLUI): $(GLUI_OBJS)
47
47
	@echo "Creating library"
48
bin/example5: $(GLUI_OBJS) example5.o lib/libglui.a
48
	test -d $(dir $@) || mkdir -p $(dir $@)
49
	@echo "Linking example5"
49
	ar -r $@ $^
50
	$(CC)  $(CFLAG) $(CPPFLAGS) $(LPATH) example5.o $(LIBGLUI) $(libs) -o bin/example5
50
51
51
$(SO_GLUI): $(GLUI_OBJS)
52
lib/libglui.a: $(GLUI_OBJS)
52
	@echo "Creating shared library"
53
	@echo "Creating library"
53
	test -d $(dir $@) || mkdir -p $(dir $@)
54
	ar -r lib/libglui.a $(GLUI_OBJS)
54
	$(CXX) -o $@ -shared -Wl,-soname,$(SONAME) $^ $(LDLIBS)
55
55
56
.cpp.o:
56
bin/example%: example%.o $(GLUI)
57
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCS) $*.cpp
57
	@echo "Creating Examples"
58
58
	test -d $(dir $@) || mkdir -p $(dir $@)
59
.c.o:
59
	$(CXX) $(LDFLAGS) $(LDLIBS) $< $(LIBGLUI) -o $@
60
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCS) $*.c
60
61
clean:
61
.cpp.o:
62
	/bin/rm *.o
62
	$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $(INCS) $<
63
63
64
64
.c.o:
65
65
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCS) $<
66
algebra3.o: algebra3.h
66
67
arcball.o: arcball.h algebra3.h quaternion.h stdinc.h
67
clean:
68
example1.o: glui.h
68
	$(RM) *.o
69
example2.o:   glui.h
69
	$(RM) bin/* lib/
70
example3.o:   glui.h
70
	$(RM) tags *~
71
example4.o:   glui.h
71
72
glui.o: glui.h  stdinc.h 
72
.SUFFIXES: .cpp
73
glui_add_controls.o: glui.h  stdinc.h 
73
.PHONY: all static shared example
74
glui_bitmap_img_data.o: glui_img_checkbox_0.c glui_img_checkbox_1.c
74
75
glui_bitmap_img_data.o: glui_img_radiobutton_0.c glui_img_radiobutton_1.c
75
algebra3.o: algebra3.h
76
glui_bitmap_img_data.o: glui_img_uparrow.c glui_img_downarrow.c
76
arcball.o: arcball.h algebra3.h quaternion.h
77
glui_bitmap_img_data.o: glui_img_leftarrow.c glui_img_rightarrow.c
77
glui.o: glui.h
78
glui_bitmap_img_data.o: glui_img_spinup_1.c glui_img_spinup_0.c
78
glui_add_controls.o: glui.h
79
glui_bitmap_img_data.o: glui_img_spindown_1.c glui_img_spindown_0.c
79
glui_bitmap_img_data.o: glui_img_checkbox_0.c glui_img_checkbox_1.c
80
glui_bitmap_img_data.o: glui_img_checkbox_0_dis.c glui_img_checkbox_1_dis.c
80
glui_bitmap_img_data.o: glui_img_radiobutton_0.c glui_img_radiobutton_1.c
81
glui_bitmap_img_data.o: glui_img_radiobutton_0_dis.c
81
glui_bitmap_img_data.o: glui_img_uparrow.c glui_img_downarrow.c
82
glui_bitmap_img_data.o: glui_img_radiobutton_1_dis.c glui_img_spinup_dis.c
82
glui_bitmap_img_data.o: glui_img_leftarrow.c glui_img_rightarrow.c
83
glui_bitmap_img_data.o: glui_img_spindown_dis.c
83
glui_bitmap_img_data.o: glui_img_spinup_1.c glui_img_spinup_0.c
84
glui_bitmaps.o: glui.h stdinc.h 
84
glui_bitmap_img_data.o: glui_img_spindown_1.c glui_img_spindown_0.c
85
glui_button.o: glui.h stdinc.h 
85
glui_bitmap_img_data.o: glui_img_checkbox_0_dis.c glui_img_checkbox_1_dis.c
86
glui_checkbox.o: glui.h stdinc.h 
86
glui_bitmap_img_data.o: glui_img_radiobutton_0_dis.c
87
glui_column.o: glui.h stdinc.h 
87
glui_bitmap_img_data.o: glui_img_radiobutton_1_dis.c glui_img_spinup_dis.c
88
glui_control.o: glui.h stdinc.h 
88
glui_bitmap_img_data.o: glui_img_spindown_dis.c
89
glui_edittext.o: glui.h stdinc.h 
89
glui_bitmaps.o: glui.h
90
glui_node.o: glui.h stdinc.h 
90
glui_button.o: glui.h
91
glui_panel.o: glui.h stdinc.h 
91
glui_checkbox.o: glui.h
92
glui_radio.o: glui.h stdinc.h 
92
glui_column.o: glui.h
93
glui_separator.o: glui.h stdinc.h 
93
glui_control.o: glui.h
94
glui_spinner.o: glui.h stdinc.h 
94
glui_edittext.o: glui.h
95
glui_statictext.o: glui.h stdinc.h 
95
glui_node.o: glui.h
96
quaternion.o: quaternion.h algebra3.h stdinc.h
96
glui_panel.o: glui.h
97
glui_translation.o: glui.h stdinc.h  
97
glui_radio.o: glui.h
98
glui_rotation.o: glui.h stdinc.h  
98
glui_separator.o: glui.h
99
glui_mouse_iaction.o: glui.h stdinc.h  
99
glui_spinner.o: glui.h
100
glui_listbox.o: glui.h stdinc.h  
100
glui_statictext.o: glui.h
101
glui_rollout.o: glui.h stdinc.h 
101
quaternion.o: quaternion.h algebra3.h
102
glui_translation.o: glui.h
103
glui_rotation.o: glui.h
104
glui_mouse_iaction.o: glui.h
105
glui_listbox.o: glui.h
(-)glui_v2_1_beta.orig/quaternion.cpp (+2 lines)
Lines 110-116 Link Here
110
mat4  quat::to_mat4( void )
110
mat4  quat::to_mat4( void )
111
{
111
{
112
  float t, xs, ys, zs, wx, wy, wz, xx, xy, xz, yy, yz, zz;
112
  float t, xs, ys, zs, wx, wy, wz, xx, xy, xz, yy, yz, zz;
113
#if 0
113
  vec3  a, c, b, d;
114
  vec3  a, c, b, d;
115
#endif
114
  
116
  
115
  t  = 2.0 / (v*v + s*s);
117
  t  = 2.0 / (v*v + s*s);
116
  
118
  

Return to bug 23207