first commit

This commit is contained in:
编码猿
2024-09-27 01:01:17 +08:00
commit 14b8ae24fa
198 changed files with 22193 additions and 0 deletions

25
uebersicht-code/.gitignore vendored Executable file
View File

@@ -0,0 +1,25 @@
# Xcode
.DS_Store
/build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
server/node_modules
# build files
server/release/server.js
server/release/public/client.js
server/release/node_modules

3
uebersicht-code/.gitmodules vendored Executable file
View File

@@ -0,0 +1,3 @@
[submodule "SocketRocket"]
path = SocketRocket
url = https://github.com/square/SocketRocket.git

6
uebersicht-code/.prettierrc Executable file
View File

@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"bracketSpacing": false,
"arrowParens": "always",
"singleQuote": true
}

1
uebersicht-code/.pydio Normal file
View File

@@ -0,0 +1 @@
928a3811-afca-4423-b581-fd03ec123269

15
uebersicht-code/.travis.yml Executable file
View File

@@ -0,0 +1,15 @@
os: osx
language: node_js
# Add new versions to test here
node_js:
- 10
before_install:
- cd server
install:
- npm install
script:
- npm test

268
uebersicht-code/ClassicWidgets.md Executable file
View File

@@ -0,0 +1,268 @@
# Übersicht
*Keep an eye on what's happening on your machine and in the world.*
For general info check out the [Übersicht website.](http://tracesof.net/uebersicht)
## Writing Widgets
In essence, widgets are plain JavaScript objects that define a few key properties and methods. They need to be defined in a single file with a `.js` or `.coffee` extension for Übersicht to pick them up. Übersicht will listen to file changes inside your widget directory, so you can edit widgets and see the result live.
You can also include node modules and split your widget into separate files using [NodeJS' module syntax](https://www.sitepoint.com/understanding-module-exports-exports-node-js/). Any file that is in a directory called `/node_modules`, `/lib` or `/src` will be treated as a module and will not show up as a separate widget.
Currently they are best written in [CoffeeScript](http://coffeescript.org). Plain JS widgets work as well, but it currently doesn't have CommonJS support. This documentation will use the CoffeScript syntax, but here is a small example widget [in pure JavaScript](https://gist.github.com/felixhageloh/34645a899a0f22f583bb). As an alternative, you could use CoffeScript's back-tick <tt>`</tt> operator to only write the relevant parts in JavaScript.
The following properties and methods are currently supported:
### command
A **string** containing the shell command to be executed, or
a **function(callback)** which eventually calls callback with some data.
For example:
```coffeescript
command: "echo Hello World"
```
Watch out for quotes inside commands. Often they need to properly escaped, like:
```coffeescript
command: "ps axo \"rss,pid,ucomm\" | sort -nr | head -n3"
```
Example using a command function:
```coffeescript
command: (callback) ->
# example function that fetches data from a server
fetchData 'some/url', (error, data) ->
callback(error, data)
```
The first and only argument passed to a command function is a callback, which must be called to continue running the widget. It follows the standard NodeJS [error-first callback pattern](http://fredkschott.com/post/2014/03/understanding-error-first-callbacks-in-node-js/).
### refreshFrequency
An **integer** specifying how often the above command is executed. It defines the delay in milliseconds between consecutive commands executions. Example:
```coffeescript
refreshFrequency: 10000
```
You can also specify `refreshFrequency` as a string, like '2 days', '1d', '10h', '2.5 hrs', '2h', '1m', or '5s'.
```coffeescript
refreshFrequency: '10s' # equates to 10000
```
The default is 1000 (1s). If set to `false` the widget won't refresh automatically.
### style
A **string** defining the css style of this widget, which is also used to control the position. In order to allow for easy scoping of CSS rules, styles are written using the [Stylus](http://learnboost.github.io/stylus/) preprocessor. Example:
```coffeescript
style: """
top: 0
left: 0
color: #fff
.some-class
box-shadow: 0 0 2px rgba(#000, 0.1)
"""
```
For convenience, the [nib library](https://tj.github.io/nib/) for Stylus is included, so mixins for CSS3 are available.
Note that widgets are positioned absolute in relation to the screen (minus the menu bar), so a widget with `top: 0` and `left: 0` will be positioned in the top left corner of the screen, just below the menu bar.
### render : output
A **function** returning a HTML string to render this widget. It gets the output of `command` passed in as a string. For example, a widget with:
```coffeescript
command: "echo Hello World!"
render: (output) -> """
<h1>#{output}</h1>
"""
```
would render as **Hello World!**. Usually, your `output` will be something more complicated, for example a JSON string, so you will have to parse it first.
The default implementation of render just returns `output`.
### afterRender : domEl
A **function** that gets called, as the name suggests, after `render` with a reference to our newly rendered DOM element. It can be used to do one time setups that you wouldn't want to do on every update.
### update : output, domEl
A **function** implementing update behavior of this widget. If specified, `render` will be called once when the widget is first initialized. Afterwards, update will be called for every refresh cycle. If no update method is provided, `render` will be called instead.
Since `render` will simply replace the inner HTML of a widget every time, you can use render to do a partial update of your widgets, kick off animations etc. For example, if the output of your command returns a percentage, you could do something like:
```coffeescript
# we don't care about output here
render: (_) -> """
<div class='bar'></div>
"""
update: (output, domEl) ->
$(domEl).find('.bar').css height: output+'%'
```
This will set the height of .bar every time this widget refreshes. As you can see, jQuery is available.
## Widget Internals
For writing more advanced widgets you might not want to rely on the standard 'run command, then redraw' cycle and instead manage some of the widget internals yourself. There are a few methods you can use from within `render`, `afterRender` and `update`
### @stop()
Stop the widget from updating if a `refreshFrequency` is set. The widget won't update until `@start` is called.
### @start()
Start updating a previously stopped widget again. Does nothing if `refreshFrequency` is set to `false`.
### @refresh()
Runs the command and redraws the widget as it normally would as part of a refresh cycle. If no command is set, the widget will only redraw.
### @run(command, callback)
Runs a shell command and calls callback with the result. Command is a string containing the shell command, just like the `command` property of a widget. Callback is called with err (if any) and stdout, in standard node fashion.
## Geolocation API
While the WebView used by Übersicht seems to provide the standard HTML5 geolocation API, it is not functional and there seems to be no way to enable it. Übersicht now provides a custom implementation, which tries to follow the standard implementation as closely as possible. However, so far it provides only the basics and might still be somewehat unstable. The api can be found under `window.geolocation` (instead of `window.navigator.geolocation`). And supports the following methods
```coffeescript
geolocation.getCurrentPosition(callback)
```
```coffeescript
geolocation.watchPosition(callback)
```
```coffeescript
geolocation.clearWatch(watchId)
```
Check the [documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation) for details on how to use these methods. The main difference to the standard API is that none of them accept options (the accuracy for position data is always set to the highest) and error reporting has not be implemented yet.
However, in a adition to the standard `Position` object provided by the standard API, Übersicht provides an extra `address` property with the following fields:
- Street
- City
- ZIP
- Country
- State
- CountryCode
## Hosted Functionality
A global object called `uebersicht` exists which exposes extra functionality that is typically not available in a browser. At the moment it is very limited:
### uebersicht.makeBgSlice(canvas)
Has been deprecated as of version 0.8 in favor of -webkit-backdrop-filter. It should be available on all systems that have Safari 9+ installed. https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter
## Built In Proxy Server
If you like you make Ajax requests to an external site without using a command, you can make use of the built in proxy server. It is running on `http://127.0.0.1:41417` and can be used as follows:
command: (callback) ->
proxy = "http://127.0.0.1:41417/"
server = "http://example.com:8080"
path = "/getsomejson"
$.get proxy + server + path, (json) ->
callback null, json
## Scripting Support
Übersicht has AppleScript support since version 1.1.45. To get detailed information on what you can script, open the Script Editor and add Übersicht to the Library (use Window -> Library to show). Here are a few examples of what you can do with AppleScript:
tell application "Übersicht" to refresh
refreshes all widgets.
tell application "Übersicht" to refresh widget id "my-widget"
refreshes widget with id "my-widget".
tell application "Übersicht" to every widget
lists all widgets.
tell application "Übersicht" to set hidden of widget id "top-cpu-coffee" to false
hides the widget with ID "top-cpu-coffee"
### Typing the umlaut 'Ü'
Unfortunately OS X seems to use a different UTF-8 code point for the Ü in its file system than you get by typing it normally (or by copy pasting it from here). There are three ways you can get the correct character:
- use the Script Editor of OS X and add Übersicht to its library. Once you initiate a new script via the Editor it will contain the correct name of the app.
- while Übersicht is running, list the process using `ps ax | grep sicht` and copy paste the name from there
- rename the app to whatever you like ('Uebersicht' would be the correct spelling without using the umlaut)
## Building Übersicht
To build Übersicht you will need to have NodeJS and a few dependencies installed:
### setup
Install node and npm using homebrew
brew install node
then run
npm install
### git and unicode characters
Git might not like the umlaut (ü) in some of the path names and will constantly show them as untracked files. To get rid of this issue, I had to use
git config core.precomposeunicode false
However, the common advice is to set this to `true`. It might depend on the OS and git version which one to use.
### building
The code base consists of two parts, a cocoa app and a NodeJS app inside `server/`. To build the node app seperately, use `npm run release`. This happens automatically every time you build using XCode.
The node app can be run standalone using
```coffeescript
coffee server/server.coffee -d <path/to/widget/dir> -p <port>
```
# Building in Xcode
The first time opening the project in Xcode you might see this message when trying to build: "The run destination My Mac is not valid for Running the scheme 'Übersicht'."
Click on `Uebersicht` in the project navigator and then select the menu `Editor > Validate Settings...` and click `Perform Changes`.
You can then attempt to build, you may then be presented with code sign issues, click `Fix Issue` to continue.
Now you need to remove the code signing shell script, select the `Übersicht` target and under `Build Phases` remove the code in the `Code Sign Frameworks` section.
You should now be able to build successfully.
There is one last step on the Node.js side to complete. For the sake of brevity, this link will solve your problem:
http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http
# Legal
The source for Übersicht is released under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
© 2016 Felix Hageloh

674
uebersicht-code/LICENSE Executable file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

2
uebersicht-code/Makefile Executable file
View File

@@ -0,0 +1,2 @@
test:
cd server && npm install --no-progress && npm test

8
uebersicht-code/Podfile Executable file
View File

@@ -0,0 +1,8 @@
# Uncomment the next line to define a global platform for your project
platform :macos, '10.10'
target 'Uebersicht' do
# Pods for Uebersicht
pod 'SocketRocket'
pod 'Sparkle'
end

20
uebersicht-code/Podfile.lock Executable file
View File

@@ -0,0 +1,20 @@
PODS:
- SocketRocket (0.5.1)
- Sparkle (1.23.0)
DEPENDENCIES:
- SocketRocket
- Sparkle
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- SocketRocket
- Sparkle
SPEC CHECKSUMS:
SocketRocket: d57c7159b83c3c6655745cd15302aa24b6bae531
Sparkle: 55b1a87ba69d56913375a281546b7c82dec95bb0
PODFILE CHECKSUM: f68839bf85fc3a629cc21d58a289a00e2eaaa792
COCOAPODS: 1.7.5

414
uebersicht-code/README.md Normal file
View File

@@ -0,0 +1,414 @@
# Übersicht
*Keep an eye on what's happening on your machine and in the world.*
For general info check out the [Übersicht website.](http://tracesof.net/uebersicht)
## Writing Widgets
In essence, widgets are JavaScript modules that expose a few key properties and methods. They need to be defined in a single file with a `.jsx` extension for Übersicht to pick them up. Previously, widgets could be written in CoffeeScript and are still supported. Check [the old documentation](ClassicWidgets.md) for details. Übersicht will listen to file changes inside your widget directory, so you can edit widgets and see the result live.
Widget rendering is done using [React](https://reactjs.org) and its [JSX](https://reactjs.org/docs/introducing-jsx.html) syntax. Simple widget state is managed for you by Übersicht, but for more advanced widgets you can manage state using a Redux-like pattern. You `dispatch` events, which get processed by a single `updateState` function which returns the new state, which is passed to the render function of your widget.
State is kept when you modify your widget, which allows for live coding. Any changes to the UI of your widget will be immediately visible. One drawback (at least with the current implementation) is that if you change the shape of your state you might have to 'Refresh all Widgets' from the app menu for your widget to work.
You can also include node modules and split your widget into separate files using [ESM syntax](http://2ality.com/2014/09/es6-modules-final.html). Any file that is in a directory called `/node_modules`, `/lib` or `/src` will be treated as a module and will not show up as a separate widget.
The following properties and methods are supported:
### command
A **string** containing the shell command to be executed, or<br>
a **function(dispatch : function)** which eventually dispatches an event,
or **undefined** meaning that no command will be executed for this widget.
For example:
```jsx
export const command = "echo Hello World";
```
Watch out for quotes inside commands. Often they need to properly escaped, like:
```jsx
export const command = "ps axo \"rss,pid,ucomm\" | sort -nr | head -n3";
```
Example using a command function:
```jsx
export const command = (dispatch) =>
fetch('some/url.json)')
.then((response) => {
dispatch({ type: 'FETCH_SUCCEDED', data: response.json() });
})
.catch((error) => {
dispatch({ type: 'FETCH_FAILED', error: error });
});
```
The first and only argument passed to a command function is a `dispatch` function, which you can use to dispatch plain JasvaScript objects, called events, to be picked up by your `updateState` function.
### refreshFrequency
An **number** specifying how often the above command is executed.
It defines the delay in milliseconds between consecutive commands executions. Example:
```coffeescript
export const refreshFrequency = 1000; // widget will run command once a second
```
The default is 1000 (1s). If set to `false` the widget won't refresh automatically.
### className
An **object** or **string** defining the CSS rules to applied to the root of your widget.
It is most commonly used control the position of your widget. It is converted to a CSS class name using the [Emotion CSS-in-JS library](https://emotion.sh/docs/css). Read more about [styling your widgets here](#styling-widgets).
```jsx
export const className = {
top: 0,
left: 0,
color: '#fff'
}
```
or
```jsx
export const className = `
top: 0;
left: 0;
color: #fff;
`
```
Note that widgets are positioned absolute in relation to the screen (minus the menu bar), so a widget with `top: 0` and `left: 0` will be positioned in the top left corner of the screen, just below the menu bar.
### render : props
A **function(props : object)** to render your widget.
If you know [React functional components](https://reactjs.org/docs/components-and-props.html) you know how render works. The `props` passed to this function is whatever state your `updateState` function returns. If you don't provide your own `updateState` function, the default props that are passed are `output` and `error`, containing the output your command produced and any error that might have occurred.
```jsx
export const render = ({output, error}) => {
return error ? (
<div>Something went wrong: <strong>{String(error)}</strong></div>
) : (
<div>
<h1>We got some output!</h1>
<p>{output}</p>
</div>
);
}
```
The default implementation of render just returns `output`.
### updateState : event, previousState
A **function(event : object, previousState : object)** implementing the state update behavior of this widget.
When provided, this function must return the next state, which will be passed as `props` to your render function. The default function will return `output` and `error` from the event object.
```jsx
export const updateState = (event, previousState) => {
if (event.error) {
return { ...previousState, warning: `We got an error: ${event.error}` };
}
const [cpuPct, processName] = event.output.split(',');
return {
cpuPct: parseFloat(cpuPct),
processName
};
}
```
This will pass a props object containing `cpuPct` and `processName` to the render function. If an error occurred, it will pass the previous state plus a warning message.
If your widget has more complex state logic, for example because it is fetching data from several different sources, it is a good idea to add a `type` property to your events. You can use this type to decide how to update your state. For example:
```jsx
export const updateState = (event, previousState) => {
switch(event.type) {
case 'CO2_FETCHED': return updateCo2(event.output, previousState);
case 'TEMPERATURE_FETCHED': return updateTemp(event.output, previousState);
default: {
return previousState;
}
}
}
```
This example also shows that you can make use of functions to further break down your state update logic.
### initialState
An **object** with the initial state of your widget.
If you provide a custom `updateState` function you might need to define the initial state that gets passed on initial render of the widget. before any command has been run.
```jsx
export const initialState = { output: 'fetching data...' };
```
The default initial state is `{ output: '' }`.
### init : dispatch
A **function(dispatch : function)** that is called the first time your widget loads. Many widgets won't need this, but you can use this function to perform any initial setup for more advanced use cases. For example, instead of relying on periodic shell commands, you might want to open and listen to WebSocket events to update your widget.
```jsx
export const init = (dispatch) => {
const socket = new WebSocket('ws://localhost:8080');
socket.addEventListener('message', (event) => {
dispatch({type: 'MESSAGE_RECEIVED', data: event.data});
});
}
```
## Styling Widgets
Uebersicht comes bundled with [Emotion ](https://emotion.sh) (version 9). It exposes it's `css` and `styled` functions via the `uebersicht` module.
As described above, you can use `className` to style and position the root node of your widget. For further styling you can do something like this:
```jsx
import { css } from "uebersicht"
const header = css`
font-family: Ubuntu;
font-size: 20px;
text-align: center;
color: white;
`
const boxes = css`
display: flex;
justify-content: center;
`
const box = css({
height: "40px",
width: "40px",
"& + &": {
marginLeft: "5px"
}
})
export const className = `
left: 20px;
top: 20px;
width: 200px;
`
export const initialState = { colors: ["DeepPink", "DeepSkyBlue", "Coral"] }
export const render = ({ colors }) => {
return (
<div>
<h1 className={header}>Some colored boxes</h1>
<div className={boxes}>
{colors.map((color, idx) => (
<div className={`${box} ${css({ background: color })}`} key={idx} />
))}
</div>
</div>
)
}
```
Alternatively, you can also make use of Emotion's styles components:
```jsx
import { styled } from "uebersicht"
const Header = styled("h1")`
font-family: Ubuntu;
font-size: 20px;
text-align: center;
color: white;
`
const Boxes = styled("div")`
display: flex;
justify-content: center;
`
const Box = styled("div")(props => ({
height: "40px",
width: "40px",
background: props.color,
marginRight: "5px"
}))
export const className = `
left: 20px;
top: 20px;
width: 200px;
`
export const initialState = { colors: ["DeepPink", "DeepSkyBlue", "Coral"] }
export const render = ({ colors }) => {
return (
<div>
<Header>Some colored boxes</Header>
<Boxes>
{colors.map((color, idx) => (
<Box color={color} key={idx} />
))}
</Boxes>
</div>
)
}
```
Finally, since you can also install and import any module you like, you can use your favorite styling library instead.
## Running Shell Commands
If need to run extra shell commands without using the [command](#command) property, you can import the `run` function from the `uebersicht` module.
It returns a Promise, which will resolve to the output of the command (stdout) or reject if any error occurred.
```jsx
import { run } from 'uebersicht'
export const render => (props, dispatch) {
return (
<button
onClick={() => {
run('echo "new output"')
.then((output) => dispatch({type: 'OUTPUT_UPDATED', output}))
}}
>
Update
</button>
);
}
```
> Note that in order to receive click events you need to configure an interaction shortcut and give Übersicht accessibility access.
## Geolocation API
While the WebView used by Übersicht seems to provide the standard HTML5 geolocation API, it is not functional and there seems to be no way to enable it. Übersicht now provides a custom implementation, which tries to follow the standard implementation as closely as possible. However, so far it provides only the basics and might still be somewhat unstable. The api can be found under `window.geolocation` (instead of `window.navigator.geolocation`). And supports the following methods
```js
geolocation.getCurrentPosition(callback)
```
```js
geolocation.watchPosition(callback)
```
```js
geolocation.clearWatch(watchId)
```
Check the [documentation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation) for details on how to use these methods. The main difference to the standard API is that none of them accept options (the accuracy for position data is always set to the highest) and error reporting has not be implemented yet.
However, in a addition to the standard `Position` object provided by the standard API, Übersicht provides an extra `address` property with the following fields:
- Street
- City
- ZIP
- Country
- State
- CountryCode
## Built In Proxy Server
If you like you make Ajax requests to an external site without using a command, you can make use of the built in proxy server. It is running on `http://127.0.0.1:41417` and can be used as follows:
command: (callback) ->
proxy = "http://127.0.0.1:41417/"
server = "http://example.com:8080"
path = "/getsomejson"
$.get proxy + server + path, (json) ->
callback null, json
## Scripting Support
Übersicht has AppleScript support since version 1.1.45. To get detailed information on what you can script, open the Script Editor and add Übersicht to the Library (use Window -> Library to show). Here are a few examples of what you can do with AppleScript. (Note that the examples all use the application id instead of the app name. This is because typing the umlaut Ü can be tricky):
tell application id "tracesOf.Uebersicht" to refresh
refreshes all widgets.
tell application id "tracesOf.Uebersicht" to refresh widget id "my-widget"
refreshes widget with id "my-widget".
tell application id "tracesOf.Uebersicht" to every widget
lists all widgets.
tell application id "tracesOf.Uebersicht" to set hidden of widget id "top-cpu-coffee" to false
hides the widget with ID "top-cpu-coffee"
## Building Übersicht
To build Übersicht you will need to have NodeJS and a few dependencies installed:
### setup
Currently, the project supports node 8.
If you already have node, you'll have to
```
brew unlink node
```
Now, install node 8 using homebrew
```
brew install node@8 && brew link --force node@6
```
then run
```
npm install
```
### git and unicode characters
Git might not like the umlaut (ü) in some of the path names and will constantly show them as untracked files. To get rid of this issue, I had to use
git config core.precomposeunicode false
However, the common advice is to set this to `true`. It might depend on the OS and git version which one to use.
### building
The code base consists of two parts, a cocoa app and a NodeJS app inside `server/`. To build the node app separately, use `npm run release`. This happens automatically every time you build using XCode.
The node app can be run standalone using
```coffeescript
coffee server/server.coffee -d <path/to/widget/dir> -p <port>
```
# Building in Xcode
The first time opening the project in Xcode you might see this message when trying to build: "The run destination My Mac is not valid for Running the scheme 'Übersicht'."
Click on `Uebersicht` in the project navigator and then select the menu `Editor > Validate Settings...` and click `Perform Changes`.
You can then attempt to build, you may then be presented with code sign issues, click `Fix Issue` to continue.
Now you need to remove the code signing shell script, select the `Übersicht` target and under `Build Phases` remove the code in the `Code Sign Frameworks` section.
You should now be able to build successfully.
There is one last step on the Node.js side to complete. For the sake of brevity, this link will solve your problem:
http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http
# Legal
The source for Übersicht is released under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
© 2019 Felix Hageloh

View File

@@ -0,0 +1 @@
b8e13892-111e-4a98-a503-87c9d312c068

View File

@@ -0,0 +1,710 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
DC314A201C0EE024000A56D2 /* UBWidgetsController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC314A1F1C0EE024000A56D2 /* UBWidgetsController.m */; };
DC404DF31D2844E100305CE2 /* UBWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC404DF21D2844E100305CE2 /* UBWebViewController.m */; };
DC404DF51D294B3100305CE2 /* geolocation.js in Resources */ = {isa = PBXBuildFile; fileRef = DC404DF41D294B3100305CE2 /* geolocation.js */; };
DC43AD8017EC2D9500241CC2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC43AD7F17EC2D9500241CC2 /* Cocoa.framework */; };
DC43AD8C17EC2D9500241CC2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DC43AD8B17EC2D9500241CC2 /* main.m */; };
DC43AD9317EC2D9500241CC2 /* UBAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DC43AD9217EC2D9500241CC2 /* UBAppDelegate.m */; };
DC43AD9817EC2D9500241CC2 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC43AD9717EC2D9500241CC2 /* Images.xcassets */; };
DC43ADB517EC35A800241CC2 /* UBWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = DC43ADB417EC31EB00241CC2 /* UBWindow.m */; };
DC43ADB717EC38D300241CC2 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC43ADB617EC38D300241CC2 /* WebKit.framework */; };
DC4913961BEF9A75003E76EF /* UBScreensController.m in Sources */ = {isa = PBXBuildFile; fileRef = DC4913951BEF9A75003E76EF /* UBScreensController.m */; };
DC4F43F3189E90DD00937925 /* status-icon.png in Resources */ = {isa = PBXBuildFile; fileRef = DC4F43F1189E90DD00937925 /* status-icon.png */; };
DC4F43F4189E90DD00937925 /* status-icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DC4F43F2189E90DD00937925 /* status-icon@2x.png */; };
DC4FC28118EAB1CA00B7FD79 /* übersicht-logo.png in Resources */ = {isa = PBXBuildFile; fileRef = DC4FC28018EAB1CA00B7FD79 /* übersicht-logo.png */; };
DC57ED2E18DB4EC900A24FDD /* UBPreferencesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = DC57ED2C18DB4EC900A24FDD /* UBPreferencesController.xib */; };
DC62CC731E1C0F73004F85B8 /* Uebersicht.sdef in Resources */ = {isa = PBXBuildFile; fileRef = DC74D0741E1A6FC300893D53 /* Uebersicht.sdef */; };
DC66522D1E212735003267AF /* UBWidgetForScripting.m in Sources */ = {isa = PBXBuildFile; fileRef = DC66522C1E212735003267AF /* UBWidgetForScripting.m */; };
DC74D0781E1A71E500893D53 /* UBRefreshCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = DC74D0771E1A71E500893D53 /* UBRefreshCommand.m */; };
DC9296A71C5017CF006E4267 /* widget-status-visible.png in Resources */ = {isa = PBXBuildFile; fileRef = DC9296A51C5017CF006E4267 /* widget-status-visible.png */; };
DC9296A81C5017CF006E4267 /* widget-status-visible@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DC9296A61C5017CF006E4267 /* widget-status-visible@2x.png */; };
DC9296AB1C501D34006E4267 /* widget-status-hidden.png in Resources */ = {isa = PBXBuildFile; fileRef = DC9296A91C501D34006E4267 /* widget-status-hidden.png */; };
DC9296AC1C501D34006E4267 /* widget-status-hidden@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DC9296AA1C501D34006E4267 /* widget-status-hidden@2x.png */; };
DC9F7CE31C439CE50014E25B /* UBDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = DC9F7CE21C439CE50014E25B /* UBDispatcher.m */; };
DCAAAF9618DF0B050097677F /* GettingStarted.jsx in Resources */ = {isa = PBXBuildFile; fileRef = DCAAAF9518DF0B050097677F /* GettingStarted.jsx */; };
DCAC78CA1C550B810051E78B /* UBWebSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = DCAC78C91C550B810051E78B /* UBWebSocket.m */; };
DCAC78CD1C551D130051E78B /* UBListener.m in Sources */ = {isa = PBXBuildFile; fileRef = DCAC78CC1C551D130051E78B /* UBListener.m */; };
DCB95A8D22FAD3F60066A51A /* UBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = DCB95A8C22FAD3F60066A51A /* UBApplication.m */; };
DCBD665922F823AC0043E434 /* UBWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBD665822F823AC0043E434 /* UBWebView.m */; };
DCC74B26252AF6DA00C1D1E5 /* UBWindowGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = DCC74B25252AF6DA00C1D1E5 /* UBWindowGroup.m */; };
DCC7B2F61C575BCE00F563C8 /* UBWidgetsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = DCC7B2F51C575BCE00F563C8 /* UBWidgetsStore.m */; };
DCCBDB992524638400FFAAE1 /* UBWindowsController.m in Sources */ = {isa = PBXBuildFile; fileRef = DCCBDB982524638400FFAAE1 /* UBWindowsController.m */; };
DCE7E3C11A376AD400A12516 /* UBLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = DCE7E3C01A376AD400A12516 /* UBLocation.m */; };
DCECA1C71893F23200C0CA32 /* localnode in Resources */ = {isa = PBXBuildFile; fileRef = DCECA1C51893F23200C0CA32 /* localnode */; };
DCECA1C81893F23200C0CA32 /* server.js in Resources */ = {isa = PBXBuildFile; fileRef = DCECA1C61893F23200C0CA32 /* server.js */; };
DCECA1CA1893F4EF00C0CA32 /* public in Resources */ = {isa = PBXBuildFile; fileRef = DCECA1C91893F4EF00C0CA32 /* public */; };
DCECA1CE1893FE5500C0CA32 /* node_modules in Resources */ = {isa = PBXBuildFile; fileRef = DCECA1CD1893FE5500C0CA32 /* node_modules */; };
DCECA1CF1894008800C0CA32 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DC43AD9417EC2D9500241CC2 /* MainMenu.xib */; };
DCF9D9011E9D512600D27988 /* UBReloadCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = DCF9D9001E9D512600D27988 /* UBReloadCommand.m */; };
E0EA7A6227CA42DB00BC6693 /* Sparkle in Resources */ = {isa = PBXBuildFile; fileRef = E0EA7A6027CA42DB00BC6693 /* Sparkle */; };
E0EA7A6327CA42DB00BC6693 /* SocketRocket in Resources */ = {isa = PBXBuildFile; fileRef = E0EA7A6127CA42DB00BC6693 /* SocketRocket */; };
E0EA7A6527CA42EF00BC6693 /* libSocketRocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E0EA7A6427CA42EF00BC6693 /* libSocketRocket.a */; };
E0EA7A6727CA42FA00BC6693 /* Sparkle.framework.dSYM in Frameworks */ = {isa = PBXBuildFile; fileRef = E0EA7A6627CA42FA00BC6693 /* Sparkle.framework.dSYM */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1F1AEE7879137369A94611DB /* Pods-Uebersicht.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uebersicht.release.xcconfig"; path = "Pods/Target Support Files/Pods-Uebersicht/Pods-Uebersicht.release.xcconfig"; sourceTree = "<group>"; };
2B2DEDD7D214E00F6E0F133D /* Pods-Uebersicht.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Uebersicht.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Uebersicht/Pods-Uebersicht.debug.xcconfig"; sourceTree = "<group>"; };
DC314A1E1C0EE024000A56D2 /* UBWidgetsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBWidgetsController.h; sourceTree = "<group>"; };
DC314A1F1C0EE024000A56D2 /* UBWidgetsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBWidgetsController.m; sourceTree = "<group>"; };
DC404DE81D26B92000305CE2 /* WKInspector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKInspector.h; sourceTree = "<group>"; };
DC404DE91D26B9E000305CE2 /* WKBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKBase.h; sourceTree = "<group>"; };
DC404DED1D26BB6500305CE2 /* WKPage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKPage.h; sourceTree = "<group>"; };
DC404DEE1D26C1D000305CE2 /* WKView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKView.h; sourceTree = "<group>"; };
DC404DF11D2844E100305CE2 /* UBWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBWebViewController.h; sourceTree = "<group>"; };
DC404DF21D2844E100305CE2 /* UBWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = UBWebViewController.m; sourceTree = "<group>"; tabWidth = 4; };
DC404DF41D294B3100305CE2 /* geolocation.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = geolocation.js; sourceTree = "<group>"; };
DC43AD7C17EC2D9500241CC2 /* 桌面小组件.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "桌面小组件.app"; sourceTree = BUILT_PRODUCTS_DIR; };
DC43AD7F17EC2D9500241CC2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
DC43AD8217EC2D9500241CC2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
DC43AD8317EC2D9500241CC2 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
DC43AD8417EC2D9500241CC2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
DC43AD8717EC2D9500241CC2 /* Uebersicht-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Uebersicht-Info.plist"; sourceTree = "<group>"; };
DC43AD8B17EC2D9500241CC2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
DC43AD8D17EC2D9500241CC2 /* Uebersicht-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Uebersicht-Prefix.pch"; sourceTree = "<group>"; };
DC43AD9117EC2D9500241CC2 /* UBAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBAppDelegate.h; sourceTree = "<group>"; };
DC43AD9217EC2D9500241CC2 /* UBAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UBAppDelegate.m; sourceTree = "<group>"; };
DC43AD9517EC2D9500241CC2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
DC43AD9717EC2D9500241CC2 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
DC43ADB317EC31EB00241CC2 /* UBWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBWindow.h; sourceTree = "<group>"; };
DC43ADB417EC31EB00241CC2 /* UBWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UBWindow.m; sourceTree = "<group>"; };
DC43ADB617EC38D300241CC2 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
DC4913941BEF9A75003E76EF /* UBScreensController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBScreensController.h; sourceTree = "<group>"; };
DC4913951BEF9A75003E76EF /* UBScreensController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBScreensController.m; sourceTree = "<group>"; };
DC4F43F1189E90DD00937925 /* status-icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "status-icon.png"; sourceTree = "<group>"; };
DC4F43F2189E90DD00937925 /* status-icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "status-icon@2x.png"; sourceTree = "<group>"; };
DC4FC28018EAB1CA00B7FD79 /* übersicht-logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "übersicht-logo.png"; sourceTree = "<group>"; };
DC57ED2A18DB4EC900A24FDD /* UBPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBPreferencesController.h; sourceTree = "<group>"; };
DC57ED2B18DB4EC900A24FDD /* UBPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBPreferencesController.m; sourceTree = "<group>"; };
DC57ED2C18DB4EC900A24FDD /* UBPreferencesController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UBPreferencesController.xib; sourceTree = "<group>"; };
DC66522B1E212735003267AF /* UBWidgetForScripting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBWidgetForScripting.h; sourceTree = "<group>"; };
DC66522C1E212735003267AF /* UBWidgetForScripting.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBWidgetForScripting.m; sourceTree = "<group>"; };
DC74D0741E1A6FC300893D53 /* Uebersicht.sdef */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Uebersicht.sdef; sourceTree = "<group>"; };
DC74D0761E1A71E500893D53 /* UBRefreshCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBRefreshCommand.h; sourceTree = "<group>"; };
DC74D0771E1A71E500893D53 /* UBRefreshCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBRefreshCommand.m; sourceTree = "<group>"; };
DC84AF8F1E17B912008BF454 /* UBScreenChangeListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBScreenChangeListener.h; sourceTree = "<group>"; };
DC9296A51C5017CF006E4267 /* widget-status-visible.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "widget-status-visible.png"; sourceTree = "<group>"; };
DC9296A61C5017CF006E4267 /* widget-status-visible@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "widget-status-visible@2x.png"; sourceTree = "<group>"; };
DC9296A91C501D34006E4267 /* widget-status-hidden.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "widget-status-hidden.png"; sourceTree = "<group>"; };
DC9296AA1C501D34006E4267 /* widget-status-hidden@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "widget-status-hidden@2x.png"; sourceTree = "<group>"; };
DC99A7C418DC41A600E61222 /* Übersicht.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Übersicht.entitlements"; sourceTree = "<group>"; };
DC9F7CE11C439CE50014E25B /* UBDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBDispatcher.h; sourceTree = "<group>"; };
DC9F7CE21C439CE50014E25B /* UBDispatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBDispatcher.m; sourceTree = "<group>"; };
DCAAAF9518DF0B050097677F /* GettingStarted.jsx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GettingStarted.jsx; sourceTree = "<group>"; };
DCAC78C81C550B810051E78B /* UBWebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBWebSocket.h; sourceTree = "<group>"; };
DCAC78C91C550B810051E78B /* UBWebSocket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBWebSocket.m; sourceTree = "<group>"; };
DCAC78CB1C551D130051E78B /* UBListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBListener.h; sourceTree = "<group>"; };
DCAC78CC1C551D130051E78B /* UBListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBListener.m; sourceTree = "<group>"; };
DCB5D9861948802C000D5C83 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
DCB95A8B22FAD3F50066A51A /* UBApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBApplication.h; sourceTree = "<group>"; };
DCB95A8C22FAD3F60066A51A /* UBApplication.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UBApplication.m; sourceTree = "<group>"; };
DCBD665722F823AC0043E434 /* UBWebView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBWebView.h; sourceTree = "<group>"; };
DCBD665822F823AC0043E434 /* UBWebView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UBWebView.m; sourceTree = "<group>"; };
DCC74B24252AF6DA00C1D1E5 /* UBWindowGroup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBWindowGroup.h; sourceTree = "<group>"; };
DCC74B25252AF6DA00C1D1E5 /* UBWindowGroup.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UBWindowGroup.m; sourceTree = "<group>"; };
DCC7B2F41C575BCE00F563C8 /* UBWidgetsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBWidgetsStore.h; sourceTree = "<group>"; };
DCC7B2F51C575BCE00F563C8 /* UBWidgetsStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBWidgetsStore.m; sourceTree = "<group>"; };
DCCBDB972524638400FFAAE1 /* UBWindowsController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UBWindowsController.h; sourceTree = "<group>"; };
DCCBDB982524638400FFAAE1 /* UBWindowsController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UBWindowsController.m; sourceTree = "<group>"; };
DCD6280E1D8187EC00358595 /* WKWebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewInternal.h; sourceTree = "<group>"; };
DCE7E3BF1A376AD400A12516 /* UBLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBLocation.h; sourceTree = "<group>"; };
DCE7E3C01A376AD400A12516 /* UBLocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBLocation.m; sourceTree = "<group>"; };
DCECA1C51893F23200C0CA32 /* localnode */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = localnode; path = server/release/localnode; sourceTree = "<group>"; };
DCECA1C61893F23200C0CA32 /* server.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = server.js; path = server/release/server.js; sourceTree = "<group>"; };
DCECA1C91893F4EF00C0CA32 /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; name = public; path = server/release/public; sourceTree = "<group>"; };
DCECA1CD1893FE5500C0CA32 /* node_modules */ = {isa = PBXFileReference; lastKnownFileType = folder; name = node_modules; path = server/release/node_modules; sourceTree = "<group>"; };
DCF9D8FF1E9D512600D27988 /* UBReloadCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBReloadCommand.h; sourceTree = "<group>"; };
DCF9D9001E9D512600D27988 /* UBReloadCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UBReloadCommand.m; sourceTree = "<group>"; };
E0A0673E27C6BB7E005CA910 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/MainMenu.strings"; sourceTree = "<group>"; };
E0EA7A6027CA42DB00BC6693 /* Sparkle */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Sparkle; path = ../dependent/Sparkle; sourceTree = "<group>"; };
E0EA7A6127CA42DB00BC6693 /* SocketRocket */ = {isa = PBXFileReference; lastKnownFileType = folder; name = SocketRocket; path = ../dependent/SocketRocket; sourceTree = "<group>"; };
E0EA7A6427CA42EF00BC6693 /* libSocketRocket.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSocketRocket.a; path = ../dependent/SocketRocket/libSocketRocket.a; sourceTree = "<group>"; };
E0EA7A6627CA42FA00BC6693 /* Sparkle.framework.dSYM */ = {isa = PBXFileReference; lastKnownFileType = wrapper.dsym; name = Sparkle.framework.dSYM; path = ../dependent/Sparkle/Sparkle.framework.dSYM; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
DC43AD7917EC2D9500241CC2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
E0EA7A6727CA42FA00BC6693 /* Sparkle.framework.dSYM in Frameworks */,
E0EA7A6527CA42EF00BC6693 /* libSocketRocket.a in Frameworks */,
DC43ADB717EC38D300241CC2 /* WebKit.framework in Frameworks */,
DC43AD8017EC2D9500241CC2 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
66A3FC476F2A2EEE871EA3E2 /* Pods */ = {
isa = PBXGroup;
children = (
2B2DEDD7D214E00F6E0F133D /* Pods-Uebersicht.debug.xcconfig */,
1F1AEE7879137369A94611DB /* Pods-Uebersicht.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
DC404DEB1D26BAA400305CE2 /* WKHeaders */ = {
isa = PBXGroup;
children = (
DCD6280E1D8187EC00358595 /* WKWebViewInternal.h */,
DC404DE81D26B92000305CE2 /* WKInspector.h */,
DC404DE91D26B9E000305CE2 /* WKBase.h */,
DC404DED1D26BB6500305CE2 /* WKPage.h */,
DC404DEE1D26C1D000305CE2 /* WKView.h */,
);
name = WKHeaders;
sourceTree = "<group>";
};
DC43AD7317EC2D9500241CC2 = {
isa = PBXGroup;
children = (
DC43AD8517EC2D9500241CC2 /* Uebersicht */,
DCECA1C21893F1C300C0CA32 /* server */,
DC43AD7E17EC2D9500241CC2 /* Frameworks */,
DC43AD7D17EC2D9500241CC2 /* Products */,
66A3FC476F2A2EEE871EA3E2 /* Pods */,
);
sourceTree = "<group>";
};
DC43AD7D17EC2D9500241CC2 /* Products */ = {
isa = PBXGroup;
children = (
DC43AD7C17EC2D9500241CC2 /* 桌面小组件.app */,
);
name = Products;
sourceTree = "<group>";
};
DC43AD7E17EC2D9500241CC2 /* Frameworks */ = {
isa = PBXGroup;
children = (
E0EA7A6627CA42FA00BC6693 /* Sparkle.framework.dSYM */,
E0EA7A6427CA42EF00BC6693 /* libSocketRocket.a */,
E0EA7A6127CA42DB00BC6693 /* SocketRocket */,
E0EA7A6027CA42DB00BC6693 /* Sparkle */,
DCB5D9861948802C000D5C83 /* JavaScriptCore.framework */,
DC43ADB617EC38D300241CC2 /* WebKit.framework */,
DC43AD7F17EC2D9500241CC2 /* Cocoa.framework */,
DC43AD8117EC2D9500241CC2 /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
DC43AD8117EC2D9500241CC2 /* Other Frameworks */ = {
isa = PBXGroup;
children = (
DC43AD8217EC2D9500241CC2 /* AppKit.framework */,
DC43AD8317EC2D9500241CC2 /* CoreData.framework */,
DC43AD8417EC2D9500241CC2 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
DC43AD8517EC2D9500241CC2 /* Uebersicht */ = {
isa = PBXGroup;
children = (
DC99A7C418DC41A600E61222 /* Übersicht.entitlements */,
DC43AD9417EC2D9500241CC2 /* MainMenu.xib */,
DCB95A8B22FAD3F50066A51A /* UBApplication.h */,
DCB95A8C22FAD3F60066A51A /* UBApplication.m */,
DC43AD9117EC2D9500241CC2 /* UBAppDelegate.h */,
DC43AD9217EC2D9500241CC2 /* UBAppDelegate.m */,
DCCBDB972524638400FFAAE1 /* UBWindowsController.h */,
DCCBDB982524638400FFAAE1 /* UBWindowsController.m */,
DC43ADB317EC31EB00241CC2 /* UBWindow.h */,
DC43ADB417EC31EB00241CC2 /* UBWindow.m */,
DCC74B24252AF6DA00C1D1E5 /* UBWindowGroup.h */,
DCC74B25252AF6DA00C1D1E5 /* UBWindowGroup.m */,
DCBD665722F823AC0043E434 /* UBWebView.h */,
DCBD665822F823AC0043E434 /* UBWebView.m */,
DC404DF11D2844E100305CE2 /* UBWebViewController.h */,
DC404DF21D2844E100305CE2 /* UBWebViewController.m */,
DC4913941BEF9A75003E76EF /* UBScreensController.h */,
DC4913951BEF9A75003E76EF /* UBScreensController.m */,
DC57ED2A18DB4EC900A24FDD /* UBPreferencesController.h */,
DC57ED2B18DB4EC900A24FDD /* UBPreferencesController.m */,
DC57ED2C18DB4EC900A24FDD /* UBPreferencesController.xib */,
DCE7E3BF1A376AD400A12516 /* UBLocation.h */,
DCE7E3C01A376AD400A12516 /* UBLocation.m */,
DC314A1E1C0EE024000A56D2 /* UBWidgetsController.h */,
DC314A1F1C0EE024000A56D2 /* UBWidgetsController.m */,
DCC7B2F41C575BCE00F563C8 /* UBWidgetsStore.h */,
DCC7B2F51C575BCE00F563C8 /* UBWidgetsStore.m */,
DCAC78C81C550B810051E78B /* UBWebSocket.h */,
DCAC78C91C550B810051E78B /* UBWebSocket.m */,
DC9F7CE11C439CE50014E25B /* UBDispatcher.h */,
DC9F7CE21C439CE50014E25B /* UBDispatcher.m */,
DCAC78CB1C551D130051E78B /* UBListener.h */,
DCAC78CC1C551D130051E78B /* UBListener.m */,
DC84AF8F1E17B912008BF454 /* UBScreenChangeListener.h */,
DC74D0751E1A717800893D53 /* Script Support */,
DC404DEB1D26BAA400305CE2 /* WKHeaders */,
DC43AD8617EC2D9500241CC2 /* Supporting Files */,
DC43AD9717EC2D9500241CC2 /* Images.xcassets */,
);
path = Uebersicht;
sourceTree = "<group>";
};
DC43AD8617EC2D9500241CC2 /* Supporting Files */ = {
isa = PBXGroup;
children = (
DC9296A91C501D34006E4267 /* widget-status-hidden.png */,
DC9296AA1C501D34006E4267 /* widget-status-hidden@2x.png */,
DC9296A51C5017CF006E4267 /* widget-status-visible.png */,
DC9296A61C5017CF006E4267 /* widget-status-visible@2x.png */,
DC4FC28018EAB1CA00B7FD79 /* übersicht-logo.png */,
DCAAAF9518DF0B050097677F /* GettingStarted.jsx */,
DC4F43F1189E90DD00937925 /* status-icon.png */,
DC4F43F2189E90DD00937925 /* status-icon@2x.png */,
DC43AD8717EC2D9500241CC2 /* Uebersicht-Info.plist */,
DC43AD8B17EC2D9500241CC2 /* main.m */,
DC43AD8D17EC2D9500241CC2 /* Uebersicht-Prefix.pch */,
DC404DF41D294B3100305CE2 /* geolocation.js */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
DC74D0751E1A717800893D53 /* Script Support */ = {
isa = PBXGroup;
children = (
DC66522B1E212735003267AF /* UBWidgetForScripting.h */,
DC66522C1E212735003267AF /* UBWidgetForScripting.m */,
DC74D0761E1A71E500893D53 /* UBRefreshCommand.h */,
DC74D0771E1A71E500893D53 /* UBRefreshCommand.m */,
DCF9D8FF1E9D512600D27988 /* UBReloadCommand.h */,
DCF9D9001E9D512600D27988 /* UBReloadCommand.m */,
DC74D0741E1A6FC300893D53 /* Uebersicht.sdef */,
);
name = "Script Support";
sourceTree = "<group>";
};
DCECA1C21893F1C300C0CA32 /* server */ = {
isa = PBXGroup;
children = (
DCECA1CD1893FE5500C0CA32 /* node_modules */,
DCECA1C91893F4EF00C0CA32 /* public */,
DCECA1C51893F23200C0CA32 /* localnode */,
DCECA1C61893F23200C0CA32 /* server.js */,
);
name = server;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
DC43AD7B17EC2D9500241CC2 /* Uebersicht */ = {
isa = PBXNativeTarget;
buildConfigurationList = DC43ADAD17EC2D9500241CC2 /* Build configuration list for PBXNativeTarget "Uebersicht" */;
buildPhases = (
23C6390C35B95DC020D8A7A6 /* [CP] Check Pods Manifest.lock */,
DC06A1C01985092700789130 /* Compile JS */,
DC43AD7817EC2D9500241CC2 /* Sources */,
DC43AD7917EC2D9500241CC2 /* Frameworks */,
DC43AD7A17EC2D9500241CC2 /* Resources */,
DC92346F23015178009D9E2F /* Run Script */,
408EC9591BE0037CFA86EB7A /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Uebersicht;
productName = "Übersicht";
productReference = DC43AD7C17EC2D9500241CC2 /* 桌面小组件.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
DC43AD7417EC2D9500241CC2 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = UB;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = tracesOf;
TargetAttributes = {
DC43AD7B17EC2D9500241CC2 = {
DevelopmentTeam = 65D7ZZT739;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.HardenedRuntime = {
enabled = 1;
};
com.apple.Sandbox = {
enabled = 0;
};
};
};
};
};
buildConfigurationList = DC43AD7717EC2D9500241CC2 /* Build configuration list for PBXProject "Uebersicht" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
Base,
"zh-HK",
);
mainGroup = DC43AD7317EC2D9500241CC2;
productRefGroup = DC43AD7D17EC2D9500241CC2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
DC43AD7B17EC2D9500241CC2 /* Uebersicht */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
DC43AD7A17EC2D9500241CC2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DC62CC731E1C0F73004F85B8 /* Uebersicht.sdef in Resources */,
DCECA1CF1894008800C0CA32 /* MainMenu.xib in Resources */,
DC9296AC1C501D34006E4267 /* widget-status-hidden@2x.png in Resources */,
DC43AD9817EC2D9500241CC2 /* Images.xcassets in Resources */,
DC9296A71C5017CF006E4267 /* widget-status-visible.png in Resources */,
DC4F43F4189E90DD00937925 /* status-icon@2x.png in Resources */,
DC4FC28118EAB1CA00B7FD79 /* übersicht-logo.png in Resources */,
DC4F43F3189E90DD00937925 /* status-icon.png in Resources */,
DC9296A81C5017CF006E4267 /* widget-status-visible@2x.png in Resources */,
E0EA7A6227CA42DB00BC6693 /* Sparkle in Resources */,
DC9296AB1C501D34006E4267 /* widget-status-hidden.png in Resources */,
DCECA1CE1893FE5500C0CA32 /* node_modules in Resources */,
DCECA1CA1893F4EF00C0CA32 /* public in Resources */,
DC57ED2E18DB4EC900A24FDD /* UBPreferencesController.xib in Resources */,
DCECA1C71893F23200C0CA32 /* localnode in Resources */,
DC404DF51D294B3100305CE2 /* geolocation.js in Resources */,
E0EA7A6327CA42DB00BC6693 /* SocketRocket in Resources */,
DCAAAF9618DF0B050097677F /* GettingStarted.jsx in Resources */,
DCECA1C81893F23200C0CA32 /* server.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
23C6390C35B95DC020D8A7A6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Uebersicht-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
408EC9591BE0037CFA86EB7A /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Uebersicht/Pods-Uebersicht-frameworks.sh",
"${PODS_ROOT}/Sparkle/Sparkle.framework",
"${PODS_ROOT}/Sparkle/Sparkle.framework.dSYM",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework",
"${DWARF_DSYM_FOLDER_PATH}/Sparkle.framework.dSYM",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Uebersicht/Pods-Uebersicht-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
DC06A1C01985092700789130 /* Compile JS */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Compile JS";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=$PATH:/usr/local/bin\ncd server && npm run-script release\n";
};
DC92346F23015178009D9E2F /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Run Script";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "
";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
DC43AD7817EC2D9500241CC2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DCC74B26252AF6DA00C1D1E5 /* UBWindowGroup.m in Sources */,
DC9F7CE31C439CE50014E25B /* UBDispatcher.m in Sources */,
DCE7E3C11A376AD400A12516 /* UBLocation.m in Sources */,
DC43ADB517EC35A800241CC2 /* UBWindow.m in Sources */,
DCF9D9011E9D512600D27988 /* UBReloadCommand.m in Sources */,
DC314A201C0EE024000A56D2 /* UBWidgetsController.m in Sources */,
DC4913961BEF9A75003E76EF /* UBScreensController.m in Sources */,
DCBD665922F823AC0043E434 /* UBWebView.m in Sources */,
DCC7B2F61C575BCE00F563C8 /* UBWidgetsStore.m in Sources */,
DCCBDB992524638400FFAAE1 /* UBWindowsController.m in Sources */,
DCAC78CA1C550B810051E78B /* UBWebSocket.m in Sources */,
DC43AD8C17EC2D9500241CC2 /* main.m in Sources */,
DCB95A8D22FAD3F60066A51A /* UBApplication.m in Sources */,
DC74D0781E1A71E500893D53 /* UBRefreshCommand.m in Sources */,
DC404DF31D2844E100305CE2 /* UBWebViewController.m in Sources */,
DC66522D1E212735003267AF /* UBWidgetForScripting.m in Sources */,
DCAC78CD1C551D130051E78B /* UBListener.m in Sources */,
DC43AD9317EC2D9500241CC2 /* UBAppDelegate.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
DC43AD9417EC2D9500241CC2 /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
DC43AD9517EC2D9500241CC2 /* Base */,
E0A0673E27C6BB7E005CA910 /* zh-HK */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
DC43ADAB17EC2D9500241CC2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
};
DC43ADAC17EC2D9500241CC2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
SDKROOT = macosx;
};
name = Release;
};
DC43ADAE17EC2D9500241CC2 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 2B2DEDD7D214E00F6E0F133D /* Pods-Uebersicht.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Uebersicht/Übersicht.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 69;
DEVELOPMENT_TEAM = 65D7ZZT739;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
"$(PROJECT_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Uebersicht/Uebersicht-Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/Uebersicht/Uebersicht-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
"LD_RUNPATH_SEARCH_PATHS[arch=*]" = "@loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 1.6;
OTHER_CODE_SIGN_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = tracesOf.Uebersicht;
PRODUCT_NAME = "桌面小组件";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
WRAPPER_EXTENSION = app;
};
name = Debug;
};
DC43ADAF17EC2D9500241CC2 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1F1AEE7879137369A94611DB /* Pods-Uebersicht.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "Uebersicht/Übersicht.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 69;
DEVELOPMENT_TEAM = 65D7ZZT739;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
"$(PROJECT_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Uebersicht/Uebersicht-Prefix.pch";
INFOPLIST_FILE = "$(SRCROOT)/Uebersicht/Uebersicht-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
"LD_RUNPATH_SEARCH_PATHS[arch=*]" = "@loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MARKETING_VERSION = 1.6;
OTHER_CODE_SIGN_FLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = tracesOf.Uebersicht;
PRODUCT_NAME = "桌面小组件";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx;
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
DC43AD7717EC2D9500241CC2 /* Build configuration list for PBXProject "Uebersicht" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DC43ADAB17EC2D9500241CC2 /* Debug */,
DC43ADAC17EC2D9500241CC2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
DC43ADAD17EC2D9500241CC2 /* Build configuration list for PBXNativeTarget "Uebersicht" */ = {
isa = XCConfigurationList;
buildConfigurations = (
DC43ADAE17EC2D9500241CC2 /* Debug */,
DC43ADAF17EC2D9500241CC2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = DC43AD7417EC2D9500241CC2 /* Project object */;
}

View File

@@ -0,0 +1 @@
e8abf4c6-9c77-4826-b4cd-29108ef2c5b9

View File

@@ -0,0 +1 @@
bce31bce-5dde-4674-85d2-2958109bf24e

View File

@@ -0,0 +1 @@
2d3f6bcf-02a0-433b-b602-b8e6088aad64

View File

@@ -0,0 +1 @@
4ed7200e-67e1-4470-9996-d3dafc2c7e75

View File

@@ -0,0 +1,716 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="494" id="495"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29">
<items>
<menuItem title="桌面小组件" id="56">
<menu key="submenu" title="桌面小组件" systemMenu="apple" id="57">
<items>
<menuItem title="About Übersicht" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="236">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Preferences…" keyEquivalent="," id="129"/>
<menuItem isSeparatorItem="YES" id="143">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Services" id="131">
<menu key="submenu" title="Services" systemMenu="services" id="130"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide Übersicht" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-1" id="367"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="145">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="368"/>
</connections>
</menuItem>
<menuItem title="Show All" id="150">
<connections>
<action selector="unhideAllApplications:" target="-1" id="370"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit Übersicht" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-3" id="449"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="83">
<menu key="submenu" title="File" id="81">
<items>
<menuItem title="New" keyEquivalent="n" id="82">
<connections>
<action selector="newDocument:" target="-1" id="373"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="72">
<connections>
<action selector="openDocument:" target="-1" id="374"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="124">
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
<items>
<menuItem title="Clear Menu" id="126">
<connections>
<action selector="clearRecentDocuments:" target="-1" id="127"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="79">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Close" keyEquivalent="w" id="73">
<connections>
<action selector="performClose:" target="-1" id="193"/>
</connections>
</menuItem>
<menuItem title="Save…" keyEquivalent="s" id="75">
<connections>
<action selector="saveDocument:" target="-1" id="362"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" id="112">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="revertDocumentToSaved:" target="-1" id="364"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="74">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Page Setup..." keyEquivalent="P" id="77">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="runPageLayout:" target="-1" id="87"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="78">
<connections>
<action selector="print:" target="-1" id="86"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="217">
<menu key="submenu" title="Edit" id="205">
<items>
<menuItem title="Undo" keyEquivalent="z" id="207">
<connections>
<action selector="undo:" target="-1" id="223"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="215">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="redo:" target="-1" id="231"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="206">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Cut" keyEquivalent="x" id="199">
<connections>
<action selector="cut:" target="-1" id="228"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="197">
<connections>
<action selector="copy:" target="-1" id="224"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="203">
<connections>
<action selector="paste:" target="-1" id="226"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="485">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="486"/>
</connections>
</menuItem>
<menuItem title="Delete" id="202">
<connections>
<action selector="delete:" target="-1" id="235"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="198">
<connections>
<action selector="selectAll:" target="-1" id="232"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="214">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Find" id="218">
<menu key="submenu" title="Find" id="220">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
<connections>
<action selector="performFindPanelAction:" target="-1" id="241"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="534">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="535"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208">
<connections>
<action selector="performFindPanelAction:" target="-1" id="487"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="488"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221">
<connections>
<action selector="performFindPanelAction:" target="-1" id="489"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="216">
<menu key="submenu" title="Spelling and Grammar" id="200">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204">
<connections>
<action selector="showGuessPanel:" target="-1" id="230"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="201">
<connections>
<action selector="checkSpelling:" target="-1" id="225"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="453"/>
<menuItem title="Check Spelling While Typing" id="219">
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="346">
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="454">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="456"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="348">
<menu key="submenu" title="Substitutions" id="349">
<items>
<menuItem title="Show Substitutions" id="457">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="458"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="459"/>
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="460">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="461"/>
</connections>
</menuItem>
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="462">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="-1" id="463"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Transformations" id="450">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Transformations" id="451">
<items>
<menuItem title="Make Upper Case" id="452">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="-1" id="464"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="465">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="-1" id="468"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="466">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="-1" id="467"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="211">
<menu key="submenu" title="Speech" id="212">
<items>
<menuItem title="Start Speaking" id="196">
<connections>
<action selector="startSpeaking:" target="-1" id="233"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="195">
<connections>
<action selector="stopSpeaking:" target="-1" id="227"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Format" id="375">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Format" id="376">
<items>
<menuItem title="Font" id="377">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Font" systemMenu="font" id="388">
<items>
<menuItem title="Show Fonts" keyEquivalent="t" id="389">
<connections>
<action selector="orderFrontFontPanel:" target="420" id="424"/>
</connections>
</menuItem>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="390">
<connections>
<action selector="addFontTrait:" target="420" id="421"/>
</connections>
</menuItem>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="391">
<connections>
<action selector="addFontTrait:" target="420" id="422"/>
</connections>
</menuItem>
<menuItem title="Underline" keyEquivalent="u" id="392">
<connections>
<action selector="underline:" target="-1" id="432"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="393"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="394">
<connections>
<action selector="modifyFont:" target="420" id="425"/>
</connections>
</menuItem>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="395">
<connections>
<action selector="modifyFont:" target="420" id="423"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="396"/>
<menuItem title="Kern" id="397">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Kern" id="415">
<items>
<menuItem title="Use Default" id="416">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardKerning:" target="-1" id="438"/>
</connections>
</menuItem>
<menuItem title="Use None" id="417">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffKerning:" target="-1" id="441"/>
</connections>
</menuItem>
<menuItem title="Tighten" id="418">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="tightenKerning:" target="-1" id="431"/>
</connections>
</menuItem>
<menuItem title="Loosen" id="419">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="loosenKerning:" target="-1" id="435"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Ligatures" id="398">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Ligatures" id="411">
<items>
<menuItem title="Use Default" id="412">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardLigatures:" target="-1" id="439"/>
</connections>
</menuItem>
<menuItem title="Use None" id="413">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffLigatures:" target="-1" id="440"/>
</connections>
</menuItem>
<menuItem title="Use All" id="414">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAllLigatures:" target="-1" id="434"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Baseline" id="399">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Baseline" id="405">
<items>
<menuItem title="Use Default" id="406">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unscript:" target="-1" id="437"/>
</connections>
</menuItem>
<menuItem title="Superscript" id="407">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="superscript:" target="-1" id="430"/>
</connections>
</menuItem>
<menuItem title="Subscript" id="408">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="subscript:" target="-1" id="429"/>
</connections>
</menuItem>
<menuItem title="Raise" id="409">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="raiseBaseline:" target="-1" id="426"/>
</connections>
</menuItem>
<menuItem title="Lower" id="410">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowerBaseline:" target="-1" id="427"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="400"/>
<menuItem title="Show Colors" keyEquivalent="C" id="401">
<connections>
<action selector="orderFrontColorPanel:" target="-1" id="433"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="402"/>
<menuItem title="Copy Style" keyEquivalent="c" id="403">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="copyFont:" target="-1" id="428"/>
</connections>
</menuItem>
<menuItem title="Paste Style" keyEquivalent="v" id="404">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteFont:" target="-1" id="436"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Text" id="496">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Text" id="497">
<items>
<menuItem title="Align Left" keyEquivalent="{" id="498">
<connections>
<action selector="alignLeft:" target="-1" id="524"/>
</connections>
</menuItem>
<menuItem title="Center" keyEquivalent="|" id="499">
<connections>
<action selector="alignCenter:" target="-1" id="518"/>
</connections>
</menuItem>
<menuItem title="Justify" id="500">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="alignJustified:" target="-1" id="523"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="501">
<connections>
<action selector="alignRight:" target="-1" id="521"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="502"/>
<menuItem title="Writing Direction" id="503">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Writing Direction" id="508">
<items>
<menuItem title="Paragraph" enabled="NO" id="509">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="510">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="525"/>
</connections>
</menuItem>
<menuItem id="511">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="526"/>
</connections>
</menuItem>
<menuItem id="512">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="527"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="513"/>
<menuItem title="Selection" enabled="NO" id="514">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="515">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionNatural:" target="-1" id="528"/>
</connections>
</menuItem>
<menuItem id="516">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="529"/>
</connections>
</menuItem>
<menuItem id="517">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="530"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="504"/>
<menuItem title="Show Ruler" id="505">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleRuler:" target="-1" id="520"/>
</connections>
</menuItem>
<menuItem title="Copy Ruler" keyEquivalent="c" id="506">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="copyRuler:" target="-1" id="522"/>
</connections>
</menuItem>
<menuItem title="Paste Ruler" keyEquivalent="v" id="507">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="pasteRuler:" target="-1" id="519"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="295">
<menu key="submenu" title="View" id="296">
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="297">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="-1" id="366"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="298">
<connections>
<action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="19">
<menu key="submenu" title="Window" systemMenu="window" id="24">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="23">
<connections>
<action selector="performMiniaturize:" target="-1" id="37"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="239">
<connections>
<action selector="performZoom:" target="-1" id="240"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="92">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Bring All to Front" id="5">
<connections>
<action selector="arrangeInFront:" target="-1" id="39"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="490">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="491">
<items>
<menuItem title="Übersicht Help" keyEquivalent="?" id="492">
<connections>
<action selector="showHelp:" target="-1" id="493"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
<point key="canvasLocation" x="139" y="154"/>
</menu>
<customObject id="494" customClass="UBAppDelegate">
<connections>
<outlet property="statusBarMenu" destination="MVS-hI-V8a" id="3Z1-Cq-kzP"/>
</connections>
</customObject>
<customObject id="420" customClass="NSFontManager"/>
<customObject id="Y8H-N0-yva" customClass="SUUpdater"/>
<menu id="MVS-hI-V8a" userLabel="Status Bar Menu">
<items>
<menuItem title="关于软件" id="YQt-G2-uKH">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="VpR-KV-QA6"/>
</connections>
</menuItem>
<menuItem title="检查新版" id="ssJ-cC-6aL">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="Y8H-N0-yva" id="qoy-Sj-8OL"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="LqA-wK-nbB"/>
<menuItem title="本地组件目录" id="FhM-7d-UOL">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="openWidgetDir:" target="494" id="dH8-iw-QzP"/>
</connections>
</menuItem>
<menuItem title="访问组件库" id="g8k-60-Yu1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="visitWidgetGallery:" target="494" id="4jL-gZ-cAv"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="T85-qJ-hLx"/>
<menuItem title="打开调试控制台" id="mKH-1l-jB3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="showDebugConsole:" target="494" id="WYx-qr-JoR"/>
</connections>
</menuItem>
<menuItem title="刷新所有组件" id="wAr-ms-Hyi">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="refreshWidgets:" target="494" id="FyP-k0-ed8"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="3lc-y2-Kmh"/>
<menuItem title="软件设置" id="TZv-Vq-BWQ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="showPreferences:" target="494" id="qjh-Ub-oPp"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="V85-Ke-XHw"/>
<menuItem title="退出" id="0lC-di-1Ep">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="terminate:" target="-3" id="cGI-2B-ql0"/>
</connections>
</menuItem>
</items>
<point key="canvasLocation" x="147.5" y="273.5"/>
</menu>
</objects>
</document>

View File

@@ -0,0 +1,68 @@
import { css, run } from "uebersicht"
export const command = "ls"
export const refreshFrequency = 100000 // ms
export const className = css`
left: 200px;
top: 10px;
`
const hello = css`
font-size: 40px;
color: #fff;
`
const liclass = css`
color: #fff;
`
const submit = css`
font-size: 16px;
padding: 10px 15px;
border-radius: 6px;
border: none;
background: red;
color: #fff;
`
// 定义变量
export const initialState = {
count: 2,
list: [
{ id: 1, title: '新闻列表1' },
{ id: 2, title: '新闻列表2' },
{ id: 3, title: '新闻列表3' },
]
};
// 初始化函数
export const init = (dispatch) => {
console.log("init run....")
}
// 更新数据状态,刷新页面
export const updateState = (event, previousState) => {
console.log("event: ", event);
console.log("previousState: ", previousState);
return Object.assign(previousState,event);
}
export const render = ({ output, count, list }, dispatch) => (
<div>
<h1 className={hello}>h1 测试{count}</h1>
<h3 className={liclass}>h2 标签执行shell命令ls -a得到的返回: {output}</h3>
<ul>
{
list.map((e,i) => {
return <li className={liclass} key={i}>{i} {e.title}</li>
})
}
</ul>
<button className={submit} onClick={() => {
count+=1;
dispatch({ count: count })
console.log("点击事件");
}}>button按钮 - 点我 增加计数器</button>
</div>
)

View File

@@ -0,0 +1 @@
7fb5981b-2ec9-4eae-9222-f9198f7a817c

View File

@@ -0,0 +1 @@
4c10b15d-f82b-449b-92aa-c2dc2a892e6d

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

View File

@@ -0,0 +1,68 @@
{
"images" : [
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "512@2x.png",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,31 @@
//
// UBAppDelegate.h
// Übersicht
//
// Created by Felix Hageloh on 20/9/13.
// Copyright (c) 2013 Felix Hageloh.
//
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
#import <Cocoa/Cocoa.h>
#import "UBScreenChangeListener.h"
@interface UBAppDelegate : NSObject <NSApplicationDelegate, NSUserNotificationCenterDelegate, UBScreenChangeListener>
@property (weak) IBOutlet NSMenu *statusBarMenu;
@property (readonly) NSArray* widgets;
- (void)widgetDirDidChange;
- (void)interactionDidChange;
- (void)screensChanged:(NSDictionary*)screens;
- (IBAction)showPreferences:(id)sender;
- (IBAction)openWidgetDir:(id)sender;
- (IBAction)showDebugConsole:(id)sender;
- (IBAction)refreshWidgets:(id)sender;
- (void)reloadWidget:(NSString*)widgetId;
- (void)loginShellDidChange;
@end

View File

@@ -0,0 +1,466 @@
//
// UBAppDelegate.m
// Übersicht
//
// Created by Felix Hageloh on 20/9/13.
// Copyright (c) 2013 Felix Hageloh.
//
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
#import "UBAppDelegate.h"
#import "UBWindow.h"
#import "UBPreferencesController.m"
#import "UBScreensController.h"
#import "UBWidgetsController.h"
#import "UBWidgetsStore.h"
#import "UBWebSocket.h"
#import "UBWindowsController.h"
int const PORT = 41416;
@implementation UBAppDelegate {
NSStatusItem* statusBarItem;
NSTask* widgetServer;
UBPreferencesController* preferences;
UBScreensController* screensController;
UBWindowsController* windowsController;
BOOL keepServerAlive;
int portOffset;
UBWidgetsStore* widgetsStore;
UBWidgetsController* widgetsController;
BOOL needsRefresh;
}
@synthesize statusBarMenu;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
needsRefresh = YES;
statusBarItem = [self addStatusItemToMenu: statusBarMenu];
preferences = [[UBPreferencesController alloc]
initWithWindowNibName:@"UBPreferencesController"
];
// NSTask doesn't terminate when xcode stop is pressed. Other ways of
// spawning the server, like system() or popen() have the same problem.
// So, hit em with a hammer :(
system("killall localnode");
widgetsStore = [[UBWidgetsStore alloc] init];
screensController = [[UBScreensController alloc]
initWithChangeListener:self
];
windowsController = [[UBWindowsController alloc] init];
widgetsController = [[UBWidgetsController alloc]
initWithMenu: statusBarMenu
widgets: widgetsStore
screens: screensController
preferences: preferences
];
[widgetsStore onChange: ^(NSDictionary* widgets) {
[self->widgetsController render];
}];
// make sure notifcations always show
NSUserNotificationCenter* unc = [NSUserNotificationCenter
defaultUserNotificationCenter
];
unc.delegate = self;
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver: self
selector: @selector(wakeFromSleep:)
name: NSWorkspaceDidWakeNotification
object: nil
];
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver: self
selector: @selector(workspaceChanged:)
name: NSWorkspaceActiveSpaceDidChangeNotification
object: nil
];
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver: self
selector: @selector(loginSessionBecameActive:)
name: NSWorkspaceSessionDidBecomeActiveNotification
object: nil
];
[[[NSWorkspace sharedWorkspace] notificationCenter]
addObserver: self
selector: @selector(loginSessionResigned:)
name: NSWorkspaceSessionDidResignActiveNotification
object: nil
];
// start server and load webview
portOffset = 0;
[self startUp];
[self listenToWallpaperChanges];
}
- (NSDictionary*)fetchState
{
[[UBWebSocket sharedSocket] open:[self serverUrl:@"ws"]];
NSURL *urlPath = [[self serverUrl:@"http"] URLByAppendingPathComponent: @"state/"];
NSData *jsonData = [NSData dataWithContentsOfURL:urlPath];
NSError *error = nil;
NSDictionary *dataDictionary = [NSJSONSerialization
JSONObjectWithData: jsonData
options: NSJSONReadingMutableContainers
error: &error
];
if (error) NSLog(@"%@", error);
return dataDictionary;
}
- (void)startUp
{
NSLog(@"starting server task");
void (^handleData)(NSString*) = ^(NSString* output) {
// note that these might be called several times
if ([output rangeOfString:@"server started"].location != NSNotFound) {
[self->widgetsStore reset: [self fetchState]];
// this will trigger a render
[self->screensController syncScreens:self];
} else if ([output rangeOfString:@"EADDRINUSE"].location != NSNotFound) {
self->portOffset++;
}
};
void (^handleExit)(NSTask*) = ^(NSTask* theTask) {
[self shutdown];
if (self->portOffset >= 20) {
self->keepServerAlive = NO;
NSLog(@"couldn't find an open port. Giving up...");
}
if (self->keepServerAlive) {
[self
performSelector: @selector(startUp)
withObject: nil
afterDelay: 1.0
];
}
};
keepServerAlive = YES;
widgetServer = [self
launchWidgetServer: [preferences.widgetDir path]
onData: handleData
onExit: handleExit
];
}
- (void)shutdown:(Boolean)keepAlive
{
keepServerAlive = keepAlive;
[windowsController closeAll];
[[UBWebSocket sharedSocket] close];
if (widgetServer){
[widgetServer terminate];
}
}
- (void)shutdown
{
[self shutdown:false];
}
- (void)applicationWillTerminate:(NSNotification *)notification
{
keepServerAlive = NO;
[widgetServer terminate];
[[NSStatusBar systemStatusBar] removeStatusItem:statusBarItem];
}
- (NSStatusItem*)addStatusItemToMenu:(NSMenu*)aMenu
{
NSStatusBar* bar = [NSStatusBar systemStatusBar];
NSStatusItem* item;
item = [bar statusItemWithLength: NSSquareStatusItemLength];
NSImage *image = [[NSBundle mainBundle] imageForResource:@"status-icon"];
[image setTemplate:YES];
[item.button setImage: image];
[item setMenu:aMenu];
[item setEnabled:YES];
return item;
}
- (NSTask*)launchWidgetServer:(NSString*)widgetPath
onData:(void (^)(NSString*))dataHandler
onExit:(void (^)(NSTask*))exitHandler
{
NSBundle* bundle = [NSBundle mainBundle];
NSString* nodePath = [bundle pathForResource:@"localnode" ofType:nil];
NSString* serverPath = [bundle pathForResource:@"server" ofType:@"js"];
BOOL loginShell = [[NSUserDefaults standardUserDefaults]
boolForKey:@"loginShell"
];
NSTask *task = [[NSTask alloc] init];
[task setStandardOutput:[NSPipe pipe]];
[task.standardOutput fileHandleForReading].readabilityHandler = ^(NSFileHandle *handle) {
NSData *output = [handle availableData];
NSString *outStr = [[NSString alloc]
initWithData:output
encoding:NSUTF8StringEncoding
];
NSLog(@"%@", outStr);
dispatch_async(dispatch_get_main_queue(), ^{
dataHandler(outStr);
});
};
task.terminationHandler = ^(NSTask *theTask) {
[theTask.standardOutput fileHandleForReading].readabilityHandler = nil;
dispatch_async(dispatch_get_main_queue(), ^{
exitHandler(theTask);
});
};
[task setLaunchPath:nodePath];
[task setArguments:@[
serverPath,
@"-d", widgetPath,
@"-p", [NSString stringWithFormat:@"%d", PORT + portOffset],
@"-s", [[self getPreferencesDir] path],
loginShell ? @"--login-shell" : @""
]];
[task launch];
return task;
}
- (NSURL*)getPreferencesDir
{
NSArray* urls = [[NSFileManager defaultManager]
URLsForDirectory:NSApplicationSupportDirectory
inDomains:NSUserDomainMask
];
return [urls[0]
URLByAppendingPathComponent:[[NSBundle mainBundle] bundleIdentifier]
isDirectory:YES
];
}
- (NSURL*)serverUrl:(NSString*)protocol
{
// trailing slash required for load policy in UBWindow
return [NSURL
URLWithString:[NSString
stringWithFormat:@"%@://127.0.0.1:%d/", protocol, PORT+portOffset
]
];
}
#
#pragma mark Screen Handling
#
- (void)screensChanged:(NSDictionary*)screens
{
if (widgetsController) {
[windowsController
updateWindows:screens
baseUrl: [self serverUrl: @"http"]
interactionEnabled: preferences.enableInteraction
forceRefresh: needsRefresh
];
needsRefresh = NO;
}
}
#
# pragma mark received actions
#
- (void)widgetDirDidChange
{
[self shutdown:true];
}
- (void)loginShellDidChange
{
[self shutdown:true];
}
- (void)interactionDidChange
{
[windowsController closeAll];
needsRefresh = YES;
[screensController syncScreens:self];
}
- (IBAction)showPreferences:(id)sender
{
[preferences showWindow:nil];
[NSApp activateIgnoringOtherApps:YES];
[preferences.window makeKeyAndOrderFront:self];
}
- (IBAction)openWidgetDir:(id)sender
{
[[NSWorkspace sharedWorkspace]openURL:preferences.widgetDir];
}
- (IBAction)visitWidgetGallery:(id)sender
{
[[NSWorkspace sharedWorkspace]
openURL:[NSURL URLWithString:@"http://tracesof.net/uebersicht-widgets/"]
];
}
- (IBAction)refreshWidgets:(id)sender
{
needsRefresh = YES;
[screensController syncScreens:self];
}
- (IBAction)showDebugConsole:(id)sender
{
NSNumber* currentScreen = [[NSScreen mainScreen]
deviceDescription
][@"NSScreenNumber"];
[windowsController showDebugConsolesForScreen:currentScreen];
}
- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center
shouldPresentNotification:(NSUserNotification *)notification
{
return YES;
}
- (void)wakeFromSleep:(NSNotification *)notification
{
[windowsController reloadAll];
}
- (void)workspaceChanged:(NSNotification *)notification
{
[windowsController workspaceChanged];
}
- (void)wallpaperChanged:(NSNotification *)notification
{
[windowsController wallpaperChanged];
}
- (void)loginSessionBecameActive:(NSNotification *)notification
{
[self startUp];
}
- (void)loginSessionResigned:(NSNotification *)notification
{
[self shutdown];
}
- (void)listenToWallpaperChanges
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(
NSLibraryDirectory,
NSUserDomainMask,
YES
);
CFStringRef path = (__bridge CFStringRef)[paths[0]
stringByAppendingPathComponent:@"/Application Support/Dock/"
];
FSEventStreamContext context = {
0,
(__bridge void *)(self), NULL, NULL, NULL
};
FSEventStreamRef stream;
stream = FSEventStreamCreate(
NULL,
&wallpaperSettingsChanged,
&context,
CFArrayCreate(NULL, (const void **)&path, 1, NULL),
kFSEventStreamEventIdSinceNow,
0,
kFSEventStreamCreateFlagFileEvents | kFSEventStreamCreateFlagUseCFTypes
);
FSEventStreamScheduleWithRunLoop(
stream,
CFRunLoopGetCurrent(),
kCFRunLoopDefaultMode
);
FSEventStreamStart(stream);
}
void wallpaperSettingsChanged(
ConstFSEventStreamRef streamRef,
void *this,
size_t numEvents,
void *eventPaths,
const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[]
)
{
CFStringRef path;
CFArrayRef paths = eventPaths;
for (int i=0; i < numEvents; i++) {
path = CFArrayGetValueAtIndex(paths, i);
if (CFStringFindWithOptions(path, CFSTR("desktoppicture.db"),
CFRangeMake(0,CFStringGetLength(path)),
kCFCompareCaseInsensitive,
NULL) == true) {
[(__bridge UBAppDelegate*)this
performSelector:@selector(wallpaperChanged:)
withObject:nil
afterDelay:0.5
];
}
}
}
#
# pragma mark script support
#
- (NSArray*)getWidgets
{
return [widgetsController widgetsForScripting];
}
- (BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key
{
return [key isEqualToString:@"widgets"];
}
- (void)reloadWidget:(NSString*)widgetId
{
[widgetsController reloadWidget:widgetId];
}
@end

View File

@@ -0,0 +1,17 @@
//
// UBApplication.h
// Uebersicht
//
// Created by Felix Hageloh on 7/8/19.
// Copyright © 2019 tracesOf. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface UBApplication : NSApplication
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,21 @@
//
// UBApplication.m
// Uebersicht
//
// Created by Felix Hageloh on 7/8/19.
// Copyright © 2019 tracesOf. All rights reserved.
//
#import "UBApplication.h"
@implementation UBApplication
- (void)sendEvent:(NSEvent *)event
{
if (event.type == NSEventTypeMouseEntered) {
[event.window makeKeyWindow];
}
[super sendEvent:event];
}
@end

View File

@@ -0,0 +1,16 @@
//
// UBDispatcher.h
//
//
// Created by Felix Hageloh on 11/1/16.
//
//
#import <Foundation/Foundation.h>
@interface UBDispatcher : NSObject
- (void)dispatch:(NSString*)type withPayload:(id)payload;
@end

View File

@@ -0,0 +1,40 @@
//
// UBDispatcher.m
//
//
// Created by Felix Hageloh on 11/1/16.
//
//
#import "UBDispatcher.h"
#import "UBWebSocket.h"
@implementation UBDispatcher
- (void)dispatch:(NSString*)type withPayload:(id)payload
{
NSDictionary* message = @{ @"type": type, @"payload": payload };
NSError* error;
NSData* jsonData = [NSJSONSerialization
dataWithJSONObject: message
options: 0
error: &error
];
if (!jsonData) {
NSLog(@"err: %@", error);
return;
}
[[UBWebSocket sharedSocket]
send: [[NSString alloc]
initWithData:jsonData
encoding:NSUTF8StringEncoding
]
];
}
@end

View File

@@ -0,0 +1,15 @@
//
// UBListener.h
//
//
// Created by Felix Hageloh on 24/1/16.
//
//
#import <Foundation/Foundation.h>
@interface UBListener : NSObject
- (void)on:(NSString*)type do:(void (^)(id))callback;
@end

View File

@@ -0,0 +1,56 @@
//
// UBListener.m
//
//
// Created by Felix Hageloh on 24/1/16.
//
//
#import "UBListener.h"
#import "UBWebSocket.h"
@implementation UBListener {
NSMutableDictionary* listeners;
}
- (id)init
{
self = [super init];
if (self) {
listeners = [[NSMutableDictionary alloc] init];
[[UBWebSocket sharedSocket] listen:^(id message) {
[self handleMessage:message];
}];
}
return self;
}
- (void)on:(NSString*)type do:(void (^)(id))callback
{
if (!listeners[type]) {
listeners[type] = [[NSMutableArray alloc] init];
}
[listeners[type] addObject:callback];
}
- (void)handleMessage:(id)message
{
NSDictionary* parsedMessage = [NSJSONSerialization
JSONObjectWithData: [message dataUsingEncoding:NSUTF8StringEncoding]
options: 0
error: nil
];
NSString* type = parsedMessage[@"type"];
if (!listeners[type]) {
return;
}
for (void (^listener)(id) in listeners[type]) {
listener(parsedMessage[@"payload"]);
}
}
@end

View File

@@ -0,0 +1,18 @@
//
// UBLocation.h
// Übersicht
//
// Created by Felix Hageloh on 9/12/14.
// Copyright (c) 2014 tracesOf. All rights reserved.
//
#import <Foundation/Foundation.h>
@import WebKit;
@import CoreLocation;
@interface UBLocation : NSObject<CLLocationManagerDelegate, WKScriptMessageHandler>
//- (id) initWithContext:(JSContextRef)context;
//- (void)getCurrentPosition:(WebScriptObject *)callback;
@end

View File

@@ -0,0 +1,184 @@
//
// UBLocation.m
// Übersicht
//
// Created by Felix Hageloh on 9/12/14.
// Copyright (c) 2014 tracesOf. All rights reserved.
//
#import "UBLocation.h"
@implementation UBLocation {
CLLocationManager* locationManager;
CLGeocoder* geoCoder;
NSMutableDictionary* waitingForReponse;
NSString* callbackSignature;
NSString* currentPosition;
BOOL serviceStarted;
}
- (id)init {
self = [super init];
if (self) {
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
geoCoder = [[CLGeocoder alloc] init];
waitingForReponse = [[NSMutableDictionary alloc] init];
callbackSignature = @"__UBCallbacks__.call(%@, %@)";
serviceStarted = NO;
}
return self;
}
- (void)userContentController:(WKUserContentController *)controller
didReceiveScriptMessage:(WKScriptMessage *)message
{
NSString* callbackId = message.body[@"callbackId"];
if ([message.body[@"type"] isEqualToString:@"registerCallback"]) {
if (!serviceStarted) {
[self startService];
}
waitingForReponse[callbackId] = message;
if (currentPosition) {
[self respondToMessage:message withArguments:currentPosition];
}
} else if([message.body[@"type"] isEqualToString:@"removeCallback"]) {
[waitingForReponse removeObjectForKey:callbackId];
if (waitingForReponse.count == 0) {
[self stopService];
}
}
}
- (void)respondToMessage:(WKScriptMessage*)message withArguments:(NSString*)args
{
[message.webView
evaluateJavaScript: [NSString
stringWithFormat:callbackSignature,
message.body[@"callbackId"],
args
]
completionHandler: nil
];
}
- (void)startService
{
if (serviceStarted) { return; }
[locationManager startUpdatingLocation];
serviceStarted = YES;
}
- (void)stopService
{
if (!serviceStarted) { return; }
[locationManager stopUpdatingLocation];
currentPosition = nil;
serviceStarted = NO;
}
- (NSString*)toJSString:(CLLocation *)location placeMark:(CLPlacemark*)placeMark
{
// Coordinates properties (Position.coords)
CLLocationDegrees latitude = location.coordinate.latitude;
CLLocationDegrees longitude = location.coordinate.longitude;
CLLocationDistance altitude = location.altitude;
CLLocationSpeed speed = location.speed;
CLLocationDirection heading = location.course;
CLLocationAccuracy accuracy = location.horizontalAccuracy;
CLLocationAccuracy altitudeAccuracy = location.verticalAccuracy;
NSDate *timestamp = location.timestamp;
NSDictionary *address = placeMark.addressDictionary;
NSString* format = @"{ \
\"position\": { \
\"timestamp\": %f, \
\"coords\": { \
\"latitude\": %f, \
\"longitude\": %f, \
\"altitude\": %f, \
\"accuracy\": %f, \
\"altitudeAccuracy\": %f, \
\"heading\": %f, \
\"speed\": %f \
} \
}, \
\"address\": { \
\"street\": \"%@\", \
\"city\": \"%@\", \
\"zip\": \"%@\", \
\"country\": \"%@\", \
\"state\": \"%@\", \
\"CountryCode\": \"%@\" \
} \
}";
return [NSString
stringWithFormat:format,
(timestamp.timeIntervalSince1970 * 1000),
latitude,
longitude,
altitude,
accuracy,
altitudeAccuracy,
heading,
speed,
address[@"Street"],
address[@"City"],
address[@"ZIP"],
address[@"Country"],
address[@"State"],
address[@"CountryCode"]
];
}
#
#pragma mark CoreLocation delegates
#
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations
{
CLLocation *location = [locations lastObject];
[geoCoder cancelGeocode];
[geoCoder
reverseGeocodeLocation:location
completionHandler:^(NSArray *placemarks, NSError *error) {
if (error) return;
CLPlacemark *placemark = ((CLPlacemark*)placemarks[0]);
self->currentPosition = [self toJSString:location placeMark:placemark];
for (id callbackId in self->waitingForReponse) {
[self
respondToMessage: self->waitingForReponse[callbackId]
withArguments: self->currentPosition
];
}
}
];
}
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error
{
}
@end

View File

@@ -0,0 +1,26 @@
//
// UBPreferencesController.h
// Übersicht
//
// Created by Felix Hageloh on 20/3/14.
// Copyright (c) 2014 Felix Hageloh.
//
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
#import <Cocoa/Cocoa.h>
@interface UBPreferencesController : NSWindowController
@property (weak) IBOutlet NSPopUpButton *filePicker;
@property BOOL startAtLogin;
@property BOOL compatibilityMode;
@property NSURL* widgetDir;
@property BOOL loginShell;
@property BOOL enableInteraction;
- (IBAction)showFilePicker:(id)sender;
@end

View File

@@ -0,0 +1,275 @@
//
// UBPreferencesController.m
// Übersicht
//
// Created by Felix Hageloh on 20/3/14.
// Copyright (c) 2014 Felix Hageloh.
//
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
#import "UBPreferencesController.h"
@implementation UBPreferencesController {
LSSharedFileListRef loginItems;
}
@synthesize filePicker;
- (id)initWithWindowNibName:(NSString *)windowNibName
{
self = [super initWithWindowNibName:windowNibName];
if (self) {
NSData* defaultWidgetDir = [self ensureDefaultsWidgetDir];
NSDictionary *appDefaults = @{
@"widgetDirectory": defaultWidgetDir,
@"enableInteraction": @YES
};
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
// watch for login item changes
loginItems = LSSharedFileListCreate(NULL,
kLSSharedFileListSessionLoginItems,
NULL);
LSSharedFileListAddObserver(loginItems,
CFRunLoopGetMain(),
kCFRunLoopCommonModes,
loginItemsChanged,
(__bridge void*)self);
}
return self;
}
- (void)windowDidLoad
{
[super windowDidLoad];
[[self.window standardWindowButton:NSWindowMiniaturizeButton] setEnabled:NO];
[[self.window standardWindowButton:NSWindowZoomButton] setEnabled:NO];
[self widgetDirChanged:self.widgetDir];
}
#
#pragma mark Widget Directory
#
- (IBAction)showFilePicker:(id)sender
{
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles:NO];
[openPanel setCanChooseDirectories:YES];
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton) {
[self setWidgetDir:[openPanel URLs][0]];
}
[self->filePicker selectItemAtIndex:0];
}];
}
- (NSURL*)widgetDir
{
NSData* widgetDir = [[NSUserDefaults standardUserDefaults]
objectForKey:@"widgetDirectory"];
return [NSKeyedUnarchiver unarchiveObjectWithData:widgetDir];
}
- (void)setWidgetDir:(NSURL*)newDir
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[NSKeyedArchiver archivedDataWithRootObject:newDir]
forKey:@"widgetDirectory"];
[self widgetDirChanged:newDir];
[(UBAppDelegate *)[NSApp delegate] widgetDirDidChange];
}
- (void)widgetDirChanged:(NSURL*)url
{
NSImage *iconImage = [[NSWorkspace sharedWorkspace] iconForFile:[url path]];
[iconImage setSize:NSMakeSize(16,16)];
// TODO: see if we could use bindings for this
[[filePicker itemAtIndex:0] setTitle: [url path]];
[[filePicker itemAtIndex:0] setImage:iconImage];
}
- (NSData*)ensureDefaultsWidgetDir
{
NSArray* urls = [[NSFileManager defaultManager]
URLsForDirectory:NSApplicationSupportDirectory
inDomains:NSUserDomainMask
];
NSURL* defaultDir = [urls[0]
URLByAppendingPathComponent:@"Übersicht/widgets"
isDirectory:YES
];
[self createIfNotExists:defaultDir];
return [NSKeyedArchiver archivedDataWithRootObject:defaultDir];
}
- (void)createIfNotExists:(NSURL*)defaultWidgetDir
{
NSFileManager* fileManager = [NSFileManager defaultManager];
BOOL isDir;
if ([fileManager fileExistsAtPath:[defaultWidgetDir path] isDirectory:&isDir] && isDir) {
return;
}
NSError* error;
[fileManager createDirectoryAtURL:defaultWidgetDir
withIntermediateDirectories:YES
attributes:nil
error:&error];
if (error) {
NSLog(@"%@", error);
return;
}
NSURL* gettinStartedWidget = [[NSBundle mainBundle] URLForResource:@"GettingStarted" withExtension:@"jsx"];
[fileManager copyItemAtURL:gettinStartedWidget
toURL:[defaultWidgetDir URLByAppendingPathComponent:@"GettingStarted.jsx"]
error:&error];
NSURL* logo = [[NSBundle mainBundle] URLForResource:@"übersicht-logo" withExtension:@"png"];
[fileManager copyItemAtURL:logo
toURL:[defaultWidgetDir URLByAppendingPathComponent:@"logo.png"]
error:&error];
if (error) {
NSLog(@"%@", error);
}
}
#
#pragma mark Login Shell
#
- (BOOL)loginShell
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
return [defaults boolForKey:@"loginShell"];
}
- (void)setLoginShell:(BOOL)enabled
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:enabled forKey:@"loginShell"];
[(UBAppDelegate *)[NSApp delegate] loginShellDidChange];
}
#
#pragma mark Interaction
#
- (BOOL)enableInteraction
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
return [[defaults valueForKey:@"enableInteraction"] boolValue];
}
- (void)setEnableInteraction:(BOOL)enabled
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@(enabled) forKey:@"enableInteraction"];
[(UBAppDelegate *)[NSApp delegate] interactionDidChange];
}
#
#pragma mark Startup
#
- (BOOL)startAtLogin
{
return [self getLoginItem] != NULL;
}
- (void)setStartAtLogin:(BOOL)doStart
{
if (doStart) {
NSURL *bundleURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
LSSharedFileListInsertItemURL(loginItems,
kLSSharedFileListItemLast,
NULL,
NULL,
(__bridge CFURLRef)bundleURL,
NULL,
NULL);
} else {
LSSharedFileListItemRef loginItemRef = [self getLoginItem];
if (loginItemRef) {
LSSharedFileListItemRemove(loginItems, loginItemRef);
CFRelease(loginItemRef);
}
}
}
- (LSSharedFileListItemRef)getLoginItem
{
CFArrayRef snapshotRef = LSSharedFileListCopySnapshot(loginItems, NULL);
NSURL *bundleURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
LSSharedFileListItemRef itemRef = NULL;
CFURLRef itemURLRef;
for (id item in (__bridge NSArray*)snapshotRef) {
itemRef = (__bridge LSSharedFileListItemRef)item;
if (LSSharedFileListItemResolve(itemRef, 0, &itemURLRef, NULL) == noErr) {
if ([bundleURL isEqual:((__bridge NSURL *)itemURLRef)]) {
CFRetain(itemRef);
break;
}
}
itemRef = NULL;
}
CFRelease(snapshotRef);
return itemRef;
}
static void loginItemsChanged(LSSharedFileListRef listRef, void *context)
{
UBPreferencesController *controller = (__bridge UBPreferencesController*)context;
[controller willChangeValueForKey:@"startAtLogin"];
[controller didChangeValueForKey:@"startAtLogin"];
}
#
#pragma mark Teardown
#
- (void)dealloc
{
LSSharedFileListRemoveObserver(loginItems,
CFRunLoopGetMain(),
kCFRunLoopCommonModes,
loginItemsChanged,
(__bridge void*)self);
CFRelease(loginItems);
}
@end

