Coretan Keyboard ku

mengadapi netcut V.2

November 27, 2009 · Leave a Comment

problem lagi2…

lagi2 klo make gratisan pasti ada aj yang gangguin.. hehehe waktu enak2 ngenet dikampus kok tiba2 mati..koneksi yang semula lancr2 aj.. eh kok malah ngadat…

akhirnya aku berinisiatif untuk OL di jaringan dengan invisible (tak terlihat) hehehehe kyk siluman aj…

oke qt pake kekuatan linux ubuntu 9.04 ..hehehehe promosi yach…

setelah aku masuk gateway HOTSPOT

di CLI  $> sudo ifconfig wlan0  -arp

*) penjelasan singkat yah…. wlan0 cz kita pake interfacenya wireless, klo pake lan tinggal ganti aj eth0

untuk -arp biar mac dan IP terlindungi .. and biar soft netcut g bisa liat..hehehe

YUPPi ..akhirnya bisa lagi aku OL….

→ Leave a CommentCategories: Open Source (all about linux)

Membuat Usplash Dari Nol

November 25, 2009 · Leave a Comment

mohon doanya…
setelah tugas praktikum ku selesai, aku mau share nech.. pada temen2 tentang apa yang aku dapat kemaren
gmn cara buat usplash di ubuntu… hehe klo ada yang salah koreksi yah.. :)

oke mulai .. persiapan jgn lupa kopi sama rokok nya ..hehehe biar ide2 nya lebih kreatif.. :)
pertama siapin gambar / desain kamu.. buat dengan 3 resolusi masing2 800×600 ,1024×768
kenapa qt pake banyak resolusi … hehehe biar bisa fleksibel di layar manapun :)
oke buat nya pake gimp ya.. udah bwaanya ubuntu tu.. jgn lupa untuk warnanya pilih mode index ya.. mask 256…

inget ya.. jgn lupa ganti mode warnanya jadi index..

oke selanjutnya qt akan buat file .c nya maklum kode programnya pake bahasa c

rubah setingan sesuai keinginan..

/* usplash
*
* akatsuntu-theme.c – definition of akatsuntu
*
* Bima Aulia F <bimagets@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
*/

#include <usplash-theme.h>
/* Needed for the custom drawing functions */
#include <usplash_backend.h>

extern struct usplash_pixmap pixmap_usplash_800_600, pixmap_usplash_1024_768, pixmap_usplash_1365_768_scaled;
extern struct usplash_pixmap pixmap_throbber_back;
extern struct usplash_pixmap pixmap_throbber_fore;

void t_init(struct usplash_theme* theme);
void t_clear_progressbar(struct usplash_theme* theme);
void t_draw_progressbar(struct usplash_theme* theme, int percentage);
void t_animate_step(struct usplash_theme* theme, int pulsating);

struct usplash_theme usplash_theme_1024_768;
struct usplash_theme usplash_theme_1365_768_scaled;

