Browse Source

Initial import of klcddimmer 0.3

Slávek Banko 5 years ago
commit
29b50d195f

+ 1
- 0
AUTHORS View File

@@ -0,0 +1 @@
1
+Lorenzo Bettini, http://www.lorenzobettini.it

+ 340
- 0
COPYING View File

@@ -0,0 +1,340 @@
1
+		    GNU GENERAL PUBLIC LICENSE
2
+		       Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+			    Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Library General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+		    GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+    b) Accompany it with a written offer, valid for at least three
143
+    years, to give any third party, for a charge no more than your
144
+    cost of physically performing source distribution, a complete
145
+    machine-readable copy of the corresponding source code, to be
146
+    distributed under the terms of Sections 1 and 2 above on a medium
147
+    customarily used for software interchange; or,
148
+
149
+    c) Accompany it with the information you received as to the offer
150
+    to distribute corresponding source code.  (This alternative is
151
+    allowed only for noncommercial distribution and only if you
152
+    received the program in object code or executable form with such
153
+    an offer, in accord with Subsection b above.)
154
+
155
+The source code for a work means the preferred form of the work for
156
+making modifications to it.  For an executable work, complete source
157
+code means all the source code for all modules it contains, plus any
158
+associated interface definition files, plus the scripts used to
159
+control compilation and installation of the executable.  However, as a
160
+special exception, the source code distributed need not include
161
+anything that is normally distributed (in either source or binary
162
+form) with the major components (compiler, kernel, and so on) of the
163
+operating system on which the executable runs, unless that component
164
+itself accompanies the executable.
165
+
166
+If distribution of executable or object code is made by offering
167
+access to copy from a designated place, then offering equivalent
168
+access to copy the source code from the same place counts as
169
+distribution of the source code, even though third parties are not
170
+compelled to copy the source along with the object code.
171
+
172
+  4. You may not copy, modify, sublicense, or distribute the Program
173
+except as expressly provided under this License.  Any attempt
174
+otherwise to copy, modify, sublicense or distribute the Program is
175
+void, and will automatically terminate your rights under this License.
176
+However, parties who have received copies, or rights, from you under
177
+this License will not have their licenses terminated so long as such
178
+parties remain in full compliance.
179
+
180
+  5. You are not required to accept this License, since you have not
181
+signed it.  However, nothing else grants you permission to modify or
182
+distribute the Program or its derivative works.  These actions are
183
+prohibited by law if you do not accept this License.  Therefore, by
184
+modifying or distributing the Program (or any work based on the
185
+Program), you indicate your acceptance of this License to do so, and
186
+all its terms and conditions for copying, distributing or modifying
187
+the Program or works based on it.
188
+
189
+  6. Each time you redistribute the Program (or any work based on the
190
+Program), the recipient automatically receives a license from the
191
+original licensor to copy, distribute or modify the Program subject to
192
+these terms and conditions.  You may not impose any further
193
+restrictions on the recipients' exercise of the rights granted herein.
194
+You are not responsible for enforcing compliance by third parties to
195
+this License.
196
+
197
+  7. If, as a consequence of a court judgment or allegation of patent
198
+infringement or for any other reason (not limited to patent issues),
199
+conditions are imposed on you (whether by court order, agreement or
200
+otherwise) that contradict the conditions of this License, they do not
201
+excuse you from the conditions of this License.  If you cannot
202
+distribute so as to satisfy simultaneously your obligations under this
203
+License and any other pertinent obligations, then as a consequence you
204
+may not distribute the Program at all.  For example, if a patent
205
+license would not permit royalty-free redistribution of the Program by
206
+all those who receive copies directly or indirectly through you, then
207
+the only way you could satisfy both it and this License would be to
208
+refrain entirely from distribution of the Program.
209
+
210
+If any portion of this section is held invalid or unenforceable under
211
+any particular circumstance, the balance of the section is intended to
212
+apply and the section as a whole is intended to apply in other
213
+circumstances.
214
+
215
+It is not the purpose of this section to induce you to infringe any
216
+patents or other property right claims or to contest validity of any
217
+such claims; this section has the sole purpose of protecting the
218
+integrity of the free software distribution system, which is
219
+implemented by public license practices.  Many people have made
220
+generous contributions to the wide range of software distributed
221
+through that system in reliance on consistent application of that
222
+system; it is up to the author/donor to decide if he or she is willing
223
+to distribute software through any other system and a licensee cannot
224
+impose that choice.
225
+
226
+This section is intended to make thoroughly clear what is believed to
227
+be a consequence of the rest of this License.
228
+
229
+  8. If the distribution and/or use of the Program is restricted in
230
+certain countries either by patents or by copyrighted interfaces, the
231
+original copyright holder who places the Program under this License
232
+may add an explicit geographical distribution limitation excluding
233
+those countries, so that distribution is permitted only in or among
234
+countries not thus excluded.  In such case, this License incorporates
235
+the limitation as if written in the body of this License.
236
+
237
+  9. The Free Software Foundation may publish revised and/or new versions
238
+of the General Public License from time to time.  Such new versions will
239
+be similar in spirit to the present version, but may differ in detail to
240
+address new problems or concerns.
241
+
242
+Each version is given a distinguishing version number.  If the Program
243
+specifies a version number of this License which applies to it and "any
244
+later version", you have the option of following the terms and conditions
245
+either of that version or of any later version published by the Free
246
+Software Foundation.  If the Program does not specify a version number of
247
+this License, you may choose any version ever published by the Free Software
248
+Foundation.
249
+
250
+  10. If you wish to incorporate parts of the Program into other free
251
+programs whose distribution conditions are different, write to the author
252
+to ask for permission.  For software which is copyrighted by the Free
253
+Software Foundation, write to the Free Software Foundation; we sometimes
254
+make exceptions for this.  Our decision will be guided by the two goals
255
+of preserving the free status of all derivatives of our free software and
256
+of promoting the sharing and reuse of software generally.
257
+
258
+			    NO WARRANTY
259
+
260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+REPAIR OR CORRECTION.
269
+
270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+POSSIBILITY OF SUCH DAMAGES.
279
+
280
+		     END OF TERMS AND CONDITIONS
281
+
282
+	    How to Apply These Terms to Your New Programs
283
+
284
+  If you develop a new program, and you want it to be of the greatest
285
+possible use to the public, the best way to achieve this is to make it
286
+free software which everyone can redistribute and change under these terms.
287
+
288
+  To do so, attach the following notices to the program.  It is safest
289
+to attach them to the start of each source file to most effectively
290
+convey the exclusion of warranty; and each file should have at least
291
+the "copyright" line and a pointer to where the full notice is found.
292
+
293
+    <one line to give the program's name and a brief idea of what it does.>
294
+    Copyright (C) <year>  <name of author>
295
+
296
+    This program is free software; you can redistribute it and/or modify
297
+    it under the terms of the GNU General Public License as published by
298
+    the Free Software Foundation; either version 2 of the License, or
299
+    (at your option) any later version.
300
+
301
+    This program is distributed in the hope that it will be useful,
302
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
+    GNU General Public License for more details.
305
+
306
+    You should have received a copy of the GNU General Public License
307
+    along with this program; if not, write to the Free Software
308
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
309
+
310
+
311
+Also add information on how to contact you by electronic and paper mail.
312
+
313
+If the program is interactive, make it output a short notice like this
314
+when it starts in an interactive mode:
315
+
316
+    Gnomovision version 69, Copyright (C) year name of author
317
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
+    This is free software, and you are welcome to redistribute it
319
+    under certain conditions; type `show c' for details.
320
+
321
+The hypothetical commands `show w' and `show c' should show the appropriate
322
+parts of the General Public License.  Of course, the commands you use may
323
+be called something other than `show w' and `show c'; they could even be
324
+mouse-clicks or menu items--whatever suits your program.
325
+
326
+You should also get your employer (if you work as a programmer) or your
327
+school, if any, to sign a "copyright disclaimer" for the program, if
328
+necessary.  Here is a sample; alter the names:
329
+
330
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
+
333
+  <signature of Ty Coon>, 1 April 1989
334
+  Ty Coon, President of Vice
335
+
336
+This General Public License does not permit incorporating your program into
337
+proprietary programs.  If your program is a subroutine library, you may
338
+consider it more useful to permit linking proprietary applications with the
339
+library.  If this is what you want to do, use the GNU Library General
340
+Public License instead of this License.

+ 0
- 0
ChangeLog View File


+ 167
- 0
INSTALL View File