View File

@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="UBPreferencesController">
<connections>
<outlet property="filePicker" destination="43" id="55"/>
<outlet property="window" destination="1" id="3"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="软件设置" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" titlebarAppearsTransparent="YES" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="472" y="636" width="580" height="236"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1175"/>
<value key="minSize" type="size" width="580" height="236"/>
<value key="maxSize" type="size" width="580" height="236"/>
<view key="contentView" autoresizesSubviews="NO" id="2">
<rect key="frame" x="0.0" y="0.0" width="580" height="236"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="136" y="170" width="68" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="组件目录:" id="8">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton autoresizesSubviews="NO" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="43">
<rect key="frame" x="220" y="164" width="286" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" arrowPosition="arrowAtCenter" id="44">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="OtherViews" id="45">
<items>
<menuItem title="Item 1" id="46"/>
<menuItem isSeparatorItem="YES" id="53"/>
<menuItem title="Other ..." id="48" userLabel="other">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="showFilePicker:" target="-2" id="54"/>
</connections>
</menuItem>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="178">
<rect key="frame" x="220" y="198" width="205" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="登录的时候自启" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="179">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="startAtLogin" id="228"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="255">
<rect key="frame" x="163" y="200" width="41" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="自启:" id="256">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Eqv-5o-pYV">
<rect key="frame" x="158" y="72" width="110" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shell" id="f7P-gw-YYJ">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="R1C-8t-EyM">
<rect key="frame" x="163" y="137" width="126" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="互动:" id="8lm-M5-ekh">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jHv-DY-0s5">
<rect key="frame" x="220" y="136" width="132" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="开启互动" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="7vp-gG-U0H">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="enableInteraction" id="all-KL-ihA"/>
</connections>
</button>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="JRx-iq-tIq">
<rect key="frame" x="220" y="71" width="111" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="加载 Bash 环境" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="LrP-z2-QmY">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="loginShell" id="sUK-v9-cTo"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="268" translatesAutoresizingMaskIntoConstraints="NO" id="Sr1-od-DCN">
<rect key="frame" x="239" y="23" width="330" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="加载Bash env将保留您的配置比如区域设置和路径设置。但是如果设置不正确可能会导致小部件无法正常工作。" id="7Za-aa-BIO">
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="268" translatesAutoresizingMaskIntoConstraints="NO" id="VVJ-Cl-FSt">
<rect key="frame" x="239" y="88" width="312" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="开启后,小组件可以被点击进而处理鼠标或键盘事件,关闭后无法和鼠标产生交互!" id="GmJ-aJ-oHW">
<font key="font" metaFont="label" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
<outlet property="delegate" destination="-2" id="4"/>
</connections>
<point key="canvasLocation" x="75" y="195"/>
</window>
<userDefaultsController representsSharedInstance="YES" id="99"/>
</objects>
</document>

