|
@@ -342,3 +342,57 @@ slop::SlopSelection slop::GLSlopSelect( slop::SlopOptions* options, SlopWindow*
|
342
|
342
|
// Finally return the data.
|
343
|
343
|
return slop::SlopSelection( output.x, output.y, output.z, output.w, selectedWindow, cancelled );
|
344
|
344
|
}
|
|
345
|
+
|
|
346
|
+extern "C" struct slop_options slop_options_default() {
|
|
347
|
+ struct slop_options options;
|
|
348
|
+ options.border = 1;
|
|
349
|
+ options.nokeyboard = false;
|
|
350
|
+ options.noopengl = false;
|
|
351
|
+ options.nodecorations = false;
|
|
352
|
+ options.tolerance = 2;
|
|
353
|
+ options.padding = 0;
|
|
354
|
+ options.shaders = slop_default_shaders;
|
|
355
|
+ options.highlight = false;
|
|
356
|
+ options.r = 0.5;
|
|
357
|
+ options.g = 0.5;
|
|
358
|
+ options.b = 0.5;
|
|
359
|
+ options.a = 1;
|
|
360
|
+ options.quiet = false;
|
|
361
|
+
|
|
362
|
+ char* envdisplay = getenv("DISPLAY");
|
|
363
|
+ if (envdisplay == NULL) {
|
|
364
|
+ options.xdisplay = slop_default_xdisplay;
|
|
365
|
+ } else {
|
|
366
|
+ options.xdisplay = envdisplay;
|
|
367
|
+ }
|
|
368
|
+ return options;
|
|
369
|
+}
|
|
370
|
+
|
|
371
|
+extern "C" struct slop_selection slop_select( struct slop_options* options ) {
|
|
372
|
+ slop::SlopOptions realOptions = slop::SlopOptions();
|
|
373
|
+ if ( options != NULL ) {
|
|
374
|
+ realOptions.border = options->border;
|
|
375
|
+ realOptions.nokeyboard = options->nokeyboard;
|
|
376
|
+ realOptions.noopengl = options->noopengl;
|
|
377
|
+ realOptions.nodecorations = options->nodecorations;
|
|
378
|
+ realOptions.tolerance = options->tolerance;
|
|
379
|
+ realOptions.padding = options->padding;
|
|
380
|
+ realOptions.shaders = options->shaders;
|
|
381
|
+ realOptions.highlight = options->highlight;
|
|
382
|
+ realOptions.r = options->r;
|
|
383
|
+ realOptions.g = options->g;
|
|
384
|
+ realOptions.b = options->b;
|
|
385
|
+ realOptions.a = options->a;
|
|
386
|
+ realOptions.quiet = options->quiet;
|
|
387
|
+ realOptions.xdisplay = options->xdisplay;
|
|
388
|
+ }
|
|
389
|
+ slop::SlopSelection select = SlopSelect( &realOptions );
|
|
390
|
+ slop_selection realSelect;
|
|
391
|
+ realSelect.x = select.x;
|
|
392
|
+ realSelect.y = select.y;
|
|
393
|
+ realSelect.w = select.w;
|
|
394
|
+ realSelect.h = select.h;
|
|
395
|
+ realSelect.id = select.id;
|
|
396
|
+ realSelect.cancelled = select.cancelled;
|
|
397
|
+ return realSelect;
|
|
398
|
+}
|