@@ -0,0 +1,167 @@
1
+Basic Installation
2
+==================
3
+
4
+   These are generic installation instructions.
5
+
6
+   The `configure' shell script attempts to guess correct values for
7
+various system-dependent variables used during compilation.  It uses
8
+those values to create a `Makefile' in each directory of the package.
9
+It may also create one or more `.h' files containing system-dependent
10
+definitions.  Finally, it creates a shell script `config.status' that
11
+you can run in the future to recreate the current configuration, a file
12
+`config.cache' that saves the results of its tests to speed up
13
+reconfiguring, and a file `config.log' containing compiler output
14
+(useful mainly for debugging `configure').
15
+
16
+   If you need to do unusual things to compile the package, please try
17
+to figure out how `configure' could check whether to do them, and mail
18
+diffs or instructions to the address given in the `README' so they can
19
+be considered for the next release.  If at some point `config.cache'
20
+contains results you don't want to keep, you may remove or edit it.
21
+
22
+   The file `configure.in' is used to create `configure' by a program
23
+called `autoconf'.  You only need `configure.in' if you want to change
24
+it or regenerate `configure' using a newer version of `autoconf'.
25
+
26
+The simplest way to compile this package is:
27
+
28
+  1. `cd' to the directory containing the package's source code and type
29
+     `./configure' to configure the package for your system.  If you're
30
+     using `csh' on an old version of System V, you might need to type
31
+     `sh ./configure' instead to prevent `csh' from trying to execute
32
+     `configure' itself.
33
+
34
+     Running `configure' takes a while.  While running, it prints some
35
+     messages telling which features it is checking for.
36
+
37
+  2. Type `make' to compile the package.
38
+
39
+  3. Type `make install' to install the programs and any data files and
40
+     documentation.
41
+
42
+  4. You can remove the program binaries and object files from the
43
+     source code directory by typing `make clean'.  
44
+
45
+Compilers and Options
46
+=====================
47
+
48
+   Some systems require unusual options for compilation or linking that
49
+the `configure' script does not know about.  You can give `configure'
50
+initial values for variables by setting them in the environment.  Using
51
+a Bourne-compatible shell, you can do that on the command line like
52
+this:
53
+     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
54
+
55
+Or on systems that have the `env' program, you can do it like this:
56
+     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
57
+
58
+Compiling For Multiple Architectures
59
+====================================
60
+
61
+   You can compile the package for more than one kind of computer at the
62
+same time, by placing the object files for each architecture in their
63
+own directory.  To do this, you must use a version of `make' that
64
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
65
+directory where you want the object files and executables to go and run
66
+the `configure' script.  `configure' automatically checks for the
67
+source code in the directory that `configure' is in and in `..'.
68
+
69
+   If you have to use a `make' that does not supports the `VPATH'
70
+variable, you have to compile the package for one architecture at a time
71
+in the source code directory.  After you have installed the package for
72
+one architecture, use `make distclean' before reconfiguring for another
73
+architecture.
74
+
75
+Installation Names
76
+==================
77
+
78
+   By default, `make install' will install the package's files in
79
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
80
+installation prefix other than `/usr/local' by giving `configure' the
81
+option `--prefix=PATH'.
82
+
83
+   You can specify separate installation prefixes for
84
+architecture-specific files and architecture-independent files.  If you
85
+give `configure' the option `--exec-prefix=PATH', the package will use
86
+PATH as the prefix for installing programs and libraries.
87
+Documentation and other data files will still use the regular prefix.
88
+
89
+   If the package supports it, you can cause programs to be installed
90
+with an extra prefix or suffix on their names by giving `configure' the
91
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
92
+
93
+Optional Features
94
+=================
95
+
96
+   Some packages pay attention to `--enable-FEATURE' options to
97
+`configure', where FEATURE indicates an optional part of the package.
98
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
99
+is something like `gnu-as' or `x' (for the X Window System).  The
100
+`README' should mention any `--enable-' and `--with-' options that the
101
+package recognizes.
102
+
103
+   For packages that use the X Window System, `configure' can usually
104
+find the X include and library files automatically, but if it doesn't,
105
+you can use the `configure' options `--x-includes=DIR' and
106
+`--x-libraries=DIR' to specify their locations.
107
+
108
+Specifying the System Type
109
+==========================
110
+
111
+   There may be some features `configure' can not figure out
112
+automatically, but needs to determine by the type of host the package
113
+will run on.  Usually `configure' can figure that out, but if it prints
114
+a message saying it can not guess the host type, give it the
115
+`--host=TYPE' option.  TYPE can either be a short name for the system
116
+type, such as `sun4', or a canonical name with three fields:
117
+     CPU-COMPANY-SYSTEM
118
+
119
+See the file `config.sub' for the possible values of each field.  If
120
+`config.sub' isn't included in this package, then this package doesn't
121
+need to know the host type.
122
+
123
+   If you are building compiler tools for cross-compiling, you can also
124
+use the `--target=TYPE' option to select the type of system they will
125
+produce code for and the `--build=TYPE' option to select the type of
126
+system on which you are compiling the package.
127
+
128
+Sharing Defaults
129
+================
130
+
131
+   If you want to set default values for `configure' scripts to share,
132
+you can create a site shell script called `config.site' that gives
133
+default values for variables like `CC', `cache_file', and `prefix'.
134
+`configure' looks for `PREFIX/share/config.site' if it exists, then
135
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
136
+`CONFIG_SITE' environment variable to the location of the site script.
137
+A warning: not all `configure' scripts look for a site script.
138
+
139
+Operation Controls
140
+==================
141
+
142
+   `configure' recognizes the following options to control how it
143
+operates.
144
+
145
+`--cache-file=FILE'
146
+     Use and save the results of the tests in FILE instead of
147
+     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
148
+     debugging `configure'.
149
+
150
+`--help'
151
+     Print a summary of the options to `configure', and exit.
152
+
153
+`--quiet'
154
+`--silent'
155
+`-q'
156
+     Do not print messages saying which checks are being made.
157
+
158
+`--srcdir=DIR'
159
+     Look for the package's source code in directory DIR.  Usually
160
+     `configure' can determine that directory automatically.
161
+
162
+`--version'
163
+     Print the version of Autoconf used to generate the `configure'
164
+     script, and exit.
165
+
166
+`configure' also accepts some other, not widely useful, options.
167
+

+ 20
- 0
LICENSE View File

@@ -0,0 +1,20 @@
1
+KLcdDimmer
2
+A KDE Panel applet to set brightness of LCD screen
3
+
4
+Copyright (C) 2006, Lorenzo Bettini, http://www.lorenzobettini.it
5
+
6
+This program is free software; you can redistribute it and/or modify
7
+it under the terms of the GNU General Public License as published by
8
+the Free Software Foundation; either version 2 of the License, or
9
+(at your option) any later version.
10
+
11
+This program is distributed in the hope that it will be useful,
12
+but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+GNU General Public License for more details.
15
+
16
+You should have received a copy of the GNU General Public License
17
+along with this program; if not, write to the Free Software
18
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
+
20
+The included file 'COPYING' is a copy of the GNU General Public License.

+ 25
- 0
Makefile.am View File

@@ -0,0 +1,25 @@
1
+SUBDIRS = $(TOPSUBDIRS)
2
+
3
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
4
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
5
+
6
+$(top_srcdir)/subdirs:
7
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
8
+
9
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
10
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
11
+
12
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
13
+
14
+package-messages:
15
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common package-messages
16
+	$(MAKE) -C po merge
17
+
18
+EXTRA_DIST = admin LICENSE configure.in.in
19
+
20
+dist-hook:
21
+	cd $(top_distdir) && perl admin/am_edit -padmin
22
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
23
+
24
+#kde_docs_KDEDOCS = COPYING NEWS INSTALL AUTHORS README
25
+

+ 10
- 0
Makefile.cvs View File

@@ -0,0 +1,10 @@
1
+all: 
2
+	@echo "This Makefile is only for the CVS repository"
3
+	@echo "This will be deleted before making the distribution"
4
+	@echo ""
5
+	$(MAKE) -f admin/Makefile.common cvs
6
+
7
+dist:
8
+	$(MAKE) -f admin/Makefile.common dist
9
+
10
+.SILENT:

+ 19
- 0
NEWS View File

@@ -0,0 +1,19 @@
1
+KLcdDimmer
2
+A KDE Panel applet to set brightness of LCD screen
3
+
4
+Copyright (C) 2006-2007, Lorenzo Bettini, http://www.lorenzobettini.it
5
+
6
+Version 0.3
7
+
8
+* Fixed tooltips and added what's this helps
9
+* Fixed geometry (now should fit the panel better)
10
+
11
+Version 0.2
12
+
13
+* Fixed the name of the rc file to klcddimmerrc
14
+* Can store the current brightness value and restore
15
+  it on startup
16
+
17
+Version 0.1
18
+
19
+First public release

+ 19
- 0
README View File

@@ -0,0 +1,19 @@
1
+KLcdDimmer
2
+A KDE Panel applet to set brightness of LCD screen
3
+http://klcddimmer.sourceforge.net
4
+
5
+Copyright (C) 2006, Lorenzo Bettini, http://www.lorenzobettini.it
6
+
7
+Notice that this relies on an external program to get/set the
8
+brightness.
9
+
10
+For instance, I've used
11
+
12
+SmartDimmer http://www.acc.umu.se/~erikw/program/
13
+NVclock http://www.linuxhardware.org/nvclock/
14
+
15
+but it is supposed to work also with others, since you can
16
+configure the applet.
17
+
18
+When you run configure, you should pass the KDE root directory
19
+as --prefix (in my system it is /usr).

+ 1
- 0
TODO View File

@@ -0,0 +1 @@
1
+

+ 11207
- 0
acinclude.m4
File diff suppressed because it is too large
View File


+ 12040
- 0
aclocal.m4
File diff suppressed because it is too large
View File


+ 219
- 0
config.h.in View File

@@ -0,0 +1,219 @@
1
+/* config.h.in.  Generated from configure.in by autoheader.  */
2
+
3
+/* Define if you have the CoreAudio API */
4
+#undef HAVE_COREAUDIO
5
+
6
+/* Define to 1 if you have the <crt_externs.h> header file. */
7
+#undef HAVE_CRT_EXTERNS_H
8
+
9
+/* Defines if your system has the crypt function */
10
+#undef HAVE_CRYPT
11
+
12
+/* Define to 1 if you have the <dlfcn.h> header file. */
13
+#undef HAVE_DLFCN_H
14
+
15
+/* Define to 1 if you have the <inttypes.h> header file. */
16
+#undef HAVE_INTTYPES_H
17
+
18
+/* Define if you have libjpeg */
19
+#undef HAVE_LIBJPEG
20
+
21
+/* Define if you have libpng */
22
+#undef HAVE_LIBPNG
23
+
24
+/* Define if you have a working libpthread (will enable threaded code) */
25
+#undef HAVE_LIBPTHREAD
26
+
27
+/* Define if you have libz */
28
+#undef HAVE_LIBZ
29
+
30
+/* Define to 1 if you have the <memory.h> header file. */
31
+#undef HAVE_MEMORY_H
32
+
33
+/* Define if your system needs _NSGetEnviron to set up the environment */
34
+#undef HAVE_NSGETENVIRON
35
+
36
+/* Define if you have the res_init function */
37
+#undef HAVE_RES_INIT
38
+
39
+/* Define if you have a STL implementation by SGI */
40
+#undef HAVE_SGI_STL
41
+
42
+/* Define to 1 if you have the `snprintf' function. */
43
+#undef HAVE_SNPRINTF
44
+
45
+/* Define to 1 if you have the <stdint.h> header file. */
46
+#undef HAVE_STDINT_H
47
+
48
+/* Define to 1 if you have the <stdlib.h> header file. */
49
+#undef HAVE_STDLIB_H
50
+
51
+/* Define to 1 if you have the <strings.h> header file. */
52
+#undef HAVE_STRINGS_H
53
+
54
+/* Define to 1 if you have the <string.h> header file. */
55
+#undef HAVE_STRING_H
56
+
57
+/* Define if you have strlcat */
58
+#undef HAVE_STRLCAT
59
+
60
+/* Define if you have the strlcat prototype */
61
+#undef HAVE_STRLCAT_PROTO
62
+
63
+/* Define if you have strlcpy */
64
+#undef HAVE_STRLCPY
65
+
66
+/* Define if you have the strlcpy prototype */
67
+#undef HAVE_STRLCPY_PROTO
68
+
69
+/* Define to 1 if you have the <sys/stat.h> header file. */
70
+#undef HAVE_SYS_STAT_H
71
+
72
+/* Define to 1 if you have the <sys/types.h> header file. */
73
+#undef HAVE_SYS_TYPES_H
74
+
75
+/* Define to 1 if you have the <unistd.h> header file. */
76
+#undef HAVE_UNISTD_H
77
+
78
+/* Define to 1 if you have the `vsnprintf' function. */
79
+#undef HAVE_VSNPRINTF
80
+
81
+/* Suffix for lib directories */
82
+#undef KDELIBSUFF
83
+
84
+/* Define a safe value for MAXPATHLEN */
85
+#undef KDEMAXPATHLEN
86
+
87
+/* Name of package */
88
+#undef PACKAGE
89
+
90
+/* Define to the address where bug reports for this package should be sent. */
91
+#undef PACKAGE_BUGREPORT
92
+
93
+/* Define to the full name of this package. */
94
+#undef PACKAGE_NAME
95
+
96
+/* Define to the full name and version of this package. */
97
+#undef PACKAGE_STRING
98
+
99
+/* Define to the one symbol short name of this package. */
100
+#undef PACKAGE_TARNAME
101
+
102
+/* Define to the version of this package. */
103
+#undef PACKAGE_VERSION
104
+
105
+/* The size of a `char *', as computed by sizeof. */
106
+#undef SIZEOF_CHAR_P
107
+
108
+/* The size of a `int', as computed by sizeof. */
109
+#undef SIZEOF_INT
110
+
111
+/* The size of a `long', as computed by sizeof. */
112
+#undef SIZEOF_LONG
113
+
114
+/* The size of a `short', as computed by sizeof. */
115
+#undef SIZEOF_SHORT
116
+
117
+/* The size of a `size_t', as computed by sizeof. */
118
+#undef SIZEOF_SIZE_T
119
+
120
+/* The size of a `unsigned long', as computed by sizeof. */
121
+#undef SIZEOF_UNSIGNED_LONG
122
+
123
+/* Define to 1 if you have the ANSI C header files. */
124
+#undef STDC_HEADERS
125
+
126
+/* Version number of package */
127
+#undef VERSION
128
+
129
+/* Define to 1 if your processor stores words with the most significant byte
130
+   first (like Motorola and SPARC, unlike Intel and VAX). */
131
+#undef WORDS_BIGENDIAN
132
+
133
+/*
134
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
135
+ * headers and I'm too lazy to write a configure test as long as only
136
+ * unixware is related
137
+ */
138
+#ifdef _UNIXWARE
139
+#define HAVE_BOOLEAN
140
+#endif
141
+
142
+
143
+
144
+/*
145
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
146
+ * that defines bzero.
147
+ */
148
+
149
+#if defined(_AIX)
150
+#include <strings.h>
151
+#endif
152
+
153
+
154
+
155
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
156
+# include <sys/time.h>
157
+# include <crt_externs.h>
158
+# define environ (*_NSGetEnviron())
159
+#endif
160
+
161
+
162
+
163
+#if !defined(HAVE_STRLCAT_PROTO)
164
+#ifdef __cplusplus
165
+extern "C" {
166
+#endif
167
+unsigned long strlcat(char*, const char*, unsigned long);
168
+#ifdef __cplusplus
169
+}
170
+#endif
171
+#endif
172
+
173
+
174
+
175
+#if !defined(HAVE_STRLCPY_PROTO)
176
+#ifdef __cplusplus
177
+extern "C" {
178
+#endif
179
+unsigned long strlcpy(char*, const char*, unsigned long);
180
+#ifdef __cplusplus
181
+}
182
+#endif
183
+#endif
184
+
185
+
186
+
187
+/*
188
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
189
+ */
190
+
191
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
192
+#if __STDC__
193
+#include <stdarg.h>
194
+#include <stdlib.h>
195
+#else
196
+#include <varargs.h>
197
+#endif
198
+#ifdef __cplusplus
199
+extern "C"
200
+#endif
201
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
202
+#ifdef __cplusplus
203
+extern "C"
204
+#endif
205
+int snprintf(char *str, size_t n, char const *fmt, ...);
206
+#endif
207
+
208
+
209
+
210
+#if defined(__SVR4) && !defined(__svr4__)
211
+#define __svr4__ 1
212
+#endif
213
+
214
+
215
+/* Compatibility define */
216
+#undef ksize_t
217
+
218
+/* Define the real type of socklen_t */
219
+#undef socklen_t

+ 2
- 0
configure.files View File

@@ -0,0 +1,2 @@
1
+./admin/configure.in.min
2
+configure.in.in

+ 82
- 0
configure.in View File

@@ -0,0 +1,82 @@
1
+dnl    This file is part of the KDE libraries/packages
2
+dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
3
+ 
4
+dnl    This file is free software; you can redistribute it and/or
5
+dnl    modify it under the terms of the GNU Library General Public
6
+dnl    License as published by the Free Software Foundation; either
7
+dnl    version 2 of the License, or (at your option) any later version.
8
+ 
9
+dnl    This library is distributed in the hope that it will be useful,
10
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+dnl    Library General Public License for more details.
13
+ 
14
+dnl    You should have received a copy of the GNU Library General Public License
15
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
16
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
+dnl    Boston, MA 02111-1307, USA.
18
+
19
+# Original Author was Kalle@kde.org
20
+# I lifted it in some mater. (Stephan Kulow)
21
+# I used much code from Janos Farkas
22
+
23
+dnl Process this file with autoconf to produce a configure script.
24
+
25
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
26
+
27
+dnl This is so we can use kde-common
28
+AC_CONFIG_AUX_DIR(admin)
29
+
30
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
31
+unset CDPATH
32
+
33
+dnl Checking host/target/build systems, for make, install etc.
34
+AC_CANONICAL_SYSTEM 
35
+dnl Perform program name transformation
36
+AC_ARG_PROGRAM
37
+
38
+dnl Automake doc recommends to do this only here. (Janos)
39
+AM_INIT_AUTOMAKE(klcddimmer, 0.3) dnl searches for some needed programs
40
+
41
+KDE_SET_PREFIX
42
+
43
+dnl generate the config header
44
+AM_CONFIG_HEADER(config.h) dnl at the distribution this done
45
+
46
+dnl Checks for programs.
47
+AC_CHECK_COMPILERS
48
+AC_ENABLE_SHARED(yes)
49
+AC_ENABLE_STATIC(no)
50
+KDE_PROG_LIBTOOL
51
+
52
+dnl for NLS support. Call them in this order!
53
+dnl WITH_NLS is for the po files
54
+AM_KDE_WITH_NLS
55
+
56
+KDE_USE_QT(3.2.0)
57
+AC_PATH_KDE
58
+#MIN_CONFIG(3.2.0)
59
+
60
+dnl PACKAGE set before
61
+AC_C_BIGENDIAN
62
+AC_CHECK_KDEMAXPATHLEN
63
+
64
+KDE_CREATE_SUBDIRSLIST
65
+AC_CONFIG_FILES([ Makefile ])
66
+AC_CONFIG_FILES([ doc/Makefile ])
67
+AC_CONFIG_FILES([ doc/en/Makefile ])
68
+AC_CONFIG_FILES([ po/Makefile ])
69
+AC_CONFIG_FILES([ src/Makefile ])
70
+AC_OUTPUT
71
+if test "$all_tests" = "bad"; then
72
+  if test ! "$cache_file" = "/dev/null"; then
73
+    echo ""    
74
+    echo "Please remove the file $cache_file after changing your setup"
75
+    echo "so that configure will find the changes next time."
76
+    echo ""
77
+  fi
78
+else
79
+  echo ""
80
+  echo "Good - your configure finished. Start make now"
81
+  echo ""
82
+fi

+ 6
- 0
configure.in.in View File

@@ -0,0 +1,6 @@
1
+#MIN_CONFIG(3.2.0)
2
+
3
+AM_INIT_AUTOMAKE(klcddimmer, 0.3)
4
+AC_C_BIGENDIAN
5
+AC_CHECK_KDEMAXPATHLEN
6
+

+ 8
- 0
doc/Makefile.am View File

@@ -0,0 +1,8 @@
1
+# the SUBDIRS is filled automatically by am_edit. If files are 
2
+# in this directory they are installed into the english dir
3
+
4
+KDE_LANG = en
5
+KDE_DOCS = klcddimmer
6
+SUBDIRS = $(AUTODIRS)  
7
+kde_docs_KDEDOCS = configure.png hi48-app-klcddimmer.png\
8
+	klcddimmer-screenshot.png klcddimmer.html

BIN
doc/configure.png View File


+ 2
- 0
doc/en/Makefile.am View File

@@ -0,0 +1,2 @@
1
+KDE_DOCS = klcddimmer
2
+KDE_LANG = en

+ 555
- 0
doc/en/index.docbook View File

@@ -0,0 +1,555 @@
1
+<?xml version="1.0" ?>
2
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
3
+  <!ENTITY klcddimmer "<application>klcddimmer 0.1</application>">
4
+  <!ENTITY kappname "&klcddimmer;"><!-- Do *not* replace kappname-->
5
+  <!ENTITY package "kde-module"><!-- kdebase, kdeadmin, etc -->
6
+  <!ENTITY % addindex "IGNORE">
7
+  <!ENTITY % English "INCLUDE"><!-- change language only here -->
8
+  
9
+  
10
+  <!-- Do not define any other entities; instead, use the entities
11
+       from kde-genent.entities and $LANG/user.entities. -->
12
+]>
13
+<!-- kdoctemplate v0.8 October 1 1999 
14
+     Minor update to "Credits and Licenses" section on August 24, 2000
15
+     Removed "Revision history" section on 22 January 2001
16
+     Changed to Installation/Help menu entities 18 October 2001
17
+     Other minor cleanup and changes 18 October 2001 -->
18
+
19
+
20
+<!--
21
+This template was designed by: David Rugge davidrugge@mindspring.com
22
+with lots of help from: Eric Bischoff ebisch@cybercable.tm.fr
23
+and Frederik Fouvry fouvry@sfs.nphil.uni-tuebingen.de
24
+of the KDE DocBook team.
25
+
26
+You may freely use this template for writing any sort of KDE documentation.
27
+If you have any changes or improvements, please let us know.
28
+
29
+Remember:
30
+- in XML, the case of the <tags> and attributes is relevant ;
31
+- also, quote all attributes.
32
+
33
+Please don't forget to remove all these comments in your final documentation,
34
+thanks ;-).
35
+-->
36
+
37
+<!-- ................................................................ -->
38
+
39
+<!-- The language must NOT be changed here. -->
40
+
41
+<book lang="&language;">
42
+
43
+<!-- This header contains all of the meta-information for the document such
44
+as Authors, publish date, the abstract, and Keywords -->
45
+
46
+<bookinfo>
47
+<title>The &klcddimmer; Handbook</title>
48
+
49
+<authorgroup>
50
+<author>
51
+<firstname></firstname>
52
+<othername></othername>
53
+<surname>Lorenzo Bettini, http://www.lorenzobettini.it,,</surname>
54
+<affiliation>
55
+<address><email></email></address>
56
+</affiliation>
57
+</author>
58
+</authorgroup>
59
+
60
+<!-- TRANS:ROLES_OF_TRANSLATORS -->
61
+
62
+<copyright>
63
+<year>1999</year>
64
+<year>2005</year>
65
+<holder>Lorenzo Bettini, http://www.lorenzobettini.it,,</holder>
66
+</copyright>
67
+<!-- Translators: put here the copyright notice of the translation -->
68
+<!-- Put here the FDL notice.  Read the explanation in fdl-notice.docbook
69
+     and in the FDL itself on how to use it. -->
70
+<legalnotice>&FDLNotice;</legalnotice>
71
+
72
+<!-- Date and version information of the documentation
73
+Don't forget to include this last date and this last revision number, we
74
+need them for translation coordination !
75
+Please respect the format of the date (YYYY-MM-DD) and of the version
76
+(V.MM.LL), it could be used by automation scripts.
77
+Do NOT change these in the translation. -->
78
+
79
+<date>2001-10-18</date>
80
+<releaseinfo>0.1</releaseinfo>
81
+
82
+<!-- Abstract about this handbook -->
83
+
84
+<abstract>
85
+<para>
86
+&klcddimmer; is an application specially designed to do nothing you would
87
+ever want.
88
+</para>
89
+</abstract>
90
+
91
+<!-- This is a set of Keywords for indexing by search engines.
92
+Please at least include KDE, the KDE package it is in, the name
93
+ of your application, and a few relevant keywords. -->
94
+
95
+<keywordset>
96
+<keyword>KDE</keyword>
97
+<keyword>klcddimmer</keyword>
98
+<keyword>nothing</keyword>
99
+<keyword>nothing else</keyword>
100
+</keywordset>
101
+
102
+</bookinfo>
103
+
104
+<!-- The contents of the documentation begin here.  Label
105
+each chapter so with the id attribute. This is necessary for two reasons: it
106
+allows you to easily reference the chapter from other chapters of your
107
+document, and if there is no ID, the name of the generated HTML files will vary
108
+from time to time making it hard to manage for maintainers and for the CVS
109
+system. Any chapter labelled (OPTIONAL) may be left out at the author's
110
+discretion. Other chapters should not be left out in order to maintain a
111
+consistent documentation style across all KDE apps. -->
112
+
113
+<chapter id="introduction">
114
+<title>Introduction</title>
115
+
116
+<!-- The introduction chapter contains a brief introduction for the
117
+application that explains what it does and where to report
118
+problems. Basically a long version of the abstract.  Don't include a
119
+revision history. (see installation appendix comment) -->
120
+
121
+<para>
122
+&klcddimmer; is a program that lets you do absolutely nothing. Please report
123
+any problems or feature requests to the &kde; mailing lists.
124
+</para>
125
+</chapter>
126
+
127
+<chapter id="using-klcddimmer">
128
+<title>Using &klcddimmer;</title>
129
+
130
+<!-- This chapter should tell the user how to use your app. You should use as
131
+many sections (Chapter, Sect1, Sect3, etc...) as is necessary to fully document
132
+your application. -->
133
+
134
+<para>
135
+
136
+<!-- Note that all graphics should be in .png format. Use no gifs because of
137
+patent issues. -->
138
+
139
+<screenshot>
140
+<screeninfo>Here's a screenshot of &klcddimmer;</screeninfo>
141
+	<mediaobject>
142
+	  <imageobject>
143
+	    <imagedata fileref="screenshot.png" format="PNG"/>
144
+	  </imageobject>
145
+	  <imageobject>
146
+	    <imagedata fileref="screenshot.eps" format="EPS"/>
147
+	  </imageobject>
148
+	  <textobject>
149
+	    <phrase>Screenshot</phrase>
150
+	  </textobject>
151
+	</mediaobject>
152
+</screenshot>
153
+</para>
154
+
155
+
156
+<sect1 id="klcddimmer-features">
157
+<title>More &klcddimmer; features</title>
158
+
159
+<para>It slices! It dices! and it comes with a free toaster!</para>
160
+<para>
161
+The Squiggle Tool <guiicon><inlinemediaobject>
162
+	  <imageobject>
163
+	    <imagedata fileref="squiggle.png" format="PNG"/>
164
+	  </imageobject>
165
+	  <imageobject>
166
+	    <imagedata fileref="squiggle.eps" format="EPS"/>
167
+	  </imageobject>
168
+	  <textobject>
169
+	    <phrase>Squiggle</phrase>
170
+	  </textobject>
171
+</inlinemediaobject></guiicon> is used to draw squiggly lines all over
172
+the &klcddimmer; main window. It's not a bug, it's a feature!
173
+</para>
174
+
175
+</sect1>
176
+</chapter>
177
+
178
+<chapter id="commands">
179
+<title>Command Reference</title>
180
+
181
+<!-- (OPTIONAL, BUT RECOMMENDED) This chapter should list all of the
182
+application windows and their menubar and toolbar commands for easy reference.
183
+Also include any keys that have a special function but have no equivalent in the
184
+menus or toolbars. This may not be necessary for small apps or apps with no tool
185
+or menu bars. -->
186
+
187
+<sect1 id="klcddimmer-mainwindow">
188
+<title>The main &klcddimmer; window</title>
189
+
190
+<sect2>
191
+<title>The File Menu</title>
192
+<para>
193
+<variablelist>
194
+<varlistentry>
195
+<term><menuchoice>
196
+<shortcut>
197
+<keycombo action="simul">&Ctrl;<keycap>N</keycap></keycombo>
198
+</shortcut>
199
+<guimenu>File</guimenu>
200
+<guimenuitem>New</guimenuitem>
201
+</menuchoice></term>
202
+<listitem><para><action>Creates a new document</action></para></listitem>
203
+</varlistentry>
204
+<varlistentry>
205
+<term><menuchoice>
206
+<shortcut>
207
+<keycombo action="simul">&Ctrl;<keycap>S</keycap></keycombo>
208
+</shortcut>
209
+<guimenu>File</guimenu>
210
+<guimenuitem>Save</guimenuitem>
211
+</menuchoice></term>
212
+<listitem><para><action>Saves the document</action></para></listitem>
213
+</varlistentry>
214
+<varlistentry>
215
+<term><menuchoice>
216
+<shortcut>
217
+<keycombo action="simul">&Ctrl;<keycap>Q</keycap></keycombo>
218
+</shortcut>
219
+<guimenu>File</guimenu>
220
+<guimenuitem>Quit</guimenuitem>
221
+</menuchoice></term>
222
+<listitem><para><action>Quits</action> &klcddimmer;</para></listitem>
223
+</varlistentry>
224
+</variablelist>
225
+</para>
226
+
227
+</sect2>
228
+
229
+<sect2>
230
+<title>The <guimenu>Help</guimenu> Menu</title>
231
+
232
+<!-- Assuming you have a standard help menu (help, what's this, about -->
233
+<!-- &klcddimmer;, about KDE) then the documentation is already written. -->
234
+<!-- The following entity is valid anywhere that a variablelist is -->
235
+<!-- valid.  -->
236
+
237
+&help.menu.documentation;
238
+
239
+</sect2>
240
+
241
+</sect1>
242
+</chapter>
243
+
244
+<chapter id="developers">
245
+<title>Developer's Guide to &klcddimmer;</title>
246
+
247
+<!-- (OPTIONAL) A Programming/Scripting reference chapter should be
248
+used for apps that use plugins or that provide their own scripting hooks
249
+and/or development libraries. -->
250
+
251
+<para>
252
+Programming &klcddimmer; plugins is a joy to behold. Just read through the next
253
+66 pages of API's to learn how!
254
+</para>
255
+
256
+<!-- Use refentries to describe APIs.  Refentries are fairly complicated and you
257
+should consult the docbook reference for further details. The example below was
258
+taken from that reference and shortened a bit for readability. -->
259
+
260
+<refentry id="re-1007-unmanagechildren-1">
261
+<refmeta>
262
+<refentrytitle>XtUnmanageChildren</refentrytitle>
263
+<refmiscinfo>Xt - Geometry Management</refmiscinfo>
264
+</refmeta>
265
+<refnamediv>
266
+<refname>XtUnmanageChildren
267
+</refname>
268
+<refpurpose>remove a list of children from a parent widget's managed
269
+list.
270
+<indexterm id="ix-1007-unmanagechildren-1"><primary>widgets</primary><secondary>removing</secondary></indexterm>
271
+<indexterm id="ix-1007-unmanagechildren-2"><primary>XtUnmanageChildren</primary></indexterm> 
272
+</refpurpose>
273
+
274
+</refnamediv>
275
+<refsynopsisdiv>
276
+<refsynopsisdivinfo>
277
+<date>4 March 1996</date>
278
+</refsynopsisdivinfo>
279
+<synopsis>
280
+void XtUnmanageChildren(<replaceable class="parameter">children</replaceable>, <replaceable class="parameter">num_children</replaceable>)
281
+    WidgetList <replaceable class="parameter">children</replaceable>;
282
+    Cardinal <replaceable class="parameter">num_children</replaceable>;
283
+</synopsis>
284
+
285
+<refsect2 id="r2-1007-unmanagechildren-1">
286
+<title>Inputs</title>
287
+<variablelist>
288
+<varlistentry>
289
+<term><replaceable class="parameter">children</replaceable>
290
+</term>
291
+<listitem>
292
+<para>Specifies an array of child widgets. Each child must be of
293
+class RectObj or any subclass thereof.
294
+</para>
295
+</listitem>
296
+</varlistentry>
297
+<varlistentry>
298
+<term><replaceable class="parameter">num_children</replaceable>
299
+</term>
300
+<listitem>
301
+<para>Specifies the number of elements in <replaceable class="parameter">children</replaceable>.
302
+</para>
303
+</listitem>
304
+</varlistentry>
305
+</variablelist>
306
+</refsect2></refsynopsisdiv>
307
+
308
+<refsect1 id="r1-1007-unmanagechildren-1">
309
+<title>Description
310
+</title>
311
+<para><function>XtUnmanageChildren()</function> unmaps the specified widgets
312
+and removes them from their parent's geometry management.
313
+The widgets will disappear from the screen, and (depending
314
+on its parent) may no longer have screen space allocated for
315
+them.
316
+</para>
317
+<para>Each of the widgets in the <replaceable class="parameter">children</replaceable> array must have
318
+the same parent.
319
+</para>
320
+<para>See the &ldquo;Algorithm&rdquo; section below for full details of the
321
+widget unmanagement procedure.
322
+</para>
323
+</refsect1>
324
+
325
+<refsect1 id="r1-1007-unmanagechildren-2">
326
+<title>Usage</title>
327
+<para>Unmanaging widgets is the usual method for temporarily
328
+making them invisible.  They can be re-managed with
329
+<function>XtManageChildren()</function>.
330
+</para>
331
+<para>You can unmap a widget, but leave it under geometry
332
+management by calling <function>XtUnmapWidget()</function>.  You can
333
+destroy a widget's window without destroying the widget by
334
+calling <function>XtUnrealizeWidget()</function>.  You can destroy a
335
+widget completely with <function>XtDestroyWidget()</function>.
336
+</para>
337
+<para>If you are only going to unmanage a single widget, it is
338
+more convenient to call <function>XtUnmanageChild()</function>.  It is
339
+often more convenient to call <function>XtUnmanageChild()</function>
340
+several times than it is to declare and initialize an array
341
+of widgets to pass to <function>XtUnmanageChildren()</function>.  Calling
342
+<function>XtUnmanageChildren()</function> is more efficient, however,
343
+because it only calls the parent's <function>change_managed()</function>
344
+method once.
345
+</para>
346
+</refsect1>
347
+
348
+<refsect1 id="r1-1007-unmanagechildren-3">
349
+<title>Algorithm
350
+</title>
351
+<para><function>XtUnmanageChildren()</function> performs the following:
352
+</para>
353
+<variablelist>
354
+<varlistentry>
355
+<term>-
356
+</term>
357
+<listitem>
358
+<para>Ignores the child if it already is unmanaged or is being
359
+destroyed.
360
+</para>
361
+</listitem>
362
+</varlistentry>
363
+<varlistentry>
364
+<term>-
365
+</term>
366
+<listitem>
367
+<para>Otherwise, if the child is realized, it makes it nonvisible
368
+by unmapping it.
369
+</para>
370
+</listitem>
371
+</varlistentry>
372
+</variablelist>
373
+<para>
374
+</para>
375
+</refsect1>
376
+
377
+<refsect1 id="r1-1007-unmanagechildren-4">
378
+<title>Structures</title>
379
+<para>The <type>WidgetList</type> type is simply an array of widgets:
380
+</para>
381
+<screen id="sc-1007-unmanagechildren-1">typedef Widget *WidgetList;
382
+</screen>
383
+</refsect1>
384
+</refentry>
385
+
386
+</chapter>
387
+
388
+<chapter id="faq">
389
+<title>Questions and Answers</title>
390
+
391
+<!-- (OPTIONAL but recommended) This chapter should include all of the silly
392
+(and not-so-silly) newbie questions that fill up your mailbox. This chapter
393
+should be reserved for BRIEF questions and answers! If one question uses more
394
+than a page or so then it should probably be part of the
395
+"Using this Application" chapter instead. You should use links to
396
+cross-reference questions to the parts of your documentation that answer them.
397
+This is also a great place to provide pointers to other FAQ's if your users
398
+must do some complicated configuration on other programs in order for your
399
+application work. -->
400
+
401
+&reporting.bugs;
402
+&updating.documentation;
403
+
404
+<qandaset id="faqlist">
405
+<qandaentry>
406
+<question>
407
+<para>My Mouse doesn't work. How do I quit &klcddimmer;?</para>
408
+</question>
409
+<answer>
410
+<para>You silly goose! Check out the <link linkend="commands">Commands
411
+Section</link> for the answer.</para>
412
+</answer>
413
+</qandaentry>
414
+<qandaentry>
415
+<question>
416
+<para>Why can't I twiddle my documents?</para>
417
+</question>
418
+<answer>
419
+<para>You can only twiddle your documents if you have the foobar.lib
420
+installed.</para>
421
+</answer>
422
+</qandaentry>
423
+</qandaset>
424
+</chapter>
425
+
426
+<chapter id="credits">
427
+
428
+<!-- Include credits for the programmers, documentation writers, and
429
+contributors here. The license for your software should then be included below
430
+the credits with a reference to the appropriate license file included in the KDE
431
+distribution. -->
432
+
433
+<title>Credits and License</title>
434
+
435
+<para>
436
+&klcddimmer;
437
+</para>
438
+<para>
439
+Program copyright 2005 Lorenzo Bettini, http://www.lorenzobettini.it,,
440
+</para>
441
+<para>
442
+Contributors:
443
+<itemizedlist>
444
+<listitem><para>Konqui the KDE Dragon <email>konqui@kde.org</email></para>
445
+</listitem>
446
+<listitem><para>Tux the Linux Penguin <email>tux@linux.org</email></para>
447
+</listitem>
448
+</itemizedlist>
449
+</para>
450
+
451
+<para>
452
+Documentation copyright 2005 Lorenzo Bettini, http://www.lorenzobettini.it,, 
453
+</para>
454
+
455
+<!-- TRANS:CREDIT_FOR_TRANSLATORS -->
456
+
457
+&underFDL;               <!-- FDL: do not remove -->
458
+
459
+<!-- Determine which license your application is licensed under, 
460
+     and delete all the remaining licenses below:
461
+
462
+     (NOTE:  All documentation are licensed under the FDL, 
463
+     regardless of what license the application uses) -->
464
+
465
+&underGPL;        	 <!-- GPL License -->
466
+&underBSDLicense;        <!-- BSD License -->
467
+&underArtisticLicense;   <!-- BSD Artistic License -->
468
+&underX11License;        <!-- X11 License  -->
469
+
470
+</chapter>
471
+
472
+<appendix id="installation">
473
+<title>Installation</title>
474
+
475
+<sect1 id="getting-klcddimmer">
476
+<title>How to obtain &klcddimmer;</title>
477
+
478
+<!-- This first entity contains boiler plate for applications that are
479
+part of KDE CVS.  You should remove it if you are releasing your
480
+application --> 
481
+
482
+&install.intro.documentation;
483
+
484
+</sect1>
485
+
486
+<sect1 id="requirements">
487
+<title>Requirements</title>
488
+
489
+<!--
490
+List any special requirements for your application here. This should include:
491
+.Libraries or other software that is not included in kdesupport,
492
+kdelibs, or kdebase.
493
+.Hardware requirements like amount of RAM, disk space, graphics card
494
+capabilities, screen resolution, special expansion cards, etc.
495
+.Operating systems the app will run on. If your app is designed only for a
496
+specific OS, (you wrote a graphical LILO configurator for example) put this
497
+information here.
498
+-->
499
+
500
+<para>
501
+In order to successfully use &klcddimmer;, you need &kde; 1.1. Foobar.lib is
502
+required in order to support the advanced &klcddimmer; features. &klcddimmer; uses
503
+about 5 megs of memory to run, but this may vary depending on your
504
+platform and configuration.
505
+</para>
506
+
507
+<para>
508
+All required libraries as well as &klcddimmer; itself can be found
509
+on <ulink url="ftp://ftp.klcddimmer.org">The &klcddimmer; home page</ulink>.
510
+</para>
511
+
512
+<!-- For a list of updates, you may refer to the application web site
513
+or the ChangeLog file, or ... -->
514
+<para>
515
+You can find a list of changes at <ulink
516
+url="http://apps.kde.org/klcddimmer">http://apps.kde.org/klcddimmer</ulink>.
517
+</para>
518
+</sect1>
519
+
520
+<sect1 id="compilation">
521
+<title>Compilation and Installation</title>
522
+
523
+<!-- This entity contains the boilerplate text for standard -->
524
+<!-- compilation instructions.  If your application requires any -->
525
+<!-- special handling, remove it, and replace with your own text. -->
526
+
527
+&install.compile.documentation;
528
+
529
+</sect1>
530
+
531
+<sect1 id="configuration">
532
+<title>Configuration</title>
533
+
534
+<para>Don't forget to tell your system to start the <filename>dtd</filename>
535
+dicer-toaster daemon first, or &klcddimmer; won't work !</para>
536
+
537
+</sect1>
538
+
539
+</appendix>
540
+
541
+&documentation.index;
542
+</book>
543
+
544
+<!--
545
+Local Variables:
546
+mode: sgml
547
+sgml-minimize-attributes:nil
548
+sgml-general-insert-case:lower
549
+sgml-indent-step:0
550
+sgml-indent-data:nil
551
+End:
552
+
553
+vim:tabstop=2:shiftwidth=2:expandtab 
554
+-->
555
+