View File

@@ -0,0 +1,13 @@
//
// UBRefreshCommand.h
// Uebersicht
//
// Created by Felix Hageloh on 2/1/17.
// Copyright © 2017 tracesOf. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UBRefreshCommand : NSScriptCommand
@end

View File

@@ -0,0 +1,20 @@
//
// UBRefreshCommand.m
// Uebersicht
//
// Created by Felix Hageloh on 2/1/17.
// Copyright © 2017 tracesOf. All rights reserved.
//
#import "UBRefreshCommand.h"
#import "UBAppDelegate.h"
@implementation UBRefreshCommand
-(id)performDefaultImplementation
{
[(UBAppDelegate*)[NSApp delegate] refreshWidgets:self];
return nil;
}
@end

View File

@@ -0,0 +1,13 @@
//
// UBReloadCommand.h
// Uebersicht
//
// Created by Felix Hageloh on 11/4/17.
// Copyright © 2017 tracesOf. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UBReloadCommand : NSScriptCommand
@end

View File

@@ -0,0 +1,18 @@
//
// UBReloadCommand.m
// Uebersicht
//
// Created by Felix Hageloh on 11/4/17.
// Copyright © 2017 tracesOf. All rights reserved.
//
#import "UBReloadCommand.h"
@implementation UBReloadCommand
-(id)performDefaultImplementation
{
return nil;
}
@end

