[glade/css] Added splash screen



commit c22aa4e91e40c57d7f13d422182095df51f539d4
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Thu Sep 26 14:50:36 2013 -0300

    Added splash screen

 src/Makefile.am    |    8 +-
 src/glade-logo.h   |  464 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/glade-splash.c |  175 ++++++++++++++++++++
 src/glade-splash.h |   37 ++++
 src/main.c         |   12 +-
 5 files changed, 690 insertions(+), 6 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 89e597e..f476179 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -24,19 +24,19 @@ BUILT_SOURCES = glade-resources.c glade-resources.h
 
 glade_SOURCES = \
        glade-window.c \
-       glade-window.h \
        glade-close-button.c \
-       glade-close-button.h \
        glade-resources.c \
        glade-preferences.c \
-       glade-preferences.h \
+       glade-splash.c \
        main.c
 
 noinst_HEADERS = \
        glade-window.h \
        glade-close-button.h \
        glade-resources.h \
-       glade-preferences.h
+       glade-preferences.h \
+       glade-logo.h \
+       glade-splash.h
 
 # Generate resources
 glade-resources.h: glade-resources.gresource.xml $(UI_FILES)
diff --git a/src/glade-logo.h b/src/glade-logo.h
new file mode 100644
index 0000000..aa4094b
--- /dev/null
+++ b/src/glade-logo.h
@@ -0,0 +1,464 @@
+#ifndef __GLADE_LOGO_H__
+#define __GLADE_LOGO_H__
+
+#define GLADE_LOGO_WIDTH 250.000000
+#define GLADE_LOGO_HEIGHT 320.000000
+
+#include <cairo.h>
+
+static cairo_path_data_t glade_logo_data[] = {
+       {.header.type = 0, .header.length = 2},
+       {.point.x = 123.696550, .point.y = 318.839150},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 110.137780, .point.y = 316.186390},
+       {.point.x = 93.163559, .point.y = 308.523530},
+       {.point.x = 81.491943, .point.y = 299.786260},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 74.318660, .point.y = 294.416420},
+       {.point.x = 70.948005, .point.y = 291.542980},
+       {.point.x = 73.133025, .point.y = 292.660410},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 73.717653, .point.y = 292.959390},
+       {.point.x = 78.022635, .point.y = 295.379740},
+       {.point.x = 82.699646, .point.y = 298.038960},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 93.959038, .point.y = 304.440780},
+       {.point.x = 106.365290, .point.y = 309.839000},
+       {.point.x = 122.560570, .point.y = 315.383310},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 135.528970, .point.y = 319.822940},
+       {.point.x = 135.996650, .point.y = 321.245660},
+       {.point.x = 123.696550, .point.y = 318.839150},
+       {.header.type = 3, .header.length = 1},
+       {.header.type = 0, .header.length = 2},
+       {.point.x = 142.756790, .point.y = 315.724410},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 136.618200, .point.y = 314.637070},
+       {.point.x = 127.290740, .point.y = 312.502950},
+       {.point.x = 122.029090, .point.y = 310.981900},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 100.716080, .point.y = 304.820740},
+       {.point.x = 70.321696, .point.y = 290.954990},
+       {.point.x = 65.447634, .point.y = 285.169740},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 58.774939, .point.y = 278.299380},
+       {.point.x = 53.992986, .point.y = 268.625140},
+       {.point.x = 49.958962, .point.y = 261.324430},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 47.523844, .point.y = 257.617650},
+       {.point.x = 42.130573, .point.y = 241.288660},
+       {.point.x = 41.176872, .point.y = 234.735310},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 40.418249, .point.y = 229.522570},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 43.722262, .point.y = 231.869110},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 45.539469, .point.y = 233.159710},
+       {.point.x = 47.286530, .point.y = 234.635700},
+       {.point.x = 47.604635, .point.y = 235.149060},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 47.922741, .point.y = 235.662440},
+       {.point.x = 50.209284, .point.y = 237.656870},
+       {.point.x = 52.685837, .point.y = 239.581140},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 56.830671, .point.y = 242.801670},
+       {.point.x = 56.687487, .point.y = 242.533900},
+       {.point.x = 50.884762, .point.y = 236.212940},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 43.522477, .point.y = 228.193080},
+       {.point.x = 35.998221, .point.y = 216.962400},
+       {.point.x = 33.686140, .point.y = 210.542260},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 32.790743, .point.y = 208.055930},
+       {.point.x = 31.167873, .point.y = 198.513310},
+       {.point.x = 30.079749, .point.y = 189.336420},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 27.815569, .point.y = 170.240820},
+       {.point.x = 24.767722, .point.y = 156.964690},
+       {.point.x = 20.465785, .point.y = 147.458830},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 17.114317, .point.y = 140.053160},
+       {.point.x = 8.311111, .point.y = 130.080900},
+       {.point.x = 3.296087, .point.y = 128.009000},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 0.000000, .point.y = 126.647260},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 4.144992, .point.y = 125.215950},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 13.321669, .point.y = 122.047160},
+       {.point.x = 27.559263, .point.y = 122.587300},
+       {.point.x = 41.689313, .point.y = 126.640270},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 43.864665, .point.y = 127.264240},
+       {.point.x = 44.147165, .point.y = 127.083760},
+       {.point.x = 43.525241, .point.y = 125.467260},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 42.209792, .point.y = 122.048150},
+       {.point.x = 37.704335, .point.y = 98.061740},
+       {.point.x = 37.049273, .point.y = 90.990130},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 36.410914, .point.y = 84.098830},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 38.991277, .point.y = 88.894460},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 42.258249, .point.y = 94.966230},
+       {.point.x = 51.083142, .point.y = 103.248380},
+       {.point.x = 57.127155, .point.y = 105.915010},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 59.685857, .point.y = 107.043890},
+       {.point.x = 64.080437, .point.y = 108.282110},
+       {.point.x = 66.892897, .point.y = 108.666600},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 72.006482, .point.y = 109.365680},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 68.132801, .point.y = 104.851900},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 58.276521, .point.y = 93.366950},
+       {.point.x = 52.394362, .point.y = 76.305000},
+       {.point.x = 52.421619, .point.y = 59.279620},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 52.439689, .point.y = 48.021450},
+       {.point.x = 53.403708, .point.y = 44.740490},
+       {.point.x = 55.405866, .point.y = 49.123360},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 57.449226, .point.y = 53.596370},
+       {.point.x = 66.161062, .point.y = 62.177070},
+       {.point.x = 71.960271, .point.y = 65.428560},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 78.595935, .point.y = 69.149040},
+       {.point.x = 84.942194, .point.y = 71.235930},
+       {.point.x = 98.112537, .point.y = 74.028410},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 118.834700, .point.y = 78.422080},
+       {.point.x = 129.297940, .point.y = 86.810330},
+       {.point.x = 134.949400, .point.y = 103.560060},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 136.960850, .point.y = 109.521560},
+       {.point.x = 137.702390, .point.y = 110.603800},
+       {.point.x = 139.775660, .point.y = 110.603800},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 141.759080, .point.y = 110.603800},
+       {.point.x = 142.959450, .point.y = 109.126040},
+       {.point.x = 146.082780, .point.y = 102.839170},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 151.082470, .point.y = 92.775430},
+       {.point.x = 152.697710, .point.y = 84.891870},
+       {.point.x = 152.140680, .point.y = 73.271850},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 151.770390, .point.y = 65.546970},
+       {.point.x = 151.100790, .point.y = 62.657570},
+       {.point.x = 148.295030, .point.y = 56.677340},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 146.426510, .point.y = 52.694770},
+       {.point.x = 143.419160, .point.y = 47.574320},
+       {.point.x = 141.612020, .point.y = 45.298540},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 139.804880, .point.y = 43.022780},
+       {.point.x = 138.761070, .point.y = 41.160780},
+       {.point.x = 139.292410, .point.y = 41.160780},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 139.823750, .point.y = 41.160780},
+       {.point.x = 143.581670, .point.y = 42.288120},
+       {.point.x = 147.643320, .point.y = 43.665990},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 168.470380, .point.y = 50.731350},
+       {.point.x = 185.041050, .point.y = 62.180450},
+       {.point.x = 195.403970, .point.y = 76.665070},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 206.970430, .point.y = 92.831970},
+       {.point.x = 211.172080, .point.y = 110.362940},
+       {.point.x = 205.951990, .point.y = 120.675680},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 200.998710, .point.y = 130.461270},
+       {.point.x = 186.841420, .point.y = 132.870190},
+       {.point.x = 171.235190, .point.y = 126.582920},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 167.613620, .point.y = 125.123920},
+       {.point.x = 164.480200, .point.y = 124.100040},
+       {.point.x = 164.272020, .point.y = 124.307680},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 162.701490, .point.y = 125.874100},
+       {.point.x = 181.175230, .point.y = 134.959400},
+       {.point.x = 189.389290, .point.y = 136.660200},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 204.602600, .point.y = 139.810270},
+       {.point.x = 212.735560, .point.y = 135.110600},
+       {.point.x = 216.656990, .point.y = 120.903480},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 217.415840, .point.y = 118.154200},
+       {.point.x = 218.079500, .point.y = 116.885370},
+       {.point.x = 218.131750, .point.y = 118.083860},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 218.184050, .point.y = 119.282330},
+       {.point.x = 220.630880, .point.y = 124.958210},
+       {.point.x = 223.569190, .point.y = 130.696890},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 228.364950, .point.y = 140.063290},
+       {.point.x = 228.892210, .point.y = 141.774070},
+       {.point.x = 228.722430, .point.y = 147.417480},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 228.502960, .point.y = 154.712020},
+       {.point.x = 227.950120, .point.y = 155.260630},
+       {.point.x = 217.163860, .point.y = 158.886960},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 200.608790, .point.y = 164.452770},
+       {.point.x = 168.872120, .point.y = 158.189320},
+       {.point.x = 144.057060, .point.y = 144.458820},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 139.753660, .point.y = 142.077690},
+       {.point.x = 139.408770, .point.y = 142.009130},
+       {.point.x = 141.642810, .point.y = 143.978950},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 149.285820, .point.y = 150.718000},
+       {.point.x = 171.460130, .point.y = 161.069350},
+       {.point.x = 187.401030, .point.y = 165.339660},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 194.556210, .point.y = 167.256420},
+       {.point.x = 199.319980, .point.y = 167.769860},
+       {.point.x = 210.295840, .point.y = 167.807280},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 223.417650, .point.y = 167.852080},
+       {.point.x = 224.458420, .point.y = 167.697810},
+       {.point.x = 229.844970, .point.y = 164.912030},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 232.974190, .point.y = 163.293670},
+       {.point.x = 235.690420, .point.y = 162.125100},
+       {.point.x = 235.881040, .point.y = 162.315250},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 236.071670, .point.y = 162.505390},
+       {.point.x = 238.147160, .point.y = 166.692030},
+       {.point.x = 240.493240, .point.y = 171.618920},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 244.758840, .point.y = 180.576910},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 242.292050, .point.y = 182.765970},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 240.935300, .point.y = 183.969950},
+       {.point.x = 235.802670, .point.y = 186.305030},
+       {.point.x = 230.886200, .point.y = 187.955040},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 222.932510, .point.y = 190.624360},
+       {.point.x = 220.482560, .point.y = 190.951420},
+       {.point.x = 208.660190, .point.y = 190.922040},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 185.571990, .point.y = 190.864740},
+       {.point.x = 161.177750, .point.y = 184.277320},
+       {.point.x = 134.518850, .point.y = 170.901160},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 126.187910, .point.y = 166.721090},
+       {.point.x = 119.371700, .point.y = 163.423110},
+       {.point.x = 119.371700, .point.y = 163.572320},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 119.371700, .point.y = 164.299780},
+       {.point.x = 132.201590, .point.y = 172.198450},
+       {.point.x = 140.920720, .point.y = 176.838870},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 169.969120, .point.y = 192.298800},
+       {.point.x = 207.076830, .point.y = 201.357560},
+       {.point.x = 228.399960, .point.y = 198.194380},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 238.127890, .point.y = 196.751280},
+       {.point.x = 244.331630, .point.y = 194.114690},
+       {.point.x = 244.132370, .point.y = 191.508060},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 244.057170, .point.y = 190.522900},
+       {.point.x = 244.614590, .point.y = 189.479870},
+       {.point.x = 245.371310, .point.y = 189.190240},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 246.752150, .point.y = 188.661740},
+       {.point.x = 248.151880, .point.y = 193.219250},
+       {.point.x = 249.607270, .point.y = 202.982460},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 250.197440, .point.y = 206.941400},
+       {.point.x = 249.971220, .point.y = 207.563880},
+       {.point.x = 247.264910, .point.y = 209.427760},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 243.550750, .point.y = 211.985770},
+       {.point.x = 234.146040, .point.y = 215.691980},
+       {.point.x = 227.793440, .point.y = 217.101100},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 220.397260, .point.y = 218.741710},
+       {.point.x = 197.462460, .point.y = 218.415190},
+       {.point.x = 186.259650, .point.y = 216.509800},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 161.405830, .point.y = 212.282630},
+       {.point.x = 131.394370, .point.y = 201.164570},
+       {.point.x = 107.944890, .point.y = 187.497250},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 99.832740, .point.y = 182.769160},
+       {.point.x = 101.108060, .point.y = 184.558500},
+       {.point.x = 109.820110, .point.y = 190.128300},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 154.725830, .point.y = 218.837410},
+       {.point.x = 215.587610, .point.y = 233.521700},
+       {.point.x = 243.762630, .point.y = 222.444990},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 246.715400, .point.y = 221.284150},
+       {.point.x = 249.408480, .point.y = 220.334360},
+       {.point.x = 249.747260, .point.y = 220.334360},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 250.625720, .point.y = 220.334360},
+       {.point.x = 249.019980, .point.y = 234.298240},
+       {.point.x = 247.900400, .point.y = 236.395070},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 246.668540, .point.y = 238.702140},
+       {.point.x = 233.155300, .point.y = 244.235230},
+       {.point.x = 225.206560, .point.y = 245.687200},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 216.136510, .point.y = 247.344000},
+       {.point.x = 194.897850, .point.y = 247.097790},
+       {.point.x = 183.164020, .point.y = 245.199800},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 154.674260, .point.y = 240.591530},
+       {.point.x = 122.448020, .point.y = 229.032500},
+       {.point.x = 96.783842, .point.y = 214.216640},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 91.668358, .point.y = 211.263470},
+       {.point.x = 87.482954, .point.y = 209.063940},
+       {.point.x = 87.482954, .point.y = 209.328780},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 87.482954, .point.y = 210.579470},
+       {.point.x = 108.469500, .point.y = 223.132920},
+       {.point.x = 119.880070, .point.y = 228.707660},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 165.230910, .point.y = 250.864210},
+       {.point.x = 212.406640, .point.y = 259.720830},
+       {.point.x = 241.346160, .point.y = 251.511290},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 244.599120, .point.y = 250.588490},
+       {.point.x = 244.411040, .point.y = 251.808390},
+       {.point.x = 239.897760, .point.y = 260.905900},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 235.716470, .point.y = 269.334200},
+       {.point.x = 234.008630, .point.y = 270.526800},
+       {.point.x = 221.210550, .point.y = 273.955380},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 189.715030, .point.y = 282.392960},
+       {.point.x = 129.641310, .point.y = 268.561220},
+       {.point.x = 84.028349, .point.y = 242.369700},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 78.328227, .point.y = 239.096620},
+       {.point.x = 73.664500, .point.y = 236.627100},
+       {.point.x = 73.664500, .point.y = 236.881880},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 73.664500, .point.y = 237.980050},
+       {.point.x = 92.653213, .point.y = 249.551640},
+       {.point.x = 103.735580, .point.y = 255.206990},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 137.171580, .point.y = 272.269460},
+       {.point.x = 175.760740, .point.y = 283.180310},
+       {.point.x = 202.813930, .point.y = 283.220810},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 209.829440, .point.y = 283.231410},
+       {.point.x = 218.004750, .point.y = 283.041020},
+       {.point.x = 220.981260, .point.y = 282.797950},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 226.393100, .point.y = 282.355980},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 222.593640, .point.y = 286.888910},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 215.336720, .point.y = 295.546760},
+       {.point.x = 209.880680, .point.y = 297.789690},
+       {.point.x = 192.184340, .point.y = 299.389950},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 162.968990, .point.y = 302.031850},
+       {.point.x = 110.647120, .point.y = 287.339290},
+       {.point.x = 74.482976, .point.y = 266.338060},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 69.063484, .point.y = 263.190860},
+       {.point.x = 66.035280, .point.y = 261.780580},
+       {.point.x = 67.753620, .point.y = 263.204130},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 69.471960, .point.y = 264.627640},
+       {.point.x = 75.868309, .point.y = 268.757370},
+       {.point.x = 81.967721, .point.y = 272.381260},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 112.337680, .point.y = 290.425200},
+       {.point.x = 157.272050, .point.y = 305.370190},
+       {.point.x = 181.819790, .point.y = 305.591670},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 187.227180, .point.y = 305.640470},
+       {.point.x = 191.651750, .point.y = 306.038160},
+       {.point.x = 191.652140, .point.y = 306.475500},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 191.652540, .point.y = 306.912830},
+       {.point.x = 192.729100, .point.y = 307.292210},
+       {.point.x = 194.044520, .point.y = 307.318580},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 197.616970, .point.y = 307.390180},
+       {.point.x = 188.752660, .point.y = 311.902130},
+       {.point.x = 178.576750, .point.y = 315.191770},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 168.487010, .point.y = 318.453560},
+       {.point.x = 158.963560, .point.y = 318.595160},
+       {.point.x = 142.756790, .point.y = 315.724410},
+       {.header.type = 3, .header.length = 1},
+       {.header.type = 0, .header.length = 2},
+       {.point.x = 229.914170, .point.y = 123.294940},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 229.257580, .point.y = 121.562790},
+       {.point.x = 227.370710, .point.y = 117.998680},
+       {.point.x = 225.721070, .point.y = 115.374690},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 219.548550, .point.y = 105.556270},
+       {.point.x = 219.289200, .point.y = 98.584660},
+       {.point.x = 224.901150, .point.y = 93.333820},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 227.261960, .point.y = 91.124930},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 227.494380, .point.y = 94.358570},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 227.622200, .point.y = 96.137080},
+       {.point.x = 229.261540, .point.y = 99.977660},
+       {.point.x = 231.137300, .point.y = 102.893200},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 235.630820, .point.y = 109.877580},
+       {.point.x = 236.499380, .point.y = 117.951240},
+       {.point.x = 233.299520, .point.y = 122.991960},
+       {.header.type = 1, .header.length = 2},
+       {.point.x = 231.107950, .point.y = 126.444310},
+       {.header.type = 3, .header.length = 1},
+       {.header.type = 0, .header.length = 2},
+       {.point.x = 123.871880, .point.y = 73.326950},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 119.605310, .point.y = 69.007030},
+       {.point.x = 114.688600, .point.y = 66.460670},
+       {.point.x = 100.262330, .point.y = 61.099550},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 84.688709, .point.y = 55.312050},
+       {.point.x = 70.765125, .point.y = 48.403090},
+       {.point.x = 65.419079, .point.y = 43.810160},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 56.557214, .point.y = 36.196690},
+       {.point.x = 52.316764, .point.y = 25.709480},
+       {.point.x = 52.317986, .point.y = 11.409390},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 52.318962, .point.y = -1.171975},
+       {.point.x = 52.923953, .point.y = -2.314802},
+       {.point.x = 56.775387, .point.y = 2.988140},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 62.139216, .point.y = 10.373460},
+       {.point.x = 66.245251, .point.y = 12.787330},
+       {.point.x = 87.482954, .point.y = 21.040550},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 101.013180, .point.y = 26.298550},
+       {.point.x = 106.778120, .point.y = 29.872960},
+       {.point.x = 113.982870, .point.y = 37.471140},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 121.379730, .point.y = 45.271940},
+       {.point.x = 125.489100, .point.y = 54.312360},
+       {.point.x = 126.912000, .point.y = 65.914650},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 127.532980, .point.y = 70.978350},
+       {.point.x = 127.884210, .point.y = 75.508590},
+       {.point.x = 127.692490, .point.y = 75.981870},
+       {.header.type = 2, .header.length = 4},
+       {.point.x = 127.500760, .point.y = 76.455140},
+       {.point.x = 125.781500, .point.y = 75.260430},
+       {.point.x = 123.871880, .point.y = 73.326950},
+       {.header.type = 3, .header.length = 1}
+};
+
+cairo_path_t glade_logo_path = {0, glade_logo_data, 450};
+
+#endif /* __GLADE_LOGO_H__ */
diff --git a/src/glade-splash.c b/src/glade-splash.c
new file mode 100644
index 0000000..13ec035
--- /dev/null
+++ b/src/glade-splash.c
@@ -0,0 +1,175 @@
+/*
+ * glade-splash.c
+ * 
+ * Copyright (C) 2013 Juan Pablo Ugarte.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Authors:
+ *   Juan Pablo Ugarte <juanpablougarte gmail com>
+ */
+
+#include <config.h>
+
+#include <gladeui/glade.h>
+#include <glib/gi18n.h>
+#include "glade-splash.h"
+#include "glade-logo.h"
+
+static gboolean
+quit_when_idle (gpointer loop)
+{
+  g_main_loop_quit (loop);
+
+  return G_SOURCE_REMOVE;
+}
+
+static void
+glade_app_event_handler (GdkEvent *event, gpointer data)
+{
+  if (glade_app_do_event (event)) return;
+
+  gtk_main_do_event (event);
+}
+
+static void
+check_for_draw (GdkEvent *event, gpointer loop)
+{
+  if (event->type == GDK_EXPOSE)
+    {
+      g_idle_add (quit_when_idle, loop);
+      gdk_event_handler_set (glade_app_event_handler, NULL, NULL);
+    }
+
+  gtk_main_do_event (event);
+}
+
+/* Taken from Gtk sources gtk-reftest.c  */
+static void
+glade_wait_for_drawing (GtkWidget *widget)
+{
+  GMainLoop *loop;
+
+  loop = g_main_loop_new (NULL, FALSE);
+  /* We wait until the widget is drawn for the first time.
+   * We can not wait for a GtkWidget::draw event, because that might not
+   * happen if the window is fully obscured by windowed child widgets.
+   * Alternatively, we could wait for an expose event on widget's window.
+   * Both of these are rather hairy, not sure what's best. */
+  gdk_event_handler_set (check_for_draw, loop, NULL);
+  g_main_loop_run (loop);
+}
+
+#define LOGO_OFFSET 36
+
+static gboolean
+on_glade_splash_screen_draw (GtkWidget *widget, cairo_t *cr)
+{
+  GtkAllocation alloc;
+
+  /* Clear BG */
+  cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
+  cairo_paint (cr);
+  cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
+
+  gtk_widget_get_allocation (widget, &alloc);
+  cairo_translate (cr, MAX(0, (alloc.width/2) - (GLADE_LOGO_WIDTH+LOGO_OFFSET)/2), 0);
+  
+  cairo_set_source_rgba (cr, .8, .8, .8, .12);
+  cairo_translate (cr, 4, 4);
+  cairo_append_path (cr, &glade_logo_path);
+  cairo_fill (cr);
+
+  cairo_set_source_rgba (cr, .1, .1, .1, .12);
+  cairo_translate (cr, -4, -4);
+  cairo_append_path (cr, &glade_logo_path);
+  cairo_fill (cr);
+
+  return FALSE;
+}
+
+/*
+ * We want this function to be as fast as possible, this is one of the reason
+ * why we do not use an image as the logo, instead we use a harcoded cairo path
+ * besides we already need a custom draw function to clear the bg!
+ */
+GtkWidget *
+glade_splash_screen_new (void)
+{
+  gchar *glade_string, *glade_version;
+  GtkWidget *window, *label;
+  GtkCssProvider *css;
+  GdkVisual *visual;
+  gint natural;
+
+  /* No transparency, No Splash screen! */
+  if (!(visual = gdk_screen_get_rgba_visual (gdk_screen_get_default ())))
+    return NULL;
+
+  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
+  gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
+
+  gtk_widget_set_visual (window, visual);
+  gtk_widget_set_app_paintable (window, TRUE);
+  
+  g_signal_connect (window, "draw", G_CALLBACK (on_glade_splash_screen_draw), NULL);
+
+  label = gtk_label_new ("");
+  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
+
+  /* To translators: This is the version string used in the splash screen */
+  glade_version = g_strdup_printf (_("Version %s"), PACKAGE_VERSION);
+  
+  glade_string = g_strdup_printf ("<span size='64000' weight='bold' style='italic'>%s</span>\n"
+                                  "<span size='16000'>%s</span>",
+                                  g_get_application_name (),
+                                  glade_version);
+  gtk_label_set_markup (GTK_LABEL (label), glade_string);
+  gtk_widget_set_opacity (label, .5);
+  g_free (glade_version);
+  g_free (glade_string);
+
+  css = gtk_css_provider_new ();
+  gtk_css_provider_load_from_data (css, "GtkLabel { color: white; text-shadow: 2px 2px 2px black;}", -1, 
NULL);
+  gtk_style_context_add_provider (gtk_widget_get_style_context (label),
+                                  GTK_STYLE_PROVIDER (css), 
+                                  GTK_STYLE_PROVIDER_PRIORITY_USER);
+  g_object_unref (css);
+
+  gtk_widget_show (label);
+  
+  /* Leave room for the logo */
+  gtk_widget_get_preferred_height (label, NULL, &natural);
+  gtk_widget_set_margin_top (label, GLADE_LOGO_HEIGHT - (natural/6));
+
+  /* Center text to the logo */
+  gtk_widget_get_preferred_width (label, NULL, &natural);
+  gtk_widget_set_margin_left (label, MAX (0, ((GLADE_LOGO_WIDTH+LOGO_OFFSET)/2) - (natural/2) ));
+
+  /* Needed for css text shadow */
+  gtk_widget_set_margin_right (label, 2);
+
+  gtk_container_add (GTK_CONTAINER (window), label);
+  
+  return window;
+}
+
+void
+glade_splash_window_show_immediately (GtkWidget *window)
+{
+  gtk_widget_show (window);
+  glade_wait_for_drawing (window);
+}
diff --git a/src/glade-splash.h b/src/glade-splash.h
new file mode 100644
index 0000000..1fd21f9
--- /dev/null
+++ b/src/glade-splash.h
@@ -0,0 +1,37 @@
+/*
+ * glade-splash.c
+ * 
+ * Copyright (C) 2013 Juan Pablo Ugarte.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Authors:
+ *   Juan Pablo Ugarte <juanpablougarte gmail com>
+ */
+
+#ifndef __GLADE_SPLASH_H__
+#define __GLADE_SPLASH_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+GtkWidget *glade_splash_screen_new (void);
+
+void       glade_splash_window_show_immediately (GtkWidget *window);
+
+G_END_DECLS
+
+#endif /* __GLADE_SPLASH_H__ */
diff --git a/src/main.c b/src/main.c
index 15b01af..a9fd84b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,6 +24,7 @@
 
 #include "glade-window.h"
 #include "glade-resources.h"
+#include "glade-splash.h"
 
 #include <gladeui/glade.h>
 #include <gladeui/glade-app.h>
@@ -76,6 +77,7 @@ main (int argc, char *argv[])
   GError *error = NULL;
   gboolean opened_project = FALSE;
   GTimer *timer = NULL;
+  GtkWidget *splash;
 
 #ifdef ENABLE_NLS
   setlocale (LC_ALL, "");
@@ -153,15 +155,21 @@ main (int argc, char *argv[])
 
   glade_setup_log_handlers ();
 
+  /* Splash Screen */
+  if ((splash = glade_splash_screen_new ()))
+      glade_splash_window_show_immediately (splash);
+
+  /* Main Window */
   window = GLADE_WINDOW (glade_window_new ());
 
   if (without_devhelp == FALSE)
     glade_window_check_devhelp (window);
 
-  gtk_widget_show (GTK_WIDGET (window));
+  if (splash)
+    gtk_widget_destroy (splash);
 
   /* Update UI before loading files */
-  while (gtk_events_pending ()) gtk_main_iteration ();
+  glade_splash_window_show_immediately (GTK_WIDGET (window));
 
   if (verbose) timer = g_timer_new ();
   


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]