~muktupavels/metacity/adwaita-icon-theme-lp-1414613

« back to all changes in this revision

Viewing changes to src/core/testboxes.c

  • Committer: Package Import Robot
  • Author(s): Dmitry Shachnev
  • Date: 2014-11-18 18:13:01 UTC
  • mfrom: (1.4.1) (2.5.4 sid)
  • mto: This revision was merged to the branch mainline in revision 135.
  • Revision ID: package-import@ubuntu.com-20141118181301-cgqtucqg732irm9x
* Merge with Debian unstable, remaining changes:
  - 05_raise_on_click_for_click_mode.patch:
    Force raise on click option.
  - 22_fix_above_tab_switching.patch:
    For Above_Tab, don't compare keysym (fixes group switching).
  - debian/metacity-common.links:
    Show keybindings in Unity control center.
  - Use Ubuntu Desktop team Vcs fields.
* Drop all other patches, they were needed only for Unity 2D.
* New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
/* Metacity box operation testing program */
4
4
 
5
 
/* 
 
5
/*
6
6
 * Copyright (C) 2005 Elijah Newren
7
 
 * 
 
7
 *
8
8
 * This program is free software; you can redistribute it and/or
9
9
 * modify it under the terms of the GNU General Public License as
10
10
 * published by the Free Software Foundation; either version 2 of the
14
14
 * WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
16
 * General Public License for more details.
17
 
 * 
 
17
 *
18
18
 * You should have received a copy of the GNU General Public License
19
19
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20
20
 */
369
369
   * uniformly distributed location of center of struts (within screen)
370
370
   * merge all regions that are possible
371
371
   * print stats on problem setup
372
 
   *   number of (non-completely-occluded?) struts 
 
372
   *   number of (non-completely-occluded?) struts
373
373
   *   percentage of screen covered
374
374
   *   length of resulting non-minimal spanning set
375
375
   *   length of resulting minimal spanning set
514
514
      compare = compare->next;
515
515
    }
516
516
 
517
 
  printf ("  Num rectangles contained in others          : %d\n", 
 
517
  printf ("  Num rectangles contained in others          : %d\n",
518
518
          num_contains);
519
 
  printf ("  Num rectangles partially contained in others: %d\n", 
 
519
  printf ("  Num rectangles partially contained in others: %d\n",
520
520
          num_part_contains);
521
 
  printf ("  Num rectangles adjacent to others           : %d\n", 
 
521
  printf ("  Num rectangles adjacent to others           : %d\n",
522
522
          num_adjacent);
523
523
  printf ("  Num rectangles merged with others           : %d\n",
524
524
          num_merged);
589
589
  GList* region;
590
590
  GList* tmp;
591
591
 
592
 
  /*************************************************************/  
 
592
  /*************************************************************/
593
593
  /* Make sure test region 0 has the right spanning rectangles */
594
 
  /*************************************************************/  
 
594
  /*************************************************************/
595
595
  region = get_screen_region (0);
596
596
  tmp = NULL;
597
597
  tmp = g_list_prepend (tmp, new_meta_rect (0, 0, 1600, 1200));
599
599
  meta_rectangle_free_list_and_elements (tmp);
600
600
  meta_rectangle_free_list_and_elements (region);
601
601
 
602
 
  /*************************************************************/  
 
602
  /*************************************************************/
603
603
  /* Make sure test region 1 has the right spanning rectangles */
604
 
  /*************************************************************/  
 
604
  /*************************************************************/
605
605
  region = get_screen_region (1);
606
606
  tmp = NULL;
607
607
  tmp = g_list_prepend (tmp, new_meta_rect (0, 20,  400, 1180));
612
612
 
613
613
  /*************************************************************/
614
614
  /* Make sure test region 2 has the right spanning rectangles */
615
 
  /*************************************************************/  
 
615
  /*************************************************************/
616
616
  region = get_screen_region (2);
617
617
  tmp = NULL;
618
618
  tmp = g_list_prepend (tmp, new_meta_rect (   0,   20,  300, 1180));
626
626
 
627
627
  /*************************************************************/
628
628
  /* Make sure test region 3 has the right spanning rectangles */
629
 
  /*************************************************************/  
 
629
  /*************************************************************/
630
630
  region = get_screen_region (3);
631
631
  tmp = NULL;
632
632
  tmp = g_list_prepend (tmp, new_meta_rect ( 380,  675,  420,  525)); /* 220500 */
652
652
 
653
653
  /*************************************************************/
654
654
  /* Make sure test region 4 has the right spanning rectangles */
655
 
  /*************************************************************/  
 
655
  /*************************************************************/
656
656
  region = get_screen_region (4);
657
657
  tmp = NULL;
658
658
  tmp = g_list_prepend (tmp, new_meta_rect ( 800,   20,  800, 1180));
662
662
 
663
663
  /*************************************************************/
664
664
  /* Make sure test region 5 has the right spanning rectangles */
665
 
  /*************************************************************/  
 
665
  /*************************************************************/
666
666
  printf ("The next test intentionally causes a warning, "
667
667
          "but it can be ignored.\n");
668
668
  region = get_screen_region (5);
1026
1026
  int top    = META_DIRECTION_TOP;
1027
1027
  int bottom = META_DIRECTION_BOTTOM;
1028
1028
 
1029
 
  /*************************************************/  
 
1029
  /*************************************************/
1030
1030
  /* Make sure test region 0 has the correct edges */
1031
 
  /*************************************************/  
 
1031
  /*************************************************/
1032
1032
  edges = get_screen_edges (0);
1033
1033
  tmp = NULL;
1034
1034
  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200, 1600, 0, bottom));
1039
1039
  meta_rectangle_free_list_and_elements (tmp);
1040
1040
  meta_rectangle_free_list_and_elements (edges);
1041
1041
 
1042
 
  /*************************************************/  
 
1042
  /*************************************************/
1043
1043
  /* Make sure test region 1 has the correct edges */
1044
 
  /*************************************************/  
 
1044
  /*************************************************/
1045
1045
  edges = get_screen_edges (1);
1046
1046
  tmp = NULL;
1047
1047
  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200,  400, 0, bottom));