View File

@@ -0,0 +1,17 @@
//
// UBScreenChangeListener.h
// Uebersicht
//
// Created by Felix Hageloh on 31/12/16.
// Copyright © 2016 tracesOf. All rights reserved.
//
#ifndef UBScreenChangeListener_h
#define UBScreenChangeListener_h
#endif /* UBScreenChangeListener_h */
@protocol UBScreenChangeListener
- (void)screensChanged:(NSDictionary*)screens;
@end

View File

@@ -0,0 +1,19 @@
//
// UBScreensMenuController.h
//
//
// Created by Felix Hageloh on 8/11/15.
//
//
#import <Foundation/Foundation.h>
@interface UBScreensController : NSObject
@property NSMutableDictionary* screens;
@property NSArray* sortedScreens;
- (id)initWithChangeListener:(id)target;
- (void)syncScreens:(id)sender;
@end

View File

@@ -0,0 +1,195 @@
//
// UBScreensMenuController.m
//
//
// Created by Felix Hageloh on 8/11/15.
//
//
#import "UBScreensController.h"
#import "UBDispatcher.h"
#import "UBScreenChangeListener.h"
int const MAX_DISPLAYS = 42;
@implementation UBScreensController {
id listener;
UBDispatcher* dispatcher;
}
@synthesize screens;
@synthesize sortedScreens;
- (id)initWithChangeListener:(id<UBScreenChangeListener>)target;
{
self = [super init];
if (self) {
screens = [[NSMutableDictionary alloc] initWithCapacity:MAX_DISPLAYS];
listener = target;
dispatcher = [[UBDispatcher alloc] init];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(syncScreens:)
name: NSApplicationDidChangeScreenParametersNotification
object: nil
];
}
return self;
}
- (void)updateScreens
{
NSString *name;
NSMutableDictionary *nameList = [[NSMutableDictionary alloc]
initWithCapacity:MAX_DISPLAYS
];
CGDirectDisplayID displays[MAX_DISPLAYS];
uint32_t numDisplays;
CGError error = CGGetActiveDisplayList(
MAX_DISPLAYS,
displays,
&numDisplays
);
if (error || numDisplays == 0) {
[self
performSelector: @selector(updateScreens)
withObject: nil
afterDelay: 1
];
return;
}
[screens removeAllObjects];
NSMutableArray *ids = [[NSMutableArray alloc] initWithCapacity:numDisplays];
for(int i = 0; i < numDisplays; i++) {
name = [self screenNameForDisplay:displays[i]];
if (!name)
name = [NSString stringWithFormat:@"Display %i", i];
NSNumber *count;
if ((count = nameList[name])) {
nameList[name] = [NSNumber numberWithInt:count.intValue+1];
name = [name stringByAppendingString:[NSString
stringWithFormat:@" (%i)", count.intValue+1]
];
} else {
nameList[name] = [NSNumber numberWithInt:1];
}
NSNumber* screenId = @(displays[i]);
screens[screenId] = name;
[ids addObject: screenId];
}
sortedScreens = ids;
[dispatcher
dispatch: @"SCREENS_DID_CHANGE"
withPayload: sortedScreens
];
}
- (void)syncScreens:(id)sender
{
[self updateScreens];
[listener screensChanged:screens];
}
- (NSString*)screenNameForDisplay:(CGDirectDisplayID)displayID
{
if (CGDisplayIsBuiltin(displayID)) {
return @"Built-in Display";
}
CFDictionaryRef deviceInfo = getDisplayInfoDictionary(displayID);
if (!deviceInfo) {
return nil;
}
NSString *name = nil;
NSDictionary *localizedNames = [(__bridge NSDictionary *)deviceInfo
objectForKey:[NSString stringWithUTF8String:kDisplayProductName]
];
if ([localizedNames count] > 0) {
name = [localizedNames
objectForKey:[[localizedNames allKeys] objectAtIndex:0]
];
}
CFRelease(deviceInfo);
return name;
}
-(NSInteger)indexOfScreenMenuItems:(NSMenu*)menu
{
return [menu indexOfItem:[menu itemWithTitle:@"Check for Updates..."]] + 2;
}
// can't belive you are making. me. do. this.
static CFDictionaryRef getDisplayInfoDictionary(CGDirectDisplayID displayID)
{
CFDictionaryRef info = nil;
io_iterator_t iter;
io_service_t serv;
CFMutableDictionaryRef matching = IOServiceMatching("IODisplayConnect");
// releases matching for us
kern_return_t err = IOServiceGetMatchingServices(
kIOMasterPortDefault,
matching,
&iter
);
if (err) return nil;
while ((serv = IOIteratorNext(iter)) != 0)
{
CFIndex vendorID, productID;
CFNumberRef vendorIDRef, productIDRef;
Boolean success;
info = IODisplayCreateInfoDictionary(serv,kIODisplayOnlyPreferredName);
vendorIDRef = CFDictionaryGetValue(info, CFSTR(kDisplayVendorID));
productIDRef = CFDictionaryGetValue(info, CFSTR(kDisplayProductID));
success = CFNumberGetValue(
vendorIDRef,
kCFNumberCFIndexType,
&vendorID
);
success &= CFNumberGetValue(
productIDRef,
kCFNumberCFIndexType,
&productID
);
if (!success || CGDisplayVendorNumber(displayID) != vendorID ||
CGDisplayModelNumber(displayID) != productID) {
CFRelease(info);
info = nil;
continue;
}
break;
}
IOObjectRelease(serv);
IOObjectRelease(iter);
return info;
}
@end

