├── .gitignore ├── LICENSE.txt ├── README.md └── src └── frege ├── android ├── animation │ └── TimeInterpolator.fr ├── app │ ├── Activity.fr │ └── DownloadManager.fr ├── content │ ├── Context.fr │ ├── DialogInterface.fr │ ├── Intent.fr │ ├── SharedPreferences.fr │ ├── pm │ │ └── PackageManager.fr │ └── res │ │ └── Configuration.fr ├── database │ └── sqlite │ │ └── SQLiteOpenHelper.fr ├── gesture │ └── GestureOverlayView.fr ├── graphics │ ├── Matrix.fr │ ├── Point.fr │ ├── Rect.fr │ ├── RectF.fr │ └── drawable │ │ ├── Drawable.fr │ │ ├── ShapeDrawable.fr │ │ └── shapes │ │ ├── RectShape.fr │ │ └── Shape.fr ├── media │ └── MediaPlayer.fr ├── os │ ├── Handler.fr │ └── Looper.fr ├── provider │ └── Settings.fr ├── util │ └── AttributeSet.fr ├── view │ ├── Display.fr │ ├── GestureDetector.fr │ ├── Gravity.fr │ ├── InputEvent.fr │ ├── KeyEvent.fr │ ├── MotionEvent.fr │ ├── SurfaceHolder.fr │ ├── SurfaceView.fr │ ├── TextureView.fr │ ├── View.fr │ ├── ViewManager.fr │ ├── ViewTreeObserver.fr │ ├── Window.fr │ ├── WindowManager.fr │ └── animation │ │ ├── CycleInterpolator.fr │ │ └── Transformation.fr └── widget │ ├── DatePicker.fr │ ├── EditText.fr │ ├── FrameLayout.fr │ ├── HorizontalScrollView.fr │ ├── ImageButton.fr │ ├── ImageView.fr │ ├── LinearLayout.fr │ ├── MediaController.fr │ ├── NumberPicker.fr │ ├── ProgressBar.fr │ ├── RelativeLayout.fr │ ├── SeekBar.fr │ ├── StackView.fr │ ├── TextView.fr │ ├── TimePicker.fr │ ├── Toast.fr │ ├── VideoView.fr │ └── ZoomButton.fr └── java └── util └── Locale.fr /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | cabal-dev 3 | *.o 4 | *.hi 5 | *.chi 6 | *.chs.h 7 | .virtualenv 8 | .hsenv 9 | .cabal-sandbox/ 10 | cabal.sandbox.config 11 | cabal.config 12 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FregeAndroid 2 | ============ 3 | 4 | Frege interface to Android 5 | 6 | src/frege contains the Android wrapper files 7 | 8 | build.yaml-template is a custom build file in yaml format. This can be used to infer 9 | the build order of the frege files. 10 | 11 | -------------------------------------------------------------------------------- /src/frege/android/animation/TimeInterpolator.fr: -------------------------------------------------------------------------------- 1 | package frege.android.animation.TimeInterpolator where 2 | 3 | 4 | data TimeInterpolator = pure native android.animation.TimeInterpolator where 5 | 6 | 7 | pure native getInterpolation :: TimeInterpolator -> Float -> Float 8 | {- -} 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/frege/android/app/Activity.fr: -------------------------------------------------------------------------------- 1 | package frege.android.app.Activity where 2 | 3 | import frege.android.app.ActionBar 4 | import frege.android.app.Application 5 | import frege.android.app.Fragment 6 | import frege.android.app.FragmentManager 7 | import frege.android.app.LoaderManager 8 | import frege.android.app.PendingIntent 9 | import frege.android.app.TaskStackBuilder 10 | import frege.android.content.Context 11 | import frege.android.content.Intent 12 | import frege.android.content.SharedPreferences 13 | import frege.android.content.res.Configuration 14 | import frege.android.database.Cursor 15 | import frege.android.graphics.Bitmap 16 | import frege.android.graphics.Canvas 17 | import frege.android.graphics.drawable.Drawable 18 | import frege.android.net.Uri 19 | import frege.android.os.Bundle 20 | import frege.android.util.AttributeSet 21 | import frege.android.view.ActionMode 22 | import frege.android.view.KeyEvent 23 | import frege.android.view.LayoutInflater 24 | import frege.android.view.Menu 25 | import frege.android.view.MenuItem 26 | import frege.android.view.MotionEvent 27 | import frege.android.view.View 28 | import frege.android.view.ViewGroup 29 | import frege.android.view.Window 30 | import frege.android.view.WindowManager 31 | import frege.java.lang.Runnable 32 | 33 | data Activity = native android.app.Activity where 34 | 35 | pure native result_canceled android.app.Activity.RESULT_CANCELED :: Int 36 | pure native result_ok android.app.Activity.RESULT_OK :: Int 37 | pure native result_first_user android.app.Activity.RESULT_FIRST_USER :: Int 38 | pure native default_keys_disable android.app.Activity.DEFAULT_KEYS_DISABLE :: Int 39 | pure native default_keys_dialer android.app.Activity.DEFAULT_KEYS_DIALER :: Int 40 | pure native default_keys_shortcut android.app.Activity.DEFAULT_KEYS_SHORTCUT :: Int 41 | pure native default_keys_search_local android.app.Activity.DEFAULT_KEYS_SEARCH_LOCAL :: Int 42 | pure native default_keys_search_global android.app.Activity.DEFAULT_KEYS_SEARCH_GLOBAL :: Int 43 | native new :: () -> IOMutable Activity 44 | 45 | native addContentView :: MutableIO Activity -> MutableIO View -> ViewGroup_LayoutParams -> IO () 46 | 47 | native closeContextMenu :: MutableIO Activity -> IO () 48 | 49 | native closeOptionsMenu :: MutableIO Activity -> IO () 50 | 51 | native createPendingResult :: MutableIO Activity -> Int -> MutableIO Intent -> Int -> IOMutable PendingIntent 52 | 53 | native dismissDialog :: MutableIO Activity -> Int -> IO () 54 | 55 | native dispatchGenericMotionEvent :: MutableIO Activity -> MutableIO MotionEvent -> IO Bool 56 | 57 | native dispatchKeyEvent :: MutableIO Activity -> KeyEvent -> IO Bool 58 | 59 | native dispatchKeyShortcutEvent :: MutableIO Activity -> KeyEvent -> IO Bool 60 | 61 | native dispatchTouchEvent :: MutableIO Activity -> MutableIO MotionEvent -> IO Bool 62 | 63 | native dispatchTrackballEvent :: MutableIO Activity -> MutableIO MotionEvent -> IO Bool 64 | 65 | native findViewById :: MutableIO Activity -> Int -> IOMutable View 66 | 67 | native finish :: MutableIO Activity -> IO () 68 | 69 | native finishActivity :: MutableIO Activity -> Int -> IO () 70 | 71 | native finishActivityFromChild :: MutableIO Activity -> MutableIO Activity -> Int -> IO () 72 | 73 | native finishAffinity :: MutableIO Activity -> IO () 74 | 75 | native finishFromChild :: MutableIO Activity -> MutableIO Activity -> IO () 76 | 77 | native getActionBar :: MutableIO Activity -> IO ActionBar 78 | 79 | native getApplication :: MutableIO Activity -> IOMutable Application 80 | 81 | native getCallingPackage :: MutableIO Activity -> IO String 82 | 83 | native getChangingConfigurations :: MutableIO Activity -> IO Int 84 | 85 | native getCurrentFocus :: MutableIO Activity -> IOMutable View 86 | 87 | native getFragmentManager :: MutableIO Activity -> IOMutable FragmentManager 88 | 89 | native getIntent :: MutableIO Activity -> IOMutable Intent 90 | 91 | native getLastNonConfigurationInstance :: MutableIO Activity -> IO Object 92 | 93 | native getLayoutInflater :: MutableIO Activity -> IO LayoutInflater 94 | 95 | native getLoaderManager :: MutableIO Activity -> IOMutable LoaderManager 96 | 97 | native getLocalClassName :: MutableIO Activity -> IO String 98 | 99 | native getParent :: MutableIO Activity -> IOMutable Activity 100 | 101 | native getParentActivityIntent :: MutableIO Activity -> IOMutable Intent 102 | 103 | native getPreferences :: MutableIO Activity -> Int -> IO SharedPreferences 104 | 105 | native getRequestedOrientation :: MutableIO Activity -> IO Int 106 | 107 | native getSystemService :: MutableIO Activity -> String -> IO Object 108 | 109 | native getTaskId :: MutableIO Activity -> IO Int 110 | 111 | native getTitle :: MutableIO Activity -> IO CharSequence 112 | 113 | native getTitleColor :: MutableIO Activity -> IO Int 114 | 115 | native getVolumeControlStream :: MutableIO Activity -> IO Int 116 | 117 | native getWindow :: MutableIO Activity -> IOMutable Window 118 | 119 | native getWindowManager :: MutableIO Activity -> IOMutable WindowManager 120 | 121 | native hasWindowFocus :: MutableIO Activity -> IO Bool 122 | 123 | native invalidateOptionsMenu :: MutableIO Activity -> IO () 124 | 125 | native isChangingConfigurations :: MutableIO Activity -> IO Bool 126 | 127 | native isChild :: MutableIO Activity -> IO Bool 128 | 129 | native isDestroyed :: MutableIO Activity -> IO Bool 130 | 131 | native isFinishing :: MutableIO Activity -> IO Bool 132 | 133 | native isImmersive :: MutableIO Activity -> IO Bool 134 | 135 | native isTaskRoot :: MutableIO Activity -> IO Bool 136 | 137 | native moveTaskToBack :: MutableIO Activity -> Bool -> IO Bool 138 | 139 | native navigateUpTo :: MutableIO Activity -> MutableIO Intent -> IO Bool 140 | 141 | native navigateUpToFromChild :: MutableIO Activity -> MutableIO Activity -> MutableIO Intent -> IO Bool 142 | 143 | native onActionModeFinished :: MutableIO Activity -> MutableIO ActionMode -> IO () 144 | 145 | native onActionModeStarted :: MutableIO Activity -> MutableIO ActionMode -> IO () 146 | 147 | native onAttachFragment :: MutableIO Activity -> MutableIO Fragment -> IO () 148 | 149 | native onAttachedToWindow :: MutableIO Activity -> IO () 150 | 151 | native onBackPressed :: MutableIO Activity -> IO () 152 | 153 | native onConfigurationChanged :: MutableIO Activity -> Configuration -> IO () 154 | 155 | native onContentChanged :: MutableIO Activity -> IO () 156 | 157 | native onContextItemSelected :: MutableIO Activity -> MenuItem -> IO Bool 158 | 159 | native onContextMenuClosed :: MutableIO Activity -> Menu -> IO () 160 | 161 | native onCreateDescription :: MutableIO Activity -> IO CharSequence 162 | 163 | native onCreateNavigateUpTaskStack :: MutableIO Activity -> MutableIO TaskStackBuilder -> IO () 164 | 165 | native onCreateOptionsMenu :: MutableIO Activity -> Menu -> IO Bool 166 | 167 | native onCreatePanelMenu :: MutableIO Activity -> Int -> Menu -> IO Bool 168 | 169 | native onCreatePanelView :: MutableIO Activity -> Int -> IOMutable View 170 | 171 | native onCreateThumbnail :: MutableIO Activity -> Bitmap -> MutableIO Canvas -> IO Bool 172 | 173 | native onCreateView :: MutableIO Activity -> String -> MutableIO Context -> AttributeSet -> IOMutable View 174 | | MutableIO Activity -> MutableIO View -> String -> MutableIO Context -> AttributeSet -> IOMutable View 175 | 176 | native onDetachedFromWindow :: MutableIO Activity -> IO () 177 | 178 | native onGenericMotionEvent :: MutableIO Activity -> MutableIO MotionEvent -> IO Bool 179 | 180 | native onKeyDown :: MutableIO Activity -> Int -> KeyEvent -> IO Bool 181 | 182 | native onKeyLongPress :: MutableIO Activity -> Int -> KeyEvent -> IO Bool 183 | 184 | native onKeyMultiple :: MutableIO Activity -> Int -> Int -> KeyEvent -> IO Bool 185 | 186 | native onKeyShortcut :: MutableIO Activity -> Int -> KeyEvent -> IO Bool 187 | 188 | native onKeyUp :: MutableIO Activity -> Int -> KeyEvent -> IO Bool 189 | 190 | native onLowMemory :: MutableIO Activity -> IO () 191 | 192 | native onMenuItemSelected :: MutableIO Activity -> Int -> MenuItem -> IO Bool 193 | 194 | native onMenuOpened :: MutableIO Activity -> Int -> Menu -> IO Bool 195 | 196 | native onNavigateUp :: MutableIO Activity -> IO Bool 197 | 198 | native onNavigateUpFromChild :: MutableIO Activity -> MutableIO Activity -> IO Bool 199 | 200 | native onOptionsItemSelected :: MutableIO Activity -> MenuItem -> IO Bool 201 | 202 | native onOptionsMenuClosed :: MutableIO Activity -> Menu -> IO () 203 | 204 | native onPanelClosed :: MutableIO Activity -> Int -> Menu -> IO () 205 | 206 | native onPrepareNavigateUpTaskStack :: MutableIO Activity -> MutableIO TaskStackBuilder -> IO () 207 | 208 | native onPrepareOptionsMenu :: MutableIO Activity -> Menu -> IO Bool 209 | 210 | native onPreparePanel :: MutableIO Activity -> Int -> MutableIO View -> Menu -> IO Bool 211 | 212 | native onProvideAssistData :: MutableIO Activity -> Bundle -> IO () 213 | 214 | native onRetainNonConfigurationInstance :: MutableIO Activity -> IO Object 215 | 216 | native onSearchRequested :: MutableIO Activity -> IO Bool 217 | 218 | native onTouchEvent :: MutableIO Activity -> MutableIO MotionEvent -> IO Bool 219 | 220 | native onTrackballEvent :: MutableIO Activity -> MutableIO MotionEvent -> IO Bool 221 | 222 | native onTrimMemory :: MutableIO Activity -> Int -> IO () 223 | 224 | native onUserInteraction :: MutableIO Activity -> IO () 225 | 226 | native onWindowAttributesChanged :: MutableIO Activity -> WindowManager_LayoutParams -> IO () 227 | 228 | native onWindowFocusChanged :: MutableIO Activity -> Bool -> IO () 229 | 230 | native onWindowStartingActionMode :: MutableIO Activity -> ActionMode_Callback -> IOMutable ActionMode 231 | 232 | native openContextMenu :: MutableIO Activity -> MutableIO View -> IO () 233 | 234 | native openOptionsMenu :: MutableIO Activity -> IO () 235 | 236 | native overridePendingTransition :: MutableIO Activity -> Int -> Int -> IO () 237 | 238 | native recreate :: MutableIO Activity -> IO () 239 | 240 | native registerForContextMenu :: MutableIO Activity -> MutableIO View -> IO () 241 | 242 | native removeDialog :: MutableIO Activity -> Int -> IO () 243 | 244 | native reportFullyDrawn :: MutableIO Activity -> IO () 245 | 246 | native requestWindowFeature :: MutableIO Activity -> Int -> IO Bool 247 | 248 | native runOnUiThread :: MutableIO Activity -> Runnable -> IO () 249 | 250 | native setContentView :: MutableIO Activity -> Int -> IO () 251 | | MutableIO Activity -> MutableIO View -> ViewGroup_LayoutParams -> IO () 252 | | MutableIO Activity -> MutableIO View -> IO () 253 | 254 | native setDefaultKeyMode :: MutableIO Activity -> Int -> IO () 255 | 256 | native setFeatureDrawable :: MutableIO Activity -> Int -> Drawable -> IO () 257 | 258 | native setFeatureDrawableAlpha :: MutableIO Activity -> Int -> Int -> IO () 259 | 260 | native setFeatureDrawableResource :: MutableIO Activity -> Int -> Int -> IO () 261 | 262 | native setFeatureDrawableUri :: MutableIO Activity -> Int -> Uri -> IO () 263 | 264 | native setFinishOnTouchOutside :: MutableIO Activity -> Bool -> IO () 265 | 266 | native setImmersive :: MutableIO Activity -> Bool -> IO () 267 | 268 | native setIntent :: MutableIO Activity -> MutableIO Intent -> IO () 269 | 270 | native setProgress :: MutableIO Activity -> Int -> IO () 271 | 272 | native setProgressBarIndeterminate :: MutableIO Activity -> Bool -> IO () 273 | 274 | native setProgressBarIndeterminateVisibility :: MutableIO Activity -> Bool -> IO () 275 | 276 | native setProgressBarVisibility :: MutableIO Activity -> Bool -> IO () 277 | 278 | native setRequestedOrientation :: MutableIO Activity -> Int -> IO () 279 | 280 | native setResult :: MutableIO Activity -> Int -> IO () 281 | | MutableIO Activity -> Int -> MutableIO Intent -> IO () 282 | 283 | native setSecondaryProgress :: MutableIO Activity -> Int -> IO () 284 | 285 | native setTitle :: MutableIO Activity -> CharSequence -> IO () 286 | | MutableIO Activity -> Int -> IO () 287 | 288 | native setTitleColor :: MutableIO Activity -> Int -> IO () 289 | 290 | native setVisible :: MutableIO Activity -> Bool -> IO () 291 | 292 | native setVolumeControlStream :: MutableIO Activity -> Int -> IO () 293 | 294 | native shouldUpRecreateTask :: MutableIO Activity -> MutableIO Intent -> IO Bool 295 | 296 | native showDialog :: MutableIO Activity -> Int -> Bundle -> IO Bool 297 | | MutableIO Activity -> Int -> IO () 298 | 299 | native startActionMode :: MutableIO Activity -> ActionMode_Callback -> IOMutable ActionMode 300 | 301 | native startActivity :: MutableIO Activity -> MutableIO Intent -> Bundle -> IO () 302 | | MutableIO Activity -> MutableIO Intent -> IO () 303 | 304 | native startActivityForResult :: MutableIO Activity -> MutableIO Intent -> Int -> IO () 305 | | MutableIO Activity -> MutableIO Intent -> Int -> Bundle -> IO () 306 | 307 | native startActivityFromChild :: MutableIO Activity -> MutableIO Activity -> MutableIO Intent -> Int -> Bundle -> IO () 308 | | MutableIO Activity -> MutableIO Activity -> MutableIO Intent -> Int -> IO () 309 | 310 | native startActivityFromFragment :: MutableIO Activity -> MutableIO Fragment -> MutableIO Intent -> Int -> IO () 311 | | MutableIO Activity -> MutableIO Fragment -> MutableIO Intent -> Int -> Bundle -> IO () 312 | 313 | native startActivityIfNeeded :: MutableIO Activity -> MutableIO Intent -> Int -> Bundle -> IO Bool 314 | | MutableIO Activity -> MutableIO Intent -> Int -> IO Bool 315 | 316 | native startManagingCursor :: MutableIO Activity -> Cursor -> IO () 317 | 318 | native startNextMatchingActivity :: MutableIO Activity -> MutableIO Intent -> IO Bool 319 | | MutableIO Activity -> MutableIO Intent -> Bundle -> IO Bool 320 | 321 | native startSearch :: MutableIO Activity -> String -> Bool -> Bundle -> Bool -> IO () 322 | 323 | native stopManagingCursor :: MutableIO Activity -> Cursor -> IO () 324 | 325 | native takeKeyEvents :: MutableIO Activity -> Bool -> IO () 326 | 327 | native triggerSearch :: MutableIO Activity -> String -> Bundle -> IO () 328 | 329 | native unregisterForContextMenu :: MutableIO Activity -> MutableIO View -> IO () 330 | {- -} 331 | 332 | 333 | -------------------------------------------------------------------------------- /src/frege/android/app/DownloadManager.fr: -------------------------------------------------------------------------------- 1 | package frege.android.app.DownloadManager where 2 | 3 | import frege.android.content.Context 4 | import frege.android.database.Cursor 5 | import frege.android.net.Uri 6 | 7 | data DownloadManager_Query = pure native android.app.DownloadManager.Query where 8 | 9 | native new :: () -> ST s DownloadManager_Query 10 | 11 | pure native setFilterByStatus :: DownloadManager_Query -> Int -> DownloadManager_Query 12 | {- -} 13 | 14 | data DownloadManager_Request = pure native android.app.DownloadManager.Request where 15 | 16 | pure native network_mobile android.app.DownloadManager.Request.NETWORK_MOBILE :: Int 17 | pure native network_wifi android.app.DownloadManager.Request.NETWORK_WIFI :: Int 18 | pure native visibility_visible android.app.DownloadManager.Request.VISIBILITY_VISIBLE :: Int 19 | pure native visibility_visible_notify_completed android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED :: Int 20 | pure native visibility_hidden android.app.DownloadManager.Request.VISIBILITY_HIDDEN :: Int 21 | pure native visibility_visible_notify_only_completion android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION :: Int 22 | native new :: Uri -> ST s DownloadManager_Request 23 | 24 | pure native addRequestHeader :: DownloadManager_Request -> String -> String -> DownloadManager_Request 25 | 26 | native allowScanningByMediaScanner :: DownloadManager_Request -> ST s () 27 | 28 | pure native setAllowedNetworkTypes :: DownloadManager_Request -> Int -> DownloadManager_Request 29 | 30 | pure native setAllowedOverMetered :: DownloadManager_Request -> Bool -> DownloadManager_Request 31 | 32 | pure native setAllowedOverRoaming :: DownloadManager_Request -> Bool -> DownloadManager_Request 33 | 34 | pure native setDescription :: DownloadManager_Request -> CharSequence -> DownloadManager_Request 35 | 36 | native setDestinationInExternalFilesDir :: DownloadManager_Request -> MutableIO Context -> String -> String -> IO DownloadManager_Request 37 | 38 | pure native setDestinationInExternalPublicDir :: DownloadManager_Request -> String -> String -> DownloadManager_Request 39 | 40 | pure native setDestinationUri :: DownloadManager_Request -> Uri -> DownloadManager_Request 41 | 42 | pure native setMimeType :: DownloadManager_Request -> String -> DownloadManager_Request 43 | 44 | pure native setNotificationVisibility :: DownloadManager_Request -> Int -> DownloadManager_Request 45 | 46 | pure native setShowRunningNotification :: DownloadManager_Request -> Bool -> DownloadManager_Request 47 | 48 | pure native setTitle :: DownloadManager_Request -> CharSequence -> DownloadManager_Request 49 | 50 | pure native setVisibleInDownloadsUi :: DownloadManager_Request -> Bool -> DownloadManager_Request 51 | {- -} 52 | 53 | data DownloadManager = native android.app.DownloadManager where 54 | 55 | pure native column_id android.app.DownloadManager.COLUMN_ID :: String 56 | pure native column_title android.app.DownloadManager.COLUMN_TITLE :: String 57 | pure native column_description android.app.DownloadManager.COLUMN_DESCRIPTION :: String 58 | pure native column_uri android.app.DownloadManager.COLUMN_URI :: String 59 | pure native column_media_type android.app.DownloadManager.COLUMN_MEDIA_TYPE :: String 60 | pure native column_total_size_bytes android.app.DownloadManager.COLUMN_TOTAL_SIZE_BYTES :: String 61 | pure native column_local_uri android.app.DownloadManager.COLUMN_LOCAL_URI :: String 62 | pure native column_local_filename android.app.DownloadManager.COLUMN_LOCAL_FILENAME :: String 63 | pure native column_status android.app.DownloadManager.COLUMN_STATUS :: String 64 | pure native column_reason android.app.DownloadManager.COLUMN_REASON :: String 65 | pure native column_bytes_downloaded_so_far android.app.DownloadManager.COLUMN_BYTES_DOWNLOADED_SO_FAR :: String 66 | pure native column_last_modified_timestamp android.app.DownloadManager.COLUMN_LAST_MODIFIED_TIMESTAMP :: String 67 | pure native column_mediaprovider_uri android.app.DownloadManager.COLUMN_MEDIAPROVIDER_URI :: String 68 | pure native status_pending android.app.DownloadManager.STATUS_PENDING :: Int 69 | pure native status_running android.app.DownloadManager.STATUS_RUNNING :: Int 70 | pure native status_paused android.app.DownloadManager.STATUS_PAUSED :: Int 71 | pure native status_successful android.app.DownloadManager.STATUS_SUCCESSFUL :: Int 72 | pure native status_failed android.app.DownloadManager.STATUS_FAILED :: Int 73 | pure native error_unknown android.app.DownloadManager.ERROR_UNKNOWN :: Int 74 | pure native error_file_error android.app.DownloadManager.ERROR_FILE_ERROR :: Int 75 | pure native error_unhandled_http_code android.app.DownloadManager.ERROR_UNHANDLED_HTTP_CODE :: Int 76 | pure native error_http_data_error android.app.DownloadManager.ERROR_HTTP_DATA_ERROR :: Int 77 | pure native error_too_many_redirects android.app.DownloadManager.ERROR_TOO_MANY_REDIRECTS :: Int 78 | pure native error_insufficient_space android.app.DownloadManager.ERROR_INSUFFICIENT_SPACE :: Int 79 | pure native error_device_not_found android.app.DownloadManager.ERROR_DEVICE_NOT_FOUND :: Int 80 | pure native error_cannot_resume android.app.DownloadManager.ERROR_CANNOT_RESUME :: Int 81 | pure native error_file_already_exists android.app.DownloadManager.ERROR_FILE_ALREADY_EXISTS :: Int 82 | pure native paused_waiting_to_retry android.app.DownloadManager.PAUSED_WAITING_TO_RETRY :: Int 83 | pure native paused_waiting_for_network android.app.DownloadManager.PAUSED_WAITING_FOR_NETWORK :: Int 84 | pure native paused_queued_for_wifi android.app.DownloadManager.PAUSED_QUEUED_FOR_WIFI :: Int 85 | pure native paused_unknown android.app.DownloadManager.PAUSED_UNKNOWN :: Int 86 | pure native action_download_complete android.app.DownloadManager.ACTION_DOWNLOAD_COMPLETE :: String 87 | pure native action_notification_clicked android.app.DownloadManager.ACTION_NOTIFICATION_CLICKED :: String 88 | pure native action_view_downloads android.app.DownloadManager.ACTION_VIEW_DOWNLOADS :: String 89 | pure native intent_extras_sort_by_size android.app.DownloadManager.INTENT_EXTRAS_SORT_BY_SIZE :: String 90 | pure native extra_download_id android.app.DownloadManager.EXTRA_DOWNLOAD_ID :: String 91 | pure native extra_notification_click_download_ids android.app.DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS :: String 92 | 93 | native addCompletedDownload :: MutableIO DownloadManager -> String -> String -> Bool -> String -> String -> Long -> Bool -> IO Long 94 | 95 | native enqueue :: MutableIO DownloadManager -> DownloadManager_Request -> IO Long 96 | 97 | native getMaxBytesOverMobile android.app.DownloadManager.getMaxBytesOverMobile :: MutableIO Context -> IO Long 98 | 99 | native getMimeTypeForDownloadedFile :: MutableIO DownloadManager -> Long -> IO String 100 | 101 | native getRecommendedMaxBytesOverMobile android.app.DownloadManager.getRecommendedMaxBytesOverMobile :: MutableIO Context -> IO Long 102 | 103 | native getUriForDownloadedFile :: MutableIO DownloadManager -> Long -> IO Uri 104 | 105 | native query :: MutableIO DownloadManager -> DownloadManager_Query -> IO Cursor 106 | {- -} 107 | 108 | 109 | -------------------------------------------------------------------------------- /src/frege/android/content/Context.fr: -------------------------------------------------------------------------------- 1 | package frege.android.content.Context where 2 | 3 | import frege.android.content.BroadcastReceiver 4 | import frege.android.content.Intent 5 | import frege.android.content.SharedPreferences 6 | import frege.android.content.pm.PackageManager 7 | import frege.android.content.res.Configuration 8 | import frege.android.content.res.Resources 9 | import frege.android.graphics.Bitmap 10 | import frege.android.graphics.drawable.Drawable 11 | import frege.android.net.Uri 12 | import frege.android.os.Bundle 13 | import frege.android.os.Handler 14 | import frege.android.os.Looper 15 | import frege.android.os.UserHandle 16 | import frege.android.view.Display 17 | import frege.java.io.File 18 | import frege.java.io.IOException 19 | 20 | data Context = native android.content.Context where 21 | 22 | pure native mode_private android.content.Context.MODE_PRIVATE :: Int 23 | pure native mode_world_readable android.content.Context.MODE_WORLD_READABLE :: Int 24 | pure native mode_world_writeable android.content.Context.MODE_WORLD_WRITEABLE :: Int 25 | pure native mode_append android.content.Context.MODE_APPEND :: Int 26 | pure native mode_multi_process android.content.Context.MODE_MULTI_PROCESS :: Int 27 | pure native mode_enable_write_ahead_logging android.content.Context.MODE_ENABLE_WRITE_AHEAD_LOGGING :: Int 28 | pure native bind_auto_create android.content.Context.BIND_AUTO_CREATE :: Int 29 | pure native bind_debug_unbind android.content.Context.BIND_DEBUG_UNBIND :: Int 30 | pure native bind_not_foreground android.content.Context.BIND_NOT_FOREGROUND :: Int 31 | pure native bind_above_client android.content.Context.BIND_ABOVE_CLIENT :: Int 32 | pure native bind_allow_oom_management android.content.Context.BIND_ALLOW_OOM_MANAGEMENT :: Int 33 | pure native bind_waive_priority android.content.Context.BIND_WAIVE_PRIORITY :: Int 34 | pure native bind_important android.content.Context.BIND_IMPORTANT :: Int 35 | pure native bind_adjust_with_activity android.content.Context.BIND_ADJUST_WITH_ACTIVITY :: Int 36 | pure native power_service android.content.Context.POWER_SERVICE :: String 37 | pure native window_service android.content.Context.WINDOW_SERVICE :: String 38 | pure native layout_inflater_service android.content.Context.LAYOUT_INFLATER_SERVICE :: String 39 | pure native account_service android.content.Context.ACCOUNT_SERVICE :: String 40 | pure native activity_service android.content.Context.ACTIVITY_SERVICE :: String 41 | pure native alarm_service android.content.Context.ALARM_SERVICE :: String 42 | pure native notification_service android.content.Context.NOTIFICATION_SERVICE :: String 43 | pure native accessibility_service android.content.Context.ACCESSIBILITY_SERVICE :: String 44 | pure native captioning_service android.content.Context.CAPTIONING_SERVICE :: String 45 | pure native keyguard_service android.content.Context.KEYGUARD_SERVICE :: String 46 | pure native location_service android.content.Context.LOCATION_SERVICE :: String 47 | pure native search_service android.content.Context.SEARCH_SERVICE :: String 48 | pure native sensor_service android.content.Context.SENSOR_SERVICE :: String 49 | pure native storage_service android.content.Context.STORAGE_SERVICE :: String 50 | pure native wallpaper_service android.content.Context.WALLPAPER_SERVICE :: String 51 | pure native vibrator_service android.content.Context.VIBRATOR_SERVICE :: String 52 | pure native connectivity_service android.content.Context.CONNECTIVITY_SERVICE :: String 53 | pure native wifi_service android.content.Context.WIFI_SERVICE :: String 54 | pure native wifi_p2p_service android.content.Context.WIFI_P2P_SERVICE :: String 55 | pure native nsd_service android.content.Context.NSD_SERVICE :: String 56 | pure native audio_service android.content.Context.AUDIO_SERVICE :: String 57 | pure native media_router_service android.content.Context.MEDIA_ROUTER_SERVICE :: String 58 | pure native telephony_service android.content.Context.TELEPHONY_SERVICE :: String 59 | pure native clipboard_service android.content.Context.CLIPBOARD_SERVICE :: String 60 | pure native input_method_service android.content.Context.INPUT_METHOD_SERVICE :: String 61 | pure native text_services_manager_service android.content.Context.TEXT_SERVICES_MANAGER_SERVICE :: String 62 | pure native dropbox_service android.content.Context.DROPBOX_SERVICE :: String 63 | pure native device_policy_service android.content.Context.DEVICE_POLICY_SERVICE :: String 64 | pure native ui_mode_service android.content.Context.UI_MODE_SERVICE :: String 65 | pure native download_service android.content.Context.DOWNLOAD_SERVICE :: String 66 | pure native nfc_service android.content.Context.NFC_SERVICE :: String 67 | pure native bluetooth_service android.content.Context.BLUETOOTH_SERVICE :: String 68 | pure native usb_service android.content.Context.USB_SERVICE :: String 69 | pure native input_service android.content.Context.INPUT_SERVICE :: String 70 | pure native display_service android.content.Context.DISPLAY_SERVICE :: String 71 | pure native user_service android.content.Context.USER_SERVICE :: String 72 | pure native app_ops_service android.content.Context.APP_OPS_SERVICE :: String 73 | pure native print_service android.content.Context.PRINT_SERVICE :: String 74 | pure native consumer_ir_service android.content.Context.CONSUMER_IR_SERVICE :: String 75 | pure native context_include_code android.content.Context.CONTEXT_INCLUDE_CODE :: Int 76 | pure native context_ignore_security android.content.Context.CONTEXT_IGNORE_SECURITY :: Int 77 | pure native context_restricted android.content.Context.CONTEXT_RESTRICTED :: Int 78 | 79 | native checkCallingOrSelfPermission :: MutableIO Context -> String -> IO Int 80 | 81 | native checkCallingOrSelfUriPermission :: MutableIO Context -> Uri -> Int -> IO Int 82 | 83 | native checkCallingPermission :: MutableIO Context -> String -> IO Int 84 | 85 | native checkCallingUriPermission :: MutableIO Context -> Uri -> Int -> IO Int 86 | 87 | native checkPermission :: MutableIO Context -> String -> Int -> Int -> IO Int 88 | 89 | native checkUriPermission :: MutableIO Context -> Uri -> String -> String -> Int -> Int -> Int -> IO Int 90 | | MutableIO Context -> Uri -> Int -> Int -> Int -> IO Int 91 | 92 | native clearWallpaper :: MutableIO Context -> IO () throws IOException 93 | 94 | native createConfigurationContext :: MutableIO Context -> Configuration -> IOMutable Context 95 | 96 | native createDisplayContext :: MutableIO Context -> MutableIO Display -> IOMutable Context 97 | 98 | native deleteDatabase :: MutableIO Context -> String -> IO Bool 99 | 100 | native deleteFile :: MutableIO Context -> String -> IO Bool 101 | 102 | native enforceCallingOrSelfPermission :: MutableIO Context -> String -> String -> IO () 103 | 104 | native enforceCallingOrSelfUriPermission :: MutableIO Context -> Uri -> Int -> String -> IO () 105 | 106 | native enforceCallingPermission :: MutableIO Context -> String -> String -> IO () 107 | 108 | native enforceCallingUriPermission :: MutableIO Context -> Uri -> Int -> String -> IO () 109 | 110 | native enforcePermission :: MutableIO Context -> String -> Int -> Int -> String -> IO () 111 | 112 | native enforceUriPermission :: MutableIO Context -> Uri -> String -> String -> Int -> Int -> Int -> String -> IO () 113 | | MutableIO Context -> Uri -> Int -> Int -> Int -> String -> IO () 114 | 115 | native getApplicationContext :: MutableIO Context -> IOMutable Context 116 | 117 | native getCacheDir :: MutableIO Context -> IOMutable File 118 | 119 | native getDatabasePath :: MutableIO Context -> String -> IOMutable File 120 | 121 | native getDir :: MutableIO Context -> String -> Int -> IOMutable File 122 | 123 | native getExternalCacheDir :: MutableIO Context -> IOMutable File 124 | 125 | native getExternalFilesDir :: MutableIO Context -> String -> IOMutable File 126 | 127 | native getFileStreamPath :: MutableIO Context -> String -> IOMutable File 128 | 129 | native getFilesDir :: MutableIO Context -> IOMutable File 130 | 131 | native getMainLooper :: MutableIO Context -> IO Looper 132 | 133 | native getObbDir :: MutableIO Context -> IOMutable File 134 | 135 | native getPackageCodePath :: MutableIO Context -> IO String 136 | 137 | native getPackageManager :: MutableIO Context -> IOMutable PackageManager 138 | 139 | native getPackageName :: MutableIO Context -> IO String 140 | 141 | native getPackageResourcePath :: MutableIO Context -> IO String 142 | 143 | native getResources :: MutableIO Context -> IO Resources 144 | 145 | native getSharedPreferences :: MutableIO Context -> String -> Int -> IO SharedPreferences 146 | 147 | native getString :: MutableIO Context -> Int -> IO String 148 | 149 | native getSystemService :: MutableIO Context -> String -> IO Object 150 | 151 | native getText :: MutableIO Context -> Int -> IO CharSequence 152 | 153 | native getTheme :: MutableIO Context -> IO Resources_Theme 154 | 155 | native getWallpaper :: MutableIO Context -> IO Drawable 156 | 157 | native getWallpaperDesiredMinimumHeight :: MutableIO Context -> IO Int 158 | 159 | native getWallpaperDesiredMinimumWidth :: MutableIO Context -> IO Int 160 | 161 | native grantUriPermission :: MutableIO Context -> String -> Uri -> Int -> IO () 162 | 163 | native isRestricted :: MutableIO Context -> IO Bool 164 | 165 | native peekWallpaper :: MutableIO Context -> IO Drawable 166 | 167 | native removeStickyBroadcast :: MutableIO Context -> MutableIO Intent -> IO () 168 | 169 | native removeStickyBroadcastAsUser :: MutableIO Context -> MutableIO Intent -> UserHandle -> IO () 170 | 171 | native revokeUriPermission :: MutableIO Context -> Uri -> Int -> IO () 172 | 173 | native sendBroadcast :: MutableIO Context -> MutableIO Intent -> String -> IO () 174 | | MutableIO Context -> MutableIO Intent -> IO () 175 | 176 | native sendBroadcastAsUser :: MutableIO Context -> MutableIO Intent -> UserHandle -> IO () 177 | | MutableIO Context -> MutableIO Intent -> UserHandle -> String -> IO () 178 | 179 | native sendOrderedBroadcast :: MutableIO Context -> MutableIO Intent -> String -> MutableIO BroadcastReceiver -> Handler -> Int -> String -> Bundle -> IO () 180 | | MutableIO Context -> MutableIO Intent -> String -> IO () 181 | 182 | native sendOrderedBroadcastAsUser :: MutableIO Context -> MutableIO Intent -> UserHandle -> String -> MutableIO BroadcastReceiver -> Handler -> Int -> String -> Bundle -> IO () 183 | 184 | native sendStickyBroadcast :: MutableIO Context -> MutableIO Intent -> IO () 185 | 186 | native sendStickyBroadcastAsUser :: MutableIO Context -> MutableIO Intent -> UserHandle -> IO () 187 | 188 | native sendStickyOrderedBroadcast :: MutableIO Context -> MutableIO Intent -> MutableIO BroadcastReceiver -> Handler -> Int -> String -> Bundle -> IO () 189 | 190 | native sendStickyOrderedBroadcastAsUser :: MutableIO Context -> MutableIO Intent -> UserHandle -> MutableIO BroadcastReceiver -> Handler -> Int -> String -> Bundle -> IO () 191 | 192 | native setTheme :: MutableIO Context -> Int -> IO () 193 | 194 | native setWallpaper :: MutableIO Context -> Bitmap -> IO () throws IOException 195 | 196 | native startActivity :: MutableIO Context -> MutableIO Intent -> Bundle -> IO () 197 | | MutableIO Context -> MutableIO Intent -> IO () 198 | 199 | native stopService :: MutableIO Context -> MutableIO Intent -> IO Bool 200 | 201 | native unregisterReceiver :: MutableIO Context -> MutableIO BroadcastReceiver -> IO () 202 | {- -} 203 | 204 | 205 | -------------------------------------------------------------------------------- /src/frege/android/content/DialogInterface.fr: -------------------------------------------------------------------------------- 1 | package frege.android.content.DialogInterface where 2 | 3 | 4 | data DialogInterface = native android.content.DialogInterface where 5 | 6 | pure native button_positive android.content.DialogInterface.BUTTON_POSITIVE :: Int 7 | pure native button_negative android.content.DialogInterface.BUTTON_NEGATIVE :: Int 8 | pure native button_neutral android.content.DialogInterface.BUTTON_NEUTRAL :: Int 9 | pure native button1 android.content.DialogInterface.BUTTON1 :: Int 10 | pure native button2 android.content.DialogInterface.BUTTON2 :: Int 11 | pure native button3 android.content.DialogInterface.BUTTON3 :: Int 12 | 13 | native cancel :: MutableIO DialogInterface -> IO () 14 | 15 | native dismiss :: MutableIO DialogInterface -> IO () 16 | {- -} 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/frege/android/content/SharedPreferences.fr: -------------------------------------------------------------------------------- 1 | package frege.android.content.SharedPreferences where 2 | 3 | 4 | data SharedPreferences = pure native android.content.SharedPreferences where 5 | 6 | 7 | pure native contains :: SharedPreferences -> String -> Bool 8 | 9 | pure native getBoolean :: SharedPreferences -> String -> Bool -> Bool 10 | 11 | pure native getFloat :: SharedPreferences -> String -> Float -> Float 12 | 13 | pure native getInt :: SharedPreferences -> String -> Int -> Int 14 | 15 | pure native getLong :: SharedPreferences -> String -> Long -> Long 16 | 17 | pure native getString :: SharedPreferences -> String -> String -> String 18 | {- -} 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/frege/android/content/pm/PackageManager.fr: -------------------------------------------------------------------------------- 1 | package frege.android.content.pm.PackageManager where 2 | 3 | import frege.android.content.Intent 4 | import frege.android.graphics.drawable.Drawable 5 | 6 | data PackageManager = native android.content.pm.PackageManager where 7 | 8 | pure native get_activities android.content.pm.PackageManager.GET_ACTIVITIES :: Int 9 | pure native get_receivers android.content.pm.PackageManager.GET_RECEIVERS :: Int 10 | pure native get_services android.content.pm.PackageManager.GET_SERVICES :: Int 11 | pure native get_providers android.content.pm.PackageManager.GET_PROVIDERS :: Int 12 | pure native get_instrumentation android.content.pm.PackageManager.GET_INSTRUMENTATION :: Int 13 | pure native get_intent_filters android.content.pm.PackageManager.GET_INTENT_FILTERS :: Int 14 | pure native get_signatures android.content.pm.PackageManager.GET_SIGNATURES :: Int 15 | pure native get_resolved_filter android.content.pm.PackageManager.GET_RESOLVED_FILTER :: Int 16 | pure native get_meta_data android.content.pm.PackageManager.GET_META_DATA :: Int 17 | pure native get_gids android.content.pm.PackageManager.GET_GIDS :: Int 18 | pure native get_disabled_components android.content.pm.PackageManager.GET_DISABLED_COMPONENTS :: Int 19 | pure native get_shared_library_files android.content.pm.PackageManager.GET_SHARED_LIBRARY_FILES :: Int 20 | pure native get_uri_permission_patterns android.content.pm.PackageManager.GET_URI_PERMISSION_PATTERNS :: Int 21 | pure native get_permissions android.content.pm.PackageManager.GET_PERMISSIONS :: Int 22 | pure native get_uninstalled_packages android.content.pm.PackageManager.GET_UNINSTALLED_PACKAGES :: Int 23 | pure native get_configurations android.content.pm.PackageManager.GET_CONFIGURATIONS :: Int 24 | pure native get_disabled_until_used_components android.content.pm.PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS :: Int 25 | pure native match_default_only android.content.pm.PackageManager.MATCH_DEFAULT_ONLY :: Int 26 | pure native permission_granted android.content.pm.PackageManager.PERMISSION_GRANTED :: Int 27 | pure native permission_denied android.content.pm.PackageManager.PERMISSION_DENIED :: Int 28 | pure native signature_match android.content.pm.PackageManager.SIGNATURE_MATCH :: Int 29 | pure native signature_neither_signed android.content.pm.PackageManager.SIGNATURE_NEITHER_SIGNED :: Int 30 | pure native signature_first_not_signed android.content.pm.PackageManager.SIGNATURE_FIRST_NOT_SIGNED :: Int 31 | pure native signature_second_not_signed android.content.pm.PackageManager.SIGNATURE_SECOND_NOT_SIGNED :: Int 32 | pure native signature_no_match android.content.pm.PackageManager.SIGNATURE_NO_MATCH :: Int 33 | pure native signature_unknown_package android.content.pm.PackageManager.SIGNATURE_UNKNOWN_PACKAGE :: Int 34 | pure native component_enabled_state_default android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT :: Int 35 | pure native component_enabled_state_enabled android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED :: Int 36 | pure native component_enabled_state_disabled android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED :: Int 37 | pure native component_enabled_state_disabled_user android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER :: Int 38 | pure native component_enabled_state_disabled_until_used android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED :: Int 39 | pure native dont_kill_app android.content.pm.PackageManager.DONT_KILL_APP :: Int 40 | pure native verification_allow android.content.pm.PackageManager.VERIFICATION_ALLOW :: Int 41 | pure native verification_reject android.content.pm.PackageManager.VERIFICATION_REJECT :: Int 42 | pure native maximum_verification_timeout android.content.pm.PackageManager.MAXIMUM_VERIFICATION_TIMEOUT :: Long 43 | pure native feature_audio_low_latency android.content.pm.PackageManager.FEATURE_AUDIO_LOW_LATENCY :: String 44 | pure native feature_bluetooth android.content.pm.PackageManager.FEATURE_BLUETOOTH :: String 45 | pure native feature_bluetooth_le android.content.pm.PackageManager.FEATURE_BLUETOOTH_LE :: String 46 | pure native feature_camera android.content.pm.PackageManager.FEATURE_CAMERA :: String 47 | pure native feature_camera_autofocus android.content.pm.PackageManager.FEATURE_CAMERA_AUTOFOCUS :: String 48 | pure native feature_camera_any android.content.pm.PackageManager.FEATURE_CAMERA_ANY :: String 49 | pure native feature_camera_external android.content.pm.PackageManager.FEATURE_CAMERA_EXTERNAL :: String 50 | pure native feature_camera_flash android.content.pm.PackageManager.FEATURE_CAMERA_FLASH :: String 51 | pure native feature_camera_front android.content.pm.PackageManager.FEATURE_CAMERA_FRONT :: String 52 | pure native feature_consumer_ir android.content.pm.PackageManager.FEATURE_CONSUMER_IR :: String 53 | pure native feature_location android.content.pm.PackageManager.FEATURE_LOCATION :: String 54 | pure native feature_location_gps android.content.pm.PackageManager.FEATURE_LOCATION_GPS :: String 55 | pure native feature_location_network android.content.pm.PackageManager.FEATURE_LOCATION_NETWORK :: String 56 | pure native feature_microphone android.content.pm.PackageManager.FEATURE_MICROPHONE :: String 57 | pure native feature_nfc android.content.pm.PackageManager.FEATURE_NFC :: String 58 | pure native feature_nfc_host_card_emulation android.content.pm.PackageManager.FEATURE_NFC_HOST_CARD_EMULATION :: String 59 | pure native feature_sensor_accelerometer android.content.pm.PackageManager.FEATURE_SENSOR_ACCELEROMETER :: String 60 | pure native feature_sensor_barometer android.content.pm.PackageManager.FEATURE_SENSOR_BAROMETER :: String 61 | pure native feature_sensor_compass android.content.pm.PackageManager.FEATURE_SENSOR_COMPASS :: String 62 | pure native feature_sensor_gyroscope android.content.pm.PackageManager.FEATURE_SENSOR_GYROSCOPE :: String 63 | pure native feature_sensor_light android.content.pm.PackageManager.FEATURE_SENSOR_LIGHT :: String 64 | pure native feature_sensor_proximity android.content.pm.PackageManager.FEATURE_SENSOR_PROXIMITY :: String 65 | pure native feature_sensor_step_counter android.content.pm.PackageManager.FEATURE_SENSOR_STEP_COUNTER :: String 66 | pure native feature_sensor_step_detector android.content.pm.PackageManager.FEATURE_SENSOR_STEP_DETECTOR :: String 67 | pure native feature_sensor_heart_rate android.content.pm.PackageManager.FEATURE_SENSOR_HEART_RATE :: String 68 | pure native feature_telephony android.content.pm.PackageManager.FEATURE_TELEPHONY :: String 69 | pure native feature_telephony_cdma android.content.pm.PackageManager.FEATURE_TELEPHONY_CDMA :: String 70 | pure native feature_telephony_gsm android.content.pm.PackageManager.FEATURE_TELEPHONY_GSM :: String 71 | pure native feature_usb_host android.content.pm.PackageManager.FEATURE_USB_HOST :: String 72 | pure native feature_usb_accessory android.content.pm.PackageManager.FEATURE_USB_ACCESSORY :: String 73 | pure native feature_sip android.content.pm.PackageManager.FEATURE_SIP :: String 74 | pure native feature_sip_voip android.content.pm.PackageManager.FEATURE_SIP_VOIP :: String 75 | pure native feature_touchscreen android.content.pm.PackageManager.FEATURE_TOUCHSCREEN :: String 76 | pure native feature_touchscreen_multitouch android.content.pm.PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH :: String 77 | pure native feature_touchscreen_multitouch_distinct android.content.pm.PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT :: String 78 | pure native feature_touchscreen_multitouch_jazzhand android.content.pm.PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND :: String 79 | pure native feature_faketouch android.content.pm.PackageManager.FEATURE_FAKETOUCH :: String 80 | pure native feature_faketouch_multitouch_distinct android.content.pm.PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT :: String 81 | pure native feature_faketouch_multitouch_jazzhand android.content.pm.PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND :: String 82 | pure native feature_screen_portrait android.content.pm.PackageManager.FEATURE_SCREEN_PORTRAIT :: String 83 | pure native feature_screen_landscape android.content.pm.PackageManager.FEATURE_SCREEN_LANDSCAPE :: String 84 | pure native feature_live_wallpaper android.content.pm.PackageManager.FEATURE_LIVE_WALLPAPER :: String 85 | pure native feature_app_widgets android.content.pm.PackageManager.FEATURE_APP_WIDGETS :: String 86 | pure native feature_home_screen android.content.pm.PackageManager.FEATURE_HOME_SCREEN :: String 87 | pure native feature_input_methods android.content.pm.PackageManager.FEATURE_INPUT_METHODS :: String 88 | pure native feature_device_admin android.content.pm.PackageManager.FEATURE_DEVICE_ADMIN :: String 89 | pure native feature_wifi android.content.pm.PackageManager.FEATURE_WIFI :: String 90 | pure native feature_wifi_direct android.content.pm.PackageManager.FEATURE_WIFI_DIRECT :: String 91 | pure native feature_television android.content.pm.PackageManager.FEATURE_TELEVISION :: String 92 | pure native feature_watch android.content.pm.PackageManager.FEATURE_WATCH :: String 93 | pure native feature_printing android.content.pm.PackageManager.FEATURE_PRINTING :: String 94 | pure native feature_backup android.content.pm.PackageManager.FEATURE_BACKUP :: String 95 | pure native feature_webview android.content.pm.PackageManager.FEATURE_WEBVIEW :: String 96 | pure native extra_verification_id android.content.pm.PackageManager.EXTRA_VERIFICATION_ID :: String 97 | pure native extra_verification_result android.content.pm.PackageManager.EXTRA_VERIFICATION_RESULT :: String 98 | 99 | native addPackageToPreferred :: MutableIO PackageManager -> String -> IO () 100 | 101 | native checkPermission :: MutableIO PackageManager -> String -> String -> IO Int 102 | 103 | native checkSignatures :: MutableIO PackageManager -> String -> String -> IO Int 104 | | MutableIO PackageManager -> Int -> Int -> IO Int 105 | 106 | native clearPackagePreferredActivities :: MutableIO PackageManager -> String -> IO () 107 | 108 | native extendVerificationTimeout :: MutableIO PackageManager -> Int -> Int -> Long -> IO () 109 | 110 | native getApplicationEnabledSetting :: MutableIO PackageManager -> String -> IO Int 111 | 112 | native getDefaultActivityIcon :: MutableIO PackageManager -> IO Drawable 113 | 114 | native getInstallerPackageName :: MutableIO PackageManager -> String -> IO String 115 | 116 | native getLaunchIntentForPackage :: MutableIO PackageManager -> String -> IOMutable Intent 117 | 118 | native getNameForUid :: MutableIO PackageManager -> Int -> IO String 119 | 120 | native hasSystemFeature :: MutableIO PackageManager -> String -> IO Bool 121 | 122 | native isSafeMode :: MutableIO PackageManager -> IO Bool 123 | 124 | native removePackageFromPreferred :: MutableIO PackageManager -> String -> IO () 125 | 126 | native removePermission :: MutableIO PackageManager -> String -> IO () 127 | 128 | native setApplicationEnabledSetting :: MutableIO PackageManager -> String -> Int -> Int -> IO () 129 | 130 | native setInstallerPackageName :: MutableIO PackageManager -> String -> String -> IO () 131 | 132 | native verifyPendingInstall :: MutableIO PackageManager -> Int -> Int -> IO () 133 | {- -} 134 | 135 | 136 | -------------------------------------------------------------------------------- /src/frege/android/content/res/Configuration.fr: -------------------------------------------------------------------------------- 1 | package frege.android.content.res.Configuration where 2 | 3 | import frege.java.util.Locale 4 | 5 | data Configuration = pure native android.content.res.Configuration where 6 | 7 | pure native fontscale ".fontScale" :: Configuration -> Float 8 | pure native mcc ".mcc" :: Configuration -> Int 9 | pure native mnc ".mnc" :: Configuration -> Int 10 | pure native mnc_zero android.content.res.Configuration.MNC_ZERO :: Int 11 | pure native locale ".locale" :: Configuration -> Locale 12 | pure native screenlayout_size_mask android.content.res.Configuration.SCREENLAYOUT_SIZE_MASK :: Int 13 | pure native screenlayout_size_undefined android.content.res.Configuration.SCREENLAYOUT_SIZE_UNDEFINED :: Int 14 | pure native screenlayout_size_small android.content.res.Configuration.SCREENLAYOUT_SIZE_SMALL :: Int 15 | pure native screenlayout_size_normal android.content.res.Configuration.SCREENLAYOUT_SIZE_NORMAL :: Int 16 | pure native screenlayout_size_large android.content.res.Configuration.SCREENLAYOUT_SIZE_LARGE :: Int 17 | pure native screenlayout_size_xlarge android.content.res.Configuration.SCREENLAYOUT_SIZE_XLARGE :: Int 18 | pure native screenlayout_long_mask android.content.res.Configuration.SCREENLAYOUT_LONG_MASK :: Int 19 | pure native screenlayout_long_undefined android.content.res.Configuration.SCREENLAYOUT_LONG_UNDEFINED :: Int 20 | pure native screenlayout_long_no android.content.res.Configuration.SCREENLAYOUT_LONG_NO :: Int 21 | pure native screenlayout_long_yes android.content.res.Configuration.SCREENLAYOUT_LONG_YES :: Int 22 | pure native screenlayout_layoutdir_mask android.content.res.Configuration.SCREENLAYOUT_LAYOUTDIR_MASK :: Int 23 | pure native screenlayout_layoutdir_shift android.content.res.Configuration.SCREENLAYOUT_LAYOUTDIR_SHIFT :: Int 24 | pure native screenlayout_layoutdir_undefined android.content.res.Configuration.SCREENLAYOUT_LAYOUTDIR_UNDEFINED :: Int 25 | pure native screenlayout_layoutdir_ltr android.content.res.Configuration.SCREENLAYOUT_LAYOUTDIR_LTR :: Int 26 | pure native screenlayout_layoutdir_rtl android.content.res.Configuration.SCREENLAYOUT_LAYOUTDIR_RTL :: Int 27 | pure native screenlayout_undefined android.content.res.Configuration.SCREENLAYOUT_UNDEFINED :: Int 28 | pure native screenlayout ".screenLayout" :: Configuration -> Int 29 | pure native touchscreen_undefined android.content.res.Configuration.TOUCHSCREEN_UNDEFINED :: Int 30 | pure native touchscreen_notouch android.content.res.Configuration.TOUCHSCREEN_NOTOUCH :: Int 31 | pure native touchscreen_stylus android.content.res.Configuration.TOUCHSCREEN_STYLUS :: Int 32 | pure native touchscreen_finger android.content.res.Configuration.TOUCHSCREEN_FINGER :: Int 33 | pure native touchscreen ".touchscreen" :: Configuration -> Int 34 | pure native keyboard_undefined android.content.res.Configuration.KEYBOARD_UNDEFINED :: Int 35 | pure native keyboard_nokeys android.content.res.Configuration.KEYBOARD_NOKEYS :: Int 36 | pure native keyboard_qwerty android.content.res.Configuration.KEYBOARD_QWERTY :: Int 37 | pure native keyboard_12key android.content.res.Configuration.KEYBOARD_12KEY :: Int 38 | pure native keyboard ".keyboard" :: Configuration -> Int 39 | pure native keyboardhidden_undefined android.content.res.Configuration.KEYBOARDHIDDEN_UNDEFINED :: Int 40 | pure native keyboardhidden_no android.content.res.Configuration.KEYBOARDHIDDEN_NO :: Int 41 | pure native keyboardhidden_yes android.content.res.Configuration.KEYBOARDHIDDEN_YES :: Int 42 | pure native keyboardhidden ".keyboardHidden" :: Configuration -> Int 43 | pure native hardkeyboardhidden_undefined android.content.res.Configuration.HARDKEYBOARDHIDDEN_UNDEFINED :: Int 44 | pure native hardkeyboardhidden_no android.content.res.Configuration.HARDKEYBOARDHIDDEN_NO :: Int 45 | pure native hardkeyboardhidden_yes android.content.res.Configuration.HARDKEYBOARDHIDDEN_YES :: Int 46 | pure native hardkeyboardhidden ".hardKeyboardHidden" :: Configuration -> Int 47 | pure native navigation_undefined android.content.res.Configuration.NAVIGATION_UNDEFINED :: Int 48 | pure native navigation_nonav android.content.res.Configuration.NAVIGATION_NONAV :: Int 49 | pure native navigation_dpad android.content.res.Configuration.NAVIGATION_DPAD :: Int 50 | pure native navigation_trackball android.content.res.Configuration.NAVIGATION_TRACKBALL :: Int 51 | pure native navigation_wheel android.content.res.Configuration.NAVIGATION_WHEEL :: Int 52 | pure native navigation ".navigation" :: Configuration -> Int 53 | pure native navigationhidden_undefined android.content.res.Configuration.NAVIGATIONHIDDEN_UNDEFINED :: Int 54 | pure native navigationhidden_no android.content.res.Configuration.NAVIGATIONHIDDEN_NO :: Int 55 | pure native navigationhidden_yes android.content.res.Configuration.NAVIGATIONHIDDEN_YES :: Int 56 | pure native navigationhidden ".navigationHidden" :: Configuration -> Int 57 | pure native orientation_undefined android.content.res.Configuration.ORIENTATION_UNDEFINED :: Int 58 | pure native orientation_portrait android.content.res.Configuration.ORIENTATION_PORTRAIT :: Int 59 | pure native orientation_landscape android.content.res.Configuration.ORIENTATION_LANDSCAPE :: Int 60 | pure native orientation_square android.content.res.Configuration.ORIENTATION_SQUARE :: Int 61 | pure native orientation ".orientation" :: Configuration -> Int 62 | pure native ui_mode_type_mask android.content.res.Configuration.UI_MODE_TYPE_MASK :: Int 63 | pure native ui_mode_type_undefined android.content.res.Configuration.UI_MODE_TYPE_UNDEFINED :: Int 64 | pure native ui_mode_type_normal android.content.res.Configuration.UI_MODE_TYPE_NORMAL :: Int 65 | pure native ui_mode_type_desk android.content.res.Configuration.UI_MODE_TYPE_DESK :: Int 66 | pure native ui_mode_type_car android.content.res.Configuration.UI_MODE_TYPE_CAR :: Int 67 | pure native ui_mode_type_television android.content.res.Configuration.UI_MODE_TYPE_TELEVISION :: Int 68 | pure native ui_mode_type_appliance android.content.res.Configuration.UI_MODE_TYPE_APPLIANCE :: Int 69 | pure native ui_mode_type_watch android.content.res.Configuration.UI_MODE_TYPE_WATCH :: Int 70 | pure native ui_mode_night_mask android.content.res.Configuration.UI_MODE_NIGHT_MASK :: Int 71 | pure native ui_mode_night_undefined android.content.res.Configuration.UI_MODE_NIGHT_UNDEFINED :: Int 72 | pure native ui_mode_night_no android.content.res.Configuration.UI_MODE_NIGHT_NO :: Int 73 | pure native ui_mode_night_yes android.content.res.Configuration.UI_MODE_NIGHT_YES :: Int 74 | pure native uimode ".uiMode" :: Configuration -> Int 75 | pure native screen_width_dp_undefined android.content.res.Configuration.SCREEN_WIDTH_DP_UNDEFINED :: Int 76 | pure native screenwidthdp ".screenWidthDp" :: Configuration -> Int 77 | pure native screen_height_dp_undefined android.content.res.Configuration.SCREEN_HEIGHT_DP_UNDEFINED :: Int 78 | pure native screenheightdp ".screenHeightDp" :: Configuration -> Int 79 | pure native smallest_screen_width_dp_undefined android.content.res.Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED :: Int 80 | pure native smallestscreenwidthdp ".smallestScreenWidthDp" :: Configuration -> Int 81 | pure native density_dpi_undefined android.content.res.Configuration.DENSITY_DPI_UNDEFINED :: Int 82 | pure native densitydpi ".densityDpi" :: Configuration -> Int 83 | native new :: () -> ST s Configuration 84 | | Configuration -> ST s Configuration 85 | 86 | pure native compareTo :: Configuration -> Configuration -> Int 87 | 88 | pure native describeContents :: Configuration -> Int 89 | 90 | pure native diff :: Configuration -> Configuration -> Int 91 | 92 | pure native equals :: Configuration -> Configuration -> Bool 93 | | Configuration -> Object -> Bool 94 | 95 | pure native getLayoutDirection :: Configuration -> Int 96 | 97 | pure native hashCode :: Configuration -> Int 98 | 99 | pure native isLayoutSizeAtLeast :: Configuration -> Int -> Bool 100 | 101 | pure native needNewResources android.content.res.Configuration.needNewResources :: Int -> Int -> Bool 102 | 103 | native setLayoutDirection :: Configuration -> Locale -> ST s () 104 | 105 | native setLocale :: Configuration -> Locale -> ST s () 106 | 107 | native setTo :: Configuration -> Configuration -> ST s () 108 | 109 | native setToDefaults :: Configuration -> ST s () 110 | 111 | pure native toString :: Configuration -> String 112 | 113 | pure native updateFrom :: Configuration -> Configuration -> Int 114 | {- -} 115 | 116 | 117 | -------------------------------------------------------------------------------- /src/frege/android/database/sqlite/SQLiteOpenHelper.fr: -------------------------------------------------------------------------------- 1 | package frege.android.database.sqlite.SQLiteOpenHelper where 2 | 3 | import frege.android.database.sqlite.SQLiteDatabase 4 | 5 | data SQLiteOpenHelper = pure native android.database.sqlite.SQLiteOpenHelper where 6 | 7 | 8 | native close :: SQLiteOpenHelper -> ST s () 9 | 10 | pure native getDatabaseName :: SQLiteOpenHelper -> String 11 | 12 | native getReadableDatabase :: SQLiteOpenHelper -> IOMutable SQLiteDatabase 13 | 14 | native getWritableDatabase :: SQLiteOpenHelper -> IOMutable SQLiteDatabase 15 | 16 | native onConfigure :: SQLiteOpenHelper -> MutableIO SQLiteDatabase -> IO () 17 | 18 | native onCreate :: SQLiteOpenHelper -> MutableIO SQLiteDatabase -> IO () 19 | 20 | native onDowngrade :: SQLiteOpenHelper -> MutableIO SQLiteDatabase -> Int -> Int -> IO () 21 | 22 | native onOpen :: SQLiteOpenHelper -> MutableIO SQLiteDatabase -> IO () 23 | 24 | native onUpgrade :: SQLiteOpenHelper -> MutableIO SQLiteDatabase -> Int -> Int -> IO () 25 | 26 | native setWriteAheadLoggingEnabled :: SQLiteOpenHelper -> Bool -> ST s () 27 | {- -} 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/frege/android/gesture/GestureOverlayView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.gesture.GestureOverlayView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.gesture.Gesture 5 | import frege.android.graphics.Canvas 6 | import frege.android.graphics.Path 7 | import frege.android.util.AttributeSet 8 | import frege.android.view.MotionEvent 9 | 10 | data GestureOverlayView = pure native android.gesture.GestureOverlayView where 11 | 12 | pure native gesture_stroke_type_single android.gesture.GestureOverlayView.GESTURE_STROKE_TYPE_SINGLE :: Int 13 | pure native gesture_stroke_type_multiple android.gesture.GestureOverlayView.GESTURE_STROKE_TYPE_MULTIPLE :: Int 14 | pure native orientation_horizontal android.gesture.GestureOverlayView.ORIENTATION_HORIZONTAL :: Int 15 | pure native orientation_vertical android.gesture.GestureOverlayView.ORIENTATION_VERTICAL :: Int 16 | native new :: MutableIO Context -> IO GestureOverlayView 17 | | MutableIO Context -> AttributeSet -> IO GestureOverlayView 18 | | MutableIO Context -> AttributeSet -> Int -> IO GestureOverlayView 19 | 20 | native cancelClearAnimation :: GestureOverlayView -> ST s () 21 | 22 | native cancelGesture :: GestureOverlayView -> ST s () 23 | 24 | native clear :: GestureOverlayView -> Bool -> ST s () 25 | 26 | native dispatchTouchEvent :: GestureOverlayView -> Mutable s MotionEvent -> ST s Bool 27 | 28 | native draw :: GestureOverlayView -> MutableIO Canvas -> IO () 29 | 30 | pure native getFadeOffset :: GestureOverlayView -> Long 31 | 32 | pure native getGesture :: GestureOverlayView -> Gesture 33 | 34 | pure native getGestureColor :: GestureOverlayView -> Int 35 | 36 | native getGesturePath :: GestureOverlayView -> Mutable s Path -> STMutable s Path 37 | | GestureOverlayView -> STMutable s Path 38 | 39 | pure native getGestureStrokeAngleThreshold :: GestureOverlayView -> Float 40 | 41 | pure native getGestureStrokeLengthThreshold :: GestureOverlayView -> Float 42 | 43 | pure native getGestureStrokeSquarenessTreshold :: GestureOverlayView -> Float 44 | 45 | pure native getGestureStrokeType :: GestureOverlayView -> Int 46 | 47 | pure native getGestureStrokeWidth :: GestureOverlayView -> Float 48 | 49 | pure native getOrientation :: GestureOverlayView -> Int 50 | 51 | pure native getUncertainGestureColor :: GestureOverlayView -> Int 52 | 53 | pure native isEventsInterceptionEnabled :: GestureOverlayView -> Bool 54 | 55 | pure native isFadeEnabled :: GestureOverlayView -> Bool 56 | 57 | pure native isGestureVisible :: GestureOverlayView -> Bool 58 | 59 | pure native isGesturing :: GestureOverlayView -> Bool 60 | 61 | native removeAllOnGestureListeners :: GestureOverlayView -> ST s () 62 | 63 | native removeAllOnGesturePerformedListeners :: GestureOverlayView -> ST s () 64 | 65 | native removeAllOnGesturingListeners :: GestureOverlayView -> ST s () 66 | 67 | native setEventsInterceptionEnabled :: GestureOverlayView -> Bool -> ST s () 68 | 69 | native setFadeEnabled :: GestureOverlayView -> Bool -> ST s () 70 | 71 | native setFadeOffset :: GestureOverlayView -> Long -> ST s () 72 | 73 | native setGesture :: GestureOverlayView -> Gesture -> ST s () 74 | 75 | native setGestureColor :: GestureOverlayView -> Int -> ST s () 76 | 77 | native setGestureStrokeAngleThreshold :: GestureOverlayView -> Float -> ST s () 78 | 79 | native setGestureStrokeLengthThreshold :: GestureOverlayView -> Float -> ST s () 80 | 81 | native setGestureStrokeSquarenessTreshold :: GestureOverlayView -> Float -> ST s () 82 | 83 | native setGestureStrokeType :: GestureOverlayView -> Int -> ST s () 84 | 85 | native setGestureStrokeWidth :: GestureOverlayView -> Float -> ST s () 86 | 87 | native setGestureVisible :: GestureOverlayView -> Bool -> ST s () 88 | 89 | native setOrientation :: GestureOverlayView -> Int -> ST s () 90 | 91 | native setUncertainGestureColor :: GestureOverlayView -> Int -> ST s () 92 | {- -} 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/frege/android/graphics/Matrix.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.Matrix where 2 | 3 | import frege.android.graphics.RectF 4 | 5 | data Matrix = native android.graphics.Matrix where 6 | 7 | pure native mscale_x android.graphics.Matrix.MSCALE_X :: Int 8 | pure native mskew_x android.graphics.Matrix.MSKEW_X :: Int 9 | pure native mtrans_x android.graphics.Matrix.MTRANS_X :: Int 10 | pure native mskew_y android.graphics.Matrix.MSKEW_Y :: Int 11 | pure native mscale_y android.graphics.Matrix.MSCALE_Y :: Int 12 | pure native mtrans_y android.graphics.Matrix.MTRANS_Y :: Int 13 | pure native mpersp_0 android.graphics.Matrix.MPERSP_0 :: Int 14 | pure native mpersp_1 android.graphics.Matrix.MPERSP_1 :: Int 15 | pure native mpersp_2 android.graphics.Matrix.MPERSP_2 :: Int 16 | native new :: () -> STMutable s Matrix 17 | | Mutable s Matrix -> STMutable s Matrix 18 | 19 | native equals :: Mutable s Matrix -> Object -> ST s Bool 20 | 21 | native hashCode :: Mutable s Matrix -> ST s Int 22 | 23 | native invert :: Mutable s Matrix -> Mutable s Matrix -> ST s Bool 24 | 25 | native isIdentity :: Mutable s Matrix -> ST s Bool 26 | 27 | native mapRadius :: Mutable s Matrix -> Float -> ST s Float 28 | 29 | native mapRect :: Mutable s Matrix -> Mutable s RectF -> ST s Bool 30 | | Mutable s Matrix -> Mutable s RectF -> Mutable s RectF -> ST s Bool 31 | 32 | native postConcat :: Mutable s Matrix -> Mutable s Matrix -> ST s Bool 33 | 34 | native postRotate :: Mutable s Matrix -> Float -> Float -> Float -> ST s Bool 35 | | Mutable s Matrix -> Float -> ST s Bool 36 | 37 | native postScale :: Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s Bool 38 | | Mutable s Matrix -> Float -> Float -> ST s Bool 39 | 40 | native postSkew :: Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s Bool 41 | | Mutable s Matrix -> Float -> Float -> ST s Bool 42 | 43 | native postTranslate :: Mutable s Matrix -> Float -> Float -> ST s Bool 44 | 45 | native preConcat :: Mutable s Matrix -> Mutable s Matrix -> ST s Bool 46 | 47 | native preRotate :: Mutable s Matrix -> Float -> ST s Bool 48 | | Mutable s Matrix -> Float -> Float -> Float -> ST s Bool 49 | 50 | native preScale :: Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s Bool 51 | | Mutable s Matrix -> Float -> Float -> ST s Bool 52 | 53 | native preSkew :: Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s Bool 54 | | Mutable s Matrix -> Float -> Float -> ST s Bool 55 | 56 | native preTranslate :: Mutable s Matrix -> Float -> Float -> ST s Bool 57 | 58 | native rectStaysRect :: Mutable s Matrix -> ST s Bool 59 | 60 | native reset :: Mutable s Matrix -> ST s () 61 | 62 | native set :: Mutable s Matrix -> Mutable s Matrix -> ST s () 63 | 64 | native setConcat :: Mutable s Matrix -> Mutable s Matrix -> Mutable s Matrix -> ST s Bool 65 | 66 | native setRotate :: Mutable s Matrix -> Float -> Float -> Float -> ST s () 67 | | Mutable s Matrix -> Float -> ST s () 68 | 69 | native setScale :: Mutable s Matrix -> Float -> Float -> ST s () 70 | | Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s () 71 | 72 | native setSinCos :: Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s () 73 | | Mutable s Matrix -> Float -> Float -> ST s () 74 | 75 | native setSkew :: Mutable s Matrix -> Float -> Float -> Float -> Float -> ST s () 76 | | Mutable s Matrix -> Float -> Float -> ST s () 77 | 78 | native setTranslate :: Mutable s Matrix -> Float -> Float -> ST s () 79 | 80 | native toShortString :: Mutable s Matrix -> ST s String 81 | 82 | native toString :: Mutable s Matrix -> ST s String 83 | {- -} 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/frege/android/graphics/Point.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.Point where 2 | 3 | 4 | data Point = native android.graphics.Point where 5 | 6 | native x ".x" :: Mutable s Point -> ST s Int 7 | native y ".y" :: Mutable s Point -> ST s Int 8 | native new :: () -> STMutable s Point 9 | | Mutable s Point -> STMutable s Point 10 | | Int -> Int -> STMutable s Point 11 | 12 | native describeContents :: Mutable s Point -> ST s Int 13 | 14 | native equals :: Mutable s Point -> Object -> ST s Bool 15 | | Mutable s Point -> Int -> Int -> ST s Bool 16 | 17 | native hashCode :: Mutable s Point -> ST s Int 18 | 19 | native negate :: Mutable s Point -> ST s () 20 | 21 | native offset :: Mutable s Point -> Int -> Int -> ST s () 22 | 23 | native set :: Mutable s Point -> Int -> Int -> ST s () 24 | 25 | native toString :: Mutable s Point -> ST s String 26 | {- -} 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/frege/android/graphics/Rect.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.Rect where 2 | 3 | 4 | data Rect = native android.graphics.Rect where 5 | 6 | native left ".left" :: Mutable s Rect -> ST s Int 7 | native top ".top" :: Mutable s Rect -> ST s Int 8 | native right ".right" :: Mutable s Rect -> ST s Int 9 | native bottom ".bottom" :: Mutable s Rect -> ST s Int 10 | native new :: Int -> Int -> Int -> Int -> STMutable s Rect 11 | | () -> STMutable s Rect 12 | | Mutable s Rect -> STMutable s Rect 13 | 14 | native centerX :: Mutable s Rect -> ST s Int 15 | 16 | native centerY :: Mutable s Rect -> ST s Int 17 | 18 | native contains :: Mutable s Rect -> Mutable s Rect -> ST s Bool 19 | | Mutable s Rect -> Int -> Int -> Int -> Int -> ST s Bool 20 | | Mutable s Rect -> Int -> Int -> ST s Bool 21 | 22 | native describeContents :: Mutable s Rect -> ST s Int 23 | 24 | native equals :: Mutable s Rect -> Object -> ST s Bool 25 | 26 | native exactCenterX :: Mutable s Rect -> ST s Float 27 | 28 | native exactCenterY :: Mutable s Rect -> ST s Float 29 | 30 | native flattenToString :: Mutable s Rect -> ST s String 31 | 32 | native hashCode :: Mutable s Rect -> ST s Int 33 | 34 | native height :: Mutable s Rect -> ST s Int 35 | 36 | native inset :: Mutable s Rect -> Int -> Int -> ST s () 37 | 38 | native intersect :: Mutable s Rect -> Mutable s Rect -> ST s Bool 39 | | Mutable s Rect -> Int -> Int -> Int -> Int -> ST s Bool 40 | 41 | native isEmpty :: Mutable s Rect -> ST s Bool 42 | 43 | native offset :: Mutable s Rect -> Int -> Int -> ST s () 44 | 45 | native offsetTo :: Mutable s Rect -> Int -> Int -> ST s () 46 | 47 | native set :: Mutable s Rect -> Int -> Int -> Int -> Int -> ST s () 48 | | Mutable s Rect -> Mutable s Rect -> ST s () 49 | 50 | native setEmpty :: Mutable s Rect -> ST s () 51 | 52 | native setIntersect :: Mutable s Rect -> Mutable s Rect -> Mutable s Rect -> ST s Bool 53 | 54 | native sort :: Mutable s Rect -> ST s () 55 | 56 | native toShortString :: Mutable s Rect -> ST s String 57 | 58 | native toString :: Mutable s Rect -> ST s String 59 | 60 | native unflattenFromString android.graphics.Rect.unflattenFromString :: String -> STMutable s Rect 61 | 62 | native union :: Mutable s Rect -> Mutable s Rect -> ST s () 63 | | Mutable s Rect -> Int -> Int -> Int -> Int -> ST s () 64 | | Mutable s Rect -> Int -> Int -> ST s () 65 | 66 | native width :: Mutable s Rect -> ST s Int 67 | {- -} 68 | 69 | 70 | -------------------------------------------------------------------------------- /src/frege/android/graphics/RectF.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.RectF where 2 | 3 | import frege.android.graphics.Rect 4 | 5 | data RectF = native android.graphics.RectF where 6 | 7 | native left ".left" :: Mutable s RectF -> ST s Float 8 | native top ".top" :: Mutable s RectF -> ST s Float 9 | native right ".right" :: Mutable s RectF -> ST s Float 10 | native bottom ".bottom" :: Mutable s RectF -> ST s Float 11 | native new :: () -> STMutable s RectF 12 | | Mutable s RectF -> STMutable s RectF 13 | | Float -> Float -> Float -> Float -> STMutable s RectF 14 | | Mutable s Rect -> STMutable s RectF 15 | 16 | native centerX :: Mutable s RectF -> ST s Float 17 | 18 | native centerY :: Mutable s RectF -> ST s Float 19 | 20 | native contains :: Mutable s RectF -> Float -> Float -> ST s Bool 21 | | Mutable s RectF -> Mutable s RectF -> ST s Bool 22 | | Mutable s RectF -> Float -> Float -> Float -> Float -> ST s Bool 23 | 24 | native describeContents :: Mutable s RectF -> ST s Int 25 | 26 | native equals :: Mutable s RectF -> Object -> ST s Bool 27 | 28 | native hashCode :: Mutable s RectF -> ST s Int 29 | 30 | native height :: Mutable s RectF -> ST s Float 31 | 32 | native inset :: Mutable s RectF -> Float -> Float -> ST s () 33 | 34 | native intersect :: Mutable s RectF -> Float -> Float -> Float -> Float -> ST s Bool 35 | | Mutable s RectF -> Mutable s RectF -> ST s Bool 36 | 37 | native isEmpty :: Mutable s RectF -> ST s Bool 38 | 39 | native offset :: Mutable s RectF -> Float -> Float -> ST s () 40 | 41 | native offsetTo :: Mutable s RectF -> Float -> Float -> ST s () 42 | 43 | native round :: Mutable s RectF -> Mutable s Rect -> ST s () 44 | 45 | native roundOut :: Mutable s RectF -> Mutable s Rect -> ST s () 46 | 47 | native set :: Mutable s RectF -> Mutable s RectF -> ST s () 48 | | Mutable s RectF -> Mutable s Rect -> ST s () 49 | | Mutable s RectF -> Float -> Float -> Float -> Float -> ST s () 50 | 51 | native setEmpty :: Mutable s RectF -> ST s () 52 | 53 | native setIntersect :: Mutable s RectF -> Mutable s RectF -> Mutable s RectF -> ST s Bool 54 | 55 | native sort :: Mutable s RectF -> ST s () 56 | 57 | native toShortString :: Mutable s RectF -> ST s String 58 | 59 | native toString :: Mutable s RectF -> ST s String 60 | 61 | native union :: Mutable s RectF -> Mutable s RectF -> ST s () 62 | | Mutable s RectF -> Float -> Float -> ST s () 63 | | Mutable s RectF -> Float -> Float -> Float -> Float -> ST s () 64 | 65 | native width :: Mutable s RectF -> ST s Float 66 | {- -} 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/frege/android/graphics/drawable/Drawable.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.drawable.Drawable where 2 | 3 | import frege.android.graphics.Canvas 4 | import frege.android.graphics.ColorFilter 5 | import frege.android.graphics.PorterDuff 6 | import frege.android.graphics.Rect 7 | import frege.android.graphics.Region 8 | import frege.java.lang.Runnable 9 | 10 | data Drawable_ConstantState = pure native android.graphics.drawable.Drawable.ConstantState where 11 | 12 | 13 | pure native getChangingConfigurations :: Drawable_ConstantState -> Int 14 | 15 | pure native newDrawable :: Drawable_ConstantState -> Drawable 16 | {- -} 17 | 18 | data Drawable = pure native android.graphics.drawable.Drawable where 19 | 20 | 21 | native clearColorFilter :: Drawable -> ST s () 22 | 23 | native copyBounds :: Drawable -> STMutable s Rect 24 | | Drawable -> Mutable s Rect -> ST s () 25 | 26 | pure native createFromPath android.graphics.drawable.Drawable.createFromPath :: String -> Drawable 27 | 28 | native draw :: Drawable -> MutableIO Canvas -> IO () 29 | 30 | pure native getAlpha :: Drawable -> Int 31 | 32 | native getBounds :: Drawable -> STMutable s Rect 33 | 34 | pure native getChangingConfigurations :: Drawable -> Int 35 | 36 | pure native getConstantState :: Drawable -> Drawable_ConstantState 37 | 38 | pure native getCurrent :: Drawable -> Drawable 39 | 40 | pure native getIntrinsicHeight :: Drawable -> Int 41 | 42 | pure native getIntrinsicWidth :: Drawable -> Int 43 | 44 | pure native getLevel :: Drawable -> Int 45 | 46 | pure native getMinimumHeight :: Drawable -> Int 47 | 48 | pure native getMinimumWidth :: Drawable -> Int 49 | 50 | pure native getOpacity :: Drawable -> Int 51 | 52 | native getPadding :: Drawable -> Mutable s Rect -> ST s Bool 53 | 54 | pure native getTransparentRegion :: Drawable -> Region 55 | 56 | native invalidateSelf :: Drawable -> ST s () 57 | 58 | pure native isAutoMirrored :: Drawable -> Bool 59 | 60 | pure native isStateful :: Drawable -> Bool 61 | 62 | pure native isVisible :: Drawable -> Bool 63 | 64 | native jumpToCurrentState :: Drawable -> ST s () 65 | 66 | pure native mutate :: Drawable -> Drawable 67 | 68 | pure native resolveOpacity android.graphics.drawable.Drawable.resolveOpacity :: Int -> Int -> Int 69 | 70 | native scheduleSelf :: Drawable -> Runnable -> Long -> ST s () 71 | 72 | native setAlpha :: Drawable -> Int -> ST s () 73 | 74 | native setAutoMirrored :: Drawable -> Bool -> ST s () 75 | 76 | native setBounds :: Drawable -> Mutable s Rect -> ST s () 77 | | Drawable -> Int -> Int -> Int -> Int -> ST s () 78 | 79 | native setChangingConfigurations :: Drawable -> Int -> ST s () 80 | 81 | native setColorFilter :: Drawable -> ColorFilter -> ST s () 82 | | Drawable -> Int -> PorterDuff_Mode -> ST s () 83 | 84 | native setDither :: Drawable -> Bool -> ST s () 85 | 86 | native setFilterBitmap :: Drawable -> Bool -> ST s () 87 | 88 | pure native setLevel :: Drawable -> Int -> Bool 89 | 90 | pure native setVisible :: Drawable -> Bool -> Bool -> Bool 91 | 92 | native unscheduleSelf :: Drawable -> Runnable -> ST s () 93 | {- -} 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/frege/android/graphics/drawable/ShapeDrawable.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.drawable.ShapeDrawable where 2 | 3 | import frege.android.graphics.Canvas 4 | import frege.android.graphics.ColorFilter 5 | import frege.android.graphics.Paint 6 | import frege.android.graphics.Rect 7 | import frege.android.graphics.Shader 8 | import frege.android.graphics.drawable.Drawable 9 | import frege.android.graphics.drawable.shapes.Shape 10 | 11 | data ShapeDrawable_ShaderFactory = pure native android.graphics.drawable.ShapeDrawable.ShaderFactory where 12 | 13 | 14 | native resize :: ShapeDrawable_ShaderFactory -> Int -> Int -> STMutable s Shader 15 | {- -} 16 | 17 | data ShapeDrawable = pure native android.graphics.drawable.ShapeDrawable where 18 | 19 | native new :: Shape -> ST s ShapeDrawable 20 | | () -> ST s ShapeDrawable 21 | 22 | native draw :: ShapeDrawable -> MutableIO Canvas -> IO () 23 | 24 | pure native getAlpha :: ShapeDrawable -> Int 25 | 26 | pure native getChangingConfigurations :: ShapeDrawable -> Int 27 | 28 | pure native getConstantState :: ShapeDrawable -> Drawable_ConstantState 29 | 30 | pure native getIntrinsicHeight :: ShapeDrawable -> Int 31 | 32 | pure native getIntrinsicWidth :: ShapeDrawable -> Int 33 | 34 | pure native getOpacity :: ShapeDrawable -> Int 35 | 36 | native getPadding :: ShapeDrawable -> Mutable s Rect -> ST s Bool 37 | 38 | pure native getPaint :: ShapeDrawable -> Paint 39 | 40 | pure native getShaderFactory :: ShapeDrawable -> ShapeDrawable_ShaderFactory 41 | 42 | pure native getShape :: ShapeDrawable -> Shape 43 | 44 | pure native mutate :: ShapeDrawable -> Drawable 45 | 46 | native setAlpha :: ShapeDrawable -> Int -> ST s () 47 | 48 | native setColorFilter :: ShapeDrawable -> ColorFilter -> ST s () 49 | 50 | native setDither :: ShapeDrawable -> Bool -> ST s () 51 | 52 | native setIntrinsicHeight :: ShapeDrawable -> Int -> ST s () 53 | 54 | native setIntrinsicWidth :: ShapeDrawable -> Int -> ST s () 55 | 56 | native setPadding :: ShapeDrawable -> Mutable s Rect -> ST s () 57 | | ShapeDrawable -> Int -> Int -> Int -> Int -> ST s () 58 | 59 | native setShaderFactory :: ShapeDrawable -> ShapeDrawable_ShaderFactory -> ST s () 60 | 61 | native setShape :: ShapeDrawable -> Shape -> ST s () 62 | {- -} 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/frege/android/graphics/drawable/shapes/RectShape.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.drawable.shapes.RectShape where 2 | 3 | import frege.android.graphics.Canvas 4 | import frege.android.graphics.Paint 5 | 6 | data RectShape = pure native android.graphics.drawable.shapes.RectShape where 7 | 8 | native new :: () -> ST s RectShape 9 | 10 | native draw :: RectShape -> MutableIO Canvas -> Paint -> IO () 11 | {- derive Cloneable RectShape -} 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/frege/android/graphics/drawable/shapes/Shape.fr: -------------------------------------------------------------------------------- 1 | package frege.android.graphics.drawable.shapes.Shape where 2 | 3 | import frege.android.graphics.Canvas 4 | import frege.android.graphics.Paint 5 | 6 | data Shape = pure native android.graphics.drawable.shapes.Shape where 7 | 8 | 9 | native draw :: Shape -> MutableIO Canvas -> Paint -> IO () 10 | 11 | pure native getHeight :: Shape -> Float 12 | 13 | pure native getWidth :: Shape -> Float 14 | 15 | pure native hasAlpha :: Shape -> Bool 16 | 17 | native resize :: Shape -> Float -> Float -> ST s () 18 | {- derive Cloneable Shape -} 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/frege/android/media/MediaPlayer.fr: -------------------------------------------------------------------------------- 1 | package frege.android.media.MediaPlayer where 2 | 3 | import frege.android.content.Context 4 | import frege.android.media.MediaFormat 5 | import frege.android.media.TimedText 6 | import frege.android.net.Uri 7 | import frege.android.view.Surface 8 | import frege.android.view.SurfaceHolder 9 | import frege.java.io.IOException 10 | 11 | data MediaPlayer_OnBufferingUpdateListener = pure native android.media.MediaPlayer.OnBufferingUpdateListener where 12 | 13 | 14 | native onBufferingUpdate :: MediaPlayer_OnBufferingUpdateListener -> MediaPlayer -> Int -> ST s () 15 | {- -} 16 | 17 | data MediaPlayer_OnCompletionListener = pure native android.media.MediaPlayer.OnCompletionListener where 18 | 19 | 20 | native onCompletion :: MediaPlayer_OnCompletionListener -> MediaPlayer -> ST s () 21 | {- -} 22 | 23 | data MediaPlayer_OnErrorListener = pure native android.media.MediaPlayer.OnErrorListener where 24 | 25 | 26 | pure native onError :: MediaPlayer_OnErrorListener -> MediaPlayer -> Int -> Int -> Bool 27 | {- -} 28 | 29 | data MediaPlayer_OnInfoListener = pure native android.media.MediaPlayer.OnInfoListener where 30 | 31 | 32 | pure native onInfo :: MediaPlayer_OnInfoListener -> MediaPlayer -> Int -> Int -> Bool 33 | {- -} 34 | 35 | data MediaPlayer_OnPreparedListener = pure native android.media.MediaPlayer.OnPreparedListener where 36 | 37 | 38 | native onPrepared :: MediaPlayer_OnPreparedListener -> MediaPlayer -> ST s () 39 | {- -} 40 | 41 | data MediaPlayer_OnSeekCompleteListener = pure native android.media.MediaPlayer.OnSeekCompleteListener where 42 | 43 | 44 | native onSeekComplete :: MediaPlayer_OnSeekCompleteListener -> MediaPlayer -> ST s () 45 | {- -} 46 | 47 | data MediaPlayer_OnTimedTextListener = pure native android.media.MediaPlayer.OnTimedTextListener where 48 | 49 | 50 | native onTimedText :: MediaPlayer_OnTimedTextListener -> MediaPlayer -> TimedText -> ST s () 51 | {- -} 52 | 53 | data MediaPlayer_OnVideoSizeChangedListener = pure native android.media.MediaPlayer.OnVideoSizeChangedListener where 54 | 55 | 56 | native onVideoSizeChanged :: MediaPlayer_OnVideoSizeChangedListener -> MediaPlayer -> Int -> Int -> ST s () 57 | {- -} 58 | 59 | data MediaPlayer_TrackInfo = pure native android.media.MediaPlayer.TrackInfo where 60 | 61 | pure native media_track_type_unknown android.media.MediaPlayer.TrackInfo.MEDIA_TRACK_TYPE_UNKNOWN :: Int 62 | pure native media_track_type_video android.media.MediaPlayer.TrackInfo.MEDIA_TRACK_TYPE_VIDEO :: Int 63 | pure native media_track_type_audio android.media.MediaPlayer.TrackInfo.MEDIA_TRACK_TYPE_AUDIO :: Int 64 | pure native media_track_type_timedtext android.media.MediaPlayer.TrackInfo.MEDIA_TRACK_TYPE_TIMEDTEXT :: Int 65 | 66 | pure native describeContents :: MediaPlayer_TrackInfo -> Int 67 | 68 | pure native getFormat :: MediaPlayer_TrackInfo -> MediaFormat 69 | 70 | pure native getLanguage :: MediaPlayer_TrackInfo -> String 71 | 72 | pure native getTrackType :: MediaPlayer_TrackInfo -> Int 73 | {- -} 74 | 75 | data MediaPlayer = pure native android.media.MediaPlayer where 76 | 77 | pure native video_scaling_mode_scale_to_fit android.media.MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT :: Int 78 | pure native video_scaling_mode_scale_to_fit_with_cropping android.media.MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING :: Int 79 | pure native media_mimetype_text_subrip android.media.MediaPlayer.MEDIA_MIMETYPE_TEXT_SUBRIP :: String 80 | pure native media_error_unknown android.media.MediaPlayer.MEDIA_ERROR_UNKNOWN :: Int 81 | pure native media_error_server_died android.media.MediaPlayer.MEDIA_ERROR_SERVER_DIED :: Int 82 | pure native media_error_not_valid_for_progressive_playback android.media.MediaPlayer.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK :: Int 83 | pure native media_error_io android.media.MediaPlayer.MEDIA_ERROR_IO :: Int 84 | pure native media_error_malformed android.media.MediaPlayer.MEDIA_ERROR_MALFORMED :: Int 85 | pure native media_error_unsupported android.media.MediaPlayer.MEDIA_ERROR_UNSUPPORTED :: Int 86 | pure native media_error_timed_out android.media.MediaPlayer.MEDIA_ERROR_TIMED_OUT :: Int 87 | pure native media_info_unknown android.media.MediaPlayer.MEDIA_INFO_UNKNOWN :: Int 88 | pure native media_info_video_rendering_start android.media.MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START :: Int 89 | pure native media_info_video_track_lagging android.media.MediaPlayer.MEDIA_INFO_VIDEO_TRACK_LAGGING :: Int 90 | pure native media_info_buffering_start android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START :: Int 91 | pure native media_info_buffering_end android.media.MediaPlayer.MEDIA_INFO_BUFFERING_END :: Int 92 | pure native media_info_bad_interleaving android.media.MediaPlayer.MEDIA_INFO_BAD_INTERLEAVING :: Int 93 | pure native media_info_not_seekable android.media.MediaPlayer.MEDIA_INFO_NOT_SEEKABLE :: Int 94 | pure native media_info_metadata_update android.media.MediaPlayer.MEDIA_INFO_METADATA_UPDATE :: Int 95 | pure native media_info_unsupported_subtitle android.media.MediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE :: Int 96 | pure native media_info_subtitle_timed_out android.media.MediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT :: Int 97 | native new :: () -> ST s MediaPlayer 98 | 99 | native addTimedTextSource :: MediaPlayer -> MutableIO Context -> Uri -> String -> IO () throws IOException 100 | | MediaPlayer -> String -> String -> ST s () throws IOException 101 | 102 | native attachAuxEffect :: MediaPlayer -> Int -> ST s () 103 | 104 | native create android.media.MediaPlayer.create :: MutableIO Context -> Int -> IO MediaPlayer 105 | | MutableIO Context -> Uri -> IO MediaPlayer 106 | | MutableIO Context -> Uri -> MutableIO SurfaceHolder -> IO MediaPlayer 107 | 108 | native deselectTrack :: MediaPlayer -> Int -> ST s () 109 | 110 | pure native getAudioSessionId :: MediaPlayer -> Int 111 | 112 | pure native getCurrentPosition :: MediaPlayer -> Int 113 | 114 | pure native getDuration :: MediaPlayer -> Int 115 | 116 | pure native getVideoHeight :: MediaPlayer -> Int 117 | 118 | pure native getVideoWidth :: MediaPlayer -> Int 119 | 120 | pure native isLooping :: MediaPlayer -> Bool 121 | 122 | pure native isPlaying :: MediaPlayer -> Bool 123 | 124 | native pause :: MediaPlayer -> ST s () 125 | 126 | native prepare :: MediaPlayer -> ST s () throws IOException 127 | 128 | native prepareAsync :: MediaPlayer -> ST s () 129 | 130 | native release :: MediaPlayer -> ST s () 131 | 132 | native reset :: MediaPlayer -> ST s () 133 | 134 | native seekTo :: MediaPlayer -> Int -> ST s () 135 | 136 | native selectTrack :: MediaPlayer -> Int -> ST s () 137 | 138 | native setAudioSessionId :: MediaPlayer -> Int -> ST s () 139 | 140 | native setAudioStreamType :: MediaPlayer -> Int -> ST s () 141 | 142 | native setAuxEffectSendLevel :: MediaPlayer -> Float -> ST s () 143 | 144 | native setDataSource :: MediaPlayer -> String -> ST s () throws IOException 145 | | MediaPlayer -> MutableIO Context -> Uri -> IO () throws IOException 146 | 147 | native setDisplay :: MediaPlayer -> MutableIO SurfaceHolder -> IO () 148 | 149 | native setLooping :: MediaPlayer -> Bool -> ST s () 150 | 151 | native setNextMediaPlayer :: MediaPlayer -> MediaPlayer -> ST s () 152 | 153 | native setOnBufferingUpdateListener :: MediaPlayer -> MediaPlayer_OnBufferingUpdateListener -> ST s () 154 | 155 | native setOnCompletionListener :: MediaPlayer -> MediaPlayer_OnCompletionListener -> ST s () 156 | 157 | native setOnErrorListener :: MediaPlayer -> MediaPlayer_OnErrorListener -> ST s () 158 | 159 | native setOnInfoListener :: MediaPlayer -> MediaPlayer_OnInfoListener -> ST s () 160 | 161 | native setOnPreparedListener :: MediaPlayer -> MediaPlayer_OnPreparedListener -> ST s () 162 | 163 | native setOnSeekCompleteListener :: MediaPlayer -> MediaPlayer_OnSeekCompleteListener -> ST s () 164 | 165 | native setOnTimedTextListener :: MediaPlayer -> MediaPlayer_OnTimedTextListener -> ST s () 166 | 167 | native setOnVideoSizeChangedListener :: MediaPlayer -> MediaPlayer_OnVideoSizeChangedListener -> ST s () 168 | 169 | native setScreenOnWhilePlaying :: MediaPlayer -> Bool -> ST s () 170 | 171 | native setSurface :: MediaPlayer -> MutableIO Surface -> IO () 172 | 173 | native setVideoScalingMode :: MediaPlayer -> Int -> ST s () 174 | 175 | native setVolume :: MediaPlayer -> Float -> Float -> ST s () 176 | 177 | native setWakeMode :: MediaPlayer -> MutableIO Context -> Int -> IO () 178 | 179 | native start :: MediaPlayer -> ST s () 180 | 181 | native stop :: MediaPlayer -> ST s () 182 | {- -} 183 | 184 | 185 | -------------------------------------------------------------------------------- /src/frege/android/os/Handler.fr: -------------------------------------------------------------------------------- 1 | package frege.android.os.Handler where 2 | 3 | import frege.android.os.Looper 4 | import frege.android.os.Message 5 | import frege.java.lang.Runnable 6 | 7 | data Handler_Callback = pure native android.os.Handler.Callback where 8 | 9 | 10 | pure native handleMessage :: Handler_Callback -> Message -> Bool 11 | {- -} 12 | 13 | data Handler = pure native android.os.Handler where 14 | 15 | native new :: Handler_Callback -> ST s Handler 16 | | Looper -> ST s Handler 17 | | Looper -> Handler_Callback -> ST s Handler 18 | | () -> ST s Handler 19 | 20 | native dispatchMessage :: Handler -> Message -> ST s () 21 | 22 | pure native getLooper :: Handler -> Looper 23 | 24 | pure native getMessageName :: Handler -> Message -> String 25 | 26 | native handleMessage :: Handler -> Message -> ST s () 27 | 28 | pure native hasMessages :: Handler -> Int -> Bool 29 | | Handler -> Int -> Object -> Bool 30 | 31 | pure native obtainMessage :: Handler -> Int -> Int -> Int -> Message 32 | | Handler -> Int -> Int -> Int -> Object -> Message 33 | | Handler -> Message 34 | | Handler -> Int -> Message 35 | | Handler -> Int -> Object -> Message 36 | 37 | pure native post :: Handler -> Runnable -> Bool 38 | 39 | pure native postAtFrontOfQueue :: Handler -> Runnable -> Bool 40 | 41 | pure native postAtTime :: Handler -> Runnable -> Object -> Long -> Bool 42 | | Handler -> Runnable -> Long -> Bool 43 | 44 | pure native postDelayed :: Handler -> Runnable -> Long -> Bool 45 | 46 | native removeCallbacks :: Handler -> Runnable -> Object -> ST s () 47 | | Handler -> Runnable -> ST s () 48 | 49 | native removeCallbacksAndMessages :: Handler -> Object -> ST s () 50 | 51 | native removeMessages :: Handler -> Int -> Object -> ST s () 52 | | Handler -> Int -> ST s () 53 | 54 | pure native sendEmptyMessage :: Handler -> Int -> Bool 55 | 56 | pure native sendEmptyMessageAtTime :: Handler -> Int -> Long -> Bool 57 | 58 | pure native sendEmptyMessageDelayed :: Handler -> Int -> Long -> Bool 59 | 60 | pure native sendMessage :: Handler -> Message -> Bool 61 | 62 | pure native sendMessageAtFrontOfQueue :: Handler -> Message -> Bool 63 | 64 | pure native sendMessageAtTime :: Handler -> Message -> Long -> Bool 65 | 66 | pure native sendMessageDelayed :: Handler -> Message -> Long -> Bool 67 | 68 | pure native toString :: Handler -> String 69 | {- -} 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/frege/android/os/Looper.fr: -------------------------------------------------------------------------------- 1 | package frege.android.os.Looper where 2 | 3 | import frege.java.lang.Thread 4 | 5 | data Looper = pure native android.os.Looper where 6 | 7 | 8 | native getMainLooper android.os.Looper.getMainLooper :: () -> ST s Looper 9 | 10 | pure native getThread :: Looper -> Thread 11 | 12 | native loop android.os.Looper.loop :: () -> ST s () 13 | 14 | native myLooper android.os.Looper.myLooper :: () -> ST s Looper 15 | 16 | native prepare android.os.Looper.prepare :: () -> ST s () 17 | 18 | native prepareMainLooper android.os.Looper.prepareMainLooper :: () -> ST s () 19 | 20 | native quit :: Looper -> ST s () 21 | 22 | native quitSafely :: Looper -> ST s () 23 | 24 | pure native toString :: Looper -> String 25 | {- -} 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/frege/android/provider/Settings.fr: -------------------------------------------------------------------------------- 1 | package frege.android.provider.Settings where 2 | 3 | 4 | data Settings = pure native android.provider.Settings where 5 | 6 | pure native action_settings android.provider.Settings.ACTION_SETTINGS :: String 7 | pure native action_apn_settings android.provider.Settings.ACTION_APN_SETTINGS :: String 8 | pure native action_location_source_settings android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS :: String 9 | pure native action_wireless_settings android.provider.Settings.ACTION_WIRELESS_SETTINGS :: String 10 | pure native action_airplane_mode_settings android.provider.Settings.ACTION_AIRPLANE_MODE_SETTINGS :: String 11 | pure native action_accessibility_settings android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS :: String 12 | pure native action_security_settings android.provider.Settings.ACTION_SECURITY_SETTINGS :: String 13 | pure native action_privacy_settings android.provider.Settings.ACTION_PRIVACY_SETTINGS :: String 14 | pure native action_wifi_settings android.provider.Settings.ACTION_WIFI_SETTINGS :: String 15 | pure native action_wifi_ip_settings android.provider.Settings.ACTION_WIFI_IP_SETTINGS :: String 16 | pure native action_bluetooth_settings android.provider.Settings.ACTION_BLUETOOTH_SETTINGS :: String 17 | pure native action_date_settings android.provider.Settings.ACTION_DATE_SETTINGS :: String 18 | pure native action_sound_settings android.provider.Settings.ACTION_SOUND_SETTINGS :: String 19 | pure native action_display_settings android.provider.Settings.ACTION_DISPLAY_SETTINGS :: String 20 | pure native action_locale_settings android.provider.Settings.ACTION_LOCALE_SETTINGS :: String 21 | pure native action_input_method_settings android.provider.Settings.ACTION_INPUT_METHOD_SETTINGS :: String 22 | pure native action_input_method_subtype_settings android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS :: String 23 | pure native action_user_dictionary_settings android.provider.Settings.ACTION_USER_DICTIONARY_SETTINGS :: String 24 | pure native action_application_settings android.provider.Settings.ACTION_APPLICATION_SETTINGS :: String 25 | pure native action_application_development_settings android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS :: String 26 | pure native action_quick_launch_settings android.provider.Settings.ACTION_QUICK_LAUNCH_SETTINGS :: String 27 | pure native action_manage_applications_settings android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS :: String 28 | pure native action_manage_all_applications_settings android.provider.Settings.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS :: String 29 | pure native action_application_details_settings android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS :: String 30 | pure native action_sync_settings android.provider.Settings.ACTION_SYNC_SETTINGS :: String 31 | pure native action_add_account android.provider.Settings.ACTION_ADD_ACCOUNT :: String 32 | pure native action_network_operator_settings android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS :: String 33 | pure native action_data_roaming_settings android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS :: String 34 | pure native action_internal_storage_settings android.provider.Settings.ACTION_INTERNAL_STORAGE_SETTINGS :: String 35 | pure native action_memory_card_settings android.provider.Settings.ACTION_MEMORY_CARD_SETTINGS :: String 36 | pure native action_search_settings android.provider.Settings.ACTION_SEARCH_SETTINGS :: String 37 | pure native action_device_info_settings android.provider.Settings.ACTION_DEVICE_INFO_SETTINGS :: String 38 | pure native action_nfc_settings android.provider.Settings.ACTION_NFC_SETTINGS :: String 39 | pure native action_nfcsharing_settings android.provider.Settings.ACTION_NFCSHARING_SETTINGS :: String 40 | pure native action_nfc_payment_settings android.provider.Settings.ACTION_NFC_PAYMENT_SETTINGS :: String 41 | pure native action_dream_settings android.provider.Settings.ACTION_DREAM_SETTINGS :: String 42 | pure native action_captioning_settings android.provider.Settings.ACTION_CAPTIONING_SETTINGS :: String 43 | pure native action_print_settings android.provider.Settings.ACTION_PRINT_SETTINGS :: String 44 | pure native extra_authorities android.provider.Settings.EXTRA_AUTHORITIES :: String 45 | pure native extra_account_types android.provider.Settings.EXTRA_ACCOUNT_TYPES :: String 46 | pure native extra_input_method_id android.provider.Settings.EXTRA_INPUT_METHOD_ID :: String 47 | pure native authority android.provider.Settings.AUTHORITY :: String 48 | native new :: () -> ST s Settings 49 | {- -} 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/frege/android/util/AttributeSet.fr: -------------------------------------------------------------------------------- 1 | package frege.android.util.AttributeSet where 2 | 3 | 4 | data AttributeSet = pure native android.util.AttributeSet where 5 | 6 | 7 | pure native getAttributeBooleanValue :: AttributeSet -> Int -> Bool -> Bool 8 | | AttributeSet -> String -> String -> Bool -> Bool 9 | 10 | pure native getAttributeCount :: AttributeSet -> Int 11 | 12 | pure native getAttributeFloatValue :: AttributeSet -> String -> String -> Float -> Float 13 | | AttributeSet -> Int -> Float -> Float 14 | 15 | pure native getAttributeIntValue :: AttributeSet -> String -> String -> Int -> Int 16 | | AttributeSet -> Int -> Int -> Int 17 | 18 | pure native getAttributeName :: AttributeSet -> Int -> String 19 | 20 | pure native getAttributeNameResource :: AttributeSet -> Int -> Int 21 | 22 | pure native getAttributeResourceValue :: AttributeSet -> String -> String -> Int -> Int 23 | | AttributeSet -> Int -> Int -> Int 24 | 25 | pure native getAttributeUnsignedIntValue :: AttributeSet -> String -> String -> Int -> Int 26 | | AttributeSet -> Int -> Int -> Int 27 | 28 | pure native getAttributeValue :: AttributeSet -> Int -> String 29 | | AttributeSet -> String -> String -> String 30 | 31 | pure native getClassAttribute :: AttributeSet -> String 32 | 33 | pure native getIdAttribute :: AttributeSet -> String 34 | 35 | pure native getIdAttributeResourceValue :: AttributeSet -> Int -> Int 36 | 37 | pure native getPositionDescription :: AttributeSet -> String 38 | 39 | pure native getStyleAttribute :: AttributeSet -> Int 40 | {- -} 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/frege/android/view/Display.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.Display where 2 | 3 | import frege.android.graphics.Point 4 | import frege.android.graphics.Rect 5 | import frege.android.util.DisplayMetrics 6 | 7 | data Display = native android.view.Display where 8 | 9 | pure native default_display android.view.Display.DEFAULT_DISPLAY :: Int 10 | pure native flag_supports_protected_buffers android.view.Display.FLAG_SUPPORTS_PROTECTED_BUFFERS :: Int 11 | pure native flag_secure android.view.Display.FLAG_SECURE :: Int 12 | pure native flag_private android.view.Display.FLAG_PRIVATE :: Int 13 | pure native flag_presentation android.view.Display.FLAG_PRESENTATION :: Int 14 | pure native state_unknown android.view.Display.STATE_UNKNOWN :: Int 15 | pure native state_off android.view.Display.STATE_OFF :: Int 16 | pure native state_on android.view.Display.STATE_ON :: Int 17 | pure native state_dozing android.view.Display.STATE_DOZING :: Int 18 | 19 | native getCurrentSizeRange :: MutableIO Display -> MutableIO Point -> MutableIO Point -> IO () 20 | 21 | native getDisplayId :: MutableIO Display -> IO Int 22 | 23 | native getFlags :: MutableIO Display -> IO Int 24 | 25 | native getHeight :: MutableIO Display -> IO Int 26 | 27 | native getMetrics :: MutableIO Display -> DisplayMetrics -> IO () 28 | 29 | native getName :: MutableIO Display -> IO String 30 | 31 | native getOrientation :: MutableIO Display -> IO Int 32 | 33 | native getPixelFormat :: MutableIO Display -> IO Int 34 | 35 | native getRealMetrics :: MutableIO Display -> DisplayMetrics -> IO () 36 | 37 | native getRealSize :: MutableIO Display -> MutableIO Point -> IO () 38 | 39 | native getRectSize :: MutableIO Display -> MutableIO Rect -> IO () 40 | 41 | native getRefreshRate :: MutableIO Display -> IO Float 42 | 43 | native getRotation :: MutableIO Display -> IO Int 44 | 45 | native getSize :: MutableIO Display -> MutableIO Point -> IO () 46 | 47 | native getState :: MutableIO Display -> IO Int 48 | 49 | native getWidth :: MutableIO Display -> IO Int 50 | 51 | native isValid :: MutableIO Display -> IO Bool 52 | 53 | native toString :: MutableIO Display -> IO String 54 | {- -} 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/frege/android/view/GestureDetector.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.GestureDetector where 2 | 3 | import frege.android.content.Context 4 | import frege.android.os.Handler 5 | import frege.android.view.MotionEvent 6 | 7 | data GestureDetector_OnDoubleTapListener = pure native android.view.GestureDetector.OnDoubleTapListener where 8 | 9 | 10 | native onDoubleTap :: GestureDetector_OnDoubleTapListener -> Mutable s MotionEvent -> ST s Bool 11 | 12 | native onDoubleTapEvent :: GestureDetector_OnDoubleTapListener -> Mutable s MotionEvent -> ST s Bool 13 | 14 | native onSingleTapConfirmed :: GestureDetector_OnDoubleTapListener -> Mutable s MotionEvent -> ST s Bool 15 | {- -} 16 | 17 | data GestureDetector_OnGestureListener = pure native android.view.GestureDetector.OnGestureListener where 18 | 19 | 20 | native onDown :: GestureDetector_OnGestureListener -> Mutable s MotionEvent -> ST s Bool 21 | 22 | native onFling :: GestureDetector_OnGestureListener -> Mutable s MotionEvent -> Mutable s MotionEvent -> Float -> Float -> ST s Bool 23 | 24 | native onLongPress :: GestureDetector_OnGestureListener -> Mutable s MotionEvent -> ST s () 25 | 26 | native onScroll :: GestureDetector_OnGestureListener -> Mutable s MotionEvent -> Mutable s MotionEvent -> Float -> Float -> ST s Bool 27 | 28 | native onShowPress :: GestureDetector_OnGestureListener -> Mutable s MotionEvent -> ST s () 29 | 30 | native onSingleTapUp :: GestureDetector_OnGestureListener -> Mutable s MotionEvent -> ST s Bool 31 | {- -} 32 | 33 | data GestureDetector_SimpleOnGestureListener = pure native android.view.GestureDetector.SimpleOnGestureListener where 34 | 35 | native new :: () -> ST s GestureDetector_SimpleOnGestureListener 36 | 37 | native onDoubleTap :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s Bool 38 | 39 | native onDoubleTapEvent :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s Bool 40 | 41 | native onDown :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s Bool 42 | 43 | native onFling :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> Mutable s MotionEvent -> Float -> Float -> ST s Bool 44 | 45 | native onLongPress :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s () 46 | 47 | native onScroll :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> Mutable s MotionEvent -> Float -> Float -> ST s Bool 48 | 49 | native onShowPress :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s () 50 | 51 | native onSingleTapConfirmed :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s Bool 52 | 53 | native onSingleTapUp :: GestureDetector_SimpleOnGestureListener -> Mutable s MotionEvent -> ST s Bool 54 | {- -} 55 | 56 | data GestureDetector = native android.view.GestureDetector where 57 | 58 | native new :: GestureDetector_OnGestureListener -> Handler -> IOMutable GestureDetector 59 | | GestureDetector_OnGestureListener -> IOMutable GestureDetector 60 | | MutableIO Context -> GestureDetector_OnGestureListener -> IOMutable GestureDetector 61 | | MutableIO Context -> GestureDetector_OnGestureListener -> Handler -> IOMutable GestureDetector 62 | | MutableIO Context -> GestureDetector_OnGestureListener -> Handler -> Bool -> IOMutable GestureDetector 63 | 64 | native isLongpressEnabled :: MutableIO GestureDetector -> IO Bool 65 | 66 | native onTouchEvent :: MutableIO GestureDetector -> MutableIO MotionEvent -> IO Bool 67 | 68 | native setIsLongpressEnabled :: MutableIO GestureDetector -> Bool -> IO () 69 | 70 | native setOnDoubleTapListener :: MutableIO GestureDetector -> GestureDetector_OnDoubleTapListener -> IO () 71 | {- -} 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/frege/android/view/Gravity.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.Gravity where 2 | 3 | import frege.android.graphics.Rect 4 | 5 | data Gravity = pure native android.view.Gravity where 6 | 7 | pure native no_gravity android.view.Gravity.NO_GRAVITY :: Int 8 | pure native axis_specified android.view.Gravity.AXIS_SPECIFIED :: Int 9 | pure native axis_pull_before android.view.Gravity.AXIS_PULL_BEFORE :: Int 10 | pure native axis_pull_after android.view.Gravity.AXIS_PULL_AFTER :: Int 11 | pure native axis_clip android.view.Gravity.AXIS_CLIP :: Int 12 | pure native axis_x_shift android.view.Gravity.AXIS_X_SHIFT :: Int 13 | pure native axis_y_shift android.view.Gravity.AXIS_Y_SHIFT :: Int 14 | pure native top android.view.Gravity.TOP :: Int 15 | pure native bottom android.view.Gravity.BOTTOM :: Int 16 | pure native left android.view.Gravity.LEFT :: Int 17 | pure native right android.view.Gravity.RIGHT :: Int 18 | pure native center_vertical android.view.Gravity.CENTER_VERTICAL :: Int 19 | pure native fill_vertical android.view.Gravity.FILL_VERTICAL :: Int 20 | pure native center_horizontal android.view.Gravity.CENTER_HORIZONTAL :: Int 21 | pure native fill_horizontal android.view.Gravity.FILL_HORIZONTAL :: Int 22 | pure native center android.view.Gravity.CENTER :: Int 23 | pure native fill android.view.Gravity.FILL :: Int 24 | pure native clip_vertical android.view.Gravity.CLIP_VERTICAL :: Int 25 | pure native clip_horizontal android.view.Gravity.CLIP_HORIZONTAL :: Int 26 | pure native relative_layout_direction android.view.Gravity.RELATIVE_LAYOUT_DIRECTION :: Int 27 | pure native horizontal_gravity_mask android.view.Gravity.HORIZONTAL_GRAVITY_MASK :: Int 28 | pure native vertical_gravity_mask android.view.Gravity.VERTICAL_GRAVITY_MASK :: Int 29 | pure native display_clip_vertical android.view.Gravity.DISPLAY_CLIP_VERTICAL :: Int 30 | pure native display_clip_horizontal android.view.Gravity.DISPLAY_CLIP_HORIZONTAL :: Int 31 | pure native start android.view.Gravity.START :: Int 32 | pure native end android.view.Gravity.END :: Int 33 | pure native relative_horizontal_gravity_mask android.view.Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK :: Int 34 | native new :: () -> ST s Gravity 35 | 36 | native apply android.view.Gravity.apply :: Int -> Int -> Int -> Mutable s Rect -> Int -> Int -> Mutable s Rect -> Int -> ST s () 37 | | Int -> Int -> Int -> Mutable s Rect -> Mutable s Rect -> ST s () 38 | | Int -> Int -> Int -> Mutable s Rect -> Mutable s Rect -> Int -> ST s () 39 | | Int -> Int -> Int -> Mutable s Rect -> Int -> Int -> Mutable s Rect -> ST s () 40 | 41 | native applyDisplay android.view.Gravity.applyDisplay :: Int -> Mutable s Rect -> Mutable s Rect -> ST s () 42 | | Int -> Mutable s Rect -> Mutable s Rect -> Int -> ST s () 43 | 44 | pure native getAbsoluteGravity android.view.Gravity.getAbsoluteGravity :: Int -> Int -> Int 45 | 46 | pure native isHorizontal android.view.Gravity.isHorizontal :: Int -> Bool 47 | 48 | pure native isVertical android.view.Gravity.isVertical :: Int -> Bool 49 | {- -} 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/frege/android/view/InputEvent.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.InputEvent where 2 | 3 | import frege.android.view.InputDevice 4 | 5 | data InputEvent = pure native android.view.InputEvent where 6 | 7 | 8 | pure native describeContents :: InputEvent -> Int 9 | 10 | pure native getDevice :: InputEvent -> InputDevice 11 | 12 | pure native getDeviceId :: InputEvent -> Int 13 | 14 | pure native getEventTime :: InputEvent -> Long 15 | 16 | pure native getSource :: InputEvent -> Int 17 | 18 | pure native isFromSource :: InputEvent -> Int -> Bool 19 | {- -} 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/frege/android/view/MotionEvent.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.MotionEvent where 2 | 3 | import frege.android.graphics.Matrix 4 | 5 | data MotionEvent_PointerCoords = pure native android.view.MotionEvent.PointerCoords where 6 | 7 | pure native x ".x" :: MotionEvent_PointerCoords -> Float 8 | pure native y ".y" :: MotionEvent_PointerCoords -> Float 9 | pure native pressure ".pressure" :: MotionEvent_PointerCoords -> Float 10 | pure native size ".size" :: MotionEvent_PointerCoords -> Float 11 | pure native touchmajor ".touchMajor" :: MotionEvent_PointerCoords -> Float 12 | pure native touchminor ".touchMinor" :: MotionEvent_PointerCoords -> Float 13 | pure native toolmajor ".toolMajor" :: MotionEvent_PointerCoords -> Float 14 | pure native toolminor ".toolMinor" :: MotionEvent_PointerCoords -> Float 15 | pure native orientation ".orientation" :: MotionEvent_PointerCoords -> Float 16 | native new :: MotionEvent_PointerCoords -> ST s MotionEvent_PointerCoords 17 | | () -> ST s MotionEvent_PointerCoords 18 | 19 | native clear :: MotionEvent_PointerCoords -> ST s () 20 | 21 | native copyFrom :: MotionEvent_PointerCoords -> MotionEvent_PointerCoords -> ST s () 22 | 23 | pure native getAxisValue :: MotionEvent_PointerCoords -> Int -> Float 24 | 25 | native setAxisValue :: MotionEvent_PointerCoords -> Int -> Float -> ST s () 26 | {- -} 27 | 28 | data MotionEvent_PointerProperties = pure native android.view.MotionEvent.PointerProperties where 29 | 30 | pure native id ".id" :: MotionEvent_PointerProperties -> Int 31 | pure native tooltype ".toolType" :: MotionEvent_PointerProperties -> Int 32 | native new :: () -> ST s MotionEvent_PointerProperties 33 | | MotionEvent_PointerProperties -> ST s MotionEvent_PointerProperties 34 | 35 | native clear :: MotionEvent_PointerProperties -> ST s () 36 | 37 | native copyFrom :: MotionEvent_PointerProperties -> MotionEvent_PointerProperties -> ST s () 38 | 39 | pure native equals :: MotionEvent_PointerProperties -> Object -> Bool 40 | 41 | pure native hashCode :: MotionEvent_PointerProperties -> Int 42 | {- -} 43 | 44 | data MotionEvent = native android.view.MotionEvent where 45 | 46 | pure native invalid_pointer_id android.view.MotionEvent.INVALID_POINTER_ID :: Int 47 | pure native action_mask android.view.MotionEvent.ACTION_MASK :: Int 48 | pure native action_down android.view.MotionEvent.ACTION_DOWN :: Int 49 | pure native action_up android.view.MotionEvent.ACTION_UP :: Int 50 | pure native action_move android.view.MotionEvent.ACTION_MOVE :: Int 51 | pure native action_cancel android.view.MotionEvent.ACTION_CANCEL :: Int 52 | pure native action_outside android.view.MotionEvent.ACTION_OUTSIDE :: Int 53 | pure native action_pointer_down android.view.MotionEvent.ACTION_POINTER_DOWN :: Int 54 | pure native action_pointer_up android.view.MotionEvent.ACTION_POINTER_UP :: Int 55 | pure native action_hover_move android.view.MotionEvent.ACTION_HOVER_MOVE :: Int 56 | pure native action_scroll android.view.MotionEvent.ACTION_SCROLL :: Int 57 | pure native action_hover_enter android.view.MotionEvent.ACTION_HOVER_ENTER :: Int 58 | pure native action_hover_exit android.view.MotionEvent.ACTION_HOVER_EXIT :: Int 59 | pure native action_pointer_index_mask android.view.MotionEvent.ACTION_POINTER_INDEX_MASK :: Int 60 | pure native action_pointer_index_shift android.view.MotionEvent.ACTION_POINTER_INDEX_SHIFT :: Int 61 | pure native action_pointer_1_down android.view.MotionEvent.ACTION_POINTER_1_DOWN :: Int 62 | pure native action_pointer_2_down android.view.MotionEvent.ACTION_POINTER_2_DOWN :: Int 63 | pure native action_pointer_3_down android.view.MotionEvent.ACTION_POINTER_3_DOWN :: Int 64 | pure native action_pointer_1_up android.view.MotionEvent.ACTION_POINTER_1_UP :: Int 65 | pure native action_pointer_2_up android.view.MotionEvent.ACTION_POINTER_2_UP :: Int 66 | pure native action_pointer_3_up android.view.MotionEvent.ACTION_POINTER_3_UP :: Int 67 | pure native action_pointer_id_mask android.view.MotionEvent.ACTION_POINTER_ID_MASK :: Int 68 | pure native action_pointer_id_shift android.view.MotionEvent.ACTION_POINTER_ID_SHIFT :: Int 69 | pure native flag_window_is_obscured android.view.MotionEvent.FLAG_WINDOW_IS_OBSCURED :: Int 70 | pure native edge_top android.view.MotionEvent.EDGE_TOP :: Int 71 | pure native edge_bottom android.view.MotionEvent.EDGE_BOTTOM :: Int 72 | pure native edge_left android.view.MotionEvent.EDGE_LEFT :: Int 73 | pure native edge_right android.view.MotionEvent.EDGE_RIGHT :: Int 74 | pure native axis_x android.view.MotionEvent.AXIS_X :: Int 75 | pure native axis_y android.view.MotionEvent.AXIS_Y :: Int 76 | pure native axis_pressure android.view.MotionEvent.AXIS_PRESSURE :: Int 77 | pure native axis_size android.view.MotionEvent.AXIS_SIZE :: Int 78 | pure native axis_touch_major android.view.MotionEvent.AXIS_TOUCH_MAJOR :: Int 79 | pure native axis_touch_minor android.view.MotionEvent.AXIS_TOUCH_MINOR :: Int 80 | pure native axis_tool_major android.view.MotionEvent.AXIS_TOOL_MAJOR :: Int 81 | pure native axis_tool_minor android.view.MotionEvent.AXIS_TOOL_MINOR :: Int 82 | pure native axis_orientation android.view.MotionEvent.AXIS_ORIENTATION :: Int 83 | pure native axis_vscroll android.view.MotionEvent.AXIS_VSCROLL :: Int 84 | pure native axis_hscroll android.view.MotionEvent.AXIS_HSCROLL :: Int 85 | pure native axis_z android.view.MotionEvent.AXIS_Z :: Int 86 | pure native axis_rx android.view.MotionEvent.AXIS_RX :: Int 87 | pure native axis_ry android.view.MotionEvent.AXIS_RY :: Int 88 | pure native axis_rz android.view.MotionEvent.AXIS_RZ :: Int 89 | pure native axis_hat_x android.view.MotionEvent.AXIS_HAT_X :: Int 90 | pure native axis_hat_y android.view.MotionEvent.AXIS_HAT_Y :: Int 91 | pure native axis_ltrigger android.view.MotionEvent.AXIS_LTRIGGER :: Int 92 | pure native axis_rtrigger android.view.MotionEvent.AXIS_RTRIGGER :: Int 93 | pure native axis_throttle android.view.MotionEvent.AXIS_THROTTLE :: Int 94 | pure native axis_rudder android.view.MotionEvent.AXIS_RUDDER :: Int 95 | pure native axis_wheel android.view.MotionEvent.AXIS_WHEEL :: Int 96 | pure native axis_gas android.view.MotionEvent.AXIS_GAS :: Int 97 | pure native axis_brake android.view.MotionEvent.AXIS_BRAKE :: Int 98 | pure native axis_distance android.view.MotionEvent.AXIS_DISTANCE :: Int 99 | pure native axis_tilt android.view.MotionEvent.AXIS_TILT :: Int 100 | pure native axis_generic_1 android.view.MotionEvent.AXIS_GENERIC_1 :: Int 101 | pure native axis_generic_2 android.view.MotionEvent.AXIS_GENERIC_2 :: Int 102 | pure native axis_generic_3 android.view.MotionEvent.AXIS_GENERIC_3 :: Int 103 | pure native axis_generic_4 android.view.MotionEvent.AXIS_GENERIC_4 :: Int 104 | pure native axis_generic_5 android.view.MotionEvent.AXIS_GENERIC_5 :: Int 105 | pure native axis_generic_6 android.view.MotionEvent.AXIS_GENERIC_6 :: Int 106 | pure native axis_generic_7 android.view.MotionEvent.AXIS_GENERIC_7 :: Int 107 | pure native axis_generic_8 android.view.MotionEvent.AXIS_GENERIC_8 :: Int 108 | pure native axis_generic_9 android.view.MotionEvent.AXIS_GENERIC_9 :: Int 109 | pure native axis_generic_10 android.view.MotionEvent.AXIS_GENERIC_10 :: Int 110 | pure native axis_generic_11 android.view.MotionEvent.AXIS_GENERIC_11 :: Int 111 | pure native axis_generic_12 android.view.MotionEvent.AXIS_GENERIC_12 :: Int 112 | pure native axis_generic_13 android.view.MotionEvent.AXIS_GENERIC_13 :: Int 113 | pure native axis_generic_14 android.view.MotionEvent.AXIS_GENERIC_14 :: Int 114 | pure native axis_generic_15 android.view.MotionEvent.AXIS_GENERIC_15 :: Int 115 | pure native axis_generic_16 android.view.MotionEvent.AXIS_GENERIC_16 :: Int 116 | pure native button_primary android.view.MotionEvent.BUTTON_PRIMARY :: Int 117 | pure native button_secondary android.view.MotionEvent.BUTTON_SECONDARY :: Int 118 | pure native button_tertiary android.view.MotionEvent.BUTTON_TERTIARY :: Int 119 | pure native button_back android.view.MotionEvent.BUTTON_BACK :: Int 120 | pure native button_forward android.view.MotionEvent.BUTTON_FORWARD :: Int 121 | pure native tool_type_unknown android.view.MotionEvent.TOOL_TYPE_UNKNOWN :: Int 122 | pure native tool_type_finger android.view.MotionEvent.TOOL_TYPE_FINGER :: Int 123 | pure native tool_type_stylus android.view.MotionEvent.TOOL_TYPE_STYLUS :: Int 124 | pure native tool_type_mouse android.view.MotionEvent.TOOL_TYPE_MOUSE :: Int 125 | pure native tool_type_eraser android.view.MotionEvent.TOOL_TYPE_ERASER :: Int 126 | 127 | pure native actionToString android.view.MotionEvent.actionToString :: Int -> String 128 | 129 | native addBatch :: Mutable s MotionEvent -> Long -> Float -> Float -> Float -> Float -> Int -> ST s () 130 | 131 | pure native axisFromString android.view.MotionEvent.axisFromString :: String -> Int 132 | 133 | pure native axisToString android.view.MotionEvent.axisToString :: Int -> String 134 | 135 | native findPointerIndex :: Mutable s MotionEvent -> Int -> ST s Int 136 | 137 | native getAction :: Mutable s MotionEvent -> ST s Int 138 | 139 | native getActionIndex :: Mutable s MotionEvent -> ST s Int 140 | 141 | native getActionMasked :: Mutable s MotionEvent -> ST s Int 142 | 143 | native getAxisValue :: Mutable s MotionEvent -> Int -> Int -> ST s Float 144 | | Mutable s MotionEvent -> Int -> ST s Float 145 | 146 | native getButtonState :: Mutable s MotionEvent -> ST s Int 147 | 148 | native getDeviceId :: Mutable s MotionEvent -> ST s Int 149 | 150 | native getDownTime :: Mutable s MotionEvent -> ST s Long 151 | 152 | native getEdgeFlags :: Mutable s MotionEvent -> ST s Int 153 | 154 | native getEventTime :: Mutable s MotionEvent -> ST s Long 155 | 156 | native getFlags :: Mutable s MotionEvent -> ST s Int 157 | 158 | native getHistoricalAxisValue :: Mutable s MotionEvent -> Int -> Int -> Int -> ST s Float 159 | | Mutable s MotionEvent -> Int -> Int -> ST s Float 160 | 161 | native getHistoricalEventTime :: Mutable s MotionEvent -> Int -> ST s Long 162 | 163 | native getHistoricalOrientation :: Mutable s MotionEvent -> Int -> ST s Float 164 | | Mutable s MotionEvent -> Int -> Int -> ST s Float 165 | 166 | native getHistoricalPointerCoords :: Mutable s MotionEvent -> Int -> Int -> MotionEvent_PointerCoords -> ST s () 167 | 168 | native getHistoricalPressure :: Mutable s MotionEvent -> Int -> Int -> ST s Float 169 | | Mutable s MotionEvent -> Int -> ST s Float 170 | 171 | native getHistoricalSize :: Mutable s MotionEvent -> Int -> Int -> ST s Float 172 | | Mutable s MotionEvent -> Int -> ST s Float 173 | 174 | native getHistoricalToolMajor :: Mutable s MotionEvent -> Int -> ST s Float 175 | | Mutable s MotionEvent -> Int -> Int -> ST s Float 176 | 177 | native getHistoricalToolMinor :: Mutable s MotionEvent -> Int -> Int -> ST s Float 178 | | Mutable s MotionEvent -> Int -> ST s Float 179 | 180 | native getHistoricalTouchMajor :: Mutable s MotionEvent -> Int -> Int -> ST s Float 181 | | Mutable s MotionEvent -> Int -> ST s Float 182 | 183 | native getHistoricalTouchMinor :: Mutable s MotionEvent -> Int -> Int -> ST s Float 184 | | Mutable s MotionEvent -> Int -> ST s Float 185 | 186 | native getHistoricalX :: Mutable s MotionEvent -> Int -> Int -> ST s Float 187 | | Mutable s MotionEvent -> Int -> ST s Float 188 | 189 | native getHistoricalY :: Mutable s MotionEvent -> Int -> Int -> ST s Float 190 | | Mutable s MotionEvent -> Int -> ST s Float 191 | 192 | native getHistorySize :: Mutable s MotionEvent -> ST s Int 193 | 194 | native getMetaState :: Mutable s MotionEvent -> ST s Int 195 | 196 | native getOrientation :: Mutable s MotionEvent -> ST s Float 197 | | Mutable s MotionEvent -> Int -> ST s Float 198 | 199 | native getPointerCoords :: Mutable s MotionEvent -> Int -> MotionEvent_PointerCoords -> ST s () 200 | 201 | native getPointerCount :: Mutable s MotionEvent -> ST s Int 202 | 203 | native getPointerId :: Mutable s MotionEvent -> Int -> ST s Int 204 | 205 | native getPointerProperties :: Mutable s MotionEvent -> Int -> MotionEvent_PointerProperties -> ST s () 206 | 207 | native getPressure :: Mutable s MotionEvent -> Int -> ST s Float 208 | | Mutable s MotionEvent -> ST s Float 209 | 210 | native getRawX :: Mutable s MotionEvent -> ST s Float 211 | 212 | native getRawY :: Mutable s MotionEvent -> ST s Float 213 | 214 | native getSize :: Mutable s MotionEvent -> ST s Float 215 | | Mutable s MotionEvent -> Int -> ST s Float 216 | 217 | native getSource :: Mutable s MotionEvent -> ST s Int 218 | 219 | native getToolMajor :: Mutable s MotionEvent -> ST s Float 220 | | Mutable s MotionEvent -> Int -> ST s Float 221 | 222 | native getToolMinor :: Mutable s MotionEvent -> Int -> ST s Float 223 | | Mutable s MotionEvent -> ST s Float 224 | 225 | native getToolType :: Mutable s MotionEvent -> Int -> ST s Int 226 | 227 | native getTouchMajor :: Mutable s MotionEvent -> Int -> ST s Float 228 | | Mutable s MotionEvent -> ST s Float 229 | 230 | native getTouchMinor :: Mutable s MotionEvent -> ST s Float 231 | | Mutable s MotionEvent -> Int -> ST s Float 232 | 233 | native getX :: Mutable s MotionEvent -> Int -> ST s Float 234 | | Mutable s MotionEvent -> ST s Float 235 | 236 | native getXPrecision :: Mutable s MotionEvent -> ST s Float 237 | 238 | native getY :: Mutable s MotionEvent -> Int -> ST s Float 239 | | Mutable s MotionEvent -> ST s Float 240 | 241 | native getYPrecision :: Mutable s MotionEvent -> ST s Float 242 | 243 | native obtain android.view.MotionEvent.obtain :: Long -> Long -> Int -> Int -> Float -> Float -> Float -> Float -> Int -> Float -> Float -> Int -> Int -> STMutable s MotionEvent 244 | | Mutable s MotionEvent -> STMutable s MotionEvent 245 | | Long -> Long -> Int -> Float -> Float -> Float -> Float -> Int -> Float -> Float -> Int -> Int -> STMutable s MotionEvent 246 | | Long -> Long -> Int -> Float -> Float -> Int -> STMutable s MotionEvent 247 | 248 | native obtainNoHistory android.view.MotionEvent.obtainNoHistory :: Mutable s MotionEvent -> STMutable s MotionEvent 249 | 250 | native offsetLocation :: Mutable s MotionEvent -> Float -> Float -> ST s () 251 | 252 | native recycle :: Mutable s MotionEvent -> ST s () 253 | 254 | native setAction :: Mutable s MotionEvent -> Int -> ST s () 255 | 256 | native setEdgeFlags :: Mutable s MotionEvent -> Int -> ST s () 257 | 258 | native setLocation :: Mutable s MotionEvent -> Float -> Float -> ST s () 259 | 260 | native setSource :: Mutable s MotionEvent -> Int -> ST s () 261 | 262 | native toString :: Mutable s MotionEvent -> ST s String 263 | 264 | native transform :: Mutable s MotionEvent -> Mutable s Matrix -> ST s () 265 | {- -} 266 | 267 | 268 | -------------------------------------------------------------------------------- /src/frege/android/view/SurfaceHolder.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.SurfaceHolder where 2 | 3 | import frege.android.graphics.Canvas 4 | import frege.android.graphics.Rect 5 | import frege.android.view.Surface 6 | 7 | data SurfaceHolder_Callback = pure native android.view.SurfaceHolder.Callback where 8 | 9 | 10 | native surfaceChanged :: SurfaceHolder_Callback -> MutableIO SurfaceHolder -> Int -> Int -> Int -> IO () 11 | 12 | native surfaceCreated :: SurfaceHolder_Callback -> MutableIO SurfaceHolder -> IO () 13 | 14 | native surfaceDestroyed :: SurfaceHolder_Callback -> MutableIO SurfaceHolder -> IO () 15 | {- -} 16 | 17 | data SurfaceHolder = native android.view.SurfaceHolder where 18 | 19 | pure native surface_type_normal android.view.SurfaceHolder.SURFACE_TYPE_NORMAL :: Int 20 | pure native surface_type_hardware android.view.SurfaceHolder.SURFACE_TYPE_HARDWARE :: Int 21 | pure native surface_type_gpu android.view.SurfaceHolder.SURFACE_TYPE_GPU :: Int 22 | pure native surface_type_push_buffers android.view.SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS :: Int 23 | 24 | native addCallback :: MutableIO SurfaceHolder -> SurfaceHolder_Callback -> IO () 25 | 26 | native getSurface :: MutableIO SurfaceHolder -> IOMutable Surface 27 | 28 | native getSurfaceFrame :: MutableIO SurfaceHolder -> IOMutable Rect 29 | 30 | native isCreating :: MutableIO SurfaceHolder -> IO Bool 31 | 32 | native lockCanvas :: MutableIO SurfaceHolder -> IOMutable Canvas 33 | | MutableIO SurfaceHolder -> MutableIO Rect -> IOMutable Canvas 34 | 35 | native removeCallback :: MutableIO SurfaceHolder -> SurfaceHolder_Callback -> IO () 36 | 37 | native setFixedSize :: MutableIO SurfaceHolder -> Int -> Int -> IO () 38 | 39 | native setFormat :: MutableIO SurfaceHolder -> Int -> IO () 40 | 41 | native setKeepScreenOn :: MutableIO SurfaceHolder -> Bool -> IO () 42 | 43 | native setSizeFromLayout :: MutableIO SurfaceHolder -> IO () 44 | 45 | native setType :: MutableIO SurfaceHolder -> Int -> IO () 46 | 47 | native unlockCanvasAndPost :: MutableIO SurfaceHolder -> MutableIO Canvas -> IO () 48 | {- -} 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/frege/android/view/SurfaceView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.SurfaceView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Canvas 5 | import frege.android.graphics.Region 6 | import frege.android.util.AttributeSet 7 | import frege.android.view.SurfaceHolder 8 | 9 | data SurfaceView = native android.view.SurfaceView where 10 | 11 | native new :: MutableIO Context -> IOMutable SurfaceView 12 | | MutableIO Context -> AttributeSet -> IOMutable SurfaceView 13 | | MutableIO Context -> AttributeSet -> Int -> IOMutable SurfaceView 14 | 15 | native draw :: MutableIO SurfaceView -> MutableIO Canvas -> IO () 16 | 17 | native gatherTransparentRegion :: MutableIO SurfaceView -> Region -> IO Bool 18 | 19 | native getHolder :: MutableIO SurfaceView -> IOMutable SurfaceHolder 20 | 21 | native setSecure :: MutableIO SurfaceView -> Bool -> IO () 22 | 23 | native setVisibility :: MutableIO SurfaceView -> Int -> IO () 24 | 25 | native setZOrderMediaOverlay :: MutableIO SurfaceView -> Bool -> IO () 26 | 27 | native setZOrderOnTop :: MutableIO SurfaceView -> Bool -> IO () 28 | {- -} 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/frege/android/view/TextureView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.TextureView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Bitmap 5 | import frege.android.graphics.Canvas 6 | import frege.android.graphics.Matrix 7 | import frege.android.graphics.Paint 8 | import frege.android.graphics.Rect 9 | import frege.android.graphics.SurfaceTexture 10 | import frege.android.util.AttributeSet 11 | 12 | data TextureView_SurfaceTextureListener = pure native android.view.TextureView.SurfaceTextureListener where 13 | 14 | 15 | native onSurfaceTextureAvailable :: TextureView_SurfaceTextureListener -> SurfaceTexture -> Int -> Int -> ST s () 16 | 17 | pure native onSurfaceTextureDestroyed :: TextureView_SurfaceTextureListener -> SurfaceTexture -> Bool 18 | 19 | native onSurfaceTextureSizeChanged :: TextureView_SurfaceTextureListener -> SurfaceTexture -> Int -> Int -> ST s () 20 | 21 | native onSurfaceTextureUpdated :: TextureView_SurfaceTextureListener -> SurfaceTexture -> ST s () 22 | {- -} 23 | 24 | data TextureView = native android.view.TextureView where 25 | 26 | native new :: MutableIO Context -> IOMutable TextureView 27 | | MutableIO Context -> AttributeSet -> Int -> IOMutable TextureView 28 | | MutableIO Context -> AttributeSet -> IOMutable TextureView 29 | 30 | native buildLayer :: MutableIO TextureView -> IO () 31 | 32 | native draw :: MutableIO TextureView -> MutableIO Canvas -> IO () 33 | 34 | native getBitmap :: MutableIO TextureView -> Int -> Int -> IO Bitmap 35 | | MutableIO TextureView -> IO Bitmap 36 | | MutableIO TextureView -> Bitmap -> IO Bitmap 37 | 38 | native getLayerType :: MutableIO TextureView -> IO Int 39 | 40 | native getSurfaceTexture :: MutableIO TextureView -> IO SurfaceTexture 41 | 42 | native getSurfaceTextureListener :: MutableIO TextureView -> IO TextureView_SurfaceTextureListener 43 | 44 | native getTransform :: MutableIO TextureView -> MutableIO Matrix -> IOMutable Matrix 45 | 46 | native isAvailable :: MutableIO TextureView -> IO Bool 47 | 48 | native isOpaque :: MutableIO TextureView -> IO Bool 49 | 50 | native lockCanvas :: MutableIO TextureView -> MutableIO Rect -> IOMutable Canvas 51 | | MutableIO TextureView -> IOMutable Canvas 52 | 53 | native setLayerType :: MutableIO TextureView -> Int -> Paint -> IO () 54 | 55 | native setOpaque :: MutableIO TextureView -> Bool -> IO () 56 | 57 | native setSurfaceTexture :: MutableIO TextureView -> SurfaceTexture -> IO () 58 | 59 | native setSurfaceTextureListener :: MutableIO TextureView -> TextureView_SurfaceTextureListener -> IO () 60 | 61 | native setTransform :: MutableIO TextureView -> MutableIO Matrix -> IO () 62 | 63 | native unlockCanvasAndPost :: MutableIO TextureView -> MutableIO Canvas -> IO () 64 | {- -} 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/frege/android/view/ViewManager.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.ViewManager where 2 | 3 | import frege.android.view.View 4 | import frege.android.view.ViewGroup 5 | 6 | data ViewManager = native android.view.ViewManager where 7 | 8 | 9 | native addView :: MutableIO ViewManager -> MutableIO View -> ViewGroup_LayoutParams -> IO () 10 | 11 | native removeView :: MutableIO ViewManager -> MutableIO View -> IO () 12 | 13 | native updateViewLayout :: MutableIO ViewManager -> MutableIO View -> ViewGroup_LayoutParams -> IO () 14 | {- -} 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/frege/android/view/ViewTreeObserver.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.ViewTreeObserver where 2 | 3 | import frege.android.view.View 4 | 5 | data ViewTreeObserver_OnDrawListener = pure native android.view.ViewTreeObserver.OnDrawListener where 6 | 7 | 8 | native onDraw :: ViewTreeObserver_OnDrawListener -> ST s () 9 | {- -} 10 | 11 | data ViewTreeObserver_OnGlobalFocusChangeListener = pure native android.view.ViewTreeObserver.OnGlobalFocusChangeListener where 12 | 13 | 14 | native onGlobalFocusChanged :: ViewTreeObserver_OnGlobalFocusChangeListener -> MutableIO View -> MutableIO View -> IO () 15 | {- -} 16 | 17 | data ViewTreeObserver_OnGlobalLayoutListener = pure native android.view.ViewTreeObserver.OnGlobalLayoutListener where 18 | 19 | 20 | native onGlobalLayout :: ViewTreeObserver_OnGlobalLayoutListener -> ST s () 21 | {- -} 22 | 23 | data ViewTreeObserver_OnPreDrawListener = pure native android.view.ViewTreeObserver.OnPreDrawListener where 24 | 25 | 26 | pure native onPreDraw :: ViewTreeObserver_OnPreDrawListener -> Bool 27 | {- -} 28 | 29 | data ViewTreeObserver_OnScrollChangedListener = pure native android.view.ViewTreeObserver.OnScrollChangedListener where 30 | 31 | 32 | native onScrollChanged :: ViewTreeObserver_OnScrollChangedListener -> ST s () 33 | {- -} 34 | 35 | data ViewTreeObserver_OnTouchModeChangeListener = pure native android.view.ViewTreeObserver.OnTouchModeChangeListener where 36 | 37 | 38 | native onTouchModeChanged :: ViewTreeObserver_OnTouchModeChangeListener -> Bool -> ST s () 39 | {- -} 40 | 41 | data ViewTreeObserver_OnWindowAttachListener = pure native android.view.ViewTreeObserver.OnWindowAttachListener where 42 | 43 | 44 | native onWindowAttached :: ViewTreeObserver_OnWindowAttachListener -> ST s () 45 | 46 | native onWindowDetached :: ViewTreeObserver_OnWindowAttachListener -> ST s () 47 | {- -} 48 | 49 | data ViewTreeObserver_OnWindowFocusChangeListener = pure native android.view.ViewTreeObserver.OnWindowFocusChangeListener where 50 | 51 | 52 | native onWindowFocusChanged :: ViewTreeObserver_OnWindowFocusChangeListener -> Bool -> ST s () 53 | {- -} 54 | 55 | data ViewTreeObserver = native android.view.ViewTreeObserver where 56 | 57 | 58 | native addOnDrawListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnDrawListener -> IO () 59 | 60 | native addOnGlobalFocusChangeListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnGlobalFocusChangeListener -> IO () 61 | 62 | native addOnGlobalLayoutListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnGlobalLayoutListener -> IO () 63 | 64 | native addOnPreDrawListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnPreDrawListener -> IO () 65 | 66 | native addOnScrollChangedListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnScrollChangedListener -> IO () 67 | 68 | native addOnTouchModeChangeListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnTouchModeChangeListener -> IO () 69 | 70 | native addOnWindowAttachListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnWindowAttachListener -> IO () 71 | 72 | native addOnWindowFocusChangeListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnWindowFocusChangeListener -> IO () 73 | 74 | native dispatchOnDraw :: MutableIO ViewTreeObserver -> IO () 75 | 76 | native dispatchOnGlobalLayout :: MutableIO ViewTreeObserver -> IO () 77 | 78 | native dispatchOnPreDraw :: MutableIO ViewTreeObserver -> IO Bool 79 | 80 | native isAlive :: MutableIO ViewTreeObserver -> IO Bool 81 | 82 | native removeGlobalOnLayoutListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnGlobalLayoutListener -> IO () 83 | 84 | native removeOnDrawListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnDrawListener -> IO () 85 | 86 | native removeOnGlobalFocusChangeListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnGlobalFocusChangeListener -> IO () 87 | 88 | native removeOnGlobalLayoutListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnGlobalLayoutListener -> IO () 89 | 90 | native removeOnPreDrawListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnPreDrawListener -> IO () 91 | 92 | native removeOnScrollChangedListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnScrollChangedListener -> IO () 93 | 94 | native removeOnTouchModeChangeListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnTouchModeChangeListener -> IO () 95 | 96 | native removeOnWindowAttachListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnWindowAttachListener -> IO () 97 | 98 | native removeOnWindowFocusChangeListener :: MutableIO ViewTreeObserver -> ViewTreeObserver_OnWindowFocusChangeListener -> IO () 99 | {- -} 100 | 101 | 102 | -------------------------------------------------------------------------------- /src/frege/android/view/Window.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.Window where 2 | 3 | import frege.android.content.Context 4 | import frege.android.content.res.Configuration 5 | import frege.android.graphics.drawable.Drawable 6 | import frege.android.net.Uri 7 | import frege.android.os.Bundle 8 | import frege.android.view.ActionMode 9 | import frege.android.view.InputEvent 10 | import frege.android.view.KeyEvent 11 | import frege.android.view.LayoutInflater 12 | import frege.android.view.Menu 13 | import frege.android.view.MenuItem 14 | import frege.android.view.MotionEvent 15 | import frege.android.view.View 16 | import frege.android.view.ViewGroup 17 | import frege.android.view.WindowManager 18 | 19 | data Window_Callback = pure native android.view.Window.Callback where 20 | 21 | 22 | native dispatchGenericMotionEvent :: Window_Callback -> Mutable s MotionEvent -> ST s Bool 23 | 24 | pure native dispatchKeyEvent :: Window_Callback -> KeyEvent -> Bool 25 | 26 | pure native dispatchKeyShortcutEvent :: Window_Callback -> KeyEvent -> Bool 27 | 28 | native dispatchTouchEvent :: Window_Callback -> Mutable s MotionEvent -> ST s Bool 29 | 30 | native dispatchTrackballEvent :: Window_Callback -> Mutable s MotionEvent -> ST s Bool 31 | 32 | native onActionModeFinished :: Window_Callback -> MutableIO ActionMode -> IO () 33 | 34 | native onActionModeStarted :: Window_Callback -> MutableIO ActionMode -> IO () 35 | 36 | native onAttachedToWindow :: Window_Callback -> ST s () 37 | 38 | native onContentChanged :: Window_Callback -> ST s () 39 | 40 | pure native onCreatePanelMenu :: Window_Callback -> Int -> Menu -> Bool 41 | 42 | native onCreatePanelView :: Window_Callback -> Int -> IOMutable View 43 | 44 | native onDetachedFromWindow :: Window_Callback -> ST s () 45 | 46 | pure native onMenuItemSelected :: Window_Callback -> Int -> MenuItem -> Bool 47 | 48 | pure native onMenuOpened :: Window_Callback -> Int -> Menu -> Bool 49 | 50 | native onPanelClosed :: Window_Callback -> Int -> Menu -> ST s () 51 | 52 | native onPreparePanel :: Window_Callback -> Int -> MutableIO View -> Menu -> IO Bool 53 | 54 | pure native onSearchRequested :: Window_Callback -> Bool 55 | 56 | native onWindowAttributesChanged :: Window_Callback -> WindowManager_LayoutParams -> ST s () 57 | 58 | native onWindowFocusChanged :: Window_Callback -> Bool -> ST s () 59 | 60 | native onWindowStartingActionMode :: Window_Callback -> ActionMode_Callback -> IOMutable ActionMode 61 | {- -} 62 | 63 | data Window = native android.view.Window where 64 | 65 | pure native feature_options_panel android.view.Window.FEATURE_OPTIONS_PANEL :: Int 66 | pure native feature_no_title android.view.Window.FEATURE_NO_TITLE :: Int 67 | pure native feature_progress android.view.Window.FEATURE_PROGRESS :: Int 68 | pure native feature_left_icon android.view.Window.FEATURE_LEFT_ICON :: Int 69 | pure native feature_right_icon android.view.Window.FEATURE_RIGHT_ICON :: Int 70 | pure native feature_indeterminate_progress android.view.Window.FEATURE_INDETERMINATE_PROGRESS :: Int 71 | pure native feature_context_menu android.view.Window.FEATURE_CONTEXT_MENU :: Int 72 | pure native feature_custom_title android.view.Window.FEATURE_CUSTOM_TITLE :: Int 73 | pure native feature_action_bar android.view.Window.FEATURE_ACTION_BAR :: Int 74 | pure native feature_action_bar_overlay android.view.Window.FEATURE_ACTION_BAR_OVERLAY :: Int 75 | pure native feature_action_mode_overlay android.view.Window.FEATURE_ACTION_MODE_OVERLAY :: Int 76 | pure native feature_swipe_to_dismiss android.view.Window.FEATURE_SWIPE_TO_DISMISS :: Int 77 | pure native progress_visibility_on android.view.Window.PROGRESS_VISIBILITY_ON :: Int 78 | pure native progress_visibility_off android.view.Window.PROGRESS_VISIBILITY_OFF :: Int 79 | pure native progress_indeterminate_on android.view.Window.PROGRESS_INDETERMINATE_ON :: Int 80 | pure native progress_indeterminate_off android.view.Window.PROGRESS_INDETERMINATE_OFF :: Int 81 | pure native progress_start android.view.Window.PROGRESS_START :: Int 82 | pure native progress_end android.view.Window.PROGRESS_END :: Int 83 | pure native progress_secondary_start android.view.Window.PROGRESS_SECONDARY_START :: Int 84 | pure native progress_secondary_end android.view.Window.PROGRESS_SECONDARY_END :: Int 85 | pure native id_android_content android.view.Window.ID_ANDROID_CONTENT :: Int 86 | 87 | native addContentView :: MutableIO Window -> MutableIO View -> ViewGroup_LayoutParams -> IO () 88 | 89 | native addFlags :: MutableIO Window -> Int -> IO () 90 | 91 | native clearFlags :: MutableIO Window -> Int -> IO () 92 | 93 | native closeAllPanels :: MutableIO Window -> IO () 94 | 95 | native closePanel :: MutableIO Window -> Int -> IO () 96 | 97 | native findViewById :: MutableIO Window -> Int -> IOMutable View 98 | 99 | native getAttributes :: MutableIO Window -> IO WindowManager_LayoutParams 100 | 101 | native getCallback :: MutableIO Window -> IO Window_Callback 102 | 103 | native getContainer :: MutableIO Window -> IOMutable Window 104 | 105 | native getContext :: MutableIO Window -> IOMutable Context 106 | 107 | native getCurrentFocus :: MutableIO Window -> IOMutable View 108 | 109 | native getDecorView :: MutableIO Window -> IOMutable View 110 | 111 | native getLayoutInflater :: MutableIO Window -> IO LayoutInflater 112 | 113 | native getVolumeControlStream :: MutableIO Window -> IO Int 114 | 115 | native getWindowManager :: MutableIO Window -> IOMutable WindowManager 116 | 117 | native hasChildren :: MutableIO Window -> IO Bool 118 | 119 | native hasFeature :: MutableIO Window -> Int -> IO Bool 120 | 121 | native injectInputEvent :: MutableIO Window -> InputEvent -> IO () 122 | 123 | native invalidatePanelMenu :: MutableIO Window -> Int -> IO () 124 | 125 | native isActive :: MutableIO Window -> IO Bool 126 | 127 | native isFloating :: MutableIO Window -> IO Bool 128 | 129 | native isShortcutKey :: MutableIO Window -> Int -> KeyEvent -> IO Bool 130 | 131 | native makeActive :: MutableIO Window -> IO () 132 | 133 | native onConfigurationChanged :: MutableIO Window -> Configuration -> IO () 134 | 135 | native openPanel :: MutableIO Window -> Int -> KeyEvent -> IO () 136 | 137 | native peekDecorView :: MutableIO Window -> IOMutable View 138 | 139 | native performContextMenuIdentifierAction :: MutableIO Window -> Int -> Int -> IO Bool 140 | 141 | native performPanelIdentifierAction :: MutableIO Window -> Int -> Int -> Int -> IO Bool 142 | 143 | native performPanelShortcut :: MutableIO Window -> Int -> Int -> KeyEvent -> Int -> IO Bool 144 | 145 | native requestFeature :: MutableIO Window -> Int -> IO Bool 146 | 147 | native restoreHierarchyState :: MutableIO Window -> Bundle -> IO () 148 | 149 | native saveHierarchyState :: MutableIO Window -> IO Bundle 150 | 151 | native setAttributes :: MutableIO Window -> WindowManager_LayoutParams -> IO () 152 | 153 | native setBackgroundDrawable :: MutableIO Window -> Drawable -> IO () 154 | 155 | native setBackgroundDrawableResource :: MutableIO Window -> Int -> IO () 156 | 157 | native setCallback :: MutableIO Window -> Window_Callback -> IO () 158 | 159 | native setChildDrawable :: MutableIO Window -> Int -> Drawable -> IO () 160 | 161 | native setChildInt :: MutableIO Window -> Int -> Int -> IO () 162 | 163 | native setContainer :: MutableIO Window -> MutableIO Window -> IO () 164 | 165 | native setContentView :: MutableIO Window -> MutableIO View -> ViewGroup_LayoutParams -> IO () 166 | | MutableIO Window -> Int -> IO () 167 | | MutableIO Window -> MutableIO View -> IO () 168 | 169 | native setDimAmount :: MutableIO Window -> Float -> IO () 170 | 171 | native setFeatureDrawable :: MutableIO Window -> Int -> Drawable -> IO () 172 | 173 | native setFeatureDrawableAlpha :: MutableIO Window -> Int -> Int -> IO () 174 | 175 | native setFeatureDrawableResource :: MutableIO Window -> Int -> Int -> IO () 176 | 177 | native setFeatureDrawableUri :: MutableIO Window -> Int -> Uri -> IO () 178 | 179 | native setFeatureInt :: MutableIO Window -> Int -> Int -> IO () 180 | 181 | native setFlags :: MutableIO Window -> Int -> Int -> IO () 182 | 183 | native setFormat :: MutableIO Window -> Int -> IO () 184 | 185 | native setGravity :: MutableIO Window -> Int -> IO () 186 | 187 | native setIcon :: MutableIO Window -> Int -> IO () 188 | 189 | native setLayout :: MutableIO Window -> Int -> Int -> IO () 190 | 191 | native setLocalFocus :: MutableIO Window -> Bool -> Bool -> IO () 192 | 193 | native setLogo :: MutableIO Window -> Int -> IO () 194 | 195 | native setSoftInputMode :: MutableIO Window -> Int -> IO () 196 | 197 | native setTitle :: MutableIO Window -> CharSequence -> IO () 198 | 199 | native setTitleColor :: MutableIO Window -> Int -> IO () 200 | 201 | native setType :: MutableIO Window -> Int -> IO () 202 | 203 | native setUiOptions :: MutableIO Window -> Int -> Int -> IO () 204 | | MutableIO Window -> Int -> IO () 205 | 206 | native setVolumeControlStream :: MutableIO Window -> Int -> IO () 207 | 208 | native setWindowAnimations :: MutableIO Window -> Int -> IO () 209 | 210 | native superDispatchGenericMotionEvent :: MutableIO Window -> MutableIO MotionEvent -> IO Bool 211 | 212 | native superDispatchKeyEvent :: MutableIO Window -> KeyEvent -> IO Bool 213 | 214 | native superDispatchKeyShortcutEvent :: MutableIO Window -> KeyEvent -> IO Bool 215 | 216 | native superDispatchTouchEvent :: MutableIO Window -> MutableIO MotionEvent -> IO Bool 217 | 218 | native superDispatchTrackballEvent :: MutableIO Window -> MutableIO MotionEvent -> IO Bool 219 | 220 | native takeKeyEvents :: MutableIO Window -> Bool -> IO () 221 | 222 | native togglePanel :: MutableIO Window -> Int -> KeyEvent -> IO () 223 | {- -} 224 | 225 | 226 | -------------------------------------------------------------------------------- /src/frege/android/view/WindowManager.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.WindowManager where 2 | 3 | import frege.android.view.Display 4 | import frege.android.view.View 5 | 6 | data WindowManager_LayoutParams = pure native android.view.WindowManager.LayoutParams where 7 | 8 | pure native x ".x" :: WindowManager_LayoutParams -> Int 9 | pure native y ".y" :: WindowManager_LayoutParams -> Int 10 | pure native horizontalweight ".horizontalWeight" :: WindowManager_LayoutParams -> Float 11 | pure native verticalweight ".verticalWeight" :: WindowManager_LayoutParams -> Float 12 | pure native type_ ".type" :: WindowManager_LayoutParams -> Int 13 | pure native first_application_window android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW :: Int 14 | pure native type_base_application android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION :: Int 15 | pure native type_application android.view.WindowManager.LayoutParams.TYPE_APPLICATION :: Int 16 | pure native type_application_starting android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING :: Int 17 | pure native last_application_window android.view.WindowManager.LayoutParams.LAST_APPLICATION_WINDOW :: Int 18 | pure native first_sub_window android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW :: Int 19 | pure native type_application_panel android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL :: Int 20 | pure native type_application_media android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA :: Int 21 | pure native type_application_sub_panel android.view.WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL :: Int 22 | pure native type_application_attached_dialog android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG :: Int 23 | pure native last_sub_window android.view.WindowManager.LayoutParams.LAST_SUB_WINDOW :: Int 24 | pure native first_system_window android.view.WindowManager.LayoutParams.FIRST_SYSTEM_WINDOW :: Int 25 | pure native type_status_bar android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR :: Int 26 | pure native type_search_bar android.view.WindowManager.LayoutParams.TYPE_SEARCH_BAR :: Int 27 | pure native type_phone android.view.WindowManager.LayoutParams.TYPE_PHONE :: Int 28 | pure native type_system_alert android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT :: Int 29 | pure native type_keyguard android.view.WindowManager.LayoutParams.TYPE_KEYGUARD :: Int 30 | pure native type_toast android.view.WindowManager.LayoutParams.TYPE_TOAST :: Int 31 | pure native type_system_overlay android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY :: Int 32 | pure native type_priority_phone android.view.WindowManager.LayoutParams.TYPE_PRIORITY_PHONE :: Int 33 | pure native type_system_dialog android.view.WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG :: Int 34 | pure native type_keyguard_dialog android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG :: Int 35 | pure native type_system_error android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ERROR :: Int 36 | pure native type_input_method android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD :: Int 37 | pure native type_input_method_dialog android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG :: Int 38 | pure native type_wallpaper android.view.WindowManager.LayoutParams.TYPE_WALLPAPER :: Int 39 | pure native type_status_bar_panel android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL :: Int 40 | pure native type_private_presentation android.view.WindowManager.LayoutParams.TYPE_PRIVATE_PRESENTATION :: Int 41 | pure native last_system_window android.view.WindowManager.LayoutParams.LAST_SYSTEM_WINDOW :: Int 42 | pure native memory_type_normal android.view.WindowManager.LayoutParams.MEMORY_TYPE_NORMAL :: Int 43 | pure native memory_type_hardware android.view.WindowManager.LayoutParams.MEMORY_TYPE_HARDWARE :: Int 44 | pure native memory_type_gpu android.view.WindowManager.LayoutParams.MEMORY_TYPE_GPU :: Int 45 | pure native memory_type_push_buffers android.view.WindowManager.LayoutParams.MEMORY_TYPE_PUSH_BUFFERS :: Int 46 | pure native memorytype ".memoryType" :: WindowManager_LayoutParams -> Int 47 | pure native flag_allow_lock_while_screen_on android.view.WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON :: Int 48 | pure native flag_dim_behind android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND :: Int 49 | pure native flag_blur_behind android.view.WindowManager.LayoutParams.FLAG_BLUR_BEHIND :: Int 50 | pure native flag_not_focusable android.view.WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE :: Int 51 | pure native flag_not_touchable android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE :: Int 52 | pure native flag_not_touch_modal android.view.WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL :: Int 53 | pure native flag_touchable_when_waking android.view.WindowManager.LayoutParams.FLAG_TOUCHABLE_WHEN_WAKING :: Int 54 | pure native flag_keep_screen_on android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON :: Int 55 | pure native flag_layout_in_screen android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN :: Int 56 | pure native flag_layout_no_limits android.view.WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS :: Int 57 | pure native flag_fullscreen android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN :: Int 58 | pure native flag_force_not_fullscreen android.view.WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN :: Int 59 | pure native flag_dither android.view.WindowManager.LayoutParams.FLAG_DITHER :: Int 60 | pure native flag_secure android.view.WindowManager.LayoutParams.FLAG_SECURE :: Int 61 | pure native flag_scaled android.view.WindowManager.LayoutParams.FLAG_SCALED :: Int 62 | pure native flag_ignore_cheek_presses android.view.WindowManager.LayoutParams.FLAG_IGNORE_CHEEK_PRESSES :: Int 63 | pure native flag_layout_inset_decor android.view.WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR :: Int 64 | pure native flag_alt_focusable_im android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM :: Int 65 | pure native flag_watch_outside_touch android.view.WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH :: Int 66 | pure native flag_show_when_locked android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED :: Int 67 | pure native flag_show_wallpaper android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER :: Int 68 | pure native flag_turn_screen_on android.view.WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON :: Int 69 | pure native flag_dismiss_keyguard android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD :: Int 70 | pure native flag_split_touch android.view.WindowManager.LayoutParams.FLAG_SPLIT_TOUCH :: Int 71 | pure native flag_hardware_accelerated android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED :: Int 72 | pure native flag_layout_in_overscan android.view.WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN :: Int 73 | pure native flag_translucent_status android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS :: Int 74 | pure native flag_translucent_navigation android.view.WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION :: Int 75 | pure native flag_local_focus_mode android.view.WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE :: Int 76 | pure native flags ".flags" :: WindowManager_LayoutParams -> Int 77 | pure native soft_input_mask_state android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE :: Int 78 | pure native soft_input_state_unspecified android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED :: Int 79 | pure native soft_input_state_unchanged android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_UNCHANGED :: Int 80 | pure native soft_input_state_hidden android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN :: Int 81 | pure native soft_input_state_always_hidden android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN :: Int 82 | pure native soft_input_state_visible android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE :: Int 83 | pure native soft_input_state_always_visible android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE :: Int 84 | pure native soft_input_mask_adjust android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST :: Int 85 | pure native soft_input_adjust_unspecified android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED :: Int 86 | pure native soft_input_adjust_resize android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE :: Int 87 | pure native soft_input_adjust_pan android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN :: Int 88 | pure native soft_input_adjust_nothing android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING :: Int 89 | pure native soft_input_is_forward_navigation android.view.WindowManager.LayoutParams.SOFT_INPUT_IS_FORWARD_NAVIGATION :: Int 90 | pure native softinputmode ".softInputMode" :: WindowManager_LayoutParams -> Int 91 | pure native gravity ".gravity" :: WindowManager_LayoutParams -> Int 92 | pure native horizontalmargin ".horizontalMargin" :: WindowManager_LayoutParams -> Float 93 | pure native verticalmargin ".verticalMargin" :: WindowManager_LayoutParams -> Float 94 | pure native format ".format" :: WindowManager_LayoutParams -> Int 95 | pure native windowanimations ".windowAnimations" :: WindowManager_LayoutParams -> Int 96 | pure native alpha ".alpha" :: WindowManager_LayoutParams -> Float 97 | pure native dimamount ".dimAmount" :: WindowManager_LayoutParams -> Float 98 | pure native brightness_override_none android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE :: Float 99 | pure native brightness_override_off android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF :: Float 100 | pure native brightness_override_full android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL :: Float 101 | pure native screenbrightness ".screenBrightness" :: WindowManager_LayoutParams -> Float 102 | pure native buttonbrightness ".buttonBrightness" :: WindowManager_LayoutParams -> Float 103 | pure native rotation_animation_rotate android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_ROTATE :: Int 104 | pure native rotation_animation_crossfade android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_CROSSFADE :: Int 105 | pure native rotation_animation_jumpcut android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_JUMPCUT :: Int 106 | pure native rotationanimation ".rotationAnimation" :: WindowManager_LayoutParams -> Int 107 | pure native packagename ".packageName" :: WindowManager_LayoutParams -> String 108 | pure native screenorientation ".screenOrientation" :: WindowManager_LayoutParams -> Int 109 | pure native systemuivisibility ".systemUiVisibility" :: WindowManager_LayoutParams -> Int 110 | pure native layout_changed android.view.WindowManager.LayoutParams.LAYOUT_CHANGED :: Int 111 | pure native type_changed android.view.WindowManager.LayoutParams.TYPE_CHANGED :: Int 112 | pure native flags_changed android.view.WindowManager.LayoutParams.FLAGS_CHANGED :: Int 113 | pure native format_changed android.view.WindowManager.LayoutParams.FORMAT_CHANGED :: Int 114 | pure native animation_changed android.view.WindowManager.LayoutParams.ANIMATION_CHANGED :: Int 115 | pure native dim_amount_changed android.view.WindowManager.LayoutParams.DIM_AMOUNT_CHANGED :: Int 116 | pure native title_changed android.view.WindowManager.LayoutParams.TITLE_CHANGED :: Int 117 | pure native alpha_changed android.view.WindowManager.LayoutParams.ALPHA_CHANGED :: Int 118 | pure native memory_type_changed android.view.WindowManager.LayoutParams.MEMORY_TYPE_CHANGED :: Int 119 | pure native soft_input_mode_changed android.view.WindowManager.LayoutParams.SOFT_INPUT_MODE_CHANGED :: Int 120 | pure native screen_orientation_changed android.view.WindowManager.LayoutParams.SCREEN_ORIENTATION_CHANGED :: Int 121 | pure native screen_brightness_changed android.view.WindowManager.LayoutParams.SCREEN_BRIGHTNESS_CHANGED :: Int 122 | pure native rotation_animation_changed android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_CHANGED :: Int 123 | native new :: () -> ST s WindowManager_LayoutParams 124 | | Int -> ST s WindowManager_LayoutParams 125 | | Int -> Int -> ST s WindowManager_LayoutParams 126 | | Int -> Int -> Int -> ST s WindowManager_LayoutParams 127 | | Int -> Int -> Int -> Int -> Int -> Int -> Int -> ST s WindowManager_LayoutParams 128 | | Int -> Int -> Int -> Int -> Int -> ST s WindowManager_LayoutParams 129 | 130 | pure native copyFrom :: WindowManager_LayoutParams -> WindowManager_LayoutParams -> Int 131 | 132 | pure native debug :: WindowManager_LayoutParams -> String -> String 133 | 134 | pure native describeContents :: WindowManager_LayoutParams -> Int 135 | 136 | pure native getTitle :: WindowManager_LayoutParams -> CharSequence 137 | 138 | pure native mayUseInputMethod android.view.WindowManager.LayoutParams.mayUseInputMethod :: Int -> Bool 139 | 140 | native setTitle :: WindowManager_LayoutParams -> CharSequence -> ST s () 141 | 142 | pure native toString :: WindowManager_LayoutParams -> String 143 | {- -} 144 | 145 | data WindowManager = native android.view.WindowManager where 146 | 147 | 148 | native getDefaultDisplay :: MutableIO WindowManager -> IOMutable Display 149 | 150 | native removeViewImmediate :: MutableIO WindowManager -> MutableIO View -> IO () 151 | {- -} 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/frege/android/view/animation/CycleInterpolator.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.animation.CycleInterpolator where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | 6 | data CycleInterpolator = pure native android.view.animation.CycleInterpolator where 7 | 8 | native new :: MutableIO Context -> AttributeSet -> IO CycleInterpolator 9 | | Float -> ST s CycleInterpolator 10 | 11 | pure native getInterpolation :: CycleInterpolator -> Float -> Float 12 | {- -} 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/frege/android/view/animation/Transformation.fr: -------------------------------------------------------------------------------- 1 | package frege.android.view.animation.Transformation where 2 | 3 | import frege.android.graphics.Matrix 4 | 5 | data Transformation = native android.view.animation.Transformation where 6 | 7 | pure native type_identity android.view.animation.Transformation.TYPE_IDENTITY :: Int 8 | pure native type_alpha android.view.animation.Transformation.TYPE_ALPHA :: Int 9 | pure native type_matrix android.view.animation.Transformation.TYPE_MATRIX :: Int 10 | pure native type_both android.view.animation.Transformation.TYPE_BOTH :: Int 11 | native new :: () -> STMutable s Transformation 12 | 13 | native clear :: Mutable s Transformation -> ST s () 14 | 15 | native compose :: Mutable s Transformation -> Mutable s Transformation -> ST s () 16 | 17 | native getAlpha :: Mutable s Transformation -> ST s Float 18 | 19 | native getMatrix :: Mutable s Transformation -> STMutable s Matrix 20 | 21 | native getTransformationType :: Mutable s Transformation -> ST s Int 22 | 23 | native set :: Mutable s Transformation -> Mutable s Transformation -> ST s () 24 | 25 | native setAlpha :: Mutable s Transformation -> Float -> ST s () 26 | 27 | native setTransformationType :: Mutable s Transformation -> Int -> ST s () 28 | 29 | native toShortString :: Mutable s Transformation -> ST s String 30 | 31 | native toString :: Mutable s Transformation -> ST s String 32 | {- -} 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/frege/android/widget/DatePicker.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.DatePicker where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | import frege.android.widget.CalendarView 6 | 7 | data DatePicker_OnDateChangedListener = pure native android.widget.DatePicker.OnDateChangedListener where 8 | 9 | 10 | native onDateChanged :: DatePicker_OnDateChangedListener -> MutableIO DatePicker -> Int -> Int -> Int -> IO () 11 | {- -} 12 | 13 | data DatePicker = native android.widget.DatePicker where 14 | 15 | native new :: MutableIO Context -> IOMutable DatePicker 16 | | MutableIO Context -> AttributeSet -> IOMutable DatePicker 17 | | MutableIO Context -> AttributeSet -> Int -> IOMutable DatePicker 18 | 19 | native getCalendarView :: MutableIO DatePicker -> IOMutable CalendarView 20 | 21 | native getCalendarViewShown :: MutableIO DatePicker -> IO Bool 22 | 23 | native getDayOfMonth :: MutableIO DatePicker -> IO Int 24 | 25 | native getMaxDate :: MutableIO DatePicker -> IO Long 26 | 27 | native getMinDate :: MutableIO DatePicker -> IO Long 28 | 29 | native getMonth :: MutableIO DatePicker -> IO Int 30 | 31 | native getSpinnersShown :: MutableIO DatePicker -> IO Bool 32 | 33 | native getYear :: MutableIO DatePicker -> IO Int 34 | 35 | native init :: MutableIO DatePicker -> Int -> Int -> Int -> DatePicker_OnDateChangedListener -> IO () 36 | 37 | native isEnabled :: MutableIO DatePicker -> IO Bool 38 | 39 | native setCalendarViewShown :: MutableIO DatePicker -> Bool -> IO () 40 | 41 | native setEnabled :: MutableIO DatePicker -> Bool -> IO () 42 | 43 | native setMaxDate :: MutableIO DatePicker -> Long -> IO () 44 | 45 | native setMinDate :: MutableIO DatePicker -> Long -> IO () 46 | 47 | native setSpinnersShown :: MutableIO DatePicker -> Bool -> IO () 48 | 49 | native updateDate :: MutableIO DatePicker -> Int -> Int -> Int -> IO () 50 | {- -} 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/frege/android/widget/EditText.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.EditText where 2 | 3 | import frege.android.content.Context 4 | import frege.android.text.Editable 5 | import frege.android.text.TextUtils 6 | import frege.android.util.AttributeSet 7 | import frege.android.widget.TextView 8 | 9 | data EditText = native android.widget.EditText where 10 | 11 | native new :: MutableIO Context -> IOMutable EditText 12 | | MutableIO Context -> AttributeSet -> Int -> IOMutable EditText 13 | | MutableIO Context -> AttributeSet -> IOMutable EditText 14 | 15 | native extendSelection :: MutableIO EditText -> Int -> IO () 16 | 17 | native getText :: MutableIO EditText -> IO Editable 18 | 19 | native selectAll :: MutableIO EditText -> IO () 20 | 21 | native setEllipsize :: MutableIO EditText -> TextUtils_TruncateAt -> IO () 22 | 23 | native setSelection :: MutableIO EditText -> Int -> Int -> IO () 24 | | MutableIO EditText -> Int -> IO () 25 | 26 | native setText :: MutableIO EditText -> CharSequence -> TextView_BufferType -> IO () 27 | {- -} 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/frege/android/widget/FrameLayout.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.FrameLayout where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Canvas 5 | import frege.android.graphics.Region 6 | import frege.android.graphics.drawable.Drawable 7 | import frege.android.util.AttributeSet 8 | import frege.android.view.ViewGroup 9 | 10 | data FrameLayout_LayoutParams = pure native android.widget.FrameLayout.LayoutParams where 11 | 12 | pure native gravity ".gravity" :: FrameLayout_LayoutParams -> Int 13 | native new :: FrameLayout_LayoutParams -> ST s FrameLayout_LayoutParams 14 | | ViewGroup_MarginLayoutParams -> ST s FrameLayout_LayoutParams 15 | | ViewGroup_LayoutParams -> ST s FrameLayout_LayoutParams 16 | | Int -> Int -> Int -> ST s FrameLayout_LayoutParams 17 | | Int -> Int -> ST s FrameLayout_LayoutParams 18 | | MutableIO Context -> AttributeSet -> IO FrameLayout_LayoutParams 19 | {- -} 20 | 21 | data FrameLayout = native android.widget.FrameLayout where 22 | 23 | native new :: MutableIO Context -> IOMutable FrameLayout 24 | | MutableIO Context -> AttributeSet -> Int -> IOMutable FrameLayout 25 | | MutableIO Context -> AttributeSet -> IOMutable FrameLayout 26 | 27 | native draw :: MutableIO FrameLayout -> MutableIO Canvas -> IO () 28 | 29 | native gatherTransparentRegion :: MutableIO FrameLayout -> Region -> IO Bool 30 | 31 | native generateLayoutParams :: MutableIO FrameLayout -> AttributeSet -> IO FrameLayout_LayoutParams 32 | 33 | native getConsiderGoneChildrenWhenMeasuring :: MutableIO FrameLayout -> IO Bool 34 | 35 | native getForeground :: MutableIO FrameLayout -> IO Drawable 36 | 37 | native getForegroundGravity :: MutableIO FrameLayout -> IO Int 38 | 39 | native getMeasureAllChildren :: MutableIO FrameLayout -> IO Bool 40 | 41 | native jumpDrawablesToCurrentState :: MutableIO FrameLayout -> IO () 42 | 43 | native setForeground :: MutableIO FrameLayout -> Drawable -> IO () 44 | 45 | native setForegroundGravity :: MutableIO FrameLayout -> Int -> IO () 46 | 47 | native setMeasureAllChildren :: MutableIO FrameLayout -> Bool -> IO () 48 | 49 | native shouldDelayChildPressedState :: MutableIO FrameLayout -> IO Bool 50 | {- -} 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/frege/android/widget/HorizontalScrollView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.HorizontalScrollView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Canvas 5 | import frege.android.graphics.Rect 6 | import frege.android.os.Bundle 7 | import frege.android.util.AttributeSet 8 | import frege.android.view.KeyEvent 9 | import frege.android.view.MotionEvent 10 | import frege.android.view.View 11 | import frege.android.view.ViewGroup 12 | 13 | data HorizontalScrollView = native android.widget.HorizontalScrollView where 14 | 15 | native new :: MutableIO Context -> IOMutable HorizontalScrollView 16 | | MutableIO Context -> AttributeSet -> IOMutable HorizontalScrollView 17 | | MutableIO Context -> AttributeSet -> Int -> IOMutable HorizontalScrollView 18 | 19 | native addView :: MutableIO HorizontalScrollView -> MutableIO View -> ViewGroup_LayoutParams -> IO () 20 | | MutableIO HorizontalScrollView -> MutableIO View -> Int -> ViewGroup_LayoutParams -> IO () 21 | | MutableIO HorizontalScrollView -> MutableIO View -> Int -> IO () 22 | | MutableIO HorizontalScrollView -> MutableIO View -> IO () 23 | 24 | native arrowScroll :: MutableIO HorizontalScrollView -> Int -> IO Bool 25 | 26 | native computeScroll :: MutableIO HorizontalScrollView -> IO () 27 | 28 | native dispatchKeyEvent :: MutableIO HorizontalScrollView -> KeyEvent -> IO Bool 29 | 30 | native draw :: MutableIO HorizontalScrollView -> MutableIO Canvas -> IO () 31 | 32 | native executeKeyEvent :: MutableIO HorizontalScrollView -> KeyEvent -> IO Bool 33 | 34 | native fling :: MutableIO HorizontalScrollView -> Int -> IO () 35 | 36 | native fullScroll :: MutableIO HorizontalScrollView -> Int -> IO Bool 37 | 38 | native getMaxScrollAmount :: MutableIO HorizontalScrollView -> IO Int 39 | 40 | native isFillViewport :: MutableIO HorizontalScrollView -> IO Bool 41 | 42 | native isSmoothScrollingEnabled :: MutableIO HorizontalScrollView -> IO Bool 43 | 44 | native onGenericMotionEvent :: MutableIO HorizontalScrollView -> MutableIO MotionEvent -> IO Bool 45 | 46 | native onInterceptTouchEvent :: MutableIO HorizontalScrollView -> MutableIO MotionEvent -> IO Bool 47 | 48 | native onTouchEvent :: MutableIO HorizontalScrollView -> MutableIO MotionEvent -> IO Bool 49 | 50 | native pageScroll :: MutableIO HorizontalScrollView -> Int -> IO Bool 51 | 52 | native performAccessibilityAction :: MutableIO HorizontalScrollView -> Int -> Bundle -> IO Bool 53 | 54 | native requestChildFocus :: MutableIO HorizontalScrollView -> MutableIO View -> MutableIO View -> IO () 55 | 56 | native requestChildRectangleOnScreen :: MutableIO HorizontalScrollView -> MutableIO View -> MutableIO Rect -> Bool -> IO Bool 57 | 58 | native requestDisallowInterceptTouchEvent :: MutableIO HorizontalScrollView -> Bool -> IO () 59 | 60 | native requestLayout :: MutableIO HorizontalScrollView -> IO () 61 | 62 | native scrollTo :: MutableIO HorizontalScrollView -> Int -> Int -> IO () 63 | 64 | native setFillViewport :: MutableIO HorizontalScrollView -> Bool -> IO () 65 | 66 | native setOverScrollMode :: MutableIO HorizontalScrollView -> Int -> IO () 67 | 68 | native setSmoothScrollingEnabled :: MutableIO HorizontalScrollView -> Bool -> IO () 69 | 70 | native shouldDelayChildPressedState :: MutableIO HorizontalScrollView -> IO Bool 71 | 72 | native smoothScrollBy :: MutableIO HorizontalScrollView -> Int -> Int -> IO () 73 | 74 | native smoothScrollTo :: MutableIO HorizontalScrollView -> Int -> Int -> IO () 75 | {- -} 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/frege/android/widget/ImageButton.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.ImageButton where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | 6 | data ImageButton = native android.widget.ImageButton where 7 | 8 | native new :: MutableIO Context -> AttributeSet -> Int -> IOMutable ImageButton 9 | | MutableIO Context -> AttributeSet -> IOMutable ImageButton 10 | | MutableIO Context -> IOMutable ImageButton 11 | {- -} 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/frege/android/widget/ImageView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.ImageView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Bitmap 5 | import frege.android.graphics.ColorFilter 6 | import frege.android.graphics.Matrix 7 | import frege.android.graphics.PorterDuff 8 | import frege.android.graphics.drawable.Drawable 9 | import frege.android.net.Uri 10 | import frege.android.util.AttributeSet 11 | 12 | data ImageView_ScaleType = pure native android.widget.ImageView.ScaleType where 13 | 14 | pure native center android.widget.ImageView.ScaleType.CENTER :: ImageView_ScaleType 15 | pure native center_crop android.widget.ImageView.ScaleType.CENTER_CROP :: ImageView_ScaleType 16 | pure native center_inside android.widget.ImageView.ScaleType.CENTER_INSIDE :: ImageView_ScaleType 17 | pure native fit_center android.widget.ImageView.ScaleType.FIT_CENTER :: ImageView_ScaleType 18 | pure native fit_end android.widget.ImageView.ScaleType.FIT_END :: ImageView_ScaleType 19 | pure native fit_start android.widget.ImageView.ScaleType.FIT_START :: ImageView_ScaleType 20 | pure native fit_xy android.widget.ImageView.ScaleType.FIT_XY :: ImageView_ScaleType 21 | pure native matrix android.widget.ImageView.ScaleType.MATRIX :: ImageView_ScaleType 22 | 23 | pure native valueOf android.widget.ImageView.ScaleType.valueOf :: String -> ImageView_ScaleType 24 | {- derive Serializable ImageView_ScaleType -} 25 | 26 | data ImageView = native android.widget.ImageView where 27 | 28 | native new :: MutableIO Context -> IOMutable ImageView 29 | | MutableIO Context -> AttributeSet -> IOMutable ImageView 30 | | MutableIO Context -> AttributeSet -> Int -> IOMutable ImageView 31 | 32 | native clearColorFilter :: MutableIO ImageView -> IO () 33 | 34 | native getAdjustViewBounds :: MutableIO ImageView -> IO Bool 35 | 36 | native getBaseline :: MutableIO ImageView -> IO Int 37 | 38 | native getBaselineAlignBottom :: MutableIO ImageView -> IO Bool 39 | 40 | native getColorFilter :: MutableIO ImageView -> IO ColorFilter 41 | 42 | native getCropToPadding :: MutableIO ImageView -> IO Bool 43 | 44 | native getDrawable :: MutableIO ImageView -> IO Drawable 45 | 46 | native getImageAlpha :: MutableIO ImageView -> IO Int 47 | 48 | native getImageMatrix :: MutableIO ImageView -> IOMutable Matrix 49 | 50 | native getMaxHeight :: MutableIO ImageView -> IO Int 51 | 52 | native getMaxWidth :: MutableIO ImageView -> IO Int 53 | 54 | native getScaleType :: MutableIO ImageView -> IO ImageView_ScaleType 55 | 56 | native hasOverlappingRendering :: MutableIO ImageView -> IO Bool 57 | 58 | native invalidateDrawable :: MutableIO ImageView -> Drawable -> IO () 59 | 60 | native jumpDrawablesToCurrentState :: MutableIO ImageView -> IO () 61 | 62 | native onRtlPropertiesChanged :: MutableIO ImageView -> Int -> IO () 63 | 64 | native setAdjustViewBounds :: MutableIO ImageView -> Bool -> IO () 65 | 66 | native setAlpha :: MutableIO ImageView -> Int -> IO () 67 | 68 | native setBaseline :: MutableIO ImageView -> Int -> IO () 69 | 70 | native setBaselineAlignBottom :: MutableIO ImageView -> Bool -> IO () 71 | 72 | native setColorFilter :: MutableIO ImageView -> ColorFilter -> IO () 73 | | MutableIO ImageView -> Int -> IO () 74 | | MutableIO ImageView -> Int -> PorterDuff_Mode -> IO () 75 | 76 | native setCropToPadding :: MutableIO ImageView -> Bool -> IO () 77 | 78 | native setImageAlpha :: MutableIO ImageView -> Int -> IO () 79 | 80 | native setImageBitmap :: MutableIO ImageView -> Bitmap -> IO () 81 | 82 | native setImageDrawable :: MutableIO ImageView -> Drawable -> IO () 83 | 84 | native setImageLevel :: MutableIO ImageView -> Int -> IO () 85 | 86 | native setImageMatrix :: MutableIO ImageView -> MutableIO Matrix -> IO () 87 | 88 | native setImageResource :: MutableIO ImageView -> Int -> IO () 89 | 90 | native setImageURI :: MutableIO ImageView -> Uri -> IO () 91 | 92 | native setMaxHeight :: MutableIO ImageView -> Int -> IO () 93 | 94 | native setMaxWidth :: MutableIO ImageView -> Int -> IO () 95 | 96 | native setScaleType :: MutableIO ImageView -> ImageView_ScaleType -> IO () 97 | 98 | native setSelected :: MutableIO ImageView -> Bool -> IO () 99 | 100 | native setVisibility :: MutableIO ImageView -> Int -> IO () 101 | {- -} 102 | 103 | 104 | -------------------------------------------------------------------------------- /src/frege/android/widget/LinearLayout.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.LinearLayout where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.drawable.Drawable 5 | import frege.android.util.AttributeSet 6 | import frege.android.view.ViewGroup 7 | 8 | data LinearLayout_LayoutParams = pure native android.widget.LinearLayout.LayoutParams where 9 | 10 | pure native weight ".weight" :: LinearLayout_LayoutParams -> Float 11 | pure native gravity ".gravity" :: LinearLayout_LayoutParams -> Int 12 | native new :: LinearLayout_LayoutParams -> ST s LinearLayout_LayoutParams 13 | | ViewGroup_MarginLayoutParams -> ST s LinearLayout_LayoutParams 14 | | ViewGroup_LayoutParams -> ST s LinearLayout_LayoutParams 15 | | MutableIO Context -> AttributeSet -> IO LinearLayout_LayoutParams 16 | | Int -> Int -> ST s LinearLayout_LayoutParams 17 | | Int -> Int -> Float -> ST s LinearLayout_LayoutParams 18 | 19 | pure native debug :: LinearLayout_LayoutParams -> String -> String 20 | {- -} 21 | 22 | data LinearLayout = native android.widget.LinearLayout where 23 | 24 | pure native horizontal android.widget.LinearLayout.HORIZONTAL :: Int 25 | pure native vertical android.widget.LinearLayout.VERTICAL :: Int 26 | pure native show_divider_none android.widget.LinearLayout.SHOW_DIVIDER_NONE :: Int 27 | pure native show_divider_beginning android.widget.LinearLayout.SHOW_DIVIDER_BEGINNING :: Int 28 | pure native show_divider_middle android.widget.LinearLayout.SHOW_DIVIDER_MIDDLE :: Int 29 | pure native show_divider_end android.widget.LinearLayout.SHOW_DIVIDER_END :: Int 30 | native new :: MutableIO Context -> AttributeSet -> Int -> IOMutable LinearLayout 31 | | MutableIO Context -> AttributeSet -> IOMutable LinearLayout 32 | | MutableIO Context -> IOMutable LinearLayout 33 | 34 | native generateLayoutParams :: MutableIO LinearLayout -> AttributeSet -> IO LinearLayout_LayoutParams 35 | 36 | native getBaseline :: MutableIO LinearLayout -> IO Int 37 | 38 | native getBaselineAlignedChildIndex :: MutableIO LinearLayout -> IO Int 39 | 40 | native getDividerDrawable :: MutableIO LinearLayout -> IO Drawable 41 | 42 | native getDividerPadding :: MutableIO LinearLayout -> IO Int 43 | 44 | native getOrientation :: MutableIO LinearLayout -> IO Int 45 | 46 | native getShowDividers :: MutableIO LinearLayout -> IO Int 47 | 48 | native getWeightSum :: MutableIO LinearLayout -> IO Float 49 | 50 | native isBaselineAligned :: MutableIO LinearLayout -> IO Bool 51 | 52 | native isMeasureWithLargestChildEnabled :: MutableIO LinearLayout -> IO Bool 53 | 54 | native setBaselineAligned :: MutableIO LinearLayout -> Bool -> IO () 55 | 56 | native setBaselineAlignedChildIndex :: MutableIO LinearLayout -> Int -> IO () 57 | 58 | native setDividerDrawable :: MutableIO LinearLayout -> Drawable -> IO () 59 | 60 | native setDividerPadding :: MutableIO LinearLayout -> Int -> IO () 61 | 62 | native setGravity :: MutableIO LinearLayout -> Int -> IO () 63 | 64 | native setHorizontalGravity :: MutableIO LinearLayout -> Int -> IO () 65 | 66 | native setMeasureWithLargestChildEnabled :: MutableIO LinearLayout -> Bool -> IO () 67 | 68 | native setOrientation :: MutableIO LinearLayout -> Int -> IO () 69 | 70 | native setShowDividers :: MutableIO LinearLayout -> Int -> IO () 71 | 72 | native setVerticalGravity :: MutableIO LinearLayout -> Int -> IO () 73 | 74 | native setWeightSum :: MutableIO LinearLayout -> Float -> IO () 75 | 76 | native shouldDelayChildPressedState :: MutableIO LinearLayout -> IO Bool 77 | {- -} 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/frege/android/widget/MediaController.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.MediaController where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | import frege.android.view.KeyEvent 6 | import frege.android.view.MotionEvent 7 | import frege.android.view.View 8 | 9 | data MediaController_MediaPlayerControl = pure native android.widget.MediaController.MediaPlayerControl where 10 | 11 | 12 | pure native canPause :: MediaController_MediaPlayerControl -> Bool 13 | 14 | pure native canSeekBackward :: MediaController_MediaPlayerControl -> Bool 15 | 16 | pure native canSeekForward :: MediaController_MediaPlayerControl -> Bool 17 | 18 | pure native getAudioSessionId :: MediaController_MediaPlayerControl -> Int 19 | 20 | pure native getBufferPercentage :: MediaController_MediaPlayerControl -> Int 21 | 22 | pure native getCurrentPosition :: MediaController_MediaPlayerControl -> Int 23 | 24 | pure native getDuration :: MediaController_MediaPlayerControl -> Int 25 | 26 | pure native isPlaying :: MediaController_MediaPlayerControl -> Bool 27 | 28 | native pause :: MediaController_MediaPlayerControl -> ST s () 29 | 30 | native seekTo :: MediaController_MediaPlayerControl -> Int -> ST s () 31 | 32 | native start :: MediaController_MediaPlayerControl -> ST s () 33 | {- -} 34 | 35 | data MediaController = native android.widget.MediaController where 36 | 37 | native new :: MutableIO Context -> AttributeSet -> IOMutable MediaController 38 | | MutableIO Context -> Bool -> IOMutable MediaController 39 | | MutableIO Context -> IOMutable MediaController 40 | 41 | native dispatchKeyEvent :: MutableIO MediaController -> KeyEvent -> IO Bool 42 | 43 | native hide :: MutableIO MediaController -> IO () 44 | 45 | native isShowing :: MutableIO MediaController -> IO Bool 46 | 47 | native onFinishInflate :: MutableIO MediaController -> IO () 48 | 49 | native onTouchEvent :: MutableIO MediaController -> MutableIO MotionEvent -> IO Bool 50 | 51 | native onTrackballEvent :: MutableIO MediaController -> MutableIO MotionEvent -> IO Bool 52 | 53 | native setAnchorView :: MutableIO MediaController -> MutableIO View -> IO () 54 | 55 | native setEnabled :: MutableIO MediaController -> Bool -> IO () 56 | 57 | native setMediaPlayer :: MutableIO MediaController -> MediaController_MediaPlayerControl -> IO () 58 | 59 | native setPrevNextListeners :: MutableIO MediaController -> View_OnClickListener -> View_OnClickListener -> IO () 60 | 61 | native show :: MutableIO MediaController -> IO () 62 | | MutableIO MediaController -> Int -> IO () 63 | {- -} 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/frege/android/widget/NumberPicker.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.NumberPicker where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | import frege.android.view.KeyEvent 6 | import frege.android.view.MotionEvent 7 | 8 | data NumberPicker_Formatter = pure native android.widget.NumberPicker.Formatter where 9 | 10 | 11 | pure native format :: NumberPicker_Formatter -> Int -> String 12 | {- -} 13 | 14 | data NumberPicker_OnScrollListener = pure native android.widget.NumberPicker.OnScrollListener where 15 | 16 | pure native scroll_state_idle android.widget.NumberPicker.OnScrollListener.SCROLL_STATE_IDLE :: Int 17 | pure native scroll_state_touch_scroll android.widget.NumberPicker.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL :: Int 18 | pure native scroll_state_fling android.widget.NumberPicker.OnScrollListener.SCROLL_STATE_FLING :: Int 19 | 20 | native onScrollStateChange :: NumberPicker_OnScrollListener -> MutableIO NumberPicker -> Int -> IO () 21 | {- -} 22 | 23 | data NumberPicker_OnValueChangeListener = pure native android.widget.NumberPicker.OnValueChangeListener where 24 | 25 | 26 | native onValueChange :: NumberPicker_OnValueChangeListener -> MutableIO NumberPicker -> Int -> Int -> IO () 27 | {- -} 28 | 29 | data NumberPicker = native android.widget.NumberPicker where 30 | 31 | native new :: MutableIO Context -> AttributeSet -> Int -> IOMutable NumberPicker 32 | | MutableIO Context -> AttributeSet -> IOMutable NumberPicker 33 | | MutableIO Context -> IOMutable NumberPicker 34 | 35 | native computeScroll :: MutableIO NumberPicker -> IO () 36 | 37 | native dispatchKeyEvent :: MutableIO NumberPicker -> KeyEvent -> IO Bool 38 | 39 | native dispatchTouchEvent :: MutableIO NumberPicker -> MutableIO MotionEvent -> IO Bool 40 | 41 | native dispatchTrackballEvent :: MutableIO NumberPicker -> MutableIO MotionEvent -> IO Bool 42 | 43 | native getMaxValue :: MutableIO NumberPicker -> IO Int 44 | 45 | native getMinValue :: MutableIO NumberPicker -> IO Int 46 | 47 | native getSolidColor :: MutableIO NumberPicker -> IO Int 48 | 49 | native getValue :: MutableIO NumberPicker -> IO Int 50 | 51 | native getWrapSelectorWheel :: MutableIO NumberPicker -> IO Bool 52 | 53 | native onInterceptTouchEvent :: MutableIO NumberPicker -> MutableIO MotionEvent -> IO Bool 54 | 55 | native onTouchEvent :: MutableIO NumberPicker -> MutableIO MotionEvent -> IO Bool 56 | 57 | native performClick :: MutableIO NumberPicker -> IO Bool 58 | 59 | native performLongClick :: MutableIO NumberPicker -> IO Bool 60 | 61 | native scrollBy :: MutableIO NumberPicker -> Int -> Int -> IO () 62 | 63 | native setEnabled :: MutableIO NumberPicker -> Bool -> IO () 64 | 65 | native setFormatter :: MutableIO NumberPicker -> NumberPicker_Formatter -> IO () 66 | 67 | native setMaxValue :: MutableIO NumberPicker -> Int -> IO () 68 | 69 | native setMinValue :: MutableIO NumberPicker -> Int -> IO () 70 | 71 | native setOnLongPressUpdateInterval :: MutableIO NumberPicker -> Long -> IO () 72 | 73 | native setOnScrollListener :: MutableIO NumberPicker -> NumberPicker_OnScrollListener -> IO () 74 | 75 | native setOnValueChangedListener :: MutableIO NumberPicker -> NumberPicker_OnValueChangeListener -> IO () 76 | 77 | native setValue :: MutableIO NumberPicker -> Int -> IO () 78 | 79 | native setWrapSelectorWheel :: MutableIO NumberPicker -> Bool -> IO () 80 | {- -} 81 | 82 | 83 | -------------------------------------------------------------------------------- /src/frege/android/widget/ProgressBar.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.ProgressBar where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.drawable.Drawable 5 | import frege.android.util.AttributeSet 6 | 7 | data ProgressBar = native android.widget.ProgressBar where 8 | 9 | native new :: MutableIO Context -> IOMutable ProgressBar 10 | | MutableIO Context -> AttributeSet -> IOMutable ProgressBar 11 | | MutableIO Context -> AttributeSet -> Int -> IOMutable ProgressBar 12 | 13 | native getIndeterminateDrawable :: MutableIO ProgressBar -> IO Drawable 14 | 15 | native getMax :: MutableIO ProgressBar -> IO Int 16 | 17 | native getProgress :: MutableIO ProgressBar -> IO Int 18 | 19 | native getProgressDrawable :: MutableIO ProgressBar -> IO Drawable 20 | 21 | native getSecondaryProgress :: MutableIO ProgressBar -> IO Int 22 | 23 | native incrementProgressBy :: MutableIO ProgressBar -> Int -> IO () 24 | 25 | native incrementSecondaryProgressBy :: MutableIO ProgressBar -> Int -> IO () 26 | 27 | native invalidateDrawable :: MutableIO ProgressBar -> Drawable -> IO () 28 | 29 | native isIndeterminate :: MutableIO ProgressBar -> IO Bool 30 | 31 | native jumpDrawablesToCurrentState :: MutableIO ProgressBar -> IO () 32 | 33 | native postInvalidate :: MutableIO ProgressBar -> IO () 34 | 35 | native setIndeterminate :: MutableIO ProgressBar -> Bool -> IO () 36 | 37 | native setIndeterminateDrawable :: MutableIO ProgressBar -> Drawable -> IO () 38 | 39 | native setInterpolator :: MutableIO ProgressBar -> MutableIO Context -> Int -> IO () 40 | 41 | native setMax :: MutableIO ProgressBar -> Int -> IO () 42 | 43 | native setProgress :: MutableIO ProgressBar -> Int -> IO () 44 | 45 | native setProgressDrawable :: MutableIO ProgressBar -> Drawable -> IO () 46 | 47 | native setSecondaryProgress :: MutableIO ProgressBar -> Int -> IO () 48 | 49 | native setVisibility :: MutableIO ProgressBar -> Int -> IO () 50 | {- -} 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/frege/android/widget/RelativeLayout.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.RelativeLayout where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | import frege.android.view.ViewGroup 6 | 7 | data RelativeLayout_LayoutParams = pure native android.widget.RelativeLayout.LayoutParams where 8 | 9 | pure native alignwithparent ".alignWithParent" :: RelativeLayout_LayoutParams -> Bool 10 | native new :: MutableIO Context -> AttributeSet -> IO RelativeLayout_LayoutParams 11 | | Int -> Int -> ST s RelativeLayout_LayoutParams 12 | | ViewGroup_LayoutParams -> ST s RelativeLayout_LayoutParams 13 | | ViewGroup_MarginLayoutParams -> ST s RelativeLayout_LayoutParams 14 | | RelativeLayout_LayoutParams -> ST s RelativeLayout_LayoutParams 15 | 16 | native addRule :: RelativeLayout_LayoutParams -> Int -> ST s () 17 | | RelativeLayout_LayoutParams -> Int -> Int -> ST s () 18 | 19 | pure native debug :: RelativeLayout_LayoutParams -> String -> String 20 | 21 | native removeRule :: RelativeLayout_LayoutParams -> Int -> ST s () 22 | 23 | native resolveLayoutDirection :: RelativeLayout_LayoutParams -> Int -> ST s () 24 | {- -} 25 | 26 | data RelativeLayout = native android.widget.RelativeLayout where 27 | 28 | pure native true_ android.widget.RelativeLayout.TRUE :: Int 29 | pure native left_of android.widget.RelativeLayout.LEFT_OF :: Int 30 | pure native right_of android.widget.RelativeLayout.RIGHT_OF :: Int 31 | pure native above android.widget.RelativeLayout.ABOVE :: Int 32 | pure native below android.widget.RelativeLayout.BELOW :: Int 33 | pure native align_baseline android.widget.RelativeLayout.ALIGN_BASELINE :: Int 34 | pure native align_left android.widget.RelativeLayout.ALIGN_LEFT :: Int 35 | pure native align_top android.widget.RelativeLayout.ALIGN_TOP :: Int 36 | pure native align_right android.widget.RelativeLayout.ALIGN_RIGHT :: Int 37 | pure native align_bottom android.widget.RelativeLayout.ALIGN_BOTTOM :: Int 38 | pure native align_parent_left android.widget.RelativeLayout.ALIGN_PARENT_LEFT :: Int 39 | pure native align_parent_top android.widget.RelativeLayout.ALIGN_PARENT_TOP :: Int 40 | pure native align_parent_right android.widget.RelativeLayout.ALIGN_PARENT_RIGHT :: Int 41 | pure native align_parent_bottom android.widget.RelativeLayout.ALIGN_PARENT_BOTTOM :: Int 42 | pure native center_in_parent android.widget.RelativeLayout.CENTER_IN_PARENT :: Int 43 | pure native center_horizontal android.widget.RelativeLayout.CENTER_HORIZONTAL :: Int 44 | pure native center_vertical android.widget.RelativeLayout.CENTER_VERTICAL :: Int 45 | pure native start_of android.widget.RelativeLayout.START_OF :: Int 46 | pure native end_of android.widget.RelativeLayout.END_OF :: Int 47 | pure native align_start android.widget.RelativeLayout.ALIGN_START :: Int 48 | pure native align_end android.widget.RelativeLayout.ALIGN_END :: Int 49 | pure native align_parent_start android.widget.RelativeLayout.ALIGN_PARENT_START :: Int 50 | pure native align_parent_end android.widget.RelativeLayout.ALIGN_PARENT_END :: Int 51 | native new :: MutableIO Context -> IOMutable RelativeLayout 52 | | MutableIO Context -> AttributeSet -> IOMutable RelativeLayout 53 | | MutableIO Context -> AttributeSet -> Int -> IOMutable RelativeLayout 54 | 55 | native generateLayoutParams :: MutableIO RelativeLayout -> AttributeSet -> IO RelativeLayout_LayoutParams 56 | 57 | native getBaseline :: MutableIO RelativeLayout -> IO Int 58 | 59 | native getGravity :: MutableIO RelativeLayout -> IO Int 60 | 61 | native requestLayout :: MutableIO RelativeLayout -> IO () 62 | 63 | native setGravity :: MutableIO RelativeLayout -> Int -> IO () 64 | 65 | native setHorizontalGravity :: MutableIO RelativeLayout -> Int -> IO () 66 | 67 | native setIgnoreGravity :: MutableIO RelativeLayout -> Int -> IO () 68 | 69 | native setVerticalGravity :: MutableIO RelativeLayout -> Int -> IO () 70 | 71 | native shouldDelayChildPressedState :: MutableIO RelativeLayout -> IO Bool 72 | {- -} 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/frege/android/widget/SeekBar.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.SeekBar where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | 6 | data SeekBar_OnSeekBarChangeListener = pure native android.widget.SeekBar.OnSeekBarChangeListener where 7 | 8 | 9 | native onProgressChanged :: SeekBar_OnSeekBarChangeListener -> MutableIO SeekBar -> Int -> Bool -> IO () 10 | 11 | native onStartTrackingTouch :: SeekBar_OnSeekBarChangeListener -> MutableIO SeekBar -> IO () 12 | 13 | native onStopTrackingTouch :: SeekBar_OnSeekBarChangeListener -> MutableIO SeekBar -> IO () 14 | {- -} 15 | 16 | data SeekBar = native android.widget.SeekBar where 17 | 18 | native new :: MutableIO Context -> AttributeSet -> Int -> IOMutable SeekBar 19 | | MutableIO Context -> AttributeSet -> IOMutable SeekBar 20 | | MutableIO Context -> IOMutable SeekBar 21 | 22 | native setOnSeekBarChangeListener :: MutableIO SeekBar -> SeekBar_OnSeekBarChangeListener -> IO () 23 | {- -} 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/frege/android/widget/StackView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.StackView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.os.Bundle 5 | import frege.android.util.AttributeSet 6 | import frege.android.view.MotionEvent 7 | 8 | data StackView = native android.widget.StackView where 9 | 10 | native new :: MutableIO Context -> AttributeSet -> IOMutable StackView 11 | | MutableIO Context -> IOMutable StackView 12 | | MutableIO Context -> AttributeSet -> Int -> IOMutable StackView 13 | 14 | native advance :: MutableIO StackView -> IO () 15 | 16 | native onGenericMotionEvent :: MutableIO StackView -> MutableIO MotionEvent -> IO Bool 17 | 18 | native onInterceptTouchEvent :: MutableIO StackView -> MutableIO MotionEvent -> IO Bool 19 | 20 | native onTouchEvent :: MutableIO StackView -> MutableIO MotionEvent -> IO Bool 21 | 22 | native performAccessibilityAction :: MutableIO StackView -> Int -> Bundle -> IO Bool 23 | 24 | native showNext :: MutableIO StackView -> IO () 25 | 26 | native showPrevious :: MutableIO StackView -> IO () 27 | {- -} 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/frege/android/widget/TextView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.TextView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Rect 5 | import frege.android.graphics.Typeface 6 | import frege.android.graphics.drawable.Drawable 7 | import frege.android.os.Bundle 8 | import frege.android.text.Editable 9 | import frege.android.text.Spannable 10 | import frege.android.text.TextUtils 11 | import frege.android.util.AttributeSet 12 | import frege.android.view.ActionMode 13 | import frege.android.view.DragEvent 14 | import frege.android.view.KeyEvent 15 | import frege.android.view.MotionEvent 16 | import frege.android.widget.Scroller 17 | import frege.java.util.Locale 18 | 19 | data TextView_BufferType = pure native android.widget.TextView.BufferType where 20 | 21 | pure native editable android.widget.TextView.BufferType.EDITABLE :: TextView_BufferType 22 | pure native normal android.widget.TextView.BufferType.NORMAL :: TextView_BufferType 23 | pure native spannable android.widget.TextView.BufferType.SPANNABLE :: TextView_BufferType 24 | 25 | pure native valueOf android.widget.TextView.BufferType.valueOf :: String -> TextView_BufferType 26 | {- derive Serializable TextView_BufferType -} 27 | 28 | data TextView_OnEditorActionListener = pure native android.widget.TextView.OnEditorActionListener where 29 | 30 | 31 | native onEditorAction :: TextView_OnEditorActionListener -> MutableIO TextView -> Int -> KeyEvent -> IO Bool 32 | {- -} 33 | 34 | data TextView = native android.widget.TextView where 35 | 36 | native new :: MutableIO Context -> AttributeSet -> IOMutable TextView 37 | | MutableIO Context -> AttributeSet -> Int -> IOMutable TextView 38 | | MutableIO Context -> IOMutable TextView 39 | 40 | native append :: MutableIO TextView -> CharSequence -> IO () 41 | | MutableIO TextView -> CharSequence -> Int -> Int -> IO () 42 | 43 | native beginBatchEdit :: MutableIO TextView -> IO () 44 | 45 | native bringPointIntoView :: MutableIO TextView -> Int -> IO Bool 46 | 47 | native cancelLongPress :: MutableIO TextView -> IO () 48 | 49 | native clearComposingText :: MutableIO TextView -> IO () 50 | 51 | native computeScroll :: MutableIO TextView -> IO () 52 | 53 | native debug :: MutableIO TextView -> Int -> IO () 54 | 55 | native didTouchFocusSelect :: MutableIO TextView -> IO Bool 56 | 57 | native endBatchEdit :: MutableIO TextView -> IO () 58 | 59 | native getAutoLinkMask :: MutableIO TextView -> IO Int 60 | 61 | native getBaseline :: MutableIO TextView -> IO Int 62 | 63 | native getCompoundDrawablePadding :: MutableIO TextView -> IO Int 64 | 65 | native getCompoundPaddingBottom :: MutableIO TextView -> IO Int 66 | 67 | native getCompoundPaddingEnd :: MutableIO TextView -> IO Int 68 | 69 | native getCompoundPaddingLeft :: MutableIO TextView -> IO Int 70 | 71 | native getCompoundPaddingRight :: MutableIO TextView -> IO Int 72 | 73 | native getCompoundPaddingStart :: MutableIO TextView -> IO Int 74 | 75 | native getCompoundPaddingTop :: MutableIO TextView -> IO Int 76 | 77 | native getCurrentHintTextColor :: MutableIO TextView -> IO Int 78 | 79 | native getCurrentTextColor :: MutableIO TextView -> IO Int 80 | 81 | native getCustomSelectionActionModeCallback :: MutableIO TextView -> IO ActionMode_Callback 82 | 83 | native getEditableText :: MutableIO TextView -> IO Editable 84 | 85 | native getEllipsize :: MutableIO TextView -> IO TextUtils_TruncateAt 86 | 87 | native getError :: MutableIO TextView -> IO CharSequence 88 | 89 | native getExtendedPaddingBottom :: MutableIO TextView -> IO Int 90 | 91 | native getExtendedPaddingTop :: MutableIO TextView -> IO Int 92 | 93 | native getFocusedRect :: MutableIO TextView -> MutableIO Rect -> IO () 94 | 95 | native getFreezesText :: MutableIO TextView -> IO Bool 96 | 97 | native getGravity :: MutableIO TextView -> IO Int 98 | 99 | native getHighlightColor :: MutableIO TextView -> IO Int 100 | 101 | native getHint :: MutableIO TextView -> IO CharSequence 102 | 103 | native getImeActionId :: MutableIO TextView -> IO Int 104 | 105 | native getImeActionLabel :: MutableIO TextView -> IO CharSequence 106 | 107 | native getImeOptions :: MutableIO TextView -> IO Int 108 | 109 | native getIncludeFontPadding :: MutableIO TextView -> IO Bool 110 | 111 | native getInputExtras :: MutableIO TextView -> Bool -> IO Bundle 112 | 113 | native getInputType :: MutableIO TextView -> IO Int 114 | 115 | native getLineBounds :: MutableIO TextView -> Int -> MutableIO Rect -> IO Int 116 | 117 | native getLineCount :: MutableIO TextView -> IO Int 118 | 119 | native getLineHeight :: MutableIO TextView -> IO Int 120 | 121 | native getLineSpacingExtra :: MutableIO TextView -> IO Float 122 | 123 | native getLineSpacingMultiplier :: MutableIO TextView -> IO Float 124 | 125 | native getLinksClickable :: MutableIO TextView -> IO Bool 126 | 127 | native getMarqueeRepeatLimit :: MutableIO TextView -> IO Int 128 | 129 | native getMaxEms :: MutableIO TextView -> IO Int 130 | 131 | native getMaxHeight :: MutableIO TextView -> IO Int 132 | 133 | native getMaxLines :: MutableIO TextView -> IO Int 134 | 135 | native getMaxWidth :: MutableIO TextView -> IO Int 136 | 137 | native getMinEms :: MutableIO TextView -> IO Int 138 | 139 | native getMinHeight :: MutableIO TextView -> IO Int 140 | 141 | native getMinLines :: MutableIO TextView -> IO Int 142 | 143 | native getMinWidth :: MutableIO TextView -> IO Int 144 | 145 | native getOffsetForPosition :: MutableIO TextView -> Float -> Float -> IO Int 146 | 147 | native getPaintFlags :: MutableIO TextView -> IO Int 148 | 149 | native getPrivateImeOptions :: MutableIO TextView -> IO String 150 | 151 | native getSelectionEnd :: MutableIO TextView -> IO Int 152 | 153 | native getSelectionStart :: MutableIO TextView -> IO Int 154 | 155 | native getShadowColor :: MutableIO TextView -> IO Int 156 | 157 | native getShadowDx :: MutableIO TextView -> IO Float 158 | 159 | native getShadowDy :: MutableIO TextView -> IO Float 160 | 161 | native getShadowRadius :: MutableIO TextView -> IO Float 162 | 163 | native getText :: MutableIO TextView -> IO CharSequence 164 | 165 | native getTextLocale :: MutableIO TextView -> IO Locale 166 | 167 | native getTextScaleX :: MutableIO TextView -> IO Float 168 | 169 | native getTextSize :: MutableIO TextView -> IO Float 170 | 171 | native getTotalPaddingBottom :: MutableIO TextView -> IO Int 172 | 173 | native getTotalPaddingEnd :: MutableIO TextView -> IO Int 174 | 175 | native getTotalPaddingLeft :: MutableIO TextView -> IO Int 176 | 177 | native getTotalPaddingRight :: MutableIO TextView -> IO Int 178 | 179 | native getTotalPaddingStart :: MutableIO TextView -> IO Int 180 | 181 | native getTotalPaddingTop :: MutableIO TextView -> IO Int 182 | 183 | native getTypeface :: MutableIO TextView -> IO Typeface 184 | 185 | native hasOverlappingRendering :: MutableIO TextView -> IO Bool 186 | 187 | native hasSelection :: MutableIO TextView -> IO Bool 188 | 189 | native invalidateDrawable :: MutableIO TextView -> Drawable -> IO () 190 | 191 | native isCursorVisible :: MutableIO TextView -> IO Bool 192 | 193 | native isInputMethodTarget :: MutableIO TextView -> IO Bool 194 | 195 | native isSuggestionsEnabled :: MutableIO TextView -> IO Bool 196 | 197 | native isTextSelectable :: MutableIO TextView -> IO Bool 198 | 199 | native jumpDrawablesToCurrentState :: MutableIO TextView -> IO () 200 | 201 | native length :: MutableIO TextView -> IO Int 202 | 203 | native moveCursorToVisibleOffset :: MutableIO TextView -> IO Bool 204 | 205 | native onBeginBatchEdit :: MutableIO TextView -> IO () 206 | 207 | native onCheckIsTextEditor :: MutableIO TextView -> IO Bool 208 | 209 | native onDragEvent :: MutableIO TextView -> MutableIO DragEvent -> IO Bool 210 | 211 | native onEditorAction :: MutableIO TextView -> Int -> IO () 212 | 213 | native onEndBatchEdit :: MutableIO TextView -> IO () 214 | 215 | native onFinishTemporaryDetach :: MutableIO TextView -> IO () 216 | 217 | native onGenericMotionEvent :: MutableIO TextView -> MutableIO MotionEvent -> IO Bool 218 | 219 | native onKeyDown :: MutableIO TextView -> Int -> KeyEvent -> IO Bool 220 | 221 | native onKeyMultiple :: MutableIO TextView -> Int -> Int -> KeyEvent -> IO Bool 222 | 223 | native onKeyPreIme :: MutableIO TextView -> Int -> KeyEvent -> IO Bool 224 | 225 | native onKeyShortcut :: MutableIO TextView -> Int -> KeyEvent -> IO Bool 226 | 227 | native onKeyUp :: MutableIO TextView -> Int -> KeyEvent -> IO Bool 228 | 229 | native onPreDraw :: MutableIO TextView -> IO Bool 230 | 231 | native onPrivateIMECommand :: MutableIO TextView -> String -> Bundle -> IO Bool 232 | 233 | native onRtlPropertiesChanged :: MutableIO TextView -> Int -> IO () 234 | 235 | native onScreenStateChanged :: MutableIO TextView -> Int -> IO () 236 | 237 | native onStartTemporaryDetach :: MutableIO TextView -> IO () 238 | 239 | native onTextContextMenuItem :: MutableIO TextView -> Int -> IO Bool 240 | 241 | native onTouchEvent :: MutableIO TextView -> MutableIO MotionEvent -> IO Bool 242 | 243 | native onTrackballEvent :: MutableIO TextView -> MutableIO MotionEvent -> IO Bool 244 | 245 | native onWindowFocusChanged :: MutableIO TextView -> Bool -> IO () 246 | 247 | native performAccessibilityAction :: MutableIO TextView -> Int -> Bundle -> IO Bool 248 | 249 | native performLongClick :: MutableIO TextView -> IO Bool 250 | 251 | native sendAccessibilityEvent :: MutableIO TextView -> Int -> IO () 252 | 253 | native setAllCaps :: MutableIO TextView -> Bool -> IO () 254 | 255 | native setAutoLinkMask :: MutableIO TextView -> Int -> IO () 256 | 257 | native setCompoundDrawablePadding :: MutableIO TextView -> Int -> IO () 258 | 259 | native setCompoundDrawables :: MutableIO TextView -> Drawable -> Drawable -> Drawable -> Drawable -> IO () 260 | 261 | native setCompoundDrawablesRelative :: MutableIO TextView -> Drawable -> Drawable -> Drawable -> Drawable -> IO () 262 | 263 | native setCompoundDrawablesRelativeWithIntrinsicBounds :: MutableIO TextView -> Drawable -> Drawable -> Drawable -> Drawable -> IO () 264 | | MutableIO TextView -> Int -> Int -> Int -> Int -> IO () 265 | 266 | native setCompoundDrawablesWithIntrinsicBounds :: MutableIO TextView -> Drawable -> Drawable -> Drawable -> Drawable -> IO () 267 | | MutableIO TextView -> Int -> Int -> Int -> Int -> IO () 268 | 269 | native setCursorVisible :: MutableIO TextView -> Bool -> IO () 270 | 271 | native setCustomSelectionActionModeCallback :: MutableIO TextView -> ActionMode_Callback -> IO () 272 | 273 | native setEditableFactory :: MutableIO TextView -> Editable_Factory -> IO () 274 | 275 | native setEllipsize :: MutableIO TextView -> TextUtils_TruncateAt -> IO () 276 | 277 | native setEms :: MutableIO TextView -> Int -> IO () 278 | 279 | native setEnabled :: MutableIO TextView -> Bool -> IO () 280 | 281 | native setError :: MutableIO TextView -> CharSequence -> IO () 282 | | MutableIO TextView -> CharSequence -> Drawable -> IO () 283 | 284 | native setFreezesText :: MutableIO TextView -> Bool -> IO () 285 | 286 | native setGravity :: MutableIO TextView -> Int -> IO () 287 | 288 | native setHeight :: MutableIO TextView -> Int -> IO () 289 | 290 | native setHighlightColor :: MutableIO TextView -> Int -> IO () 291 | 292 | native setHint :: MutableIO TextView -> CharSequence -> IO () 293 | | MutableIO TextView -> Int -> IO () 294 | 295 | native setHintTextColor :: MutableIO TextView -> Int -> IO () 296 | 297 | native setHorizontallyScrolling :: MutableIO TextView -> Bool -> IO () 298 | 299 | native setImeActionLabel :: MutableIO TextView -> CharSequence -> Int -> IO () 300 | 301 | native setImeOptions :: MutableIO TextView -> Int -> IO () 302 | 303 | native setIncludeFontPadding :: MutableIO TextView -> Bool -> IO () 304 | 305 | native setInputType :: MutableIO TextView -> Int -> IO () 306 | 307 | native setLineSpacing :: MutableIO TextView -> Float -> Float -> IO () 308 | 309 | native setLines :: MutableIO TextView -> Int -> IO () 310 | 311 | native setLinkTextColor :: MutableIO TextView -> Int -> IO () 312 | 313 | native setLinksClickable :: MutableIO TextView -> Bool -> IO () 314 | 315 | native setMarqueeRepeatLimit :: MutableIO TextView -> Int -> IO () 316 | 317 | native setMaxEms :: MutableIO TextView -> Int -> IO () 318 | 319 | native setMaxHeight :: MutableIO TextView -> Int -> IO () 320 | 321 | native setMaxLines :: MutableIO TextView -> Int -> IO () 322 | 323 | native setMaxWidth :: MutableIO TextView -> Int -> IO () 324 | 325 | native setMinEms :: MutableIO TextView -> Int -> IO () 326 | 327 | native setMinHeight :: MutableIO TextView -> Int -> IO () 328 | 329 | native setMinLines :: MutableIO TextView -> Int -> IO () 330 | 331 | native setMinWidth :: MutableIO TextView -> Int -> IO () 332 | 333 | native setOnEditorActionListener :: MutableIO TextView -> TextView_OnEditorActionListener -> IO () 334 | 335 | native setPadding :: MutableIO TextView -> Int -> Int -> Int -> Int -> IO () 336 | 337 | native setPaddingRelative :: MutableIO TextView -> Int -> Int -> Int -> Int -> IO () 338 | 339 | native setPaintFlags :: MutableIO TextView -> Int -> IO () 340 | 341 | native setPrivateImeOptions :: MutableIO TextView -> String -> IO () 342 | 343 | native setRawInputType :: MutableIO TextView -> Int -> IO () 344 | 345 | native setScroller :: MutableIO TextView -> MutableIO Scroller -> IO () 346 | 347 | native setSelectAllOnFocus :: MutableIO TextView -> Bool -> IO () 348 | 349 | native setSelected :: MutableIO TextView -> Bool -> IO () 350 | 351 | native setShadowLayer :: MutableIO TextView -> Float -> Float -> Float -> Int -> IO () 352 | 353 | native setSingleLine :: MutableIO TextView -> Bool -> IO () 354 | | MutableIO TextView -> IO () 355 | 356 | native setSpannableFactory :: MutableIO TextView -> Spannable_Factory -> IO () 357 | 358 | native setText :: MutableIO TextView -> CharSequence -> IO () 359 | | MutableIO TextView -> CharSequence -> TextView_BufferType -> IO () 360 | | MutableIO TextView -> Int -> IO () 361 | | MutableIO TextView -> Int -> TextView_BufferType -> IO () 362 | 363 | native setTextAppearance :: MutableIO TextView -> MutableIO Context -> Int -> IO () 364 | 365 | native setTextColor :: MutableIO TextView -> Int -> IO () 366 | 367 | native setTextIsSelectable :: MutableIO TextView -> Bool -> IO () 368 | 369 | native setTextKeepState :: MutableIO TextView -> CharSequence -> TextView_BufferType -> IO () 370 | | MutableIO TextView -> CharSequence -> IO () 371 | 372 | native setTextLocale :: MutableIO TextView -> Locale -> IO () 373 | 374 | native setTextScaleX :: MutableIO TextView -> Float -> IO () 375 | 376 | native setTextSize :: MutableIO TextView -> Float -> IO () 377 | | MutableIO TextView -> Int -> Float -> IO () 378 | 379 | native setTypeface :: MutableIO TextView -> Typeface -> IO () 380 | | MutableIO TextView -> Typeface -> Int -> IO () 381 | 382 | native setWidth :: MutableIO TextView -> Int -> IO () 383 | {- -} 384 | 385 | 386 | -------------------------------------------------------------------------------- /src/frege/android/widget/TimePicker.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.TimePicker where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | 6 | data TimePicker_OnTimeChangedListener = pure native android.widget.TimePicker.OnTimeChangedListener where 7 | 8 | 9 | native onTimeChanged :: TimePicker_OnTimeChangedListener -> MutableIO TimePicker -> Int -> Int -> IO () 10 | {- -} 11 | 12 | data TimePicker = native android.widget.TimePicker where 13 | 14 | native new :: MutableIO Context -> AttributeSet -> Int -> IOMutable TimePicker 15 | | MutableIO Context -> AttributeSet -> IOMutable TimePicker 16 | | MutableIO Context -> IOMutable TimePicker 17 | 18 | native getBaseline :: MutableIO TimePicker -> IO Int 19 | 20 | native is24HourView :: MutableIO TimePicker -> IO Bool 21 | 22 | native isEnabled :: MutableIO TimePicker -> IO Bool 23 | 24 | native setEnabled :: MutableIO TimePicker -> Bool -> IO () 25 | 26 | native setOnTimeChangedListener :: MutableIO TimePicker -> TimePicker_OnTimeChangedListener -> IO () 27 | {- -} 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/frege/android/widget/Toast.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.Toast where 2 | 3 | import frege.android.content.Context 4 | import frege.android.view.View 5 | 6 | data Toast = native android.widget.Toast where 7 | 8 | pure native length_short android.widget.Toast.LENGTH_SHORT :: Int 9 | pure native length_long android.widget.Toast.LENGTH_LONG :: Int 10 | native new :: MutableIO Context -> IOMutable Toast 11 | 12 | native cancel :: MutableIO Toast -> IO () 13 | 14 | native getDuration :: MutableIO Toast -> IO Int 15 | 16 | native getGravity :: MutableIO Toast -> IO Int 17 | 18 | native getHorizontalMargin :: MutableIO Toast -> IO Float 19 | 20 | native getVerticalMargin :: MutableIO Toast -> IO Float 21 | 22 | native getView :: MutableIO Toast -> IOMutable View 23 | 24 | native getXOffset :: MutableIO Toast -> IO Int 25 | 26 | native getYOffset :: MutableIO Toast -> IO Int 27 | 28 | native makeText android.widget.Toast.makeText :: MutableIO Context -> Int -> Int -> IOMutable Toast 29 | | MutableIO Context -> CharSequence -> Int -> IOMutable Toast 30 | 31 | native setDuration :: MutableIO Toast -> Int -> IO () 32 | 33 | native setGravity :: MutableIO Toast -> Int -> Int -> Int -> IO () 34 | 35 | native setMargin :: MutableIO Toast -> Float -> Float -> IO () 36 | 37 | native setText :: MutableIO Toast -> Int -> IO () 38 | | MutableIO Toast -> CharSequence -> IO () 39 | 40 | native setView :: MutableIO Toast -> MutableIO View -> IO () 41 | 42 | native show :: MutableIO Toast -> IO () 43 | {- -} 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/frege/android/widget/VideoView.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.VideoView where 2 | 3 | import frege.android.content.Context 4 | import frege.android.graphics.Canvas 5 | import frege.android.media.MediaPlayer 6 | import frege.android.net.Uri 7 | import frege.android.util.AttributeSet 8 | import frege.android.view.KeyEvent 9 | import frege.android.view.MotionEvent 10 | import frege.android.widget.MediaController 11 | 12 | data VideoView = native android.widget.VideoView where 13 | 14 | native new :: MutableIO Context -> AttributeSet -> Int -> IOMutable VideoView 15 | | MutableIO Context -> AttributeSet -> IOMutable VideoView 16 | | MutableIO Context -> IOMutable VideoView 17 | 18 | native canPause :: MutableIO VideoView -> IO Bool 19 | 20 | native canSeekBackward :: MutableIO VideoView -> IO Bool 21 | 22 | native canSeekForward :: MutableIO VideoView -> IO Bool 23 | 24 | native draw :: MutableIO VideoView -> MutableIO Canvas -> IO () 25 | 26 | native getAudioSessionId :: MutableIO VideoView -> IO Int 27 | 28 | native getBufferPercentage :: MutableIO VideoView -> IO Int 29 | 30 | native getCurrentPosition :: MutableIO VideoView -> IO Int 31 | 32 | native getDuration :: MutableIO VideoView -> IO Int 33 | 34 | native isPlaying :: MutableIO VideoView -> IO Bool 35 | 36 | native onKeyDown :: MutableIO VideoView -> Int -> KeyEvent -> IO Bool 37 | 38 | native onTouchEvent :: MutableIO VideoView -> MutableIO MotionEvent -> IO Bool 39 | 40 | native onTrackballEvent :: MutableIO VideoView -> MutableIO MotionEvent -> IO Bool 41 | 42 | native pause :: MutableIO VideoView -> IO () 43 | 44 | native resolveAdjustedSize :: MutableIO VideoView -> Int -> Int -> IO Int 45 | 46 | native resume :: MutableIO VideoView -> IO () 47 | 48 | native seekTo :: MutableIO VideoView -> Int -> IO () 49 | 50 | native setMediaController :: MutableIO VideoView -> MutableIO MediaController -> IO () 51 | 52 | native setOnCompletionListener :: MutableIO VideoView -> MediaPlayer_OnCompletionListener -> IO () 53 | 54 | native setOnErrorListener :: MutableIO VideoView -> MediaPlayer_OnErrorListener -> IO () 55 | 56 | native setOnInfoListener :: MutableIO VideoView -> MediaPlayer_OnInfoListener -> IO () 57 | 58 | native setOnPreparedListener :: MutableIO VideoView -> MediaPlayer_OnPreparedListener -> IO () 59 | 60 | native setVideoPath :: MutableIO VideoView -> String -> IO () 61 | 62 | native setVideoURI :: MutableIO VideoView -> Uri -> IO () 63 | 64 | native start :: MutableIO VideoView -> IO () 65 | 66 | native stopPlayback :: MutableIO VideoView -> IO () 67 | 68 | native suspend :: MutableIO VideoView -> IO () 69 | {- -} 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/frege/android/widget/ZoomButton.fr: -------------------------------------------------------------------------------- 1 | package frege.android.widget.ZoomButton where 2 | 3 | import frege.android.content.Context 4 | import frege.android.util.AttributeSet 5 | import frege.android.view.KeyEvent 6 | import frege.android.view.MotionEvent 7 | import frege.android.view.View 8 | 9 | data ZoomButton = native android.widget.ZoomButton where 10 | 11 | native new :: MutableIO Context -> IOMutable ZoomButton 12 | | MutableIO Context -> AttributeSet -> IOMutable ZoomButton 13 | | MutableIO Context -> AttributeSet -> Int -> IOMutable ZoomButton 14 | 15 | native dispatchUnhandledMove :: MutableIO ZoomButton -> MutableIO View -> Int -> IO Bool 16 | 17 | native onKeyUp :: MutableIO ZoomButton -> Int -> KeyEvent -> IO Bool 18 | 19 | native onLongClick :: MutableIO ZoomButton -> MutableIO View -> IO Bool 20 | 21 | native onTouchEvent :: MutableIO ZoomButton -> MutableIO MotionEvent -> IO Bool 22 | 23 | native setEnabled :: MutableIO ZoomButton -> Bool -> IO () 24 | 25 | native setZoomSpeed :: MutableIO ZoomButton -> Long -> IO () 26 | {- -} 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/frege/java/util/Locale.fr: -------------------------------------------------------------------------------- 1 | package frege.java.util.Locale where 2 | 3 | 4 | data Locale = pure native java.util.Locale where 5 | 6 | pure native english java.util.Locale.ENGLISH :: Locale 7 | pure native french java.util.Locale.FRENCH :: Locale 8 | pure native german java.util.Locale.GERMAN :: Locale 9 | pure native italian java.util.Locale.ITALIAN :: Locale 10 | pure native japanese java.util.Locale.JAPANESE :: Locale 11 | pure native korean java.util.Locale.KOREAN :: Locale 12 | pure native chinese java.util.Locale.CHINESE :: Locale 13 | pure native simplified_chinese java.util.Locale.SIMPLIFIED_CHINESE :: Locale 14 | pure native traditional_chinese java.util.Locale.TRADITIONAL_CHINESE :: Locale 15 | pure native france java.util.Locale.FRANCE :: Locale 16 | pure native germany java.util.Locale.GERMANY :: Locale 17 | pure native italy java.util.Locale.ITALY :: Locale 18 | pure native japan java.util.Locale.JAPAN :: Locale 19 | pure native korea java.util.Locale.KOREA :: Locale 20 | pure native china java.util.Locale.CHINA :: Locale 21 | pure native prc java.util.Locale.PRC :: Locale 22 | pure native taiwan java.util.Locale.TAIWAN :: Locale 23 | pure native uk java.util.Locale.UK :: Locale 24 | pure native us java.util.Locale.US :: Locale 25 | pure native canada java.util.Locale.CANADA :: Locale 26 | pure native canada_french java.util.Locale.CANADA_FRENCH :: Locale 27 | pure native root java.util.Locale.ROOT :: Locale 28 | pure native private_use_extension java.util.Locale.PRIVATE_USE_EXTENSION :: Char 29 | pure native unicode_locale_extension java.util.Locale.UNICODE_LOCALE_EXTENSION :: Char 30 | native new :: String -> ST s Locale 31 | | String -> String -> ST s Locale 32 | | String -> String -> String -> ST s Locale 33 | 34 | pure native clone :: Locale -> Object 35 | 36 | pure native equals :: Locale -> Object -> Bool 37 | 38 | pure native forLanguageTag java.util.Locale.forLanguageTag :: String -> Locale 39 | 40 | pure native getCountry :: Locale -> String 41 | 42 | native getDefault java.util.Locale.getDefault :: () -> ST s Locale 43 | 44 | pure native getDisplayCountry :: Locale -> Locale -> String 45 | | Locale -> String 46 | 47 | pure native getDisplayLanguage :: Locale -> Locale -> String 48 | | Locale -> String 49 | 50 | pure native getDisplayName :: Locale -> String 51 | | Locale -> Locale -> String 52 | 53 | pure native getDisplayScript :: Locale -> String 54 | | Locale -> Locale -> String 55 | 56 | pure native getDisplayVariant :: Locale -> Locale -> String 57 | | Locale -> String 58 | 59 | pure native getExtension :: Locale -> Char -> String 60 | 61 | pure native getISO3Country :: Locale -> String 62 | 63 | pure native getISO3Language :: Locale -> String 64 | 65 | pure native getLanguage :: Locale -> String 66 | 67 | pure native getScript :: Locale -> String 68 | 69 | pure native getUnicodeLocaleType :: Locale -> String -> String 70 | 71 | pure native getVariant :: Locale -> String 72 | 73 | pure native hashCode :: Locale -> Int 74 | 75 | native setDefault java.util.Locale.setDefault :: Locale -> ST s () 76 | 77 | pure native toLanguageTag :: Locale -> String 78 | 79 | pure native toString :: Locale -> String 80 | {- derive Serializable Locale -} 81 | 82 | 83 | --------------------------------------------------------------------------------