1054
1054
  meta_rectangle_free_list_and_elements (tmp);
1055
1055
  meta_rectangle_free_list_and_elements (edges);
1056
1056
 
1057
 
  /*************************************************/  
 
1057
  /*************************************************/
1058
1058
  /* Make sure test region 2 has the correct edges */
1059
 
  /*************************************************/  
 
1059
  /*************************************************/
1060
1060
  edges = get_screen_edges (2);
1061
1061
  tmp = NULL;
1062
1062
  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200,  400, 0, bottom));
1075
1075
  meta_rectangle_free_list_and_elements (tmp);
1076
1076
  meta_rectangle_free_list_and_elements (edges);
1077
1077
 
1078
 
  /*************************************************/  
 
1078
  /*************************************************/
1079
1079
  /* Make sure test region 3 has the correct edges */
1080
 
  /*************************************************/  
 
1080
  /*************************************************/
1081
1081
  edges = get_screen_edges (3);
1082
1082
  tmp = NULL;
1083
1083
  tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200,  400, 0, bottom));
1102
1102
  char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE];
1103
1103
  meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1);
1104
1104
  meta_rectangle_edge_list_to_string (tmp,   "\n ", big_buffer2);
1105
 
  printf("Generated edge list:\n %s\nComparison edges list:\n %s\n", 
 
1105
  printf("Generated edge list:\n %s\nComparison edges list:\n %s\n",
1106
1106
         big_buffer1, big_buffer2);
1107
1107
#endif
1108
1108
 
1110
1110
  meta_rectangle_free_list_and_elements (tmp);
1111
1111
  meta_rectangle_free_list_and_elements (edges);
1112
1112
 
1113
 
  /*************************************************/  
 
1113
  /*************************************************/
1114
1114
  /* Make sure test region 4 has the correct edges */
1115
 
  /*************************************************/  
 
1115
  /*************************************************/
1116
1116
  edges = get_screen_edges (4);
1117
1117
  tmp = NULL;
1118
1118
  tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1200, 800,  0, bottom));
1123
1123
  meta_rectangle_free_list_and_elements (tmp);
1124
1124
  meta_rectangle_free_list_and_elements (edges);
1125
1125
 
1126
 
  /*************************************************/  
 
1126
  /*************************************************/
1127
1127
  /* Make sure test region 5 has the correct edges */
1128
 
  /*************************************************/  
 
1128
  /*************************************************/
1129
1129
  edges = get_screen_edges (5);
1130
1130
  tmp = NULL;
1131
1131
  verify_edge_lists_are_equal (edges, tmp);
1132
1132
  meta_rectangle_free_list_and_elements (tmp);
1133
1133
  meta_rectangle_free_list_and_elements (edges);
1134
1134
 
1135
 
  /*************************************************/  
 
1135
  /*************************************************/
1136
1136
  /* Make sure test region 6 has the correct edges */
1137
 
  /*************************************************/  
 