View File

@@ -0,0 +1,20 @@
//
// UBWebSocket.h
//
//
// Created by Felix Hageloh on 24/1/16.
//
//
#import <Foundation/Foundation.h>
#import <SocketRocket/SRWebSocket.h>
@interface UBWebSocket : NSObject <SRWebSocketDelegate>
+ (id)sharedSocket;
- (void)open:(NSURL*)aUrl;
- (void)close;
- (void)send:(id)message;
- (void)listen:(void (^)(id))listener;
@end

View File

@@ -0,0 +1,122 @@
//
// UBWebSocket.m
//
//
// Created by Felix Hageloh on 24/1/16.
//
//
#import "UBWebSocket.h"
@implementation UBWebSocket {
NSMutableArray* listeners;
NSMutableArray* queuedMessages;
SRWebSocket* ws;
NSURL* url;
}
+ (id)sharedSocket {
static UBWebSocket* sharedSocket = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedSocket = [[self alloc] init];
});
return sharedSocket;
}
- (id)init {
if (self = [super init]) {
listeners = [[NSMutableArray alloc] init];
queuedMessages = [[NSMutableArray alloc] init];
}
return self;
}
- (void)send:(id)message
{
if (ws && ws.readyState == SR_OPEN) {
[ws send:message];
} else {
[queuedMessages addObject: message];
}
}
- (void)listen:(void (^)(id))listener
{
[listeners addObject:listener];
}
- (void)open:(NSURL*)aUrl
{
if (ws) {
return;
}
url = aUrl;
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url];
[request setValue:@"Übersicht" forHTTPHeaderField:@"Origin"];
ws = [[SRWebSocket alloc] initWithURLRequest: request];
ws.delegate = self;
[ws open];
}
- (void)close
{
if (ws) {
ws.delegate = nil;
[ws close];
ws = nil;
url = nil;
}
}
- (void)reopen
{
[self close];
if (url) {
[self open:url];
}
}
- (void)webSocketDidOpen:(SRWebSocket *)webSocket
{
for (id message in queuedMessages) {
[ws send:message];
}
[queuedMessages removeAllObjects];
}
- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message
{
for (void (^listener)(id) in listeners) {
listener(message);
}
}
- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error
{
[webSocket close];
[self
performSelector:@selector(reopen)
withObject:nil
afterDelay: 0.1
];
}
- (void)webSocket:(SRWebSocket *)webSocket
didCloseWithCode:(NSInteger)code
reason:(NSString *)reason
wasClean:(BOOL)wasClean
{
[self
performSelector:@selector(reopen)
withObject:nil
afterDelay: 0.1
];
}
@end

View File

@@ -0,0 +1,17 @@
//
// UBWebView.h
// Uebersicht
//
// Created by Felix Hageloh on 5/8/19.
// Copyright © 2019 tracesOf. All rights reserved.
//
#import <WebKit/WebKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UBWebView : WKWebView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,18 @@
//
// UBWebView.m
// Uebersicht
//
// Created by Felix Hageloh on 5/8/19.
// Copyright © 2019 tracesOf. All rights reserved.
//
#import "UBWebView.h"
@implementation UBWebView
- (BOOL) acceptsFirstMouse:(NSEvent*) event
{
return YES;
}
@end

View File

@@ -0,0 +1,23 @@
//
// UBWebViewController.h
// Uebersicht
//
// Created by Felix Hageloh on 2/7/16.
// Copyright © 2016 tracesOf. All rights reserved.
//
#import <Foundation/Foundation.h>
@import WebKit;
@interface UBWebViewController : NSObject<WKNavigationDelegate, WKScriptMessageHandler>
@property (strong, readonly) NSView* view;
- (id)initWithFrame:(NSRect)frame;
- (void)load:(NSURL*)url;
- (void)reload;
- (void)redraw;
- (void)destroy;
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message;
@end

View File

@@ -0,0 +1,214 @@
//
// UBWebViewController.m
// Uebersicht
//
// Created by Felix Hageloh on 2/7/16.
// Copyright © 2016 tracesOf. All rights reserved.
//
#import "UBWebViewController.h"
#import "UBLocation.h"
#import "UBWebView.h"
#import "UBWindow.h"
@implementation UBWebViewController {
NSURL* url;
}
@synthesize view;
- (id)initWithFrame:(NSRect)frame
{
self = [super init];
if (self) {
view = [self buildWebView:frame];
}
return self;
}
- (void)load:(NSURL*)newUrl
{
switch (((UBWindow*)self.view.window).windowType) {
case UBWindowTypeAgnostic:
url = newUrl;
break;
case UBWindowTypeBackground:
url = [newUrl URLByAppendingPathComponent: @"background"];
break;
case UBWindowTypeForeground:
url = [newUrl URLByAppendingPathComponent: @"foreground"];
break;
default:
break;
}
[(WKWebView*)view loadRequest:[NSURLRequest requestWithURL: url]];
}
- (void)reload
{
[(WKWebView*)view reloadFromOrigin:self];
}
- (void)redraw
{
[self forceRedraw:(WKWebView*)view];
}
- (void)destroy
{
[self teardownWebview:(WKWebView *)view];
view = nil;
}
- (WKWebView*)buildWebView:(NSRect)frame
{
WKWebView* webView = [[UBWebView alloc]
initWithFrame: frame
configuration: [self sharedConfig]
];
[webView setValue:@YES forKey:@"drawsTransparentBackground"];
[webView.configuration.preferences
setValue: @YES
forKey: @"developerExtrasEnabled"
];
webView.navigationDelegate = (id<WKNavigationDelegate>)self;
return webView;
}
- (void)teardownWebview:(WKWebView*)webView
{
webView.navigationDelegate = nil;
[webView stopLoading:self];
[webView removeFromSuperview];
}
- (WKWebViewConfiguration*)sharedConfig {
static WKWebViewConfiguration *sharedConfig = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedConfig = [self buildConfig];
});
return sharedConfig;
}
- (WKWebViewConfiguration*)buildConfig
{
WKUserContentController* ucController = [
[WKUserContentController alloc] init
];
// geolocation
[ucController
addScriptMessageHandler: [[UBLocation alloc] init]
name: @"geolocation"
];
NSString* geolocationScript = [NSString
stringWithContentsOfURL: [[NSBundle mainBundle]
URLForResource: @"geolocation"
withExtension: @"js"
]
encoding: NSUTF8StringEncoding
error: nil
];
[ucController addUserScript:[[WKUserScript alloc]
initWithSource: geolocationScript
injectionTime: WKUserScriptInjectionTimeAtDocumentStart
forMainFrameOnly: YES
]];
// hack to make old widgets relying on process.argv[0] work
NSString* processArgvHack = [NSString
stringWithFormat:@"process = {argv: ['%@'.replace(/ /g, '\\\\ ')]}",
[[NSBundle mainBundle] pathForResource:@"localnode" ofType:nil]
];
[ucController addUserScript:[[WKUserScript alloc]
initWithSource: processArgvHack
injectionTime: WKUserScriptInjectionTimeAtDocumentStart
forMainFrameOnly: YES
]];
[ucController addScriptMessageHandler: self name: @"uebersicht"];
WKWebViewConfiguration* config = [[WKWebViewConfiguration alloc] init];
config.userContentController = ucController;
return config;
}
- (void)forceRedraw:(WKWebView*)webView
{
[webView
evaluateJavaScript:
@"document.documentElement.style.transform = 'scale(1)';\
requestAnimationFrame(function() {\
document.documentElement.style.transform = '';\
});"
completionHandler:NULL
];
}
- (void)webView:(WKWebView *)webView
didFinishNavigation:(WKNavigation*)navigation
{
NSLog(@"loaded %@", webView.URL);
}
- (void)webView:(WKWebView *)sender
didFailNavigation:(WKNavigation*)nav
withError:(NSError *)error
{
[self handleWebviewLoadError:error];
}
- (void)webView:(WKWebView *)sender
didFailProvisionalNavigation:(WKNavigation *)nav
withError:(NSError *)error
{
[self handleWebviewLoadError:error];
}
- (void)webView: (WKWebView *)theWebView
decidePolicyForNavigationAction: (WKNavigationAction*)action
decisionHandler: (void (^)(WKNavigationActionPolicy))handler
{
if (!action.targetFrame.mainFrame) {
handler(WKNavigationActionPolicyAllow);
} else if ([action.request.URL isEqual: url]) {
handler(WKNavigationActionPolicyAllow);
} else if (action.navigationType == WKNavigationTypeLinkActivated) {
[[NSWorkspace sharedWorkspace] openURL:action.request.URL];
handler(WKNavigationActionPolicyCancel);
} else {
handler(WKNavigationActionPolicyCancel);
}
}
- (void)handleWebviewLoadError:(NSError *)error
{
NSLog(@"Error loading webview: %@", error);
[self
performSelector: @selector(load:)
withObject: url
afterDelay: 5.0
];
}
- (void)userContentController:(WKUserContentController *)controller
didReceiveScriptMessage:(WKScriptMessage *) message
{
if ([message.body isEqual: @"widgetEnter"]) {
[message.webView.window setIgnoresMouseEvents: NO];
} else if ([message.body isEqual:@"widgetLeave"]) {
[message.webView.window setIgnoresMouseEvents: YES];
}
}
@end

