SV * Application_get_monitor_rects( Handle self) { int i, nrects; Rect2 * rects = apc_application_get_monitor_rects(self, &nrects); AV * ret = newAV(); for ( i = 0; i < nrects; i++) { AV * rect = newAV(); av_push( rect, newSViv( rects[i].x)); av_push( rect, newSViv( rects[i].y)); av_push( rect, newSViv( rects[i].width)); av_push( rect, newSViv( rects[i].height)); av_push( ret, newRV_noinc(( SV *) rect)); } free(rects); /* .. or return at least the current size */ if ( nrects == 0) { AV * rect = newAV(); Point sz = apc_application_get_size(self); av_push( rect, newSViv( 0)); av_push( rect, newSViv( 0)); av_push( rect, newSViv( sz.x)); av_push( rect, newSViv( sz.y)); av_push( ret, newRV_noinc(( SV *) rect)); } return newRV_noinc(( SV *) ret); }
Bool apc_application_create( Handle self) { XSetWindowAttributes attrs; DEFXX; if ( !DISP) { Mdebug("apc_application_create: failed, x11 layer is not up\n"); return false; } XX-> type.application = true; XX-> type.widget = true; XX-> type.drawable = true; attrs. event_mask = StructureNotifyMask | PropertyChangeMask; XX-> client = X_WINDOW = XCreateWindow( DISP, guts. root, 0, 0, 1, 1, 0, CopyFromParent, InputOutput, CopyFromParent, CWEventMask, &attrs); XCHECKPOINT; if (!X_WINDOW) return false; hash_store( guts.windows, &X_WINDOW, sizeof(X_WINDOW), (void*)self); XX-> pointer_id = crArrow; XX-> gdrawable = XX-> udrawable = guts. root; XX-> parent = None; XX-> origin. x = 0; XX-> origin. y = 0; XX-> ackSize = XX-> size = apc_application_get_size( self); XX-> owner = nilHandle; XX-> visual = &guts. visual; XX-> flags. clip_owner = 1; XX-> flags. sync_paint = 0; apc_component_fullname_changed_notify( self); guts. mouse_wheel_down = unix_rm_get_int( self, guts.qWheeldown, guts.qwheeldown, 5); guts. mouse_wheel_up = unix_rm_get_int( self, guts.qWheelup, guts.qwheelup, 4); guts. click_time_frame = unix_rm_get_int( self, guts.qClicktimeframe, guts.qclicktimeframe, guts. click_time_frame); guts. double_click_time_frame = unix_rm_get_int( self, guts.qDoubleclicktimeframe, guts.qdoubleclicktimeframe, guts. double_click_time_frame); guts. visible_timeout = unix_rm_get_int( self, guts.qBlinkvisibletime, guts.qblinkvisibletime, guts. visible_timeout); guts. invisible_timeout = unix_rm_get_int( self, guts.qBlinkinvisibletime, guts.qblinkinvisibletime, guts. invisible_timeout); guts. menu_timeout = unix_rm_get_int( self, guts.qSubmenudelay, guts.qsubmenudelay, guts. menu_timeout); guts. scroll_first = unix_rm_get_int( self, guts.qScrollfirst, guts.qscrollfirst, guts. scroll_first); guts. scroll_next = unix_rm_get_int( self, guts.qScrollnext, guts.qscrollnext, guts. scroll_next); prima_send_create_event( X_WINDOW); return true; }
Rect apc_application_get_indents( Handle self) { Point sz; Rect r; bzero( &r, sizeof( r)); if ( do_icccm_only) return r; sz = apc_application_get_size( self); if ( wm_net_get_current_workarea( &r)) { r. right = sz. x - r.right - r. left; r. bottom = sz. y - r. bottom - r. top; if ( r. left < 0) r. left = 0; if ( r. top < 0) r. top = 0; if ( r. right < 0) r. right = 0; if ( r. bottom < 0) r. bottom = 0; } return r; }
Handle Application_get_image( Handle self, int x, int y, int xLen, int yLen) { HV * profile; Handle i; Bool ret; Point sz; if ( var-> stage > csFrozen) return nilHandle; if ( x < 0 || y < 0 || xLen <= 0 || yLen <= 0) return nilHandle; sz = apc_application_get_size( self); if ( x + xLen > sz. x) xLen = sz. x - x; if ( y + yLen > sz. y) yLen = sz. y - y; if ( x >= sz. x || y >= sz. y || xLen <= 0 || yLen <= 0) return nilHandle; profile = newHV(); i = Object_create( "Prima::Image", profile); sv_free(( SV *) profile); ret = apc_application_get_bitmap( self, i, x, y, xLen, yLen); --SvREFCNT( SvRV((( PAnyObject) i)-> mate)); return ret ? i : nilHandle; }
Point Application_size( Handle self, Bool set, Point size) { if ( set) return size; return apc_application_get_size( self); }