1137
  /*************************************************/
1138
1138
  edges = get_screen_edges (6);
1139
1139
  tmp = NULL;
1140
1140
  tmp = g_list_prepend (tmp, new_screen_edge (   0, 1200, 1600,  0, bottom));
1159
1159
  int top    = META_DIRECTION_TOP;
1160
1160
  int bottom = META_DIRECTION_BOTTOM;
1161
1161
 
1162
 
  /*************************************************************************/  
 
1162
  /*************************************************************************/
1163
1163
  /* Make sure test xinerama set 0 for with region 0 has the correct edges */
1164
 
  /*************************************************************************/  
 
1164
  /*************************************************************************/
1165
1165
  edges = get_xinerama_edges (0, 0);
1166
1166
  tmp = NULL;
1167
1167
  verify_edge_lists_are_equal (edges, tmp);
1168
1168
  meta_rectangle_free_list_and_elements (tmp);
1169
1169
  meta_rectangle_free_list_and_elements (edges);
1170
1170
 
1171
 
  /*************************************************************************/  
 
1171
  /*************************************************************************/
1172
1172
  /* Make sure test xinerama set 2 for with region 1 has the correct edges */
1173
 
  /*************************************************************************/  
 
1173
  /*************************************************************************/
1174
1174
  edges = get_xinerama_edges (2, 1);
1175
1175
  tmp = NULL;
1176
1176
  tmp = g_list_prepend (tmp, new_xinerama_edge (   0,  600, 1600, 0, bottom));
1179
1179
  meta_rectangle_free_list_and_elements (tmp);
1180
1180
  meta_rectangle_free_list_and_elements (edges);
1181
1181
 
1182
 
  /*************************************************************************/  
 
1182
  /*************************************************************************/
1183
1183
  /* Make sure test xinerama set 1 for with region 2 has the correct edges */
1184
 
  /*************************************************************************/  
 
1184
  /*************************************************************************/
1185
1185
  edges = get_xinerama_edges (1, 2);
1186
1186
  tmp = NULL;
1187
1187
  tmp = g_list_prepend (tmp, new_xinerama_edge ( 800,   20, 0, 1080, right));
1191
1191
  char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE];
1192
1192
  meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1);
1193
1193
  meta_rectangle_edge_list_to_string (tmp,   "\n ", big_buffer2);
1194
 
  printf("Generated edge list:\n %s\nComparison edges list:\n %s\n", 
 
1194
  printf("Generated edge list:\n %s\nComparison edges list:\n %s\n",
1195
1195
         big_buffer1, big_buffer2);
1196
1196
#endif
1197
1197
  verify_edge_lists_are_equal (edges, tmp);
1198
1198
  meta_rectangle_free_list_and_elements (tmp);
1199
1199
  meta_rectangle_free_list_and_elements (edges);
1200
1200
 
1201
 
  /*************************************************************************/  
 
1201
  /*************************************************************************/
1202
1202
  /* Make sure test xinerama set 3 for with region 3 has the correct edges */
1203
 
  /*************************************************************************/  
 
1203
  /*************************************************************************/
1204
1204
  edges = get_xinerama_edges (3, 3);
1205
1205
  tmp = NULL;
1206
1206
  tmp = g_list_prepend (tmp, new_xinerama_edge ( 900,  600,  700, 0, bottom));
1213
1213
  meta_rectangle_free_list_and_elements (tmp);
1214
1214
  meta_rectangle_free_list_and_elements (edges);
1215
1215
 
1216
 
  /*************************************************************************/  
 
1216
  /*************************************************************************/
1217
1217
  /* Make sure test xinerama set 3 for with region 4 has the correct edges */
1218
 
  /*************************************************************************/  
 
1218
  /*************************************************************************/
1219
1219
  edges = get_xinerama_edges (3, 4);
1220
1220
  tmp = NULL;
1221
1221
  tmp = g_list_prepend (tmp, new_xinerama_edge ( 800,  600,  800, 0, bottom));
1225
1225
  meta_rectangle_free_list_and_elements (tmp);
1226
1226
  meta_rectangle_free_list_and_elements (edges);
1227
1227
 
1228
 
  /*************************************************************************/  
 
1228
  /*************************************************************************/
1229
1229
  /* Make sure test xinerama set 3 for with region 5has the correct edges */
1230
 
  /*************************************************************************/  
 
1230
  /*************************************************************************/
1231
1231
  edges = get_xinerama_edges (3, 5);
1232
1232
  tmp = NULL;
1233
1233
  verify_edge_lists_are_equal (edges, tmp);