View File

@@ -0,0 +1,21 @@
//
// UBWidgetForScripting.h
// Uebersicht
//
// Created by Felix Hageloh on 7/1/17.
// Copyright © 2017 tracesOf. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface UBWidgetForScripting : NSObject
@property (nonatomic) NSString *id;
@property (nonatomic) BOOL hidden;
@property (nonatomic) BOOL showOnAllScreens;
@property (nonatomic) BOOL showOnMainScreen;
-(id)initWithId:(NSString*)widgetId andSettings:(NSDictionary*)settings;
-(void)refresh:(NSScriptCommand*)command;
-(void)reload:(NSScriptCommand*)command;
@end

View File

@@ -0,0 +1,96 @@
//
// UBWidgetForScripting.m
// Uebersicht
//
// Created by Felix Hageloh on 7/1/17.
// Copyright © 2017 tracesOf. All rights reserved.
//
#import "UBWidgetForScripting.h"
#import "UBDispatcher.h"
#import "UBAppDelegate.h"
static UBDispatcher* dispatcher;
@implementation UBWidgetForScripting
+ (void)initialize {
if(!dispatcher) {
dispatcher = [[UBDispatcher alloc] init];
}
}
-(id)initWithId:(NSString*)widgetId andSettings:(NSDictionary*)settings
{
self = [super init];
if (self) {
_id = widgetId;
_hidden = [settings[@"hidden"] boolValue];
_showOnAllScreens = [settings[@"showOnAllScreens"] boolValue];
_showOnMainScreen = [settings[@"showOnMainScreen"] boolValue];
}
return self;
}
- (NSUniqueIDSpecifier *)objectSpecifier {
return [[NSUniqueIDSpecifier alloc]
initWithContainerClassDescription: (NSScriptClassDescription *)[NSApp
classDescription
]
containerSpecifier: nil
key: @"widgets"
uniqueID: self.id
];
}
- (void)setHidden:(BOOL)hidden
{
if (_hidden == hidden) {
return;
}
_hidden = hidden;
[dispatcher
dispatch: _hidden ? @"WIDGET_SET_TO_HIDE" : @"WIDGET_SET_TO_SHOW"
withPayload: _id
];
}
- (void)setShowOnMainScreen:(BOOL)showOnMainScreen
{
if (_showOnMainScreen == showOnMainScreen) {
return;
}
_showOnMainScreen = showOnMainScreen;
[dispatcher
dispatch: @"WIDGET_SET_TO_MAIN_SCREEN"
withPayload: _id
];
}
- (void)setShowOnAllScreens:(BOOL)showOnAllScreens
{
if (_showOnAllScreens == showOnAllScreens) {
return;
}
_showOnAllScreens = showOnAllScreens;
[dispatcher
dispatch: @"WIDGET_SET_TO_ALL_SCREENS"
withPayload: _id
];
}
- (void)refresh:(NSScriptCommand*)command
{
[dispatcher
dispatch: @"WIDGET_WANTS_REFRESH"
withPayload: _id
];
}
- (void)reload:(NSScriptCommand*)command
{
[(UBAppDelegate*)NSApp.delegate reloadWidget: _id];
}
@end

View File

@@ -0,0 +1,24 @@
//
// UBWidgetsController.h
//
//
// Created by Felix Hageloh on 2/12/15.
//
//
#import <Cocoa/Cocoa.h>
@class UBScreensController;
@class UBWidgetsStore;
@class UBPreferencesController;
@interface UBWidgetsController : NSController
- (id)initWithMenu:(NSMenu*)menu
widgets:(UBWidgetsStore*)theWidgets
screens:(UBScreensController*)screens
preferences:(UBPreferencesController*)preferences;
- (void)render;
- (NSArray*)widgetsForScripting;
- (void)reloadWidget:(NSString*)widgetId;
@end

View File

@@ -0,0 +1,435 @@
//
// UBWidgetsController.m
//
//
// Created by Felix Hageloh on 2/12/15.
//
//
#import "UBWidgetsController.h"
#import "UBWidgetsStore.h"
#import "UBScreensController.h"
#import "UBDispatcher.h"
#import "UBWidgetForScripting.h"
#import "UBPreferencesController.h"
@implementation UBWidgetsController {
UBWidgetsStore* widgets;
UBScreensController* screensController;
UBPreferencesController* preferences;
NSMenu* mainMenu;
NSInteger currentIndex;
NSImage* statusIconVisible;
NSImage* statusIconHidden;
UBDispatcher* dispatcher;
}
static NSInteger const WIDGET_MENU_ITEM_TAG = 42;
- (id)initWithMenu:(NSMenu*)menu
widgets:(UBWidgetsStore*)theWidgets
screens:(UBScreensController*)screens
preferences:(UBPreferencesController*)prefs
{
self = [super init];
if (self) {
mainMenu = menu;
widgets = theWidgets;
screensController = screens;
preferences = prefs;
currentIndex = [self indexOfWidgetMenuItems:menu];
[menu insertItem:[NSMenuItem separatorItem] atIndex:currentIndex];
currentIndex++;
NSMenuItem* header = [[NSMenuItem alloc] init];
[header setTitle:@"所有组件"];
[header setState:0];
[mainMenu insertItem:header atIndex:currentIndex];
currentIndex++;
[menu insertItem:[NSMenuItem separatorItem] atIndex:currentIndex];
dispatcher = [[UBDispatcher alloc] init];
statusIconVisible = [[NSBundle mainBundle]
imageForResource:@"widget-status-visible"
];
[statusIconVisible setTemplate:YES];
statusIconHidden = [[NSBundle mainBundle]
imageForResource:@"widget-status-hidden"
];
}
return self;
}
- (void)render
{
for (NSMenuItem *item in [mainMenu itemArray]) {
if (item.tag == WIDGET_MENU_ITEM_TAG) {
[mainMenu removeItem: item];
}
}
NSString* widgetId;
NSString* error;
for (NSInteger i = widgets.sortedWidgets.count - 1; i >= 0; i--) {
widgetId = widgets.sortedWidgets[i];
[self renderWidget:widgetId inMenu:mainMenu];
error = [widgets get:widgetId][@"error"];
if (error) {
[self notifyUser:error withTitle:@"Error"];
}
}
}
- (void)renderWidget:(NSString*)widgetId inMenu:(NSMenu*)menu
{
NSMenuItem* newItem = [[NSMenuItem alloc] init];
[newItem setTitle:widgetId];
[newItem setRepresentedObject:widgetId];
[newItem setTag:WIDGET_MENU_ITEM_TAG];
[newItem
setImage:[self isWidgetVisible:widgetId]
? statusIconVisible
: statusIconHidden
];
NSMenu* widgetMenu = [[NSMenu alloc] init];
[widgetMenu setAutoenablesItems: NO];
[widgetMenu insertItem:[NSMenuItem separatorItem] atIndex:0];
[self addHideOptionToMenu:widgetMenu forWidget:widgetId];
[self addBackgroundOptionToMenu:widgetMenu forWidget:widgetId];
[self
addScreens: [screensController screens]
toWidgetMenu: widgetMenu
forWidget: widgetId
];
[self addSelectedScreensOptionToMenu:widgetMenu forWidget:widgetId];
[widgetMenu insertItem:[NSMenuItem separatorItem] atIndex:0];
[self addMainScreenOptionToMenu:widgetMenu forWidget:widgetId];
[self addAllScreensOptionToMenu:widgetMenu forWidget:widgetId];
[self addEditMenuItemToMenu:widgetMenu forWidget:widgetId];
[widgetMenu insertItem:[NSMenuItem separatorItem] atIndex:1];
[newItem setSubmenu:widgetMenu];
[menu insertItem:newItem atIndex:currentIndex];
}
- (void)addEditMenuItemToMenu:(NSMenu*)menu forWidget:(NSString*)widgetId
{
NSMenuItem* item = [[NSMenuItem alloc]
initWithTitle: @"编辑..."
action: @selector(editWidget:)
keyEquivalent: @""
];
[item setRepresentedObject:widgetId];
[item setTarget:self];
[menu insertItem:item atIndex:0];
}
- (void)addMainScreenOptionToMenu:(NSMenu*)menu forWidget:(NSString*)widgetId
{
NSMenuItem* item = [[NSMenuItem alloc]
initWithTitle: @"在主显示器上显示"
action: @selector(showOnMainScreen:)
keyEquivalent: @""
];
NSDictionary* settings = [widgets getSettings:widgetId];
[item setTarget:self];
[item setRepresentedObject:widgetId];
[item setState:[settings[@"showOnMainScreen"] boolValue]];
[menu insertItem:item atIndex:0];
}
- (void)addAllScreensOptionToMenu:(NSMenu*)menu forWidget:(NSString*)widgetId
{
NSMenuItem* item = [[NSMenuItem alloc]
initWithTitle: @"在所有屏幕上显示"
action: @selector(showOnAllScreens:)
keyEquivalent: @""
];
NSDictionary* settings = [widgets getSettings:widgetId];
[item setTarget:self];
[item setRepresentedObject:widgetId];
[item setState:[settings[@"showOnAllScreens"] boolValue]];
[menu insertItem:item atIndex:0];
}
- (void)addHideOptionToMenu:(NSMenu*)menu forWidget:(NSString*)widgetId
{
NSMenuItem* item = [[NSMenuItem alloc]
initWithTitle: @"隐藏组件"
action: @selector(toggleHidden:)
keyEquivalent: @""
];
NSDictionary* settings = [widgets getSettings:widgetId];
[item setTarget:self];
[item setRepresentedObject:widgetId];
[item setState:[settings[@"隐藏"] boolValue]];
[menu insertItem:item atIndex:0];
}
- (void)addSelectedScreensOptionToMenu:(NSMenu*)menu
forWidget:(NSString*)widgetId
{
NSMenuItem* item = [[NSMenuItem alloc] init];
NSDictionary* settings = [widgets getSettings:widgetId];
[item setTitle:@"在选定屏幕上显示:"];
[item setState:[settings[@"showOnSelectedScreens"] boolValue]];
[item setEnabled:NO];
[menu insertItem:item atIndex:0];
}
- (void)addBackgroundOptionToMenu:(NSMenu*)menu
forWidget:(NSString*)widgetId
{
NSMenuItem* item = [[NSMenuItem alloc]
initWithTitle: @"发送到后台"
action: @selector(toggleBackground:)
keyEquivalent: @""
];
NSDictionary* settings = [widgets getSettings:widgetId];
[item setTarget:self];
[item setRepresentedObject:widgetId];
[item setState: preferences.enableInteraction
? [settings[@"inBackground"] boolValue]
: YES
];
[item setEnabled: preferences.enableInteraction];
[menu insertItem:item atIndex:0];
}
- (void)removeWidget:(NSString*)widgetId FromMenu:(NSMenu*)menu
{
[menu removeItem:[menu itemWithTitle:widgetId]];
}
- (void)addScreens:(NSDictionary*)screens
toWidgetMenu:(NSMenu*)menu
forWidget:(NSString*)widgetId
{
NSString *title;
NSMenuItem *newItem;
NSString *name;
NSArray* widgetScreens = [widgets getSettings:widgetId][@"screens"];
newItem = [NSMenuItem separatorItem];
[menu insertItem:newItem atIndex:0];
int i = 0;
for(NSNumber* screenId in screensController.sortedScreens) {
name = screensController.screens[screenId];
title = [NSString stringWithFormat:@"显示 %@", name];
newItem = [[NSMenuItem alloc]
initWithTitle: title
action: @selector(toggleScreen:)
keyEquivalent: @""
];
[newItem setTarget:self];
[newItem
setRepresentedObject: @{
@"screenId": screenId,
@"widgetId": widgetId
}
];
if ([widgetScreens containsObject:screenId]) {
[newItem setState:YES];
}
[menu insertItem:newItem atIndex:i];
i++;
}
}
- (BOOL)isWidgetVisible:(NSString*)widgetId
{
NSDictionary* settings = [widgets getSettings:widgetId];
BOOL isVisible = NO;
if ([settings[@"hidden"] boolValue]) {
isVisible = NO;
} else if ([settings[@"showOnAllScreens"] boolValue]) {
isVisible = YES;
} else if ([settings[@"showOnMainScreen"] boolValue]) {
isVisible = YES;
} else if ([settings[@"showOnSelectedScreens"] boolValue]) {
NSMutableSet *intersection = [NSMutableSet
setWithArray: settings[@"screens"]
];
[intersection
intersectSet:[NSSet setWithArray:[screensController sortedScreens]]
];
isVisible = [intersection count] > 0;
}
return isVisible;
}
-(NSInteger)indexOfWidgetMenuItems:(NSMenu*)menu
{
return [menu indexOfItem:[menu itemWithTitle:@"检查新版..."]] + 2;
}
- (void)showOnAllScreens:(id)sender
{
NSString* widgetId = [(NSMenuItem*)sender representedObject];
[dispatcher
dispatch: @"WIDGET_SET_TO_ALL_SCREENS"
withPayload: widgetId
];
}
- (void)showOnSelectedScreens:(id)sender
{
NSString* widgetId = [(NSMenuItem*)sender representedObject];
[dispatcher
dispatch: @"WIDGET_SET_TO_SELECTED_SCREENS"
withPayload: widgetId
];
}
- (void)showOnMainScreen:(id)sender
{
NSString* widgetId = [(NSMenuItem*)sender representedObject];
[dispatcher
dispatch: @"WIDGET_SET_TO_MAIN_SCREEN"
withPayload: widgetId
];
}
- (void)toggleHidden:(id)sender
{
NSString* widgetId = [(NSMenuItem*)sender representedObject];
NSDictionary* settings = [widgets getSettings:widgetId];
BOOL isHidden = [settings[@"hidden"] boolValue];
[dispatcher
dispatch: isHidden ? @"WIDGET_SET_TO_SHOW" : @"WIDGET_SET_TO_HIDE"
withPayload: widgetId
];
}
- (void)toggleBackground:(id)sender
{
NSString* widgetId = [(NSMenuItem*)sender representedObject];
NSDictionary* settings = [widgets getSettings:widgetId];
BOOL inBackground = [settings[@"inBackground"] boolValue];
[dispatcher
dispatch: inBackground
? @"WIDGET_SET_TO_FOREGROUND"
: @"WIDGET_SET_TO_BACKGROUND"
withPayload: widgetId
];
}
- (void)toggleScreen:(id)sender
{
NSMenuItem* menuItem = (NSMenuItem*)sender;
NSDictionary* data = [menuItem representedObject];
NSNumber* screenId = data[@"screenId"];
NSDictionary* widgetSettings = [widgets getSettings:data[@"widgetId"]];
NSString* message;
if ([(NSArray*)widgetSettings[@"screens"] containsObject:screenId]) {
message = @"SCREEN_DESELECTED_FOR_WIDGET";
} else {
message = @"SCREEN_SELECTED_FOR_WIDGET";
}
[dispatcher
dispatch: @"WIDGET_SET_TO_SELECTED_SCREENS"
withPayload: data[@"widgetId"]
];
[dispatcher
dispatch: message
withPayload: @{
@"id": data[@"widgetId"],
@"screenId": screenId
}
];
}
- (void)editWidget:(id)sender
{
NSString* widgetId = [(NSMenuItem*)sender representedObject];
NSString* filePath = [widgets get:widgetId][@"filePath"];
if (![[NSWorkspace sharedWorkspace] openFile:filePath]) {
NSString* message = @"Please configure an app to edit .%@ files";
[self
notifyUser: [NSString
stringWithFormat: message, [filePath pathExtension]
]
withTitle: @"No Editor Configured."
];
}
}
- (void)reloadWidget:(NSString*)widgetId
{
NSString* filePath = [widgets get:widgetId][@"filePath"];
NSDictionary* attributes = [NSDictionary
dictionaryWithObjectsAndKeys: [NSDate date], NSFileModificationDate, nil
];
[NSFileManager.defaultManager
setAttributes: attributes
ofItemAtPath:filePath
error: NULL
];
}
- (void)notifyUser:(NSString*)message withTitle:(NSString*)title
{
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = title;
notification.informativeText = message;
[[NSUserNotificationCenter defaultUserNotificationCenter]
deliverNotification:notification
];
}
- (NSArray*)widgetsForScripting
{
NSMutableArray* allWidgets = [NSMutableArray array];
for ( NSString* widgetId in [widgets sortedWidgets]) {
[allWidgets addObject: [[UBWidgetForScripting alloc]
initWithId: widgetId
andSettings: [widgets getSettings:widgetId]
]
];
}
return allWidgets;
}
@end

View File

@@ -0,0 +1,20 @@
//
// UBWidgetsStore.h
//
//
// Created by Felix Hageloh on 26/1/16.
//
//
#import <Foundation/Foundation.h>
@interface UBWidgetsStore : NSObject
- (void)onChange:(void (^)(NSDictionary*))aChangeHandler;
- (void)reset;
- (void)reset:(NSDictionary*)state;
- (NSDictionary*)get:(NSString*)widgetId;
- (NSDictionary*)getSettings:(NSString*)widgetId;
- (NSArray*)sortedWidgets;
@end

View File

@@ -0,0 +1,249 @@
//
// UBWidgetsStore.m
//
//
// Created by Felix Hageloh on 26/1/16.
//
//
#import "UBWidgetsStore.h"
#import "UBListener.h"
@implementation UBWidgetsStore {
UBListener* listener;
NSMutableDictionary* widgets;
NSMutableDictionary* settings;
NSArray* sortedWidgets;
void (^changeHandler)(NSDictionary*);
NSDictionary* defaultSettings;
}
- (id)init
{
self = [super init];
if (self) {
widgets = [[NSMutableDictionary alloc] init];
settings = [[NSMutableDictionary alloc] init];
listener = [[UBListener alloc] init];
defaultSettings = @{
@"showOnAllScreens": @YES,
@"showOnSelectedScreens": @NO,
@"hidden": @NO,
@"screens": @[]
};
[listener on:@"WIDGET_ADDED" do:^(NSDictionary* data) {
[self addWidget:data];
[self notifyChange];
}];
[listener on:@"WIDGET_SETTINGS_CHANGED" do:^(NSDictionary* details) {
self->settings[details[@"id"]] = [[NSMutableDictionary alloc]
initWithDictionary:details[@"settings"]
];
[self notifyChange];
}];
[listener on:@"WIDGET_REMOVED" do:^(NSString* widgetId) {
if (self->widgets[widgetId]) {
[self removeWidget:widgetId];
[self notifyChange];
}
}];
[listener on:@"WIDGET_SET_TO_SELECTED_SCREENS" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"showOnAllScreens": @NO,
@"showOnSelectedScreens": @YES,
@"showOnMainScreen": @NO,
@"hidden": @NO,
}];
[self notifyChange];
}];
[listener on:@"WIDGET_SET_TO_ALL_SCREENS" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"showOnAllScreens": @YES,
@"showOnSelectedScreens": @NO,
@"showOnMainScreen": @NO,
@"hidden": @NO,
@"screens": @[],
}];
[self notifyChange];
}];
[listener on:@"WIDGET_SET_TO_MAIN_SCREEN" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"showOnAllScreens": @NO,
@"showOnSelectedScreens": @NO,
@"showOnMainScreen": @YES,
@"hidden": @NO,
@"screens": @[],
}];
[self notifyChange];
}];
[listener on:@"WIDGET_SET_TO_HIDE" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"hidden": @YES,
}];
[self notifyChange];
}];
[listener on:@"WIDGET_SET_TO_SHOW" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"hidden": @NO,
}];
[self notifyChange];
}];
[listener on:@"WIDGET_SET_TO_BACKGROUND" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"inBackground": @YES,
}];
[self notifyChange];
}];
[listener on:@"WIDGET_SET_TO_FOREGROUND" do:^(NSString* widgetId) {
[self updateSettings:widgetId withPatch:@{
@"inBackground": @NO,
}];
[self notifyChange];
}];
[listener on:@"SCREEN_SELECTED_FOR_WIDGET" do:^(NSDictionary* data) {
[self selectScreen:data[@"screenId"] forWidget:data[@"id"]];
[self notifyChange];
}];
[listener on:@"SCREEN_DESELECTED_FOR_WIDGET" do:^(NSDictionary* data) {
[self deselectScreen:data[@"screenId"] forWidget:data[@"id"]];
[self notifyChange];
}];
[listener on:@"SCREENS_DID_CHANGE" do:^(NSDictionary* data) {
[self notifyChange];;
}];
}
return self;
}
- (void)onChange:(void (^)(NSDictionary*))aChangeHandler
{
changeHandler = aChangeHandler;
}
- (void)reset
{
widgets = [[NSMutableDictionary alloc] init];
settings = [[NSMutableDictionary alloc] init];
}
- (void)reset:(NSDictionary*)state
{
widgets = [(NSDictionary*)state[@"widgets"] mutableCopy];
settings = [(NSDictionary*)state[@"settings"] mutableCopy];
}
- (NSDictionary*)get:(NSString*)widgetId
{
NSMutableDictionary* widget;
if (widgets[widgetId]) {
widget = [[NSMutableDictionary alloc]
initWithDictionary:widgets[widgetId]
];
widget[@"settings"] = settings[widgetId];
}
return widget;
}
- (NSDictionary*)getSettings:(NSString*)widgetId
{
return widgets[widgetId] ? settings[widgetId] : NULL;
}
- (NSArray*)sortedWidgets
{
return sortedWidgets;
}
- (void)notifyChange
{
if (changeHandler) {
changeHandler(widgets);
}
}
- (NSDictionary*)addWidget:(NSDictionary*)widget
{
BOOL alreadyExists = !!widgets[widget[@"id"]];
widgets[widget[@"id"]] = widget;
if (!alreadyExists) {
sortedWidgets = [widgets.allKeys
sortedArrayUsingSelector:@selector(compare:)
];
}
if (!settings[widget[@"id"]]) {
settings[widget[@"id"]] = [[NSMutableDictionary alloc]
initWithDictionary:defaultSettings
];
}
return widget;
}
- (void)updateSettings:(NSString*)widgetId withPatch:(NSDictionary*)patch
{
if (!settings[widgetId]) {
settings[widgetId] = [[NSMutableDictionary alloc]
initWithDictionary:defaultSettings
];
}
[settings[widgetId] addEntriesFromDictionary:patch];
}
- (void)removeWidget:(NSString*)widgetId
{
[widgets removeObjectForKey:widgetId];
sortedWidgets = [widgets.allKeys
sortedArrayUsingSelector:@selector(compare:)
];
}
- (void)selectScreen:(NSNumber*)screenId forWidget:(NSString*)widgetId
{
NSArray* screens = settings[widgetId][@"screens"];
if (![screens containsObject:screenId]) {
settings[widgetId][@"screens"] = [screens arrayByAddingObject:screenId];
}
}
- (void)deselectScreen:(NSNumber*)screenId forWidget:(NSString*)widgetId
{
NSArray* screens = settings[widgetId][@"screens"];
NSPredicate *withoutScreen = [NSPredicate
predicateWithBlock: ^BOOL(id s, NSDictionary * _) {
return s != screenId;
}
];
settings[widgetId][@"screens"] = [screens
filteredArrayUsingPredicate: withoutScreen
];
}
@end