BIN
doc/hi48-app-klcddimmer.png View File


BIN
doc/klcddimmer-screenshot.png View File


+ 156
- 0
doc/klcddimmer.html View File

@@ -0,0 +1,156 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or
2
+g/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
4
+<head>
5
+  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type" />
6
+  <meta content="Lorenzo Bettini" name="author" />
7
+  <title>KLcdDimmer - A KDE Applet to adjust LCD brightness</title>
8
+</head>
9
+
10
+
11
+<body>
12
+
13
+
14
+
15
+<h1><img style="width: 48px; height: 48px;" alt="KLcdDimmer icon" src="hi48-app-klcddimmer.png"> KLcdDimmer</h1>
16
+
17
+
18
+
19
+<h1><small>A KDE Applet to adjust LCD brightness</small></h1>
20
+
21
+
22
+
23
+by <a href="http://www.lorenzobettini.it">Lorenzo
24
+Bettini</a><br>
25
+
26
+
27
+
28
+<br>
29
+
30
+
31
+
32
+<img style="width: 290px; height: 176px;" alt="KLcdDimmer Screenshot" src="klcddimmer-screenshot.png"><br>
33
+
34
+
35
+
36
+<br>
37
+
38
+
39
+
40
+To adjust the brightness simply click with the&nbsp;mouse&nbsp;left
41
+button and use the slider<br>
42
+
43
+
44
+
45
+<br>
46
+
47
+
48
+
49
+Notice that this applet relies on an external program to get/set the
50
+brightness.<br>
51
+
52
+
53
+
54
+<br>
55
+
56
+
57
+
58
+For instance, I've used<br>
59
+
60
+
61
+
62
+<br>
63
+
64
+
65
+
66
+<span style="font-weight: bold;">SmartDimmer</span> <a href="http://www.acc.umu.se/%7Eerikw/program/">http://www.acc.umu.se/~erikw/program/</a><br>
67
+
68
+
69
+
70
+<span style="font-weight: bold;">NVclock</span> <a href="http://www.linuxhardware.org/nvclock/">http://www.linuxhardware.org/nvclock/</a><br>
71
+
72
+
73
+
74
+<br>
75
+
76
+
77
+
78
+but it is supposed to work also with others, since you can configure
79
+the applet. In order to do this, click with the mouse right button and
80
+choose <span style="font-style: italic;">configure</span>:<br>
81
+
82
+
83
+
84
+<br>
85
+
86
+
87
+
88
+<img style="width: 411px; height: 346px;" alt="The configuration dialog" src="configure.png"><br>
89
+
90
+
91
+
92
+<br>
93
+
94
+
95
+You have to set the right command line argument for&nbsp;setting and
96
+getting the brightness (you have to check the documentation of the
97
+program you're using for setting the brightness). &nbsp;If the program
98
+you're using does not support the "get" argument (e.g., nvclock), just
99
+leave that field empty. As for the minimum, maximum and step values,
100
+again, you have to check the documentation of the program (you'll
101
+already find all the correct values for smartdimmer).<br>
102
+
103
+
104
+<br>
105
+
106
+
107
+If you check the "Save the current brightness value", the current value will be saved, and restored when you enter kde again. <br>
108
+
109
+
110
+
111
+<h2>Download (License: GNU GPL)</h2>
112
+
113
+
114
+
115
+KlcdDimmer's Sources can be downloaded from <a href="http://sourceforge.net/projects/klcddimmer">http://sourceforge.net/projects/klcddimmer</a>.<br>
116
+<br>
117
+
118
+You can also find details about new features on my blog, in this area: <a href="http://tronprog.blogspot.com/search/label/klcddimmer">http://tronprog.blogspot.com/search/label/klcddimmer</a>. 
119
+
120
+<h2>Installation</h2>
121
+
122
+
123
+
124
+When you run configure, you should pass the KDE root directory as
125
+--prefix (in my system it is /usr). If you don't know about this directory, you can get the right value by running:<br>
126
+
127
+<pre>kde-config --prefix</pre>
128
+
129
+
130
+<p>The steps to perform for the
131
+installation are standard for packages
132
+in source form: once you have unpacked the sources in a directory, `cd'
133
+to the directory containing the package's source code and execute the
134
+following steps: </p>
135
+
136
+
137
+
138
+<pre>./configure --prefix=&lt;your KDE directory&gt;<br></pre>
139
+
140
+Or, to automatically get the KDE root directory (notice it is ` and not '):
141
+<pre>./configure --prefix=`kde-config --prefix`<br></pre>
142
+
143
+<p>and then:</p>
144
+
145
+<pre>make<br>make install (as root)</pre>
146
+
147
+
148
+
149
+<p>Then you'll be able to add the applet to the panel, by using your
150
+KDE panel. </p>
151
+
152
+
153
+
154
+
155
+</body>
156
+</html>

+ 243
- 0
klcddimmer.kdevelop View File

@@ -0,0 +1,243 @@
1
+<?xml version = '1.0'?>
2
+<kdevelop>
3
+  <general>
4
+    <author>Lorenzo Bettini, http://www.lorenzobettini.it,,</author>
5
+    <email/>
6
+    <version>0.3</version>
7
+    <projectmanagement>KDevKDEAutoProject</projectmanagement>
8
+    <primarylanguage>C++</primarylanguage>
9
+    <keywords>
10
+      <keyword>C++</keyword>
11
+      <keyword>Code</keyword>
12
+      <keyword>Qt</keyword>
13
+      <keyword>KDE</keyword>
14
+      <keyword>Kicker</keyword>
15
+    </keywords>
16
+    <versioncontrol>kdevcvsservice</versioncontrol>
17
+    <ignoreparts/>
18
+    <projectdirectory>.</projectdirectory>
19
+    <absoluteprojectpath>false</absoluteprojectpath>
20
+    <description/>
21
+    <projectname>klcddimmer</projectname>
22
+    <defaultencoding/>
23
+  </general>
24
+  <kdevautoproject>
25
+    <general>
26
+      <activetarget>src/klcddimmer_panelapplet.la</activetarget>
27
+      <useconfiguration>default</useconfiguration>
28
+    </general>
29
+    <configurations>
30
+      <optimized>
31
+        <builddir>optimized</builddir>
32
+        <ccompiler>kdevgccoptions</ccompiler>
33
+        <cxxcompiler>kdevgppoptions</cxxcompiler>
34
+        <f77compiler>kdevg77options</f77compiler>
35
+        <cxxflags>-O2 -g0</cxxflags>
36
+      </optimized>
37
+      <debug>
38
+        <configargs>--enable-debug=full --prefix=/usr</configargs>
39
+        <builddir>debug</builddir>
40
+        <ccompiler>kdevgccoptions</ccompiler>
41
+        <cxxcompiler>kdevgppoptions</cxxcompiler>
42
+        <f77compiler>kdevg77options</f77compiler>
43
+        <cxxflags>-O0 -g3</cxxflags>
44
+        <envvars/>
45
+        <topsourcedir/>
46
+        <cppflags/>
47
+        <ldflags/>
48
+        <ccompilerbinary/>
49
+        <cxxcompilerbinary/>
50
+        <f77compilerbinary/>
51
+        <cflags/>
52
+        <f77flags/>
53
+      </debug>
54
+    </configurations>
55
+    <make>
56
+      <envvars>
57
+        <envvar value="1" name="WANT_AUTOCONF_2_5" />
58
+        <envvar value="1" name="WANT_AUTOMAKE_1_6" />
59
+      </envvars>
60
+    </make>
61
+    <run>
62
+      <directoryradio>executable</directoryradio>
63
+    </run>
64
+  </kdevautoproject>
65
+  <kdevfileview>
66
+    <groups>
67
+      <group pattern="*.cpp;*.cxx;*.h" name="Sources" />
68
+      <group pattern="*.ui" name="User Interface" />
69
+      <group pattern="*.png" name="Icons" />
70
+      <group pattern="*.po;*.ts" name="Translations" />
71
+      <group pattern="*" name="Others" />
72
+      <hidenonprojectfiles>false</hidenonprojectfiles>
73
+      <hidenonlocation>false</hidenonlocation>
74
+    </groups>
75
+    <tree>
76
+      <showvcsfields>false</showvcsfields>
77
+      <hidenonprojectfiles>false</hidenonprojectfiles>
78
+      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
79
+    </tree>
80
+  </kdevfileview>
81
+  <kdevdoctreeview>
82
+    <ignoretocs>
83
+      <toc>ada</toc>
84
+      <toc>ada_bugs_gcc</toc>
85
+      <toc>bash</toc>
86
+      <toc>bash_bugs</toc>
87
+      <toc>clanlib</toc>
88
+      <toc>fortran_bugs_gcc</toc>
89
+      <toc>gnome1</toc>
90
+      <toc>gnustep</toc>
91
+      <toc>gtk</toc>
92
+      <toc>gtk_bugs</toc>
93
+      <toc>haskell</toc>
94
+      <toc>haskell_bugs_ghc</toc>
95
+      <toc>java_bugs_gcc</toc>
96
+      <toc>java_bugs_sun</toc>
97
+      <toc>opengl</toc>
98
+      <toc>pascal_bugs_fp</toc>
99
+      <toc>php</toc>
100
+      <toc>php_bugs</toc>
101
+      <toc>perl</toc>
102
+      <toc>perl_bugs</toc>
103
+      <toc>python</toc>
104
+      <toc>python_bugs</toc>
105
+      <toc>ruby</toc>
106
+      <toc>ruby_bugs</toc>
107
+      <toc>sdl</toc>
108
+      <toc>stl</toc>
109
+      <toc>sw</toc>
110
+      <toc>w3c-dom-level2-html</toc>
111
+      <toc>w3c-svg</toc>
112
+      <toc>w3c-uaag10</toc>
113
+      <toc>wxwidgets_bugs</toc>
114
+    </ignoretocs>
115
+    <ignoreqt_xml>
116
+      <toc>qmake User Guide</toc>
117
+    </ignoreqt_xml>
118
+  </kdevdoctreeview>
119
+  <kdevdebugger>
120
+    <general>
121
+      <dbgshell>libtool</dbgshell>
122
+      <programargs/>
123
+      <gdbpath/>
124
+      <configGdbScript/>
125
+      <runShellScript/>
126
+      <runGdbScript/>
127
+      <breakonloadinglibs>true</breakonloadinglibs>
128
+      <separatetty>false</separatetty>
129
+      <floatingtoolbar>false</floatingtoolbar>
130
+    </general>
131
+    <display>
132
+      <staticmembers>false</staticmembers>
133
+      <demanglenames>true</demanglenames>
134
+      <outputradix>10</outputradix>
135
+    </display>
136
+  </kdevdebugger>
137
+  <kdevfilecreate>
138
+    <filetypes/>
139
+    <useglobaltypes>
140
+      <type ext="ui" />
141
+      <type ext="cpp" />
142
+      <type ext="h" />
143
+    </useglobaltypes>
144
+  </kdevfilecreate>
145
+  <kdevdocumentation>
146
+    <projectdoc>
147
+      <docsystem>Doxygen Documentation Collection</docsystem>
148
+      <docurl>klcddimmer.tag</docurl>
149
+    </projectdoc>
150
+  </kdevdocumentation>
151
+  <substmap>
152
+    <APPNAME>klcddimmer</APPNAME>
153
+    <APPNAMELC>klcddimmer</APPNAMELC>
154
+    <APPNAMESC>Klcddimmer</APPNAMESC>
155
+    <APPNAMEUC>KLCDDIMMER</APPNAMEUC>
156
+    <AUTHOR>Lorenzo Bettini, http://www.lorenzobettini.it,,</AUTHOR>
157
+    <EMAIL/>
158
+    <LICENSE>Custom</LICENSE>
159
+    <VERSION>0.1</VERSION>
160
+    <YEAR>2005</YEAR>
161
+    <dest>/home/bettini/work/klcddimmer</dest>
162
+  </substmap>
163
+  <cppsupportpart>
164
+    <filetemplates>
165
+      <interfacesuffix>.h</interfacesuffix>
166
+      <implementationsuffix>.cpp</implementationsuffix>
167
+    </filetemplates>
168
+  </cppsupportpart>
169
+  <kdevcppsupport>
170
+    <codecompletion>
171
+      <includeGlobalFunctions>true</includeGlobalFunctions>
172
+      <includeTypes>true</includeTypes>
173
+      <includeEnums>true</includeEnums>
174
+      <includeTypedefs>true</includeTypedefs>
175
+      <automaticCodeCompletion>true</automaticCodeCompletion>
176
+      <automaticArgumentsHint>true</automaticArgumentsHint>
177
+      <automaticHeaderCompletion>true</automaticHeaderCompletion>
178
+      <codeCompletionDelay>250</codeCompletionDelay>
179
+      <argumentsHintDelay>400</argumentsHintDelay>
180
+      <headerCompletionDelay>250</headerCompletionDelay>
181
+      <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
182
+      <completionBoxItemOrder>0</completionBoxItemOrder>
183
+      <howEvaluationContextMenu>true</howEvaluationContextMenu>
184
+      <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
185
+      <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
186
+      <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
187
+      <processPrimaryTypes>true</processPrimaryTypes>
188
+      <processFunctionArguments>false</processFunctionArguments>
189
+      <preProcessAllHeaders>false</preProcessAllHeaders>
190
+      <parseMissingHeaders>false</parseMissingHeaders>
191
+      <resolveIncludePaths>true</resolveIncludePaths>
192
+      <alwaysParseInBackground>true</alwaysParseInBackground>
193
+      <usePermanentCaching>true</usePermanentCaching>
194
+      <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
195
+      <includePaths>.;</includePaths>
196
+    </codecompletion>
197
+    <creategettersetter>
198
+      <prefixGet/>
199
+      <prefixSet>set</prefixSet>
200
+      <prefixVariable>m_,_</prefixVariable>
201
+      <parameterName>theValue</parameterName>
202
+      <inlineGet>true</inlineGet>
203
+      <inlineSet>true</inlineSet>
204
+    </creategettersetter>
205
+    <references/>
206
+    <designerintegration>
207
+      <qtdesigner>
208
+        <implementation class="klcddimmer" path="src/brightnesschooser.ui" implementationpath="src/klcddimmer.h" />
209
+      </qtdesigner>
210
+    </designerintegration>
211
+    <qt>
212
+      <used>false</used>
213
+      <version>3</version>
214
+      <root>/usr/share/qt3</root>
215
+      <includestyle>3</includestyle>
216
+      <designerintegration>EmbeddedKDevDesigner</designerintegration>
217
+      <qmake>/usr/bin/qmake-qt3</qmake>
218
+      <designer>/usr/bin/designer-qt3</designer>
219
+      <designerpluginpaths/>
220
+    </qt>
221
+    <splitheadersource>
222
+      <enabled>false</enabled>
223
+      <synchronize>true</synchronize>
224
+      <orientation>Vertical</orientation>
225
+    </splitheadersource>
226
+  </kdevcppsupport>
227
+  <kdevvisualadvance>
228
+    <emulator>VisualBoyAdvance</emulator>
229
+    <binary/>
230
+    <addOptions/>
231
+    <terminal>false</terminal>
232
+    <fullscreen>false</fullscreen>
233
+    <graphicFilter>-f0</graphicFilter>
234
+    <scaling>-1</scaling>
235
+  </kdevvisualadvance>
236
+  <kdevcvsservice>
237
+    <recursivewhenupdate>true</recursivewhenupdate>
238
+    <prunedirswhenupdate>true</prunedirswhenupdate>
239
+    <createdirswhenupdate>true</createdirswhenupdate>
240
+    <recursivewhencommitremove>true</recursivewhencommitremove>
241
+    <revertoptions>-C</revertoptions>
242
+  </kdevcvsservice>
243
+</kdevelop>

+ 1
- 0
po/Makefile.am View File

@@ -0,0 +1 @@
1
+POFILES = AUTO

+ 20
- 0
src/Makefile.am View File

@@ -0,0 +1,20 @@
1
+INCLUDES= $(all_includes)
2
+METASOURCES = AUTO
3
+
4
+lib_LTLIBRARIES = klcddimmer_panelapplet.la
5
+
6
+klcddimmer_panelapplet_la_SOURCES = brightnesschooser.ui \
7
+	brightnesschooserimpl.cpp klcddimmer.cpp klcddimmerapplet.cpp preferences.kcfg preferences.kcfgc \
8
+	progpreferences.ui
9
+klcddimmer_panelapplet_la_LDFLAGS = -module -avoid-version $(all_libraries)
10
+klcddimmer_panelapplet_la_LIBADD = $(LIB_KDEUI) 
11
+
12
+klcddimmer_DATA = klcddimmer.desktop 
13
+klcddimmerdir = $(kde_datadir)/kicker/applets
14
+
15
+messages: rc.cpp
16
+	$(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
17
+	$(XGETTEXT) *.cpp -o $(podir)/klcddimmer.pot
18
+noinst_HEADERS = brightnesschooserimpl.h klcddimmerapplet.h
19
+
20
+KDE_ICON = AUTO

+ 100
- 0
src/brightnesschooser.cpp View File

@@ -0,0 +1,100 @@
1
+#include <kdialog.h>
2
+#include <klocale.h>
3
+/****************************************************************************
4
+** Form implementation generated from reading ui file '/home/bettini/work/klcddimmer/src/brightnesschooser.ui'
5
+**
6
+** Created: Sat Feb 24 20:45:57 2007
7
+**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.7   edited Aug 31 2005 $)
8
+**
9
+** WARNING! All changes made in this file will be lost!
10
+****************************************************************************/
11
+
12
+#include "brightnesschooser.h"
13
+
14
+#include <qvariant.h>
15
+#include <qpushbutton.h>
16
+#include <qlabel.h>
17
+#include <qslider.h>
18
+#include <qlayout.h>
19
+#include <qtooltip.h>
20
+#include <qwhatsthis.h>
21
+
22
+/*
23
+ *  Constructs a BrightnessChooser as a child of 'parent', with the
24
+ *  name 'name' and widget flags set to 'f'.
25
+ */
26
+BrightnessChooser::BrightnessChooser( QWidget* parent, const char* name, WFlags fl )
27
+    : QWidget( parent, name, fl )
28
+{
29
+    if ( !name )
30
+	setName( "BrightnessChooser" );
31
+    BrightnessChooserLayout = new QGridLayout( this, 1, 1, 11, 6, "BrightnessChooserLayout"); 
32
+
33
+    layout9 = new QGridLayout( 0, 1, 1, 0, 6, "layout9"); 
34
+
35
+    layout7 = new QHBoxLayout( 0, 0, 0, "layout7"); 
36
+    spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
37
+    layout7->addItem( spacer1 );
38
+
39
+    layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 
40
+
41
+    valueLabel = new QLabel( this, "valueLabel" );
42
+    valueLabel->setAlignment( int( QLabel::AlignCenter ) );
43
+    layout5->addWidget( valueLabel );
44
+
45
+    brightnessSlider = new QSlider( this, "brightnessSlider" );
46
+    brightnessSlider->setOrientation( QSlider::Vertical );
47
+    layout5->addWidget( brightnessSlider );
48
+    layout7->addLayout( layout5 );
49
+    spacer1_2 = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
50
+    layout7->addItem( spacer1_2 );
51
+
52
+    layout9->addLayout( layout7, 0, 0 );
53
+
54
+    okButton = new QPushButton( this, "okButton" );
55
+    okButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, okButton->sizePolicy().hasHeightForWidth() ) );
56
+
57
+    layout9->addWidget( okButton, 1, 0 );
58
+
59
+    BrightnessChooserLayout->addLayout( layout9, 0, 0 );
60
+    languageChange();
61
+    resize( QSize(124, 163).expandedTo(minimumSizeHint()) );
62
+    clearWState( WState_Polished );
63
+
64
+    // signals and slots connections
65
+    connect( okButton, SIGNAL( clicked() ), this, SLOT( updateBrightness() ) );
66
+    connect( brightnessSlider, SIGNAL( valueChanged(int) ), this, SLOT( updateValue(int) ) );
67
+}
68
+
69
+/*
70
+ *  Destroys the object and frees any allocated resources
71
+ */
72
+BrightnessChooser::~BrightnessChooser()
73
+{
74
+    // no need to delete child widgets, Qt does it all for us
75
+}
76
+
77
+/*
78
+ *  Sets the strings of the subwidgets using the current
79
+ *  language.
80
+ */
81
+void BrightnessChooser::languageChange()
82
+{
83
+    setCaption( tr2i18n( "Form1" ) );
84
+    valueLabel->setText( tr2i18n( "0" ) );
85
+    QToolTip::add( brightnessSlider, tr2i18n( "set the brightness and click OK or press ENTER" ) );
86
+    okButton->setText( tr2i18n( "&OK" ) );
87
+    okButton->setAccel( QKeySequence( tr2i18n( "Alt+O" ) ) );
88
+}
89
+
90
+void BrightnessChooser::updateBrightness()
91
+{
92
+    qWarning( "BrightnessChooser::updateBrightness(): Not implemented yet" );
93
+}
94
+
95
+void BrightnessChooser::updateValue(int)
96
+{
97
+    qWarning( "BrightnessChooser::updateValue(int): Not implemented yet" );
98
+}
99
+
100
+#include "brightnesschooser.moc"