/* Theme definition */
struct usplash_theme usplash_theme = {
.version = THEME_VERSION, /* ALWAYS set this to THEME_VERSION,
it’s a compatibility check */
.next = &usplash_theme_1024_768,
.ratio = USPLASH_4_3,

/* Background and font */
.pixmap = &pixmap_usplash_800_600,

/* Palette indexes */
.background             = 0×0,
.progressbar_background = 0×7,
.progressbar_foreground = 0×156,
.text_background        = 0×0,
.text_foreground        = 0×33,
.text_success           = 0×15,
.text_failure           = 0×144,

/* Progress bar position and size in pixels */
.progressbar_x      = 292, /* 800/2-216/2 */
.progressbar_y      = 351,
.progressbar_width  = 216,
.progressbar_height = 8,

/* Text box position and size in pixels */
.text_x      = 120,
.text_y      = 287,
.text_width  = 360,
.text_height = 100,

/* Text details */
.line_height  = 15,
.line_length  = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1024_768 = {
.version = THEME_VERSION,
.next = &usplash_theme_1365_768_scaled,
.ratio = USPLASH_4_3,

/* Background and font */
.pixmap = &pixmap_usplash_1024_768,

/* Palette indexes */
.background             = 0×0,
.progressbar_background = 0×7,
.progressbar_foreground = 0×156,
.text_background        = 0×0,
.text_foreground        = 0×31,
.text_success           = 0×171,
.text_failure           = 0×156,

/* Progress bar position and size in pixels */
.progressbar_x      = 404, /* 1024/2 – 216/2 */
.progressbar_y      = 445,
.progressbar_width  = 216,
.progressbar_height = 8,

/* Text box position and size in pixels */
.text_x      = 322,
.text_y      = 505,
.text_width  = 380,
.text_height = 100,

/* Text details */
.line_height  = 15,
.line_length  = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

struct usplash_theme usplash_theme_1365_768_scaled = {
.version = THEME_VERSION,
.next = NULL,
.ratio = USPLASH_16_9,

/* Background and font */
.pixmap = &pixmap_usplash_1365_768_scaled,

/* Palette indexes */
.background             = 0×0,
.progressbar_background = 0×7,
.progressbar_foreground = 0×156,
.text_background        = 0×0,
.text_foreground        = 0×33,
.text_success           = 0×15,
.text_failure           = 0×144,

/* Progress bar position and size in pixels */
.progressbar_x      = 404, /* 1024/2 – 216/2 */
.progressbar_y      = 445,
.progressbar_width  = 216,
.progressbar_height = 8,

/* Text box position and size in pixels */
.text_x      = 322,
.text_y      = 505,
.text_width  = 380,
.text_height = 100,

/* Text details */
.line_height  = 15,
.line_length  = 32,
.status_width = 35,

/* Functions */
.init = t_init,
.clear_progressbar = t_clear_progressbar,
.draw_progressbar = t_draw_progressbar,
.animate_step = t_animate_step,
};

void t_init(struct usplash_theme *theme) {
int x, y;
usplash_getdimensions(&x, &y);
theme->progressbar_x = (x – theme->pixmap->width)/2 + theme->progressbar_x;
theme->progressbar_y = (y – theme->pixmap->height)/2 + theme->progressbar_y;
}

void t_clear_progressbar(struct usplash_theme *theme) {
t_draw_progressbar(theme, 0);
}

void t_draw_progressbar(struct usplash_theme *theme, int percentage) {
int w = (pixmap_throbber_back.width * percentage / 100);
usplash_put(theme->progressbar_x, theme->progressbar_y, &pixmap_throbber_back);
if(percentage == 0)
return;
if(percentage < 0)
usplash_put_part(theme->progressbar_x – w, theme->progressbar_y, pixmap_throbber_back.width + w,
pixmap_throbber_back.height, &pixmap_throbber_fore, -w, 0);
else
usplash_put_part(theme->progressbar_x, theme->progressbar_y, w, pixmap_throbber_back.height,
&pixmap_throbber_fore, 0, 0);
}

void t_animate_step(struct usplash_theme* theme, int pulsating) {

static int pulsate_step = 0;
static int pulse_width = 28;
static int step_width = 2;
static int num_steps = (216 – 28)/2;
int x1;

if (pulsating) {
t_draw_progressbar(theme, 0);

if(pulsate_step < num_steps/2+1)
x1 = 2 * step_width * pulsate_step;
else
x1 = 216 – pulse_width – 2 * step_width * (pulsate_step – num_steps/2+1);

usplash_put_part(theme->progressbar_x + x1, theme->progressbar_y, pulse_width,
pixmap_throbber_fore.height, &pixmap_throbber_fore, x1, 0);

pulsate_step = (pulsate_step + 1) % num_steps;
}
}

oke simpan namanya terserah anda

Keep reading →

→ Leave a CommentCategories: Open Source (all about linux)