View File

@@ -0,0 +1,33 @@
//
// UBWindow.h
// Übersicht
//
// Created by Felix Hageloh on 20/9/13.
// Copyright (c) 2013 Felix Hageloh.
//
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
#import <Cocoa/Cocoa.h>
typedef NS_ENUM(NSInteger, UBWindowType) {
UBWindowTypeAgnostic,
UBWindowTypeBackground,
UBWindowTypeForeground
};
@interface UBWindow : NSWindow
@property UBWindowType windowType;
- (id)initWithWindowType:(UBWindowType)type;
- (void)loadUrl:(NSURL*)url;
- (void)reload;
- (void)workspaceChanged;
- (void)wallpaperChanged;
@end

View File

@@ -0,0 +1,166 @@
//
// UBWindow.m
// Übersicht
//
// A window that sits on desktop level, is always fullscreen and doesn't show
// up in Mission Control
//
// Created by Felix Hageloh on 20/9/13.
// Copyright (c) 2013 Felix Hageloh.
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
//
#import "UBWindow.h"
#import "UBWebViewController.h"
@implementation UBWindow {
UBWebViewController* webViewController;
NSTrackingArea* trackingArea;
UBWindowType type;
}
- (id)initWithWindowType:(UBWindowType)windowType
{
self = [super
initWithContentRect: NSMakeRect(0, 0, 0, 0)
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreBuffered
defer: NO
];
if (self) {
type = windowType;
[self setBackgroundColor:[NSColor clearColor]];
[self setOpaque:NO];
[self setCollectionBehavior:(
NSWindowCollectionBehaviorStationary |
NSWindowCollectionBehaviorCanJoinAllSpaces |
NSWindowCollectionBehaviorIgnoresCycle
)];
[self setRestorable:NO];
[self disableSnapshotRestoration];
[self setDisplaysWhenScreenProfileChanges:YES];
[self setReleasedWhenClosed:NO];
[self setWindowType:windowType];
[self setIgnoresMouseEvents:YES];
webViewController = [[UBWebViewController alloc]
initWithFrame: [self frame]
];
[self setContentView:webViewController.view];
}
return self;
}
- (void)loadUrl:(NSURL*)url
{
[webViewController load:url];
}
- (void)reload
{
[webViewController reload];
}
// TODO: check if we can do at least some cleanups in webViewController#destroy
//- (void)close
//{
// [webViewController destroy];
// [super close];
//}
#
#pragma mark tracking area
#
- (void)setupTrackingArea
{
trackingArea = [[NSTrackingArea alloc]
initWithRect: self.contentView.bounds
options: NSTrackingMouseMoved
| NSTrackingMouseEnteredAndExited
| NSTrackingActiveAlways
owner: nil
userInfo: nil
];
[self.contentView addTrackingArea:trackingArea];
}
- (void)setFrame:(NSRect)newFrame display:(BOOL)doDisplay
{
[super setFrame:newFrame display:doDisplay];
[self updateTrackingArea];
}
- (void)updateTrackingArea
{
if (trackingArea != nil) {
[self.contentView removeTrackingArea:trackingArea];
}
if (self.contentView) {
[self setupTrackingArea];
}
}
#
#pragma mark signals/events
#
- (void)workspaceChanged
{
[webViewController redraw];
}
- (void)wallpaperChanged
{
[webViewController redraw];
}
#
#pragma mark window type and interaction
#
- (void)setWindowType:(UBWindowType)newType
{
switch (newType) {
case UBWindowTypeForeground:
[self setLevel:kCGNormalWindowLevel-1];
[self updateTrackingArea];
break;
case UBWindowTypeBackground:
case UBWindowTypeAgnostic:
[self setLevel:kCGDesktopWindowLevel];
if (trackingArea != nil) {
[self.contentView removeTrackingArea:trackingArea];
}
[self setIgnoresMouseEvents:YES];
break;
default:
break;
}
type = newType;
}
- (UBWindowType)windowType
{
return type;
}
#
#pragma mark flags
#
- (BOOL)isKeyWindow { return type == UBWindowTypeForeground; }
- (BOOL)canBecomeKeyWindow { return type == UBWindowTypeForeground; }
- (BOOL)canBecomeMainWindow { return type == UBWindowTypeForeground; }
- (BOOL)acceptsFirstResponder { return type == UBWindowTypeForeground; }
- (BOOL)acceptsMouseMovedEvents { return type == UBWindowTypeForeground;; }
@end

View File

@@ -0,0 +1,29 @@
//
// UBWindowGroup.h
// Uebersicht
//
// Created by Felix Hageloh on 05/10/2020.
// Copyright © 2020 tracesOf. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UBWindow.h"
NS_ASSUME_NONNULL_BEGIN
@interface UBWindowGroup : NSObject
@property (readonly, strong) UBWindow* foreground;
@property (readonly, strong) UBWindow* background;
- (id)initWithInteractionEnabled:(BOOL)interactionEnabled;
- (void)loadUrl:(NSURL*)Url;
- (void)reload;
- (void)close;
- (void)setFrame:(NSRect)frame display:(BOOL)flag;
- (void)workspaceChanged;
- (void)wallpaperChanged;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,75 @@
//
// UBWindowGroup.m
// Uebersicht
//
// Created by Felix Hageloh on 05/10/2020.
// Copyright © 2020 tracesOf. All rights reserved.
//
#import "UBWindowGroup.h"
#import "UBWindow.h"
@implementation UBWindowGroup
@synthesize foreground;
@synthesize background;
- (id)initWithInteractionEnabled:(BOOL)interactionEnabled
{
self = [super init];
if (self) {
if (interactionEnabled) {
foreground = [[UBWindow alloc]
initWithWindowType: UBWindowTypeForeground
];
[foreground orderFront:self];
}
background = [[UBWindow alloc]
initWithWindowType: interactionEnabled
? UBWindowTypeBackground
: UBWindowTypeAgnostic
];
[background orderFront:self];
}
return self;
}
- (void)close
{
[foreground close];
[background close];
}
- (void)reload
{
[foreground reload];
[background reload];
}
- (void)loadUrl:(NSURL*)url
{
[foreground loadUrl: url];
[background loadUrl: url];
}
- (void)setFrame:(NSRect)frame display:(BOOL)flag
{
[foreground setFrame:frame display:flag];
[background setFrame:frame display:flag];
}
- (void)wallpaperChanged
{
[foreground wallpaperChanged];
[background wallpaperChanged];
}
- (void)workspaceChanged
{
[foreground workspaceChanged];
[background workspaceChanged];
}
@end

View File

@@ -0,0 +1,29 @@
//
// UBWindowsController.h
// Uebersicht
//
// Created by Felix Hageloh on 30/09/2020.
// Copyright © 2020 tracesOf. All rights reserved.
//
#import <Cocoa/Cocoa.h>
NS_ASSUME_NONNULL_BEGIN
@interface UBWindowsController : NSObject
- (void)updateWindows:(NSDictionary*)screens
baseUrl:(NSURL*)baseUrl
interactionEnabled:(Boolean)interactionEnabled
forceRefresh:(Boolean)forceRefresh;
- (void)reloadAll;
- (void)closeAll;
- (void)workspaceChanged;
- (void)wallpaperChanged;
- (void)showDebugConsolesForScreen:(NSNumber*)screenId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,164 @@
//
// UBWindowsController.m
// Uebersicht
//
// Created by Felix Hageloh on 30/09/2020.
// Copyright © 2020 tracesOf. All rights reserved.
//
#import "UBWindowsController.h"
#import "UBWindowGroup.h"
#import "WKInspector.h"
#import "WKView.h"
#import "WKPage.h"
#import "WKWebViewInternal.h"
@import WebKit;
@implementation UBWindowsController {
NSMutableDictionary* windows;
}
- (id)init
{
self = [super init];
if (self) {
windows = [[NSMutableDictionary alloc] initWithCapacity:42];
}
return self;
}
- (void)updateWindows:(NSDictionary*)screens
baseUrl:(NSURL*)baseUrl
interactionEnabled:(Boolean)interactionEnabled
forceRefresh:(Boolean)forceRefresh
{
NSMutableArray* obsoleteScreens = [[windows allKeys] mutableCopy];
UBWindowGroup* windowGroup;
for(NSNumber* screenId in screens) {
if (![windows objectForKey:screenId]) {
windowGroup = [[UBWindowGroup alloc]
initWithInteractionEnabled: interactionEnabled
];
[windows setObject:windowGroup forKey:screenId];
[windowGroup loadUrl: [self screenUrl:screenId baseUrl:baseUrl]];
} else {
windowGroup = windows[screenId];
if (forceRefresh) {
[windowGroup reload];
}
}
[windowGroup setFrame:[self screenRect:screenId] display:YES];
[obsoleteScreens removeObject:screenId];
}
for (NSNumber* screenId in obsoleteScreens) {
[windows[screenId] close];
[windows removeObjectForKey:screenId];
}
NSLog(@"using %lu screens", (unsigned long)[windows count]);
}
- (NSRect)screenRect:(NSNumber*)screenId
{
NSRect screenRect = CGDisplayBounds([screenId unsignedIntValue]);
CGRect mainScreenRect = CGDisplayBounds(CGMainDisplayID());
int menuBarHeight = [[NSApp mainMenu] menuBarHeight];
screenRect.origin.y = -1 * (screenRect.origin.y + screenRect.size.height -
mainScreenRect.size.height);
screenRect.size.height = screenRect.size.height - menuBarHeight;
return screenRect;
}
- (void)reloadAll
{
for (NSNumber* screenId in windows) {
UBWindowGroup* window = windows[screenId];
[window reload];
}
}
- (void)closeAll
{
for (UBWindowGroup* window in [windows allValues]) {
[window close];
}
[windows removeAllObjects];
}
- (void)showDebugConsolesForScreen:(NSNumber*)screenId
{
NSWindow* window;
window = [(UBWindowGroup*)windows[screenId] foreground];
if (window) [self showDebugConsoleForWindow: window];
window = [(UBWindowGroup*)windows[screenId] background];
if (window) [self showDebugConsoleForWindow: window];
}
- (void)showDebugConsoleForWindow:(NSWindow*)window
{
WKPageRef page = NULL;
SEL pageForTesting = @selector(_pageForTesting);
if ([window.contentView.subviews[0] isKindOfClass:[WKView class]]) {
WKView* webview = window.contentView.subviews[0];
page = webview.pageRef;
} else if ([window.contentView respondsToSelector:pageForTesting]) {
page = (__bridge WKPageRef)([window.contentView
performSelector: pageForTesting
]);
}
if (page) {
WKInspectorRef inspector = WKPageGetInspector(page);
[NSApp activateIgnoringOtherApps:YES];
WKInspectorShowConsole(inspector);
[self
performSelector: @selector(detachInspector:)
withObject: (__bridge id)(inspector)
afterDelay: 0
];
}
}
- (void)detachInspector:(WKInspectorRef)inspector
{
WKInspectorDetach(inspector);
}
- (void)workspaceChanged
{
for (NSNumber* screenId in windows) {
[windows[screenId] workspaceChanged];
}
}
- (void)wallpaperChanged
{
for (NSNumber* screenId in windows) {
[windows[screenId] wallpaperChanged];
}
}
- (NSURL*)screenUrl:(NSNumber*)screenId baseUrl:(NSURL*)baseUrl
{
return [baseUrl
URLByAppendingPathComponent:[NSString
stringWithFormat:@"%@",
screenId
]
];
}
@end

View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>zh_CN</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>a.hecdn.net</key> <!--Include your domain at this line -->
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
<key>NSAppleEventsUsageDescription</key>
<string>A widget would like to control another app.</string>
<key>NSAppleMusicUsageDescription</key>
<string>A widget would like to access your Media Library.</string>
<key>NSAppleScriptEnabled</key>
<true/>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>A widget would like to access Bluetooth.</string>
<key>NSCalendarsUsageDescription</key>
<string>A widget would like to access your Calendar.</string>
<key>NSHomeKitUsageDescription</key>
<string>A widget would like to make use of HomeKit.</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2022 Felix Hageloh, Translation in bmy . 一款可以用 React.js 开发MacOs桌面小组件的应用</string>
<key>NSLocationUsageDescription</key>
<string>A widget would like to access your current locatiuon.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>A widget would like to access your Photo Library.</string>
<key>NSPrincipalClass</key>
<string>UBApplication</string>
<key>NSRemindersUsageDescription</key>
<string>A widget would like to access your Reminders.</string>
<key>NSSupportsAppNap</key>
<true/>
<key>OSAScriptingDefinition</key>
<string>Uebersicht.sdef</string>
<key>SUFeedURL</key>
<string>https://raw.githubusercontent.com/felixhageloh/uebersicht/gh-pages/updates.xml.rss</string>
</dict>
</plist>

View File

@@ -0,0 +1,9 @@
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary title="Übersicht">
<suite name="Übersicht Suite" code="uebt" description="Übersicht Scripts">
<command name="refresh" code="wigetrfs" description="Refresh all widgets.">
<cocoa class="UBRefreshCommand"/>
<direct-parameter description="A widget." type="widget"/>
</command>
<command name="reload" code="wigetrld" description="Reload a widget.">
<cocoa class="UBReloadCommand"/>
<direct-parameter description="A widget." type="widget"/>
</command>
<class name="application" code="capp" description="An application's top level scripting object.">
<cocoa class="NSApplication"/>
<element type="widget" description="A list of all widgets." access="r">
<cocoa key="widgets"/>
</element>
<property name="name" code="pnam" description="The name of the application." type="text" access="r"/>
<property name="version" code="vers" description="The version of the application." type="text" access="r"/>
</class>
<class name="widget" code="Wdgt" description="A Widget." plural="widgets">
<cocoa class="UBWidgetForScripting"/>
<property name="id" code="ID " description="The widget's unique ID." type="text" access="r">
<cocoa key="id"/>
</property>
<property name="hidden" code="wghd" description="Is this widget is hidden?" type="boolean" access="rw">
<cocoa key="hidden"/>
</property>
<property name="showOnMainScreen" code="wgms" description="Is this widget visible on the main screen only?" type="boolean" access="rw">
<cocoa key="showOnMainScreen"/>
</property>
<property name="showOnAllScreens" code="wgas" description="Is this widget visible on all screens?" type="boolean" access="rw">
<cocoa key="showOnAllScreens"/>
</property>
<responds-to name="refresh">
<cocoa method="refresh:"/>
</responds-to>
<responds-to name="reload">
<cocoa method="reload:"/>
</responds-to>
</class>
</suite>
<suite name="Standard Suite" code="ustd" description="Common classes and commands for all applications.">
<command name="quit" code="aevtquit" description="Quit the application.">
<cocoa class="NSQuitCommand"/>
</command>
</suite>
</dictionary>

View File

@@ -0,0 +1,16 @@
/*
* https://github.com/WebKit/webkit/blob/master/Source/WebKit2/Shared/API/c/WKBase.h
* Copyright (C) 2010 Apple Inc. All rights reserved.
*/
#ifndef WKBase_h
#define WKBase_h
#define WK_EXPORT
/* WebKit2 shared types */
typedef const struct OpaqueWKInspector* WKInspectorRef;
typedef const struct OpaqueWKPage* WKPageRef;
#endif /* WKBase_h */

View File

@@ -0,0 +1,47 @@
/*
* https://raw.githubusercontent.com/WebKit/webkit/master/Source/WebKit2/UIProcess/API/C/WKInspector.h
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
*/
#ifndef WKInspector_h
#define WKInspector_h
#include "WKBase.h"
#ifndef __cplusplus
#include <stdbool.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
WK_EXPORT WKPageRef WKInspectorGetPage(WKInspectorRef inspector);
WK_EXPORT bool WKInspectorIsConnected(WKInspectorRef inspector);
WK_EXPORT bool WKInspectorIsVisible(WKInspectorRef inspector);
WK_EXPORT bool WKInspectorIsFront(WKInspectorRef inspector);
WK_EXPORT void WKInspectorConnect(WKInspectorRef inspector);
WK_EXPORT void WKInspectorShow(WKInspectorRef inspector);
WK_EXPORT void WKInspectorHide(WKInspectorRef inspector);
WK_EXPORT void WKInspectorClose(WKInspectorRef inspector);
WK_EXPORT void WKInspectorShowConsole(WKInspectorRef inspector);
WK_EXPORT void WKInspectorShowResources(WKInspectorRef inspector);
WK_EXPORT bool WKInspectorIsAttached(WKInspectorRef inspector);
WK_EXPORT void WKInspectorAttach(WKInspectorRef inspector);
WK_EXPORT void WKInspectorDetach(WKInspectorRef inspector);
WK_EXPORT bool WKInspectorIsProfilingPage(WKInspectorRef inspector);
WK_EXPORT void WKInspectorTogglePageProfiling(WKInspectorRef inspector);
#ifdef __cplusplus
}
#endif
#endif // WKInspector_h

View File

@@ -0,0 +1,14 @@
/*
* https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/C/WKPage.h
* Copyright (C) 2010 Apple Inc. All rights reserved.
*/
#ifndef WKPage_h
#define WKPage_h
#import "WKBase.h"
#import "WKInspector.h"
WK_EXPORT WKInspectorRef WKPageGetInspector(WKPageRef page);
#endif

View File

@@ -0,0 +1,16 @@
/* https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/Cocoa/WKView.h
* https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
* https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
* Copyright (C) 2010 Apple Inc. All rights reserved.
*/
#ifndef WKView_h
#define WKView_h
#import "WKBase.h"
@interface WKView : NSView {}
@property (readonly) WKPageRef pageRef;
@end
#endif

View File

@@ -0,0 +1,14 @@
/*
* https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
* Copyright (C) 2010 Apple Inc. All rights reserved.
*/
#ifndef WKWebViewInternal_h
#define WKWebViewInternal_h
#include "WKBase.h"
//@interface WKWebView
//- (WKPageRef)_pageForTesting;
//@end
#endif

View File

@@ -0,0 +1 @@
70c7a87a-683a-47da-9894-740ac308d1c9

View File

@@ -0,0 +1,6 @@
{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf400
{\fonttbl}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\vieww9600\viewh8400\viewkind0
}

View File

@@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

View File

@@ -0,0 +1,67 @@
window.__UBCallbacks__ = (function () {
var api = {};
var callbacks = {};
var currentId = 0;
api.register = function register(callback) {
var id = currentId++;
callbacks[id] = callback;
return id;
};
api.remove = function remove(id) {
delete callbacks[id];
};
api.call = function call(id) {
if (callbacks[id]) {
callbacks[id].apply(
null,
Array.prototype.slice.apply(arguments, [1])
);
}
};
return api;
}());
(function() {
var geolocation = window.navigator.geolocation;
var messageHandler = window.webkit.messageHandlers.geolocation;
geolocation.getCurrentPosition = function getCurrentPosition(onPos, onErr) {
var callbackId = __UBCallbacks__.register(function (pos) {
onPos(pos);
__UBCallbacks__.remove(callbackId);
geolocation.clearWatch(callbackId);
})
messageHandler.postMessage({
type: 'registerCallback',
callbackId: callbackId
});
};
geolocation.watchPosition = function watchPosition(onPos, onErr) {
var callbackId = __UBCallbacks__.register(function (pos) {
onPos(pos);
})
messageHandler.postMessage({
type: 'registerCallback',
callbackId: callbackId
});
return callbackId;
};
geolocation.clearWatch = function clearWatch(callbackId) {
messageHandler.postMessage({
type: 'removeCallback',
callbackId: callbackId
});
}
window.geolocation = geolocation;
}());