+ 53
- 0
src/brightnesschooser.h View File

@@ -0,0 +1,53 @@
1
+/****************************************************************************
2
+** Form interface generated from reading ui file '/home/bettini/work/klcddimmer/src/brightnesschooser.ui'
3
+**
4
+** Created: Sat Feb 24 20:45:57 2007
5
+**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.7   edited Aug 31 2005 $)
6
+**
7
+** WARNING! All changes made in this file will be lost!
8
+****************************************************************************/
9
+
10
+#ifndef BRIGHTNESSCHOOSER_H
11
+#define BRIGHTNESSCHOOSER_H
12
+
13
+#include <qvariant.h>
14
+#include <qwidget.h>
15
+
16
+class QVBoxLayout;
17
+class QHBoxLayout;
18
+class QGridLayout;
19
+class QSpacerItem;
20
+class QLabel;
21
+class QSlider;
22
+class QPushButton;
23
+
24
+class BrightnessChooser : public QWidget
25
+{
26
+    Q_OBJECT
27
+
28
+public:
29
+    BrightnessChooser( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
30
+    ~BrightnessChooser();
31
+
32
+    QLabel* valueLabel;
33
+    QSlider* brightnessSlider;
34
+    QPushButton* okButton;
35
+
36
+public slots:
37
+    virtual void updateBrightness();
38
+    virtual void updateValue(int);
39
+
40
+protected:
41
+    QGridLayout* BrightnessChooserLayout;
42
+    QGridLayout* layout9;
43
+    QHBoxLayout* layout7;
44
+    QSpacerItem* spacer1;
45
+    QSpacerItem* spacer1_2;
46
+    QVBoxLayout* layout5;
47
+
48
+protected slots:
49
+    virtual void languageChange();
50
+
51
+};
52
+
53
+#endif // BRIGHTNESSCHOOSER_H

+ 154
- 0
src/brightnesschooser.ui View File

@@ -0,0 +1,154 @@
1
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
2
+<class>BrightnessChooser</class>
3
+<widget class="QWidget">
4
+    <property name="name">
5
+        <cstring>BrightnessChooser</cstring>
6
+    </property>
7
+    <property name="geometry">
8
+        <rect>
9
+            <x>0</x>
10
+            <y>0</y>
11
+            <width>124</width>
12
+            <height>163</height>
13
+        </rect>
14
+    </property>
15
+    <property name="caption">
16
+        <string>Form1</string>
17
+    </property>
18
+    <grid>
19
+        <property name="name">
20
+            <cstring>unnamed</cstring>
21
+        </property>
22
+        <widget class="QLayoutWidget" row="0" column="0">
23
+            <property name="name">
24
+                <cstring>layout9</cstring>
25
+            </property>
26
+            <grid>
27
+                <property name="name">
28
+                    <cstring>unnamed</cstring>
29
+                </property>
30
+                <widget class="QLayoutWidget" row="0" column="0">
31
+                    <property name="name">
32
+                        <cstring>layout7</cstring>
33
+                    </property>
34
+                    <hbox>
35
+                        <property name="name">
36
+                            <cstring>unnamed</cstring>
37
+                        </property>
38
+                        <property name="margin">
39
+                            <number>0</number>
40
+                        </property>
41
+                        <property name="spacing">
42
+                            <number>0</number>
43
+                        </property>
44
+                        <spacer>
45
+                            <property name="name">
46
+                                <cstring>spacer1</cstring>
47
+                            </property>
48
+                            <property name="orientation">
49
+                                <enum>Horizontal</enum>
50
+                            </property>
51
+                            <property name="sizeType">
52
+                                <enum>Minimum</enum>
53
+                            </property>
54
+                            <property name="sizeHint">
55
+                                <size>
56
+                                    <width>20</width>
57
+                                    <height>20</height>
58
+                                </size>
59
+                            </property>
60
+                        </spacer>
61
+                        <widget class="QLayoutWidget">
62
+                            <property name="name">
63
+                                <cstring>layout5</cstring>
64
+                            </property>
65
+                            <vbox>
66
+                                <property name="name">
67
+                                    <cstring>unnamed</cstring>
68
+                                </property>
69
+                                <widget class="QLabel">
70
+                                    <property name="name">
71
+                                        <cstring>valueLabel</cstring>
72
+                                    </property>
73
+                                    <property name="text">
74
+                                        <string>0</string>
75
+                                    </property>
76
+                                    <property name="alignment">
77
+                                        <set>AlignCenter</set>
78
+                                    </property>
79
+                                </widget>
80
+                                <widget class="QSlider">
81
+                                    <property name="name">
82
+                                        <cstring>brightnessSlider</cstring>
83
+                                    </property>
84
+                                    <property name="orientation">
85
+                                        <enum>Vertical</enum>
86
+                                    </property>
87
+                                    <property name="toolTip" stdset="0">
88
+                                        <string>set the brightness and click OK or press ENTER</string>
89
+                                    </property>
90
+                                </widget>
91
+                            </vbox>
92
+                        </widget>
93
+                        <spacer>
94
+                            <property name="name">
95
+                                <cstring>spacer1_2</cstring>
96
+                            </property>
97
+                            <property name="orientation">
98
+                                <enum>Horizontal</enum>
99
+                            </property>
100
+                            <property name="sizeType">
101
+                                <enum>Minimum</enum>
102
+                            </property>
103
+                            <property name="sizeHint">
104
+                                <size>
105
+                                    <width>16</width>
106
+                                    <height>20</height>
107
+                                </size>
108
+                            </property>
109
+                        </spacer>
110
+                    </hbox>
111
+                </widget>
112
+                <widget class="QPushButton" row="1" column="0">
113
+                    <property name="name">
114
+                        <cstring>okButton</cstring>
115
+                    </property>
116
+                    <property name="sizePolicy">
117
+                        <sizepolicy>
118
+                            <hsizetype>1</hsizetype>
119
+                            <vsizetype>1</vsizetype>
120
+                            <horstretch>0</horstretch>
121
+                            <verstretch>0</verstretch>
122
+                        </sizepolicy>
123
+                    </property>
124
+                    <property name="text">
125
+                        <string>&amp;OK</string>
126
+                    </property>
127
+                    <property name="accel">
128
+                        <string>Alt+O</string>
129
+                    </property>
130
+                </widget>
131
+            </grid>
132
+        </widget>
133
+    </grid>
134
+</widget>
135
+<connections>
136
+    <connection>
137
+        <sender>okButton</sender>
138
+        <signal>clicked()</signal>
139
+        <receiver>BrightnessChooser</receiver>
140
+        <slot>updateBrightness()</slot>
141
+    </connection>
142
+    <connection>
143
+        <sender>brightnessSlider</sender>
144
+        <signal>valueChanged(int)</signal>
145
+        <receiver>BrightnessChooser</receiver>
146
+        <slot>updateValue(int)</slot>
147
+    </connection>
148
+</connections>
149
+<slots>
150
+    <slot>updateBrightness()</slot>
151
+    <slot>updateValue(int)</slot>
152
+</slots>
153
+<layoutdefaults spacing="6" margin="11"/>
154
+</UI>

+ 217
- 0
src/brightnesschooserimpl.cpp View File

@@ -0,0 +1,217 @@
1
+/***************************************************************************
2
+ *   Copyright (C) 2005 by Lorenzo Bettini                                 *
3
+ *   http://www.lorenzobettini.it                                          *
4
+ *                                                                         *
5
+ *   This program is free software; you can redistribute it and/or modify  *
6
+ *   it under the terms of the GNU General Public License as published by  *
7
+ *   the Free Software Foundation; either version 2 of the License, or     *
8
+ *   (at your option) any later version.                                   *
9
+ *                                                                         *
10
+ *   This program is distributed in the hope that it will be useful,       *
11
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
+ *   GNU General Public License for more details.                          *
14
+ *                                                                         *
15
+ *   You should have received a copy of the GNU General Public License     *
16
+ *   along with this program; if not, write to the                         *
17
+ *   Free Software Foundation, Inc.,                                       *
18
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
+ ***************************************************************************/
20
+#include "brightnesschooserimpl.h"
21
+
22
+#include <qprocess.h>
23
+#include <qslider.h>
24
+#include <qlabel.h>
25
+#include <qmessagebox.h>
26
+#include <kdebug.h>
27
+#include <qevent.h>
28
+#include <qregexp.h>
29
+
30
+#include "preferences.h"
31
+
32
+BrightnessChooserImpl::BrightnessChooserImpl(QWidget *parent, const char *name)
33
+ : BrightnessChooser(parent, name), proc(0)
34
+{
35
+    updateSlider();
36
+
37
+    // check whether to restore the previous brightness value
38
+    if (Preferences::saveCurrent()) {
39
+        kdDebug() << "restore previous brightness value: " <<
40
+                Preferences::currentValue() << endl;
41
+        setValue(Preferences::currentValue());
42
+    }
43
+
44
+    valueLabel->setText(getValue());
45
+    brightnessSlider->setFocus();
46
+}
47
+
48
+
49
+BrightnessChooserImpl::~BrightnessChooserImpl()
50
+{
51
+    // in case save the current brightness setting
52
+    if (Preferences::saveCurrent()) {
53
+        const QString &val = getValue();
54
+        kdDebug() << "save the current brightness value: " << val << endl;
55
+        Preferences::setCurrentValue(val);
56
+        Preferences::writeConfig();
57
+    }
58
+}
59
+
60
+void BrightnessChooserImpl::updateSlider()
61
+{
62
+    brightnessSlider->setPageStep(QString(Preferences::step()).toInt());
63
+    brightnessSlider->setLineStep(QString(Preferences::step()).toInt());
64
+    brightnessSlider->setRange(QString(Preferences::minValue()).toInt(),
65
+                               QString(Preferences::maxValue()).toInt()+1);
66
+    valueLabel->setText(getValue());
67
+    kdDebug() << "updateSlider" << endl;
68
+    kdDebug() << "program: " << Preferences::program() << endl;
69
+    kdDebug() << "min value: " << Preferences::minValue() << endl;
70
+    kdDebug() << "max value: " << Preferences::maxValue() << endl;
71
+    kdDebug() << "page step: " << brightnessSlider->pageStep() << endl;
72
+    kdDebug() << "line step: " << brightnessSlider->lineStep() << endl;
73
+}
74
+
75
+void BrightnessChooserImpl::updateBrightness()
76
+{
77
+    if (proc)
78
+        delete proc; // delete the previous instance
79
+
80
+    proc = new QProcess(this);
81
+
82
+    QString args = Preferences::setArgument();
83
+    args += getValue();
84
+    proc->addArgument( Preferences::program() );
85
+    proc->addArgument( args );
86
+
87
+    connect( proc, SIGNAL(readyReadStdout()),
88
+             this, SLOT(readFromStdout()) );
89
+    connect( proc, SIGNAL(readyReadStderr()),
90
+             this, SLOT(readFromStderr()) );
91
+    connect( proc, SIGNAL(processExited()),
92
+             this, SLOT(procExited()) );
93
+
94
+    if ( !proc->start() ) {
95
+        // error handling
96
+        QMessageBox::critical( 0,
97
+                               tr("Fatal error"),
98
+                               tr("Could not start the brightness adjustment command."),
99
+                               tr("Quit") );
100
+    }
101
+
102
+    QString arguments = proc->arguments().join(" ");
103
+    qWarning("%s", arguments.ascii());
104
+}
105
+
106
+void BrightnessChooserImpl::getBrightness()
107
+{
108
+    QString args = Preferences::getArgument();
109
+
110
+    /* some programs, such as nvclock, do not have a parameter to
111
+    get the current brightness; in such case we simply return */
112
+    if (args == "") {
113
+        kdDebug() << "the program does not support a get brightness functionality" << endl;
114
+        return;
115
+    }
116
+
117
+    if (proc)
118
+        delete proc; // delete the previous instance
119
+
120
+    proc = new QProcess(this);
121
+
122
+    proc->addArgument( Preferences::program() );
123
+    proc->addArgument( args );
124
+
125
+    connect( proc, SIGNAL(readyReadStdout()),
126
+             this, SLOT(readValueFromStdout()) );
127
+    connect( proc, SIGNAL(readyReadStderr()),
128
+             this, SLOT(readFromStderr()) );
129
+    connect( proc, SIGNAL(processExited()),
130
+             this, SLOT(procExited()) );
131
+
132
+    if ( !proc->start() ) {
133
+        // error handling
134
+        QMessageBox::critical( 0,
135
+                               tr("Fatal error"),
136
+                               tr("Could not start the brightness adjustment command."),
137
+                               tr("Quit") );
138
+    }
139
+
140
+    QString arguments = proc->arguments().join(" ");
141
+    qWarning("%s", arguments.ascii());
142
+}
143
+
144
+void BrightnessChooserImpl::updateValue(int)
145
+{
146
+    valueLabel->setText(getValue());
147
+}
148
+
149
+void BrightnessChooserImpl::readFromStderr()
150
+{
151
+    // Read and process the data.
152
+    // Bear in mind that the data might be output in chunks.
153
+    QString out = proc->readStderr();
154
+    qWarning( "%s", out.ascii() );
155
+}
156
+
157
+void BrightnessChooserImpl::readFromStdout()
158
+{
159
+    // Read and process the data.
160
+    // Bear in mind that the data might be output in chunks.
161
+    QString out = proc->readStdout();
162
+    qWarning( "%s", out.ascii() );
163
+}
164
+
165
+void BrightnessChooserImpl::readValueFromStdout()
166
+{
167
+    // Read and process the data.
168
+    // Bear in mind that the data might be output in chunks.
169
+    QString out = proc->readStdout();
170
+    QRegExp regexp("(\\d+)");
171
+    if (regexp.search(out) > 0) {
172
+        QString result = regexp.cap(1);
173
+        kdDebug() << "initial slider value: " << brightnessSlider->value() << endl;
174
+        kdDebug() << "captured result: " << result << endl;
175
+        brightnessSlider->setValue(brightnessSlider->maxValue() - result.toInt());
176
+        kdDebug() << "updated slider value: " << brightnessSlider->value() << endl;
177
+    }
178
+    qWarning( "%s", out.ascii() );
179
+}
180
+
181
+void BrightnessChooserImpl::procExited()
182
+{
183
+    qWarning("process terminated");
184
+
185
+    emit valueUpdated();
186
+}
187
+
188
+const QString BrightnessChooserImpl::getValue()
189
+{
190
+    return QString::number((brightnessSlider->maxValue() - brightnessSlider->value()));
191
+}
192
+
193
+void BrightnessChooserImpl::setValue(const QString &val)
194
+{
195
+    int iVal = brightnessSlider->maxValue() - val.toInt();
196
+    kdDebug() << "set slider value: " << iVal << endl;
197
+    brightnessSlider->setValue(iVal);
198
+    updateBrightness();
199
+}
200
+
201
+void BrightnessChooserImpl::keyPressEvent(QKeyEvent *event)
202
+{
203
+    /* intercept ENTER and simulate the OK button;
204
+     also intercept ESC in order to close the parent widget (otherwise
205
+     ESC is passed to the applet which seems to close the main panel?)*/
206
+    if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
207
+        kdDebug() << "pressed ENTER" << endl;
208
+        updateBrightness();
209
+    } else if (event->key() == Qt::Key_Escape) {
210
+        kdDebug() << "pressed ESC" << endl;
211
+        parentWidget()->close();
212
+    } else {
213
+        BrightnessChooser::keyPressEvent(event);
214
+    }
215
+}
216
+
217
+#include "brightnesschooserimpl.moc"

+ 82
- 0
src/brightnesschooserimpl.h View File

<
@@ -0,0 +1,82 @@
1
+/***************************************************************************
2
+ *   Copyright (C) 2005 by Lorenzo Bettini                                 *
3
+ *   http://www.lorenzobettini.it                                          *
4
+ *                                                                         *
5
+ *   This program is free software; you can redistribute it and/or modify  *
6
+ *   it under the terms of the GNU General Public License as published by  *
7
+ *   the Free Software Foundation; either version 2 of the License, or     *
8
+ *   (at your option) any later version.                                   *
9
+ *                                                                         *
10
+ *   This program is distributed in the hope that it will be useful,       *
11
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
+ *   GNU General Public License for more details.                          *
14
+ *                                                                         *
15
+ *   You should have received a copy of the GNU General Public License     *
16
+ *   along with this program; if not, write to the                         *
17
+ *   Free Software Foundation, Inc.,                                       *
18
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
+ ***************************************************************************/
20
+#ifndef BRIGHTNESSCHOOSERIMPL_H
21
+#define BRIGHTNESSCHOOSERIMPL_H
22
+
23
+#include <brightnesschooser.h>
24
+
25
+class QProcess;
26
+
27
+/**
28
+Implementation slots for BrightnessChooser
29
+
30
+@author Lorenzo Bettini, http://www.lorenzobettini.it,,
31
+*/
32
+class BrightnessChooserImpl : public BrightnessChooser
33
+{
34
+Q_OBJECT
35
+public:
36
+    BrightnessChooserImpl(QWidget *parent = 0, const char *name = 0);
37
+
38
+    ~BrightnessChooserImpl();
39
+
40
+    /**
41
+     * Updates the slider properties according to the global
42
+     * properties.
43
+     */
44
+    void updateSlider();
45
+
46
+    /**
47
+     * Returns the current value of brightness.
48
+     * @return 
49
+     */
50
+    const QString getValue();
51
+
52
+    /**
53
+     * Sets the current value of brightness
54
+     * @param val 
55
+     */
56
+    void setValue(const QString &val);
57
+
58
+    /// retrieve the current brightness
59
+    void getBrightness();
60
+
61
+    protected slots:
62
+        void updateBrightness();
63
+        void updateValue(int);
64
+        void readFromStderr();
65
+        void readFromStdout();
66
+        void readValueFromStdout();
67
+        void procExited();
68
+
69
+    private:
70
+        /// process instance used to adjust brightness
71
+        QProcess *proc;
72
+