View File

@@ -0,0 +1,18 @@
//
// main.m
// Übersicht
//
// Created by Felix Hageloh on 20/9/13.
// Copyright (c) 2013 Felix Hageloh.
//
// Released under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version. See <http://www.gnu.org/licenses/> for
// details.
#import <Cocoa/Cocoa.h>
int main(int argc, const char * argv[])
{
return NSApplicationMain(argc, argv);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

View File

@@ -0,0 +1 @@
3ba705a2-adc8-41c7-b90f-147bb0e38905

View File

@@ -0,0 +1,405 @@
/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */
"5.title" = "Bring All to Front";
/* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */
"19.title" = "Window";
/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */
"23.title" = "Minimize";
/* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */
"24.title" = "Window";
/* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */
"29.title" = "AMainMenu";
/* Class = "NSMenuItem"; title = "桌面小组件"; ObjectID = "56"; */
"56.title" = "桌面小组件";
/* Class = "NSMenu"; title = "桌面小组件"; ObjectID = "57"; */
"57.title" = "桌面小组件";
/* Class = "NSMenuItem"; title = "About Übersicht"; ObjectID = "58"; */
"58.title" = "About Übersicht";
/* Class = "NSMenuItem"; title = "Open…"; ObjectID = "72"; */
"72.title" = "Open…";
/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */
"73.title" = "Close";
/* Class = "NSMenuItem"; title = "Save…"; ObjectID = "75"; */
"75.title" = "Save…";
/* Class = "NSMenuItem"; title = "Page Setup..."; ObjectID = "77"; */
"77.title" = "Page Setup...";
/* Class = "NSMenuItem"; title = "Print…"; ObjectID = "78"; */
"78.title" = "Print…";
/* Class = "NSMenu"; title = "File"; ObjectID = "81"; */
"81.title" = "File";
/* Class = "NSMenuItem"; title = "New"; ObjectID = "82"; */
"82.title" = "New";
/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */
"83.title" = "File";
/* Class = "NSMenuItem"; title = "Revert to Saved"; ObjectID = "112"; */
"112.title" = "Revert to Saved";
/* Class = "NSMenuItem"; title = "Open Recent"; ObjectID = "124"; */
"124.title" = "Open Recent";
/* Class = "NSMenu"; title = "Open Recent"; ObjectID = "125"; */
"125.title" = "Open Recent";
/* Class = "NSMenuItem"; title = "Clear Menu"; ObjectID = "126"; */
"126.title" = "Clear Menu";
/* Class = "NSMenuItem"; title = "Preferences…"; ObjectID = "129"; */
"129.title" = "Preferences…";
/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */
"130.title" = "Services";
/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */
"131.title" = "Services";
/* Class = "NSMenuItem"; title = "Hide Übersicht"; ObjectID = "134"; */
"134.title" = "Hide Übersicht";
/* Class = "NSMenuItem"; title = "Quit Übersicht"; ObjectID = "136"; */
"136.title" = "Quit Übersicht";
/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */
"145.title" = "Hide Others";
/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */
"150.title" = "Show All";
/* Class = "NSMenuItem"; title = "Stop Speaking"; ObjectID = "195"; */
"195.title" = "Stop Speaking";
/* Class = "NSMenuItem"; title = "Start Speaking"; ObjectID = "196"; */
"196.title" = "Start Speaking";
/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "197"; */
"197.title" = "Copy";
/* Class = "NSMenuItem"; title = "Select All"; ObjectID = "198"; */
"198.title" = "Select All";
/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "199"; */
"199.title" = "Cut";
/* Class = "NSMenu"; title = "Spelling and Grammar"; ObjectID = "200"; */
"200.title" = "Spelling and Grammar";
/* Class = "NSMenuItem"; title = "Check Document Now"; ObjectID = "201"; */
"201.title" = "Check Document Now";
/* Class = "NSMenuItem"; title = "Delete"; ObjectID = "202"; */
"202.title" = "Delete";
/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "203"; */
"203.title" = "Paste";
/* Class = "NSMenuItem"; title = "Show Spelling and Grammar"; ObjectID = "204"; */
"204.title" = "Show Spelling and Grammar";
/* Class = "NSMenu"; title = "Edit"; ObjectID = "205"; */
"205.title" = "Edit";
/* Class = "NSMenuItem"; title = "Undo"; ObjectID = "207"; */
"207.title" = "Undo";
/* Class = "NSMenuItem"; title = "Find Next"; ObjectID = "208"; */
"208.title" = "Find Next";
/* Class = "NSMenuItem"; title = "Find…"; ObjectID = "209"; */
"209.title" = "Find…";
/* Class = "NSMenuItem"; title = "Jump to Selection"; ObjectID = "210"; */
"210.title" = "Jump to Selection";
/* Class = "NSMenuItem"; title = "Speech"; ObjectID = "211"; */
"211.title" = "Speech";
/* Class = "NSMenu"; title = "Speech"; ObjectID = "212"; */
"212.title" = "Speech";
/* Class = "NSMenuItem"; title = "Find Previous"; ObjectID = "213"; */
"213.title" = "Find Previous";
/* Class = "NSMenuItem"; title = "Redo"; ObjectID = "215"; */
"215.title" = "Redo";
/* Class = "NSMenuItem"; title = "Spelling and Grammar"; ObjectID = "216"; */
"216.title" = "Spelling and Grammar";
/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "217"; */
"217.title" = "Edit";
/* Class = "NSMenuItem"; title = "Find"; ObjectID = "218"; */
"218.title" = "Find";
/* Class = "NSMenuItem"; title = "Check Spelling While Typing"; ObjectID = "219"; */
"219.title" = "Check Spelling While Typing";
/* Class = "NSMenu"; title = "Find"; ObjectID = "220"; */
"220.title" = "Find";
/* Class = "NSMenuItem"; title = "Use Selection for Find"; ObjectID = "221"; */
"221.title" = "Use Selection for Find";
/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "239"; */
"239.title" = "Zoom";
/* Class = "NSMenuItem"; title = "View"; ObjectID = "295"; */
"295.title" = "View";
/* Class = "NSMenu"; title = "View"; ObjectID = "296"; */
"296.title" = "View";
/* Class = "NSMenuItem"; title = "Show Toolbar"; ObjectID = "297"; */
"297.title" = "Show Toolbar";
/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "298"; */
"298.title" = "Customize Toolbar…";
/* Class = "NSMenuItem"; title = "Check Grammar With Spelling"; ObjectID = "346"; */
"346.title" = "Check Grammar With Spelling";
/* Class = "NSMenuItem"; title = "Substitutions"; ObjectID = "348"; */
"348.title" = "Substitutions";
/* Class = "NSMenu"; title = "Substitutions"; ObjectID = "349"; */
"349.title" = "Substitutions";
/* Class = "NSMenuItem"; title = "Smart Copy/Paste"; ObjectID = "350"; */
"350.title" = "Smart Copy/Paste";
/* Class = "NSMenuItem"; title = "Smart Quotes"; ObjectID = "351"; */
"351.title" = "Smart Quotes";
/* Class = "NSMenuItem"; title = "Smart Links"; ObjectID = "354"; */
"354.title" = "Smart Links";
/* Class = "NSMenuItem"; title = "Format"; ObjectID = "375"; */
"375.title" = "Format";
/* Class = "NSMenu"; title = "Format"; ObjectID = "376"; */
"376.title" = "Format";
/* Class = "NSMenuItem"; title = "Font"; ObjectID = "377"; */
"377.title" = "Font";
/* Class = "NSMenu"; title = "Font"; ObjectID = "388"; */
"388.title" = "Font";
/* Class = "NSMenuItem"; title = "Show Fonts"; ObjectID = "389"; */
"389.title" = "Show Fonts";
/* Class = "NSMenuItem"; title = "Bold"; ObjectID = "390"; */
"390.title" = "Bold";
/* Class = "NSMenuItem"; title = "Italic"; ObjectID = "391"; */
"391.title" = "Italic";
/* Class = "NSMenuItem"; title = "Underline"; ObjectID = "392"; */
"392.title" = "Underline";
/* Class = "NSMenuItem"; title = "Bigger"; ObjectID = "394"; */
"394.title" = "Bigger";
/* Class = "NSMenuItem"; title = "Smaller"; ObjectID = "395"; */
"395.title" = "Smaller";
/* Class = "NSMenuItem"; title = "Kern"; ObjectID = "397"; */
"397.title" = "Kern";
/* Class = "NSMenuItem"; title = "Ligatures"; ObjectID = "398"; */
"398.title" = "Ligatures";
/* Class = "NSMenuItem"; title = "Baseline"; ObjectID = "399"; */
"399.title" = "Baseline";
/* Class = "NSMenuItem"; title = "Show Colors"; ObjectID = "401"; */
"401.title" = "Show Colors";
/* Class = "NSMenuItem"; title = "Copy Style"; ObjectID = "403"; */
"403.title" = "Copy Style";
/* Class = "NSMenuItem"; title = "Paste Style"; ObjectID = "404"; */
"404.title" = "Paste Style";
/* Class = "NSMenu"; title = "Baseline"; ObjectID = "405"; */
"405.title" = "Baseline";
/* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "406"; */
"406.title" = "Use Default";
/* Class = "NSMenuItem"; title = "Superscript"; ObjectID = "407"; */
"407.title" = "Superscript";
/* Class = "NSMenuItem"; title = "Subscript"; ObjectID = "408"; */
"408.title" = "Subscript";
/* Class = "NSMenuItem"; title = "Raise"; ObjectID = "409"; */
"409.title" = "Raise";
/* Class = "NSMenuItem"; title = "Lower"; ObjectID = "410"; */
"410.title" = "Lower";
/* Class = "NSMenu"; title = "Ligatures"; ObjectID = "411"; */
"411.title" = "Ligatures";
/* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "412"; */
"412.title" = "Use Default";
/* Class = "NSMenuItem"; title = "Use None"; ObjectID = "413"; */
"413.title" = "Use None";
/* Class = "NSMenuItem"; title = "Use All"; ObjectID = "414"; */
"414.title" = "Use All";
/* Class = "NSMenu"; title = "Kern"; ObjectID = "415"; */
"415.title" = "Kern";
/* Class = "NSMenuItem"; title = "Use Default"; ObjectID = "416"; */
"416.title" = "Use Default";
/* Class = "NSMenuItem"; title = "Use None"; ObjectID = "417"; */
"417.title" = "Use None";
/* Class = "NSMenuItem"; title = "Tighten"; ObjectID = "418"; */
"418.title" = "Tighten";
/* Class = "NSMenuItem"; title = "Loosen"; ObjectID = "419"; */
"419.title" = "Loosen";
/* Class = "NSMenuItem"; title = "Transformations"; ObjectID = "450"; */
"450.title" = "Transformations";
/* Class = "NSMenu"; title = "Transformations"; ObjectID = "451"; */
"451.title" = "Transformations";
/* Class = "NSMenuItem"; title = "Make Upper Case"; ObjectID = "452"; */
"452.title" = "Make Upper Case";
/* Class = "NSMenuItem"; title = "Correct Spelling Automatically"; ObjectID = "454"; */
"454.title" = "Correct Spelling Automatically";
/* Class = "NSMenuItem"; title = "Show Substitutions"; ObjectID = "457"; */
"457.title" = "Show Substitutions";
/* Class = "NSMenuItem"; title = "Smart Dashes"; ObjectID = "460"; */
"460.title" = "Smart Dashes";
/* Class = "NSMenuItem"; title = "Text Replacement"; ObjectID = "462"; */
"462.title" = "Text Replacement";
/* Class = "NSMenuItem"; title = "Make Lower Case"; ObjectID = "465"; */
"465.title" = "Make Lower Case";
/* Class = "NSMenuItem"; title = "Capitalize"; ObjectID = "466"; */
"466.title" = "Capitalize";
/* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "485"; */
"485.title" = "Paste and Match Style";
/* Class = "NSMenuItem"; title = "Help"; ObjectID = "490"; */
"490.title" = "Help";
/* Class = "NSMenu"; title = "Help"; ObjectID = "491"; */
"491.title" = "Help";
/* Class = "NSMenuItem"; title = "Übersicht Help"; ObjectID = "492"; */
"492.title" = "Übersicht Help";
/* Class = "NSMenuItem"; title = "Text"; ObjectID = "496"; */
"496.title" = "Text";
/* Class = "NSMenu"; title = "Text"; ObjectID = "497"; */
"497.title" = "Text";
/* Class = "NSMenuItem"; title = "Align Left"; ObjectID = "498"; */
"498.title" = "Align Left";
/* Class = "NSMenuItem"; title = "Center"; ObjectID = "499"; */
"499.title" = "Center";
/* Class = "NSMenuItem"; title = "Justify"; ObjectID = "500"; */
"500.title" = "Justify";
/* Class = "NSMenuItem"; title = "Align Right"; ObjectID = "501"; */
"501.title" = "Align Right";
/* Class = "NSMenuItem"; title = "Writing Direction"; ObjectID = "503"; */
"503.title" = "Writing Direction";
/* Class = "NSMenuItem"; title = "Show Ruler"; ObjectID = "505"; */
"505.title" = "Show Ruler";
/* Class = "NSMenuItem"; title = "Copy Ruler"; ObjectID = "506"; */
"506.title" = "Copy Ruler";
/* Class = "NSMenuItem"; title = "Paste Ruler"; ObjectID = "507"; */
"507.title" = "Paste Ruler";
/* Class = "NSMenu"; title = "Writing Direction"; ObjectID = "508"; */
"508.title" = "Writing Direction";
/* Class = "NSMenuItem"; title = "Paragraph"; ObjectID = "509"; */
"509.title" = "Paragraph";
/* Class = "NSMenuItem"; title = "\tDefault"; ObjectID = "510"; */
"510.title" = "\tDefault";
/* Class = "NSMenuItem"; title = "\tLeft to Right"; ObjectID = "511"; */
"511.title" = "\tLeft to Right";
/* Class = "NSMenuItem"; title = "\tRight to Left"; ObjectID = "512"; */
"512.title" = "\tRight to Left";
/* Class = "NSMenuItem"; title = "Selection"; ObjectID = "514"; */
"514.title" = "Selection";
/* Class = "NSMenuItem"; title = "\tDefault"; ObjectID = "515"; */
"515.title" = "\tDefault";
/* Class = "NSMenuItem"; title = "\tLeft to Right"; ObjectID = "516"; */
"516.title" = "\tLeft to Right";
/* Class = "NSMenuItem"; title = "\tRight to Left"; ObjectID = "517"; */
"517.title" = "\tRight to Left";
/* Class = "NSMenuItem"; title = "Find and Replace…"; ObjectID = "534"; */
"534.title" = "Find and Replace…";
/* Class = "NSMenuItem"; title = "退出"; ObjectID = "0lC-di-1Ep"; */
"0lC-di-1Ep.title" = "退出";
/* Class = "NSMenuItem"; title = "本地组件目录"; ObjectID = "FhM-7d-UOL"; */
"FhM-7d-UOL.title" = "本地组件目录";
/* Class = "NSMenuItem"; title = "软件设置"; ObjectID = "TZv-Vq-BWQ"; */
"TZv-Vq-BWQ.title" = "软件设置";
/* Class = "NSMenuItem"; title = "关于软件"; ObjectID = "YQt-G2-uKH"; */
"YQt-G2-uKH.title" = "关于软件";
/* Class = "NSMenuItem"; title = "访问组件库"; ObjectID = "g8k-60-Yu1"; */
"g8k-60-Yu1.title" = "访问组件库";
/* Class = "NSMenuItem"; title = "打开调试控制台"; ObjectID = "mKH-1l-jB3"; */
"mKH-1l-jB3.title" = "打开调试控制台";
/* Class = "NSMenuItem"; title = "检查新版"; ObjectID = "ssJ-cC-6aL"; */
"ssJ-cC-6aL.title" = "检查新版";
/* Class = "NSMenuItem"; title = "刷新所有组件"; ObjectID = "wAr-ms-Hyi"; */
"wAr-ms-Hyi.title" = "刷新所有组件";

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.personal-information.addressbook</key>
<true/>
<key>com.apple.security.personal-information.calendars</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
</dict>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
uebersicht-code/search.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

20
uebersicht-code/server/.babelrc Executable file
View File

@@ -0,0 +1,20 @@
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": [
"Explorer 11",
"last 5 Safari versions",
],
"useBuiltIns": "usage",
"corejs": "2",
"modules": "commonjs"
}
]
],
"plugins": [
"@babel/plugin-proposal-object-rest-spread"
]
}

View File

@@ -0,0 +1 @@
160a04a8-07e3-427c-9d42-0ed982a3189e

View File

@@ -0,0 +1,90 @@
redux = require 'redux'
window.$ = require 'jquery'
reducer = require './src/reducer'
listenToRemote = require './src/listen'
sharedSocket = require './src/SharedSocket'
render = require './src/render'
actions = require './src/actions'
userCssLink = null
detectWidgetHover = require './src/detectWidgetHover'
window.onload = ->
sharedSocket.open("ws://#{window.location.host}")
path = window.location.pathname.split('/')
screen =
id: Number(path[1])
layer: path[2]
contentEl = document.getElementById('uebersicht')
contentEl.innerHTML = ''
userCssLink = Array.from(document.querySelectorAll('link'))
.find((el) => el.href.match('userMain.css'))
detectWidgetHover(contentEl);
getState (err, initialState) ->
bail err, 10000 if err?
store = redux.createStore(reducer, initialState)
Object.keys(initialState.widgets).forEach (id) ->
fetchWidget(id)
.then (widgetImpl) -> store.dispatch(actions.showWidget(id, widgetImpl))
prevState = null
store.subscribe ->
nextState = store.getState()
return if nextState == prevState
render(store.getState(), screen, contentEl, store.dispatch)
prevState = nextState
listenToRemote (action) ->
if action.type == 'WIDGET_WANTS_REFRESH'
render.rendered[action.payload]?.instance?.forceRefresh()
else if action.type == 'WIDGET_ADDED'
store.dispatch(action)
return if action.payload.error
fetchWidget(action.payload.id)
.then (widgetImpl) ->
store.dispatch(actions.showWidget(action.payload.id, widgetImpl))
else if action.type == 'MASTER_STYLE_CHANGED'
reloadUserCSS()
else
store.dispatch(action)
render(initialState, screen, contentEl, store.dispatch)
# legacy
window.uebersicht =
makeBgSlice: (canvas) ->
console.warn 'makeBgSlice has been deprecated. Please use CSS \
backdrop-filter instead: \
https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter'
window.addEventListener 'contextmenu', (e) ->
e.preventDefault()
getState = (callback) ->
$.get("/state/")
.done((response) -> callback null, JSON.parse(response))
.fail -> callback response, null
fetchWidget = (id) -> new Promise (resolve, reject) ->
scriptTag = document.createElement('SCRIPT')
scriptTag.id = id
scriptTag.src = '/widgets/' + id
scriptTag.onload = ->
document.head.removeChild(scriptTag)
resolve(require(id))
scriptTag.onerror = (err) ->
document.head.removeChild(scriptTag)
reject(err)
document.head.appendChild(scriptTag)
reloadUserCSS = ->
href = userCssLink.href.split('?')[0]
userCssLink.href = "#{href}?#{new Date().getTime()}"
bail = (err, timeout = 0) ->
console.log err if err?
setTimeout ->
window.location.reload(true)
, timeout

5648
uebersicht-code/server/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
{
"name": "uebersicht-server",
"version": "0.0.0",
"description": "Node.js backend for Übersicht",
"main": "server.coffee",
"scripts": {
"test": "npm run-script test-local && npm run-script test-browser",
"test-local": "tape -r coffee-script/register spec/backend/**/* | tap-spec",
"test-browser": "browserify -t coffeeify spec/frontend/*.* | tape-run | tap-spec",
"start": "coffee server.coffee",
"release": "npm run-script build-client && npm run-script build-server",
"build-client": "browserify -i ws -t coffeeify -t babelify -r ./src/uebersicht.js:uebersicht client.coffee | uglifyjs -c > release/public/client.js",
"build-server": "browserify -t coffeeify --node --detect-globals false --no-bundle-external server.coffee > release/server.js && cd release && npm prune --production && npm install --production --no-progress"
},
"author": "Felix Hageloh",
"license": "GPL v3 <http://www.gnu.org/licenses/>",
"private": true,
"devDependencies": {
"coffee-script": "^1.12.7",
"sinon": "^4.0.1",
"tap-spec": "^5.0.0",
"tape": "^4.13.3",
"tape-run": "^6.0.1",
"uglify-js": "^3.10.4"
},
"dependencies": {
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.5",
"@babel/preset-react": "^7.10.4",
"@emotion/core": "^10.0.35",
"@emotion/styled": "^10.0.27",
"babel-plugin-emotion": "^10.0.33",
"babelify": "^10.0.0",
"browserify": "^16.5.2",
"byline": "^5.0.0",
"coffeeify": "^2.1.0",
"connect": "^3.6.5",
"convert-source-map": "^1.7.0",
"core-js": "^2.6.12",
"cors-anywhere": "^0.4.3",
"emotion": "^10.0.27",
"escodegen": "^1.14.3",
"esprima": "^2.7.3",
"fsevents": "^2.1.3",
"jquery": "^3.5.1",
"minimist": "^1.2.5",
"ms": "^2.0.0",
"nib": "~1.1.2",
"raf": "^3.4.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"redux": "^3.7.2",
"serve-static": "^1.13.1",
"source-map": "^0.7.3",
"stylus": "^0.54.8",
"superagent": "^3.8.3",
"through2": "^2.0.3",
"tmp": "0.0.33",
"tosource": "~1.0.0",
"ws": "^6.0.0"
}
}

View File

@@ -0,0 +1 @@
77b65ec0-9cd4-4c2e-b745-deb1f510bfc0

Some files were not shown because too many files have changed in this diff Show More